/* =========================================================
   JF&I DocuTrack — Design System  v1.0
   ========================================================= */

/* --- Google Fonts: Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- CSS Custom Properties --- */
:root {
  --sidebar-w: 260px;
  --topbar-h: 64px;

  /* Sidebar */
  --sb-bg:          #0F172A;
  --sb-text:        #94A3B8;
  --sb-text-hover:  #CBD5E1;
  --sb-text-active: #F8FAFC;
  --sb-active-bg:   rgba(59,130,246,.12);
  --sb-hover-bg:    rgba(255,255,255,.05);
  --sb-border:      rgba(255,255,255,.08);
  --sb-accent:      #3B82F6;

  /* Brand colours */
  --c-primary:       #2563EB;
  --c-primary-dark:  #1D4ED8;
  --c-primary-light: #EFF6FF;
  --c-success:       #059669;
  --c-success-light: #ECFDF5;
  --c-warning:       #D97706;
  --c-warning-light: #FFFBEB;
  --c-danger:        #DC2626;
  --c-danger-light:  #FEF2F2;
  --c-info:          #0284C7;
  --c-info-light:    #F0F9FF;

  /* Layout */
  --body-bg:    #F1F5F9;
  --card-bg:    #FFFFFF;
  --topbar-bg:  #FFFFFF;
  --border:     #E2E8F0;

  /* Text */
  --tx-primary:   #0F172A;
  --tx-secondary: #475569;
  --tx-muted:     #94A3B8;

  /* Shadows */
  --sh-xs: 0 1px 2px rgba(0,0,0,.05);
  --sh-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --sh-md: 0 4px 12px rgba(0,0,0,.07);
  --sh-lg: 0 10px 30px rgba(0,0,0,.12);

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Motion */
  --t: all .18s ease;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--body-bg);
  color: var(--tx-primary);
  margin: 0; padding: 0;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { transition: var(--t); }
a:focus { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* =========================================================
   APP SHELL
   ========================================================= */
#app-wrapper { display: flex; min-height: 100vh; }

/* =========================================================
   SIDEBAR
   ========================================================= */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sb-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: transform .25s ease;
}

/* Brand */
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--sb-border);
  text-decoration: none;
}
.sidebar-brand:hover { text-decoration: none; }

.sb-logo {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg,#3B82F6,#1D4ED8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,.40);
}
.sb-logo i { color: #fff; font-size: 17px; }

.sb-logo-plate {
  background: #fff;
  border-radius: var(--r-md);
  padding: 5px 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo-plate img { display: block; height: 26px; width: auto; }

.sb-brand-text { flex: 1; min-width: 0; }
.sb-brand-name {
  font-size: 14.5px; font-weight: 700;
  color: #fff; letter-spacing: -.3px; line-height: 1.2;
  white-space: nowrap;
}
.sb-brand-sub {
  font-size: 9.5px; color: var(--sb-text);
  letter-spacing: .6px; text-transform: uppercase; margin-top: 1px;
}

/* Nav */
.sidebar-nav {
  flex: 1; padding: 10px 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.nav-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: #475569;
  padding: 10px 20px 3px;
}

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 18px;
  color: var(--sb-text);
  text-decoration: none;
  border-radius: var(--r-sm);
  margin: 1px 10px;
  transition: var(--t);
  position: relative;
  font-size: 13px; font-weight: 500;
}
.nav-link:hover {
  background: var(--sb-hover-bg);
  color: var(--sb-text-hover);
  text-decoration: none;
}
.nav-link.active {
  background: var(--sb-active-bg);
  color: var(--sb-text-active);
}
.nav-link.active::before {
  content: '';
  position: absolute; left: -10px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--sb-accent);
  border-radius: 0 3px 3px 0;
}
.nav-link .ni { width: 16px; text-align: center; font-size: 13px; opacity: .7; flex-shrink: 0; transition: var(--t); }
.nav-link.active .ni, .nav-link:hover .ni { opacity: 1; }
.nav-link .nb { font-size: 10px; padding: 1px 7px; border-radius: 20px; background: rgba(59,130,246,.2); color: #93C5FD; font-weight: 600; margin-left: auto; }
.nav-link .na { font-size: 10px; margin-left: auto; transition: transform .2s ease; }
.nav-link[aria-expanded="true"] .na { transform: rotate(180deg); }

/* Sub-menu */
.nav-sub { display: none; padding: 0; }
.nav-sub.show { display: block; }
.nav-sub .nav-link { padding-left: 44px; font-size: 12.5px; }

/* Sidebar footer / user widget */
.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--sb-border);
}
.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 8px; border-radius: var(--r-md);
  cursor: pointer; text-decoration: none;
  transition: var(--t);
}
.sb-user:hover { background: var(--sb-hover-bg); text-decoration: none; }

