/* ============================================
   CSS Variables — Global theme (Aşama 16)
   Firma rengi `--primary` body inline style ile dinamik set edilir.
   Sprockets stylesheet — Tailwind build'inden bağımsız.
   ============================================ */
:root {
  --primary:      #1f2937;  /* default slate-800 — firma yokken */
  --primary-soft: #e7eef9;  /* static — her firmada aynı */
  --accent:       #f59e0b;
  --danger:       #dc2626;
  --success:      #16a34a;
  --info:         #0891b2;
  --bg:           #f4f6fb;
  --text:         #1f2937;
  --muted:        #6b7280;
  --border:       #e5e7eb;
  --shadow:       0 18px 45px rgba(15, 23, 42, 0.08);
}

/* ============================================ Base body ============================================ */
body.themed {
  background: var(--bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--text);
}

/* ============================================ Buttons ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 10px 13px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--primary);
  color: white;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover { opacity: 0.92; transform: translateY(-1px); text-decoration: none; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.btn.btn-lg { padding: 12px 16px; font-size: 14px; border-radius: 12px; }

.btn-primary   { background: var(--primary); color: white; }
.btn-secondary { background: #111827;        color: white; }
.btn-light     { background: var(--primary-soft); color: var(--primary); }
.btn-ghost     { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f9fafb; }
.btn-danger    { background: var(--danger);  color: white; }
.btn-success   { background: var(--success); color: white; }
.btn-warning   { background: var(--accent);  color: #111827; }
.btn-info      { background: var(--info);    color: white; }

/* Modifier utilities (Aşama 17) */
.btn-block { width: 100%; display: flex; }   /* flex korunur (icon+text gap) */
.btn-end   { margin-left: auto; }            /* flex container'da sağa iter */

/* ============================================ Form inputs ============================================ */
.input-base, .form-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 13.5px;
  outline: none;
  background: white;
  font-family: inherit;
  color: var(--text);
}
.input-base:focus, .form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ============================================ Panel / Card ============================================ */
.panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel-tight { padding: 14px; }

/* ============================================ Sidebar ============================================ */
.sidebar {
  background: var(--primary);
  color: white;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 256px;
  padding: 24px 18px;
  overflow-y: auto;
  z-index: 20;
  transition: background 0.3s ease;
  font-family: inherit;
}

.sidebar-brand {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 18px;
  color: white;
}
.sidebar-brand-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 4px;
  font-weight: 400;
}

.sidebar-user-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 12px;
}
.sidebar-user-box .name {
  font-weight: 700; color: white;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-user-box .email {
  opacity: 0.75; color: white; font-size: 11px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 2px;
}
.sidebar-user-box .logout-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 0;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  margin-top: 8px;
}
.sidebar-user-box .logout-btn:hover { background: rgba(255, 255, 255, 0.25); }

.sidebar-company-box {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 18px;
}
.sidebar-company-box-label {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 6px;
}
.sidebar-company-current {
  color: white;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-company-current .swatch {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.sidebar-section-title {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin: 16px 6px 6px;
}

.sidebar-nav-item {
  padding: 11px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: background 0.15s ease;
}
.sidebar-nav-item:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; color: white; }
.sidebar-nav-item.active {
  background: white;
  color: var(--primary);
  font-weight: 700;
}

.sidebar-nav-parent {
  padding: 11px 12px;
  border-radius: 10px;
  margin-bottom: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.sidebar-nav-parent:hover { background: rgba(255, 255, 255, 0.14); }
.sidebar-nav-parent .chevron { font-size: 10px; opacity: 0.7; transition: transform 0.2s; }
.sidebar-nav-parent.expanded .chevron { transform: rotate(180deg); }

.sidebar-nav-sub {
  margin: 0 0 6px 8px;
  padding-left: 10px;
  border-left: 2px solid rgba(255, 255, 255, 0.18);
}
.sidebar-nav-sub.hidden { display: none; }
.sidebar-nav-sub .sidebar-nav-item { font-size: 12.5px; padding: 9px 11px; }

.sidebar-dropdown-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.sidebar-dropdown-button:hover { background: rgba(255, 255, 255, 0.22); }
.sidebar-dropdown-menu {
  background: white;
  color: var(--text);
  border-radius: 10px;
  margin-top: 6px;
  padding: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-height: 280px;
  overflow-y: auto;
}
.sidebar-dropdown-menu.hidden { display: none; }
.sidebar-dropdown-menu li { list-style: none; }
.sidebar-dropdown-menu .sidebar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  text-align: left;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 500;
}
.sidebar-dropdown-menu .sidebar-dropdown-item:hover { background: var(--bg); }
.sidebar-dropdown-menu .sidebar-dropdown-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.main-content {
  margin-left: 256px;
  padding: 24px 28px;
  min-height: 100vh;
}

/* ============================================ Topbar ============================================ */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 700; color: var(--text); }
.topbar .topbar-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ============================================ Flash ============================================ */
.flash-notice {
  background: #ecfdf5;
  border-left: 4px solid var(--success);
  color: #065f46;
  padding: 12px 18px;
  font-size: 13.5px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}
.flash-alert {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  color: #991b1b;
  padding: 12px 18px;
  font-size: 13.5px;
  margin-bottom: 12px;
  border-radius: 0 8px 8px 0;
}
