/* ============================================================
   DİJİDER — Design System
   Primary: #4545C8 (indigo)  |  Dark: #2B2B3B (charcoal)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Estedad:wght@100..900&display=swap');

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --primary:        #4545C8;
  --primary-dark:   #3333A0;
  --primary-light:  #6B6CE8;
  --primary-xlight: #EEEEFF;
  --primary-pale:   #F4F4FF;

  /* Dark tones */
  --dark:           #2B2B3B;
  --dark-2:         #3A3A4C;
  --dark-3:         #4B4B5E;

  /* Text */
  --text-title:     #1A1A2E;
  --text-body:      #4B4B5A;
  --text-muted:     #8B8BA8;
  --text-light:     #B0B0C8;

  /* UI */
  --border:         #E4E4F0;
  --border-light:   #F0F0FA;
  --bg:             #F5F5FB;
  --bg-card:        #FFFFFF;
  --white:          #FFFFFF;

  /* Sidebar */
  --sidebar-bg:     #FFFFFF;
  --sidebar-border: #EAEAF5;
  --sidebar-item-hover: rgba(69, 69, 200, 0.07);
  --sidebar-item-active: rgba(69, 69, 200, 0.12);
  --sidebar-text:   #6B6B8A;
  --sidebar-text-active: #3B3BAA;
  --sidebar-width:  260px;

  /* Layout */
  --topbar-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-xs:      6px;

  /* Shadow */
  --shadow-sm:  0 1px 4px rgba(43,43,59,.06);
  --shadow:     0 2px 12px rgba(43,43,59,.10);
  --shadow-md:  0 4px 24px rgba(69,69,200,.12);
  --shadow-lg:  0 8px 40px rgba(43,43,59,.16);

  /* Transitions */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  220ms;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: "Estedad", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select { font: inherit; }
ul, ol { list-style: none; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ================================================================
   LAYOUT SHELL
   ================================================================ */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--dur) var(--ease),
              width var(--dur) var(--ease);
  overflow: hidden;
  box-shadow: 2px 0 12px rgba(69,69,200,.05);
}

.sidebar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 18px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #3232A8 0%, #4545C8 55%, #5555D6 100%);
  border-bottom: 1px solid rgba(69,69,200,.2);
  position: relative;
  overflow: hidden;
}

/* Sağ üst parlaklık noktası */
.sidebar__logo::before {
  content: '';
  position: absolute;
  top: -24px; right: -24px;
  width: 90px; height: 90px;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, transparent 70%);
  pointer-events: none;
}

/* Sol alt hafif ışık */
.sidebar__logo::after {
  content: '';
  position: absolute;
  bottom: -28px; left: -20px;
  width: 70px; height: 70px;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar__logo-wrap {
  background: rgba(255,255,255,.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 10px 20px;
  border: 1px solid rgba(255,255,255,.65);
  box-shadow:
    0 6px 24px rgba(0,0,0,.18),
    0 1px 4px rgba(0,0,0,.08),
    inset 0 1px 0 rgba(255,255,255,1);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

/* Üst cam parlaklığı (shine) */
.sidebar__logo-wrap::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48%;
  background: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 100%);
  border-radius: 14px 14px 0 0;
  pointer-events: none;
  z-index: 2;
}

.sidebar__logo-wrap img {
  height: 42px;
  width: auto;
  display: block;
  position: relative;
  z-index: 3;
}

/* Scroll area */
.sidebar__scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
}

/* Section label */
.sidebar__section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 16px 20px 6px;
  opacity: 1;
}

/* Nav item */
.sidebar__nav-item {
  position: relative;
  margin: 2px 10px;
}

.sidebar__nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .875rem;
  font-weight: 500;
  transition: background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-left-color var(--dur) var(--ease);
  white-space: nowrap;
  overflow: hidden;
  border-left: 3px solid transparent;
}

.sidebar__nav-link:hover {
  background: var(--sidebar-item-hover);
  color: var(--primary);
}