.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg,#3B82F6,#6366F1);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-user-name  { font-size: 12.5px; font-weight: 600; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role  { font-size: 11px; color: var(--sb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-info  { flex: 1; min-width: 0; }

/* =========================================================
   CONTENT WRAPPER
   ========================================================= */
#content-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
}

/* =========================================================
   TOPBAR
   ========================================================= */
#topbar {
  height: var(--topbar-h); background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 14px;
  position: sticky; top: 0; z-index: 1020;
  box-shadow: var(--sh-xs);
}
.topbar-left { display: flex; align-items: center; gap: 12px; flex: 1; }
.topbar-title { font-size: 16px; font-weight: 600; color: var(--tx-primary); }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--tx-muted);
}
.topbar-breadcrumb a { color: var(--tx-muted); text-decoration: none; }
.topbar-breadcrumb a:hover { color: var(--c-primary); }
.topbar-right { display: flex; align-items: center; gap: 6px; }

.tb-btn {
  width: 34px; height: 34px; border-radius: var(--r-md);
  border: none; background: transparent;
  color: var(--tx-secondary); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: var(--t);
  text-decoration: none; position: relative;
}
.tb-btn:hover { background: var(--body-bg); color: var(--c-primary); }
.tb-badge {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px;
  background: var(--c-danger); border-radius: 50%;
  border: 2px solid #fff;
}
.tb-divider { width: 1px; height: 22px; background: var(--border); }

/* =========================================================
   PAGE CONTENT
   ========================================================= */
#page-content { padding: 24px; flex: 1; }