.sidebar__nav-link.active {
  background: var(--primary-xlight);
  color: var(--sidebar-text-active);
  font-weight: 600;
  border-left-color: var(--primary);
}

.sidebar__nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .75;
  transition: opacity var(--dur);
}

.sidebar__nav-link:hover .sidebar__nav-icon,
.sidebar__nav-link.active .sidebar__nav-icon {
  opacity: 1;
  color: var(--primary);
}

.sidebar__nav-label { flex: 1; }

/* Badge */
.sidebar__badge {
  font-size: .65rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}

.sidebar__badge--amber {
  background: #D97706;
  animation: badge-pulse 2.2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,.5); }
  50%       { box-shadow: 0 0 0 5px rgba(217,119,6,0); }
}

/* Sub-menu */
.sidebar__submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s var(--ease);
}

.sidebar__submenu.open {
  max-height: 500px;
}

.sidebar__submenu-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 42px;
  margin: 1px 10px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .82rem;
  transition: background var(--dur), color var(--dur), border-left-color var(--dur);
  border-left: 3px solid transparent;
}

.sidebar__submenu-link::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--dur);
}

.sidebar__submenu-link:hover,
.sidebar__submenu-link.active {
  color: var(--primary);
  background: var(--sidebar-item-hover);
}
.sidebar__submenu-link.active {
  border-left-color: var(--primary);
  font-weight: 600;
}
.sidebar__submenu-link:hover::before,
.sidebar__submenu-link.active::before {
  background: var(--primary);
}

/* Chevron */
.sidebar__chevron {
  width: 14px; height: 14px;
  transition: transform .25s var(--ease);
  opacity: .4;
  color: var(--sidebar-text);
}
.sidebar__nav-link[aria-expanded="true"] .sidebar__chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* Sidebar footer (user) */
.sidebar__footer {
  flex-shrink: 0;
  padding: 12px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background var(--dur);
  cursor: pointer;
}

.sidebar__user:hover { background: var(--sidebar-item-hover); }

.sidebar__avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar__user-info { flex: 1; min-width: 0; }

.sidebar__user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: .7rem;
  color: var(--text-muted);
}

/* ── Main Content ─────────────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--dur) var(--ease);
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.topbar__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  color: var(--text-body);
  transition: background var(--dur), color var(--dur);
}

.topbar__toggle:hover {
  background: var(--primary-xlight);
  color: var(--primary);
}

.topbar__breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-muted);
}

.topbar__breadcrumb-sep { opacity: .4; }

.topbar__breadcrumb-link {
  color: var(--text-muted);
  text-decoration: none;
}
.topbar__breadcrumb-link:hover { color: var(--primary); }

.topbar__breadcrumb-current {
  color: var(--text-title);
  font-weight: 600;
}

/* Search */
.topbar__search {
  position: relative;
  display: flex;
  align-items: center;
}

.topbar__search-input {
  width: 220px;
  height: 38px;
  background: #F4F4FC;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 0 14px 0 36px;
  font-size: .82rem;
  color: var(--text-title);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur), width var(--dur), background var(--dur);
}

.topbar__search-input::placeholder { color: var(--text-muted); }

.topbar__search-input:focus {
  border-color: var(--primary-light);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(69,69,200,.1);
  width: 280px;
}

.topbar__search-icon {
  position: absolute;
  left: 11px;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

/* Icon buttons */
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar__btn {
  position: relative;
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-body);
  transition: background var(--dur), color var(--dur);
}

.topbar__btn:hover {
  background: var(--primary-xlight);
  color: var(--primary);
}

.topbar__btn svg { width: 18px; height: 18px; }

.topbar__notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 7px; height: 7px;
  background: #EF4444;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* Topbar user */
.topbar__user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
  position: relative;
}

.topbar__user:hover {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(69,69,200,.08);
}

.topbar__user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
}

.topbar__user-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-title);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__user-chevron {
  width: 14px; height: 14px;
  color: var(--text-muted);
  transition: transform .2s;
}