.page-header {
  display: flex; align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-title  { font-size: 21px; font-weight: 700; color: var(--tx-primary); margin: 0; letter-spacing: -.4px; }
.page-sub    { font-size: 13px; color: var(--tx-muted); margin: 2px 0 0; }

/* =========================================================
   CARDS
   ========================================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  margin-bottom: 20px;
}
.card-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: transparent;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.card-title { font-size: 14.5px; font-weight: 600; color: var(--tx-primary); margin: 0; }
.card-body  { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: #FAFBFC;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Stat cards */
.stat-card {
  border-radius: var(--r-lg); padding: 22px 20px;
  border: none; box-shadow: var(--sh-md);
  position: relative; overflow: hidden; color: #fff;
}
.stat-card::after {
  content: ''; position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.sc-primary { background: linear-gradient(135deg,#2563EB,#1D4ED8); }
.sc-success { background: linear-gradient(135deg,#059669,#047857); }
.sc-warning { background: linear-gradient(135deg,#D97706,#B45309); }
.sc-danger  { background: linear-gradient(135deg,#DC2626,#B91C1C); }
.sc-info    { background: linear-gradient(135deg,#0284C7,#0369A1); }
.sc-purple  { background: linear-gradient(135deg,#7C3AED,#6D28D9); }

.stat-val   { font-size: 30px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12.5px; opacity: .85; font-weight: 500; }
.stat-icon  { position: absolute; top: 50%; right: 18px; transform: translateY(-50%); font-size: 34px; opacity: .15; }
.stat-trend { font-size: 11.5px; margin-top: 8px; opacity: .8; }

/* =========================================================
   TABLES
   ========================================================= */
.table-card .card-body { padding: 0; }

.table { margin: 0; font-size: 13.5px; }
.table thead th {
  background: #F8FAFC;
  border-bottom: 1px solid var(--border);
  color: var(--tx-secondary);
  font-size: 11px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase;
  padding: 11px 16px; white-space: nowrap;
}
.table tbody tr { transition: var(--t); }
.table tbody tr:hover { background: #F8FAFC; }
.table tbody td {
  padding: 11px 16px;
  vertical-align: middle;
  border-color: var(--border);
  color: var(--tx-primary);
}
.table tbody tr:last-child td { border-bottom: 0; }

.tbl-actions { display: flex; gap: 4px; flex-wrap: nowrap; }

/* Icon-only action buttons */
.btn-ic {
  width: 28px; height: 28px;
  border-radius: var(--r-sm); border: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; cursor: pointer; transition: var(--t);
  text-decoration: none;
}
.btn-ic-p { background: var(--c-primary-light); color: var(--c-primary); }
.btn-ic-p:hover { background: var(--c-primary); color: #fff; }
.btn-ic-s { background: var(--c-success-light); color: var(--c-success); }
.btn-ic-s:hover { background: var(--c-success); color: #fff; }
.btn-ic-d { background: var(--c-danger-light); color: var(--c-danger); }
.btn-ic-d:hover { background: var(--c-danger); color: #fff; }
.btn-ic-w { background: var(--c-warning-light); color: var(--c-warning); }
.btn-ic-w:hover { background: var(--c-warning); color: #fff; }
.btn-ic-n { background: #F1F5F9; color: var(--tx-secondary); }
.btn-ic-n:hover { background: #E2E8F0; color: var(--tx-primary); }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  border-radius: var(--r-md); font-size: 13.5px; font-weight: 500;
  padding: 8px 16px; border: none;
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; text-decoration: none; transition: var(--t);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }

.btn-primary  { background: var(--c-primary); color: #fff; box-shadow: 0 2px 8px rgba(37,99,235,.30); }
.btn-primary:hover  { background: var(--c-primary-dark); color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.40); transform: translateY(-1px); }
.btn-success  { background: var(--c-success); color: #fff; box-shadow: 0 2px 8px rgba(5,150,105,.30); }
.btn-success:hover  { background: #047857; color: #fff; transform: translateY(-1px); }
.btn-danger   { background: var(--c-danger); color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,.30); }
.btn-danger:hover   { background: #B91C1C; color: #fff; transform: translateY(-1px); }
.btn-warning  { background: var(--c-warning); color: #fff; }
.btn-warning:hover  { background: #B45309; color: #fff; transform: translateY(-1px); }
.btn-secondary { background: #F1F5F9; color: var(--tx-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { background: #E2E8F0; color: var(--tx-primary); }
.btn-outline-primary { background: transparent; color: var(--c-primary); border: 1.5px solid var(--c-primary); }
.btn-outline-primary:hover { background: var(--c-primary); color: #fff; }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* =========================================================
   FORMS
   ========================================================= */
.form-label {
  font-size: 13px; font-weight: 500;
  color: var(--tx-secondary); margin-bottom: 6px; display: block;
}
.form-label .req { color: var(--c-danger); margin-left: 2px; }

.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  font-size: 13.5px; color: var(--tx-primary);
  background: #fff; width: 100%;
  transition: var(--t); outline: none; font-family: inherit;
}
.form-control:focus, .form-select:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.10);
}
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--c-danger); }
.form-control::placeholder { color: #CBD5E1; }

.invalid-feedback  { font-size: 11.5px; color: var(--c-danger); margin-top: 4px; display: block; }
.valid-feedback    { font-size: 11.5px; color: var(--c-success); margin-top: 4px; display: block; }
.form-text         { font-size: 11.5px; color: var(--tx-muted); margin-top: 4px; }

textarea.form-control { resize: vertical; min-height: 90px; }

.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--r-md) 0 0 var(--r-md); flex: 1; }
.input-group-text {
  padding: 8px 12px; background: #F8FAFC;
  border: 1.5px solid var(--border); border-left: none;
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--tx-muted); font-size: 14px;
  display: flex; align-items: center;
}
.input-group-btn .input-group-text { cursor: pointer; }
.input-group-btn .input-group-text:hover { background: #E2E8F0; }

.form-check { display: flex; align-items: center; gap: 8px; }
.form-check-input { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; flex-shrink: 0; }
.form-check-label { font-size: 13.5px; color: var(--tx-primary); cursor: pointer; margin: 0; }

/* Section heading inside form */
.form-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--tx-muted);
  margin: 20px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* =========================================================
   BADGES
   ========================================================= */
.badge {
  padding: 3px 9px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .1px;
  display: inline-flex; align-items: center; gap: 4px;
}
.badge-primary   { background: var(--c-primary-light); color: var(--c-primary); }
.badge-success   { background: var(--c-success-light); color: var(--c-success); }
.badge-warning   { background: var(--c-warning-light); color: var(--c-warning); }
.badge-danger    { background: var(--c-danger-light);  color: var(--c-danger);  }
.badge-info      { background: var(--c-info-light);    color: var(--c-info);    }
.badge-secondary { background: #F1F5F9; color: var(--tx-secondary); }
.badge-dark      { background: #0F172A; color: #fff; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-success { background: var(--c-success); }
.dot-warning { background: var(--c-warning); }
.dot-danger  { background: var(--c-danger);  }
.dot-muted   { background: var(--tx-muted);  }
.dot-primary { background: var(--c-primary); }

/* =========================================================
   FLASH ALERTS
   ========================================================= */
.alert {
  padding: 11px 14px; border-radius: var(--r-md);
  font-size: 13.5px; margin-bottom: 14px;
  display: flex; align-items: flex-start; gap: 10px;
  border: none; position: relative;
}
.alert-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.alert-body { flex: 1; }
.alert-success { background: var(--c-success-light); color: #065F46; border-left: 4px solid var(--c-success); }
.alert-danger  { background: var(--c-danger-light);  color: #7F1D1D; border-left: 4px solid var(--c-danger);  }
.alert-warning { background: var(--c-warning-light); color: #78350F; border-left: 4px solid var(--c-warning); }
.alert-info    { background: var(--c-info-light);    color: #0C4A6E; border-left: 4px solid var(--c-info);    }
.alert-close {
  position: absolute; top: 9px; right: 11px;
  background: none; border: none; cursor: pointer;
  opacity: .5; font-size: 15px; line-height: 1; transition: var(--t); color: inherit;
}
.alert-close:hover { opacity: 1; }

/* =========================================================
   SEARCH BOX
   ========================================================= */
.search-wrap { position: relative; }
.search-wrap .si { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--tx-muted); font-size: 13px; pointer-events: none; }
.search-wrap .form-control { padding-left: 33px; height: 36px; font-size: 13px; }

/* =========================================================
   PAGINATION
   ========================================================= */
.pagination { display: flex; gap: 3px; align-items: center; margin: 0; padding: 0; list-style: none; }
.page-link {
  padding: 5px 11px; border-radius: var(--r-sm); font-size: 13px;
  color: var(--tx-secondary); text-decoration: none;
  border: 1px solid var(--border); background: #fff; transition: var(--t);
  display: inline-flex; align-items: center;
}
.page-link:hover { background: var(--body-bg); color: var(--c-primary); }
.page-item.active .page-link { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.page-item.disabled .page-link { opacity: .5; cursor: not-allowed; }

/* =========================================================
   MODALS
   ========================================================= */
.modal-content { border: none; border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
.modal-header  { padding: 18px 24px; border-bottom: 1px solid var(--border); }
.modal-title   { font-size: 15.5px; font-weight: 700; color: var(--tx-primary); }
.modal-body    { padding: 24px; }
.modal-footer  { padding: 14px 24px; border-top: 1px solid var(--border); gap: 8px; }

/* =========================================================
   AVATAR
   ========================================================= */
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 46px; height: 46px; font-size: 16px; }
.avatar-blue   { background: #DBEAFE; color: #1D4ED8; }
.avatar-green  { background: #D1FAE5; color: #047857; }
.avatar-purple { background: #EDE9FE; color: #6D28D9; }
.avatar-orange { background: #FFEDD5; color: #C2410C; }
.avatar-slate  { background: #F1F5F9; color: #475569; }
.avatar-red    { background: #FEE2E2; color: #B91C1C; }

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state-icon { font-size: 44px; color: var(--tx-muted); opacity: .35; margin-bottom: 14px; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--tx-secondary); margin-bottom: 5px; }
.empty-state-text  { font-size: 13px; color: var(--tx-muted); }

/* =========================================================
   USER PROFILE SNIPPET (in tables)
   ========================================================= */
.user-cell { display: flex; align-items: center; gap: 9px; }
.user-cell-name { font-weight: 600; font-size: 13.5px; color: var(--tx-primary); }
.user-cell-sub  { font-size: 12px; color: var(--tx-muted); }

/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-wrap {
  min-height: 100vh;
  background: linear-gradient(135deg, #0F172A 0%, #1E3564 50%, #0F172A 100%);
  display: flex; align-items: stretch;
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ''; position: absolute;
  top: -250px; left: -250px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(59,130,246,.14) 0%, transparent 70%);
  pointer-events: none;
}
.login-wrap::after {
  content: ''; position: absolute;
  bottom: -250px; right: -250px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(99,102,241,.10) 0%, transparent 70%);
  pointer-events: none;
}

/* Left brand panel */
.login-brand {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px; position: relative; z-index: 1;
}
.login-logo {
  width: 76px; height: 76px;
  background: linear-gradient(135deg,#3B82F6,#1D4ED8);
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(59,130,246,.45);
}
.login-logo i { color: #fff; font-size: 36px; }
.login-logo-plate {
  background: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.login-logo-plate img { display: block; height: 36px; width: auto; }
.login-app-name {
  font-size: 38px; font-weight: 800; color: #fff;
  letter-spacing: -1.2px; text-align: center; margin-bottom: 8px;
}
.login-tagline {
  font-size: 15px; color: rgba(255,255,255,.48);
  text-align: center; margin-bottom: 48px; max-width: 320px; line-height: 1.5;
}
.login-features { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }
.login-feat {
  display: flex; align-items: center; gap: 13px;
  padding: 12px 14px;
  background: rgba(255,255,255,.05);
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,.07);
}
.lf-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.lf-blue   { background: rgba(59,130,246,.2); color: #93C5FD; }
.lf-green  { background: rgba(16,185,129,.2); color: #6EE7B7; }
.lf-purple { background: rgba(139,92,246,.2); color: #C4B5FD; }
.lf-amber  { background: rgba(245,158,11,.2); color: #FCD34D; }
.lf-text { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.65); }

/* Right form panel */
.login-form-panel {
  width: 460px; min-height: 100vh;
  background: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 50px;
  position: relative; z-index: 1;
  box-shadow: -20px 0 60px rgba(0,0,0,.18);
}
.login-form-title {
  font-size: 24px; font-weight: 800; color: var(--tx-primary);
  margin-bottom: 4px; letter-spacing: -.5px; align-self: flex-start;
}
.login-form-sub {
  font-size: 13.5px; color: var(--tx-muted);
  margin-bottom: 30px; align-self: flex-start;
}
.login-form { width: 100%; }
.login-form .form-control {
  height: 44px; font-size: 14px;
  border-radius: 10px; border: 1.5px solid #E2E8F0; padding: 0 13px;
}
.login-form .form-control:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(37,99,235,.10); }
.login-form .input-group .form-control { border-radius: 10px 0 0 10px; }
.login-form .input-group-text { height: 44px; border-radius: 0 10px 10px 0; border: 1.5px solid #E2E8F0; border-left: none; }
.btn-login {
  height: 44px; font-size: 14.5px; font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(135deg,#2563EB,#1D4ED8);
  color: #fff; border: none; width: 100%;
  cursor: pointer; transition: var(--t); letter-spacing: .1px;
  box-shadow: 0 4px 16px rgba(37,99,235,.35);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-login:hover {
  background: linear-gradient(135deg,#1D4ED8,#1E40AF);
  box-shadow: 0 6px 20px rgba(37,99,235,.45);
  transform: translateY(-1px);
}
.login-footer {
  font-size: 11.5px; color: var(--tx-muted);
  text-align: center; margin-top: auto; padding-top: 24px; align-self: center;
}

/* =========================================================
   SETUP PAGE
   ========================================================= */
.setup-wrap {
  min-height: 100vh; background: var(--body-bg);
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.setup-card { width: 100%; max-width: 560px; background: #fff; border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.setup-header { background: linear-gradient(135deg,#0F172A,#1E3564); padding: 30px 32px; }
.setup-header-logo { width: 48px; height: 48px; background: linear-gradient(135deg,#3B82F6,#1D4ED8); border-radius: 13px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.setup-header-logo i { color: #fff; font-size: 22px; }
.setup-header h1 { font-size: 20px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.setup-header p { font-size: 13px; color: rgba(255,255,255,.55); margin: 0; }
.setup-body { padding: 32px; }
.step-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.step-item:last-child { border-bottom: none; }
.step-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.step-ok { background: var(--c-success-light); color: var(--c-success); }
.step-err { background: var(--c-danger-light); color: var(--c-danger); }
.step-wait { background: #F1F5F9; color: var(--tx-muted); }
.step-label { font-size: 13.5px; font-weight: 600; color: var(--tx-primary); }
.step-detail { font-size: 12px; color: var(--tx-muted); margin-top: 2px; }

/* =========================================================
   UTILITIES
   ========================================================= */
.text-primary-c { color: var(--c-primary) !important; }
.text-success-c { color: var(--c-success) !important; }
.text-warning-c { color: var(--c-warning) !important; }
.text-danger-c  { color: var(--c-danger)  !important; }
.text-muted-c   { color: var(--tx-muted)  !important; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fs-12  { font-size: 12px !important; }
.fs-13  { font-size: 13px !important; }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.sidebar-open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  #content-wrapper { margin-left: 0; }
  .login-brand { display: none; }
  .login-form-panel { width: 100%; max-width: 480px; min-height: auto; padding: 50px 36px; border-radius: var(--r-xl); box-shadow: var(--sh-lg); }
  .login-wrap { justify-content: center; align-items: center; padding: 24px; }
}
@media (max-width: 640px) {
  #page-content { padding: 16px; }
  .login-form-panel { padding: 36px 24px; }
  .page-header { gap: 8px; }
}

/* Sidebar overlay */
#sb-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 1025;
}
#sb-overlay.show { display: block; }