.topbar__user.open .topbar__user-chevron { transform: rotate(180deg); }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  z-index: 200;
}

.dropdown.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown__header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.dropdown__header-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-title);
}

.dropdown__header-email {
  font-size: .75rem;
  color: var(--text-muted);
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  font-size: .82rem;
  color: var(--text-body);
  transition: background var(--dur), color var(--dur);
}

.dropdown__item:hover {
  background: var(--primary-xlight);
  color: var(--primary);
}

.dropdown__item svg { width: 15px; height: 15px; flex-shrink: 0; }

.dropdown__divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

.dropdown__item--danger:hover {
  background: #FEF2F2;
  color: #EF4444;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  flex: 1;
  padding: 28px;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding: 20px 22px 20px 26px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

/* Sol aksan çizgisi */
.page-header::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #4545C8 0%, #6366F1 100%);
  border-radius: 0 2px 2px 0;
}

/* Sağ arka plan süsü */
.page-header::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(69,69,200,.06) 0%, transparent 70%);
  pointer-events: none;
}

.page-header__titles { line-height: 1.25; }

/* Başlık — iki farklı class adı desteklenir */
.page-header__title,
.page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -.4px;
  line-height: 1.2;
}

/* Alt yazı */
.page-header__sub,
.page-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-header__sub::before,
.page-subtitle::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--primary);
  border-radius: 50%;
  opacity: .5;
  flex-shrink: 0;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card--hover {
  transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur);
}

.card--hover:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(69,69,200,.2);
}

.card__header {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card__title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-title);
}

.card__body { padding: 20px 22px; }
.card__footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
}

/* ── Stat cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 18px 23px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur), transform var(--dur), border-color var(--dur);
  position: relative;
  overflow: hidden;
}

/* Sol renk aksanı */
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #4545C8 0%, #6366F1 100%);
  border-radius: 0 2px 2px 0;
}
.stat-card--green::before  { background: linear-gradient(180deg, #059669 0%, #10B981 100%); }
.stat-card--amber::before  { background: linear-gradient(180deg, #D97706 0%, #F59E0B 100%); }
.stat-card--red::before    { background: linear-gradient(180deg, #DC2626 0%, #EF4444 100%); }

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(69,69,200,.18);
}

.stat-card__icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__icon svg { width: 22px; height: 22px; }

.stat-card__icon--primary { background: var(--primary-xlight); color: var(--primary); }
.stat-card__icon--green   { background: #ECFDF5; color: #059669; }
.stat-card__icon--amber   { background: #FFFBEB; color: #D97706; }
.stat-card__icon--red     { background: #FEF2F2; color: #EF4444; }

.stat-card__info { flex: 1; }

.stat-card__label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-card__value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-title);
  letter-spacing: -.5px;
  line-height: 1.1;
}

.stat-card__change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .72rem;
  font-weight: 600;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 20px;
}

.stat-card__change--up   { background: #ECFDF5; color: #059669; }
.stat-card__change--down { background: #FEF2F2; color: #EF4444; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.3;
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  border: 1px solid transparent;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn--primary {
  background: linear-gradient(135deg, #3B3BAA 0%, #4545C8 60%, #6366F1 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(69,69,200,.3);
  border-color: transparent;
}

.btn--primary:hover {
  box-shadow: 0 4px 18px rgba(69,69,200,.4);
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--outline:hover {
  background: var(--primary-xlight);
}

.btn--ghost {
  background: transparent;
  color: var(--text-body);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--bg);
  color: var(--text-title);
}

.btn--danger {
  background: #EF4444;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.2);
}

.btn--danger:hover {
  background: #DC2626;
  transform: translateY(-1px);
}

.btn--sm { padding: 5px 12px; font-size: .8rem; }
.btn--lg { padding: 11px 24px; font-size: .95rem; }
.btn--icon { padding: 8px; }
.btn--circle { border-radius: 50%; padding: 8px; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .2px;
}

.badge--primary  { background: var(--primary-xlight); color: var(--primary); }
.badge--success  { background: #ECFDF5; color: #059669; }
.badge--warning  { background: #FFFBEB; color: #D97706; }
.badge--danger   { background: #FEF2F2; color: #EF4444; }
.badge--neutral  { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 6px;
}

.form-label span { color: #EF4444; margin-left: 2px; }

.form-control {
  width: 100%;
  height: 42px;
  background: #F8F8FE;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: .875rem;
  color: var(--text-title);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}

.form-control::placeholder { color: var(--text-light); }

.form-control:focus {
  border-color: var(--primary);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(69,69,200,.1);
}

.form-control:invalid:not(:placeholder-shown) {
  border-color: #EF4444;
}

textarea.form-control {
  height: auto;
  min-height: 100px;
  padding: 10px 12px;
  resize: vertical;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238B8BA8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
}

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Table ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.table th {
  background: var(--bg);
  padding: 11px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-body);
  vertical-align: middle;
}

.table tbody tr { transition: background var(--dur); }
.table tbody tr:hover { background: var(--primary-pale); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Alert / Toast ────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border-left: 4px solid;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert--success {
  background: #ECFDF5; color: #065F46;
  border-color: #059669;
}
.alert--error {
  background: #FEF2F2; color: #991B1B;
  border-color: #EF4444;
}
.alert--warning {
  background: #FFFBEB; color: #92400E;
  border-color: #D97706;
}
.alert--info {
  background: var(--primary-xlight); color: var(--primary-dark);
  border-color: var(--primary);
}

/* Toast container */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--dark);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
  animation: toastIn .3s var(--ease) forwards;
  min-width: 280px;
  max-width: 380px;
}

.toast.hide { animation: toastOut .3s var(--ease) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(24px) scale(.95); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
  to   { opacity: 0; transform: translateX(24px) scale(.95); }
}

/* ── Overlay (mobile sidebar) ─────────────────────────────── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27,27,40,.55);
  backdrop-filter: blur(2px);
  z-index: 99;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ── Utility ──────────────────────────────────────────────── */
.d-flex   { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm   { gap: 8px; }
.gap-md   { gap: 16px; }
.mt-sm    { margin-top: 8px; }
.mt-md    { margin-top: 16px; }
.mt-lg    { margin-top: 24px; }
.mb-md    { margin-bottom: 16px; }
.mb-lg    { margin-bottom: 24px; }
.text-muted  { color: var(--text-muted); font-size: .82rem; }
.text-title  { color: var(--text-title); }
.fw-bold  { font-weight: 700; }
.rounded  { border-radius: var(--radius); }
.w-full   { width: 100%; }

/* ── Page transitions ─────────────────────────────────────── */
.page-fade {
  animation: pageFade .25s var(--ease);
}

@keyframes pageFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Auth layout ──────────────────────────────────────────── */
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-shell {
  min-height: 100vh;
  background: #F0F2FF;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(99,102,241,.13) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(139,92,246,.08) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

/* top bar */
.auth-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(69,69,200,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.auth-topbar__logo-wrap {
  display: inline-flex;
  align-items: center;
}
.auth-topbar__logo-wrap img {
  height: 32px;
  width: auto;
}

/* center card */
.auth-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(69,69,200,.1);
  box-shadow: 0 4px 6px rgba(0,0,0,.04), 0 24px 60px rgba(69,69,200,.1);
  width: 100%;
  max-width: 440px;
  padding: 48px 44px 44px;
  animation: authFadeUp .4s cubic-bezier(.4,0,.2,1);
}

/* logo block inside card */
.auth-card__logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
}
.auth-card__logo-img {
  height: 56px;
  width: auto;
  display: block;
  margin-bottom: 14px;
}
.auth-card__logo-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #4545C8, #818CF8);
  border-radius: 4px;
}

/* titles */
.auth-card__title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1A1A2E;
  text-align: center;
  letter-spacing: -.3px;
  margin-bottom: 6px;
}
.auth-card__sub {
  font-size: .875rem;
  color: #8B8BA8;
  text-align: center;
  margin-bottom: 32px;
  line-height: 1.55;
}

/* Input with icon */
.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #C0C0D8;
  pointer-events: none;
  display: flex;
  transition: color .2s;
}
.auth-input-wrap .form-control {
  padding-left: 42px;
  height: 48px;
  border-radius: 10px;
  border: 1.5px solid #E8E8F4;
  background: #F8F8FE;
  font-size: .9rem;
  color: #1A1A2E;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input-wrap .form-control::placeholder { color: #C0C0D8; }
.auth-input-wrap .form-control:focus {
  border-color: #6366F1;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(99,102,241,.1);
  outline: none;
}
.auth-input-wrap:focus-within .auth-input-icon { color: #6366F1; }

.auth-input-wrap .auth-eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #C0C0D8;
  display: flex;
  padding: 4px;
  border-radius: 6px;
  transition: color .2s;
}
.auth-input-wrap .auth-eye-btn:hover { color: #6366F1; }

/* remember row */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: #6B6B8A;
  cursor: pointer;
  user-select: none;
}
.auth-remember input[type="checkbox"] {
  width: 16px; height: 16px;
  accent-color: #4545C8;
  cursor: pointer;
}

/* Submit button */
.auth-submit {
  width: 100%;
  height: 50px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #3B3BAA 0%, #4545C8 40%, #6366F1 100%);
  background-size: 200% 200%;
  background-position: 0% 50%;
  letter-spacing: .01em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-position .4s ease, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(69,69,200,.3);
}
.auth-submit:hover {
  background-position: 100% 50%;
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(69,69,200,.4);
}
.auth-submit:active { transform: translateY(0); }

/* footer note */
.auth-footer {
  margin-top: 40px;
  font-size: .78rem;
  color: #B0B0C8;
  text-align: center;
}
.auth-footer a { color: #6366F1; text-decoration: underline; text-underline-offset: 2px; }

/* keep .auth-panel for any legacy/other auth views */
.auth-panel { display: none; }
.auth-brand  { display: none; }
.auth-form { width: 100%; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .topbar__search { display: none; }
}
@media (max-width: 480px) {
  .auth-card { padding: 36px 24px 32px; border-radius: 16px; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .overlay { display: block; pointer-events: none; }

  .main-wrap {
    margin-left: 0;
  }

  .topbar__toggle { display: flex; }
  .topbar__user-name { display: none; }

  .page-content { padding: 20px 16px; }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  .page-header { flex-direction: column; align-items: flex-start; gap: 14px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Form validation states ───────────────────────────────── */
.form-control.is-invalid {
  border-color: #EF4444;
  background-image: none;
}

.form-error {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: #EF4444;
}

/* ── Button full width ────────────────────────────────────── */
.btn--full {
  width: 100%;
  justify-content: center;
}

/* ── Stat Card ────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card__body {
  flex: 1;
  min-width: 0;
}

.stat-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-title);
  line-height: 1.2;
}

.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Badge danger ─────────────────────────────────────────── */
.badge--danger {
  background: rgba(239, 68, 68, 0.1);
  color: #EF4444;
}

/* ── Preloader ──────────────────────────────────────────── */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .45s ease, visibility .45s ease;
}
#preloader.preloader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: preloader-fadein .3s ease;
}
@keyframes preloader-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
.preloader__logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--primary-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: preloader-pulse 1.8s ease-in-out infinite;
}
.preloader__logo img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
@keyframes preloader-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(69,69,200,.30); }
  50%       { box-shadow: 0 0 0 14px rgba(69,69,200,.00); }
}
.preloader__track {
  width: 140px;
  height: 3px;
  background: var(--primary-xlight);
  border-radius: 99px;
  overflow: hidden;
}
.preloader__fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-light));
  border-radius: 99px;
  animation: preloader-slide 1.3s ease-in-out infinite;
}
@keyframes preloader-slide {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(360%);  }
}
.preloader__label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--text-muted);
}
