/* =========================================================
   Vibely Admin — Design System
   Premium SaaS dashboard aesthetic: clean type, generous
   spacing, subtle depth, restrained color.
   ========================================================= */

:root{
  --bg:            #f6f7f9;
  --surface:       #ffffff;
  --surface-alt:   #fbfbfd;
  --border:        #e6e8ec;
  --border-strong: #d8dbe1;

  --text-primary:  #14161a;
  --text-secondary:#5b6270;
  --text-tertiary: #8b91a0;

  --brand:         #4f46e5;
  --brand-dark:    #4338ca;
  --brand-light:   #eef0ff;
  --brand-glow:    rgba(79,70,229,.18);

  --success:       #14804a;
  --success-bg:    #e7f6ee;
  --warning:       #9a5b0a;
  --warning-bg:    #fdf1de;
  --danger:        #b3261e;
  --danger-bg:     #fdeceb;
  --neutral:       #565d6b;
  --neutral-bg:    #eef0f3;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px rgba(20,22,26,.04);
  --shadow-md: 0 4px 16px rgba(20,22,26,.06);
  --shadow-lg: 0 12px 32px rgba(20,22,26,.10);
  --shadow-focus: 0 0 0 4px var(--brand-glow);

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 80px;
  --header-h: 68px;

  --ease: cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"]{
  --bg:            #0d0e12;
  --surface:       #15171c;
  --surface-alt:   #191b21;
  --border:        #262932;
  --border-strong: #33363f;

  --text-primary:  #f2f3f5;
  --text-secondary:#a4a9b4;
  --text-tertiary: #6d7280;

  --brand-light:   #1c1c3a;
  --success-bg:    #0f2b1e;
  --warning-bg:    #2c220f;
  --danger-bg:     #2c1614;
  --neutral-bg:    #20222a;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
  background:var(--bg);
  color:var(--text-primary);
  font-size:14px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ margin:0; font-weight:650; letter-spacing:-.01em; }
p{ margin:0; }
a{ color:inherit; text-decoration:none; }
ul{ list-style:none; margin:0; padding:0; }
button{ font-family:inherit; cursor:pointer; }
input,select,textarea{ font-family:inherit; }
::selection{ background:var(--brand-glow); }

.scroll-thin::-webkit-scrollbar{ width:6px; height:6px; }
.scroll-thin::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:10px; }

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

.sidebar{
  width:var(--sidebar-w);
  flex-shrink:0;
  background:var(--surface);
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  position:fixed; top:0; left:0; bottom:0;
  z-index:40;
  transition:width .22s var(--ease), transform .22s var(--ease);
}
.app-shell.is-collapsed .sidebar{ width:var(--sidebar-w-collapsed); }

.sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding:20px 20px;
  height:var(--header-h);
  border-bottom:1px solid var(--border);
}
.sidebar-brand img{ width:28px; height:28px; border-radius:8px; flex-shrink:0; }
.sidebar-brand span{ font-weight:700; font-size:16px; white-space:nowrap; overflow:hidden; }
.is-collapsed .sidebar-brand span{ opacity:0; width:0; }

.sidebar-nav{ flex:1; overflow-y:auto; padding:16px 12px; }
.nav-section-label{
  font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.06em;
  color:var(--text-tertiary); padding:16px 12px 6px;
}
.nav-section-label:first-child{ padding-top:4px; }
.is-collapsed .nav-section-label{ opacity:0; height:0; padding:0; overflow:hidden; }

.nav-item{
  display:flex; align-items:center; gap:12px;
  padding:9px 12px; border-radius:var(--radius-sm);
  color:var(--text-secondary); font-weight:500; font-size:13.5px;
  margin-bottom:2px; position:relative;
  transition:background .15s var(--ease), color .15s var(--ease);
  white-space:nowrap;
}
.nav-item svg{ width:18px; height:18px; flex-shrink:0; }
.nav-item:hover{ background:var(--surface-alt); color:var(--text-primary); }
.nav-item.active{ background:var(--brand-light); color:var(--brand); }
.is-collapsed .nav-item span.label{ display:none; }
.nav-badge{
  margin-left:auto; background:var(--danger-bg); color:var(--danger);
  font-size:11px; font-weight:700; padding:1px 7px; border-radius:99px;
}

.sidebar-footer{ padding:14px 20px; border-top:1px solid var(--border); }
.sidebar-toggle-btn{
  display:flex; align-items:center; justify-content:center;
  width:32px; height:32px; border-radius:8px; border:1px solid var(--border);
  background:var(--surface); color:var(--text-secondary);
}
.sidebar-toggle-btn:hover{ background:var(--surface-alt); }

.main-area{
  margin-left:var(--sidebar-w);
  flex:1; min-width:0;
  display:flex; flex-direction:column;
  transition:margin-left .22s var(--ease);
}
.is-collapsed .main-area{ margin-left:var(--sidebar-w-collapsed); }

/* Header */
.topbar{
  height:var(--header-h);
  display:flex; align-items:center; gap:16px;
  padding:0 24px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:30;
}
.topbar-menu-btn{
  display:none;
  width:36px; height:36px; align-items:center; justify-content:center;
  border-radius:8px; border:1px solid var(--border); background:var(--surface);
}
.breadcrumb{ font-size:13px; color:var(--text-tertiary); }
.breadcrumb b{ color:var(--text-primary); font-weight:650; font-size:15px; }

.topbar-search{
  flex:1; max-width:360px; margin-left:8px;
  display:flex; align-items:center; gap:8px;
  background:var(--surface-alt); border:1px solid var(--border);
  border-radius:var(--radius-md); padding:8px 12px;
  color:var(--text-tertiary);
}
.topbar-search input{
  border:none; background:transparent; outline:none; width:100%;
  color:var(--text-primary); font-size:13.5px;
}
.topbar-search svg{ width:16px; height:16px; flex-shrink:0; }
.topbar-search kbd{
  font-size:11px; border:1px solid var(--border-strong); border-radius:5px;
  padding:1px 5px; color:var(--text-tertiary); background:var(--surface);
}

.topbar-actions{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.icon-btn{
  position:relative;
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius:9px; border:1px solid var(--border); background:var(--surface);
  color:var(--text-secondary); transition:background .15s var(--ease);
}
.icon-btn:hover{ background:var(--surface-alt); }
.icon-btn svg{ width:18px; height:18px; }
.icon-btn .dot{
  position:absolute; top:6px; right:6px; width:7px; height:7px; border-radius:50%;
  background:var(--danger); border:1.5px solid var(--surface);
}

.admin-chip{
  display:flex; align-items:center; gap:10px; padding:5px 10px 5px 5px;
  border-radius:99px; border:1px solid var(--border); background:var(--surface);
  cursor:pointer;
}
.admin-chip .avatar{ width:28px; height:28px; border-radius:50%; }
.admin-chip .meta{ line-height:1.25; text-align:left; }
.admin-chip .meta b{ display:block; font-size:12.5px; font-weight:650; }
.admin-chip .meta small{ color:var(--text-tertiary); font-size:11px; }

.page-body{ padding:24px 28px 60px; max-width:1440px; width:100%; margin:0 auto; }

/* ---------------------------------------------------------
   Cards
   --------------------------------------------------------- */
.card{
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-sm);
}
.card-pad{ padding:20px 22px; }
.card-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--border); gap:12px; flex-wrap:wrap;
}
.card-header h3{ font-size:15px; }
.card-header p{ color:var(--text-tertiary); font-size:12.5px; margin-top:2px; }

.kpi-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.kpi-card{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:18px 20px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden;
}
.kpi-card .kpi-icon{
  width:36px; height:36px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:var(--brand-light); color:var(--brand); margin-bottom:14px;
}
.kpi-card .kpi-icon svg{ width:18px; height:18px; }
.kpi-label{ font-size:12.5px; color:var(--text-tertiary); font-weight:600; }
.kpi-value{ font-size:24px; font-weight:700; margin-top:4px; letter-spacing:-.02em; }
.kpi-trend{ display:flex; align-items:center; gap:5px; margin-top:10px; font-size:12px; font-weight:650; }
.kpi-trend.up{ color:var(--success); }
.kpi-trend.down{ color:var(--danger); }
.kpi-trend .vs{ color:var(--text-tertiary); font-weight:500; }

.grid-2{ display:grid; grid-template-columns:2fr 1fr; gap:16px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }

/* ---------------------------------------------------------
   Buttons
   --------------------------------------------------------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  padding:9px 16px; border-radius:var(--radius-sm); font-size:13.5px; font-weight:600;
  border:1px solid transparent; transition:all .15s var(--ease); white-space:nowrap;
}
.btn svg{ width:15px; height:15px; }
.btn-primary{ background:var(--brand); color:#fff; }
.btn-primary:hover{ background:var(--brand-dark); }
.btn-primary:focus-visible{ box-shadow:var(--shadow-focus); }
.btn-outline{ background:var(--surface); border-color:var(--border-strong); color:var(--text-primary); }
.btn-outline:hover{ background:var(--surface-alt); }
.btn-ghost{ background:transparent; color:var(--text-secondary); }
.btn-ghost:hover{ background:var(--surface-alt); color:var(--text-primary); }
.btn-danger{ background:var(--danger); color:#fff; }
.btn-danger:hover{ filter:brightness(1.08); }
.btn-sm{ padding:6px 11px; font-size:12.5px; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.55; cursor:not-allowed; }

/* ---------------------------------------------------------
   Forms
   --------------------------------------------------------- */
.form-group{ margin-bottom:16px; }
.form-label{ display:block; font-size:12.5px; font-weight:650; margin-bottom:6px; color:var(--text-secondary); }
.form-control{
  width:100%; padding:10px 12px; border-radius:var(--radius-sm);
  border:1px solid var(--border-strong); background:var(--surface);
  color:var(--text-primary); font-size:13.5px; outline:none;
  transition:border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control:focus{ border-color:var(--brand); box-shadow:var(--shadow-focus); }
.form-hint{ font-size:11.5px; color:var(--text-tertiary); margin-top:5px; }
.input-group{ position:relative; }
.input-group .form-control{ padding-right:38px; }
.input-group-btn{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  background:none; border:none; color:var(--text-tertiary); padding:6px;
}
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.checkbox-row{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-secondary); }

.switch{ position:relative; display:inline-block; width:38px; height:22px; flex-shrink:0; }
.switch input{ opacity:0; width:0; height:0; }
.switch .slider{
  position:absolute; inset:0; background:var(--border-strong); border-radius:99px; transition:.2s;
}
.switch .slider::before{
  content:""; position:absolute; width:16px; height:16px; left:3px; top:3px;
  background:#fff; border-radius:50%; transition:.2s;
}
.switch input:checked + .slider{ background:var(--brand); }
.switch input:checked + .slider::before{ transform:translateX(16px); }

/* ---------------------------------------------------------
   Badges
   --------------------------------------------------------- */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  padding:3px 9px; border-radius:99px; font-size:11.5px; font-weight:650;
}
.badge::before{ content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.badge-success{ background:var(--success-bg); color:var(--success); }
.badge-warning{ background:var(--warning-bg); color:var(--warning); }
.badge-danger{ background:var(--danger-bg); color:var(--danger); }
.badge-neutral{ background:var(--neutral-bg); color:var(--neutral); }

/* ---------------------------------------------------------
   Tables
   --------------------------------------------------------- */
.table-toolbar{
  display:flex; align-items:center; gap:10px; padding:16px 22px; flex-wrap:wrap;
  border-bottom:1px solid var(--border);
}
.table-toolbar .spacer{ flex:1; }
.table-search{
  display:flex; align-items:center; gap:8px; background:var(--surface-alt);
  border:1px solid var(--border); border-radius:var(--radius-sm); padding:8px 12px; min-width:220px;
}
.table-search input{ border:none; background:none; outline:none; font-size:13px; width:100%; color:var(--text-primary); }
.table-search svg{ width:15px; height:15px; color:var(--text-tertiary); flex-shrink:0; }
.filter-select{
  padding:8px 30px 8px 12px; border-radius:var(--radius-sm); border:1px solid var(--border);
  background:var(--surface-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238b91a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance:none; font-size:13px; color:var(--text-secondary); cursor:pointer;
}

.table-wrap{ overflow-x:auto; }
table.data-table{ width:100%; border-collapse:collapse; min-width:720px; }
.data-table thead th{
  text-align:left; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--text-tertiary); font-weight:700; padding:12px 22px; border-bottom:1px solid var(--border);
  background:var(--surface-alt); white-space:nowrap;
}
.data-table tbody td{
  padding:14px 22px; border-bottom:1px solid var(--border); font-size:13.5px; vertical-align:middle;
}
.data-table tbody tr:last-child td{ border-bottom:none; }
.data-table tbody tr{ transition:background .12s var(--ease); }
.data-table tbody tr:hover{ background:var(--surface-alt); }

.cell-user{ display:flex; align-items:center; gap:10px; }
.cell-user img{ width:34px; height:34px; border-radius:50%; object-fit:cover; flex-shrink:0; background:var(--neutral-bg); }
.cell-user .u-name{ font-weight:600; }
.cell-user .u-sub{ color:var(--text-tertiary); font-size:12px; }

.row-actions{ display:flex; align-items:center; gap:4px; justify-content:flex-end; }

.table-footer{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 22px; border-top:1px solid var(--border); flex-wrap:wrap; gap:10px;
}
.pagination{ display:flex; gap:4px; }
.pagination a, .pagination span{
  min-width:32px; height:32px; display:flex; align-items:center; justify-content:center;
  border-radius:8px; font-size:13px; font-weight:600; color:var(--text-secondary);
}
.pagination a:hover{ background:var(--surface-alt); }
.pagination .active{ background:var(--brand); color:#fff; }
.pagination .disabled{ color:var(--text-tertiary); opacity:.5; }

/* ---------------------------------------------------------
   Tabs
   --------------------------------------------------------- */
.tabs{ display:flex; gap:4px; border-bottom:1px solid var(--border); padding:0 22px; overflow-x:auto; }
.tab-item{
  padding:13px 6px; margin-right:22px; font-size:13.5px; font-weight:600; color:var(--text-tertiary);
  border-bottom:2px solid transparent; white-space:nowrap;
}
.tab-item.active{ color:var(--brand); border-color:var(--brand); }
.tab-item .count{ margin-left:5px; color:var(--text-tertiary); font-weight:600; }

/* ---------------------------------------------------------
   Modal
   --------------------------------------------------------- */
.modal-backdrop{
  position:fixed; inset:0; background:rgba(15,17,21,.5); backdrop-filter:blur(2px);
  display:flex; align-items:center; justify-content:center; z-index:200;
  opacity:0; pointer-events:none; transition:opacity .18s var(--ease);
}
.modal-backdrop.open{ opacity:1; pointer-events:auto; }
.modal{
  background:var(--surface); border-radius:var(--radius-lg); width:100%; max-width:480px;
  box-shadow:var(--shadow-lg); transform:translateY(8px) scale(.98); opacity:0;
  transition:all .18s var(--ease); max-height:88vh; display:flex; flex-direction:column;
}
.modal-backdrop.open .modal{ transform:translateY(0) scale(1); opacity:1; }
.modal.modal-lg{ max-width:680px; }
.modal-header{
  display:flex; align-items:center; justify-content:space-between; padding:18px 22px;
  border-bottom:1px solid var(--border);
}
.modal-header h3{ font-size:16px; }
.modal-close{ width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; color:var(--text-tertiary); }
.modal-close:hover{ background:var(--surface-alt); }
.modal-body{ padding:22px; overflow-y:auto; }
.modal-footer{ padding:16px 22px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:8px; }
.modal-icon-wrap{ width:44px; height:44px; border-radius:12px; display:flex; align-items:center; justify-content:center; margin-bottom:14px; }
.modal-icon-wrap.danger{ background:var(--danger-bg); color:var(--danger); }
.modal-icon-wrap.warning{ background:var(--warning-bg); color:var(--warning); }
.modal-icon-wrap.success{ background:var(--success-bg); color:var(--success); }

/* ---------------------------------------------------------
   Toasts
   --------------------------------------------------------- */
.toast-stack{ position:fixed; top:20px; right:20px; z-index:300; display:flex; flex-direction:column; gap:10px; }
.toast{
  display:flex; align-items:flex-start; gap:10px; background:var(--surface);
  border:1px solid var(--border); box-shadow:var(--shadow-lg); border-radius:var(--radius-md);
  padding:13px 16px; min-width:300px; max-width:360px;
  transform:translateX(20px); opacity:0; transition:all .22s var(--ease);
}
.toast.show{ transform:translateX(0); opacity:1; }
.toast-icon{ width:20px; height:20px; flex-shrink:0; margin-top:1px; }
.toast.success .toast-icon{ color:var(--success); }
.toast.error .toast-icon{ color:var(--danger); }
.toast.warning .toast-icon{ color:var(--warning); }
.toast.info .toast-icon{ color:var(--brand); }
.toast-msg{ font-size:13px; font-weight:550; flex:1; }
.toast-close{ color:var(--text-tertiary); flex-shrink:0; }

/* ---------------------------------------------------------
   Empty / loading / error states
   --------------------------------------------------------- */
.state-block{ display:flex; flex-direction:column; align-items:center; justify-content:center; padding:64px 20px; text-align:center; }
.state-block .state-icon{ width:52px; height:52px; border-radius:14px; background:var(--surface-alt); display:flex; align-items:center; justify-content:center; color:var(--text-tertiary); margin-bottom:16px; }
.state-block h4{ font-size:14.5px; margin-bottom:4px; }
.state-block p{ color:var(--text-tertiary); font-size:13px; max-width:320px; }

.skeleton{ background:linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%); background-size:400% 100%; animation:skeleton-loading 1.4s ease infinite; border-radius:6px; }
@keyframes skeleton-loading{ 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }
.skeleton-text{ height:12px; margin-bottom:8px; }
.skeleton-row td{ padding:14px 22px; }

/* ---------------------------------------------------------
   Misc
   --------------------------------------------------------- */
.section-title{ font-size:18px; margin-bottom:2px; }
.section-sub{ color:var(--text-tertiary); font-size:13px; margin-bottom:20px; }
.page-head{ display:flex; align-items:flex-start; justify-content:space-between; margin-bottom:22px; gap:16px; flex-wrap:wrap; }
.divider{ height:1px; background:var(--border); margin:18px 0; }
.text-muted{ color:var(--text-tertiary); }
.progress-bar{ height:6px; background:var(--neutral-bg); border-radius:99px; overflow:hidden; }
.progress-bar-fill{ height:100%; background:var(--brand); border-radius:99px; }
.avatar-lg{ width:76px; height:76px; border-radius:20px; object-fit:cover; background:var(--neutral-bg); }
.timeline{ display:flex; flex-direction:column; }
.timeline-item{ display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--border); }
.timeline-item:last-child{ border-bottom:none; }
.timeline-dot{ width:32px; height:32px; border-radius:9px; background:var(--brand-light); color:var(--brand); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.timeline-dot svg{ width:15px; height:15px; }
.timeline-body b{ font-weight:650; font-size:13px; }
.timeline-body p{ color:var(--text-tertiary); font-size:12.5px; margin-top:2px; }

/* Login page */
.login-shell{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:20px; }
.login-card{ width:100%; max-width:400px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-xl); box-shadow:var(--shadow-lg); padding:36px 32px; }
.login-brand{ display:flex; flex-direction:column; align-items:center; gap:10px; margin-bottom:28px; }
.login-brand img{ width:44px; height:44px; border-radius:12px; }
.login-brand h1{ font-size:18px; }
.login-brand p{ color:var(--text-tertiary); font-size:13px; }
.login-error{ background:var(--danger-bg); color:var(--danger); border-radius:var(--radius-sm); padding:11px 14px; font-size:13px; font-weight:550; margin-bottom:16px; display:flex; align-items:center; gap:8px; }
.login-footer-note{ text-align:center; margin-top:20px; font-size:12px; color:var(--text-tertiary); }

/* Auth demo hint box */
.demo-hint{ background:var(--brand-light); color:var(--brand-dark); border-radius:var(--radius-sm); padding:10px 13px; font-size:12px; margin-top:18px; line-height:1.5; }
.demo-hint code{ background:rgba(255,255,255,.55); padding:1px 5px; border-radius:4px; }

/* Chart placeholder container */
.chart-legend{ display:flex; gap:16px; flex-wrap:wrap; font-size:12.5px; color:var(--text-secondary); margin-top:10px; }
.chart-legend .dot{ width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }
.chart-tabs{ display:flex; gap:6px; background:var(--surface-alt); border:1px solid var(--border); padding:3px; border-radius:9px; }
.chart-tabs button{ border:none; background:none; padding:6px 12px; border-radius:7px; font-size:12.5px; font-weight:600; color:var(--text-tertiary); }
.chart-tabs button.active{ background:var(--surface); color:var(--text-primary); box-shadow:var(--shadow-sm); }

.dropdown{ position:relative; }
.dropdown-menu{
  position:absolute; top:calc(100% + 8px); right:0; background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-md); box-shadow:var(--shadow-lg); min-width:200px; z-index:100;
  opacity:0; transform:translateY(-6px); pointer-events:none; transition:all .15s var(--ease); padding:6px;
}
.dropdown-menu.open{ opacity:1; transform:translateY(0); pointer-events:auto; }
.dropdown-menu a, .dropdown-menu button{
  display:flex; align-items:center; gap:9px; width:100%; text-align:left; padding:9px 10px;
  border-radius:8px; font-size:13px; color:var(--text-secondary); background:none; border:none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover{ background:var(--surface-alt); color:var(--text-primary); }
.dropdown-menu svg{ width:15px; height:15px; }
.dropdown-divider{ height:1px; background:var(--border); margin:5px 0; }

.permission-grid{ display:grid; grid-template-columns:1fr auto; row-gap:10px; align-items:center; }
.permission-grid .perm-name{ font-size:13px; font-weight:550; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 1180px){
  .kpi-grid{ grid-template-columns:repeat(2,1fr); }
  .grid-2{ grid-template-columns:1fr; }
  .grid-3{ grid-template-columns:1fr; }
}
@media (max-width: 900px){
  .sidebar{ transform:translateX(-100%); width:var(--sidebar-w); }
  .app-shell.mobile-open .sidebar{ transform:translateX(0); box-shadow:var(--shadow-lg); }
  .main-area{ margin-left:0 !important; }
  .topbar-menu-btn{ display:flex; }
  .topbar-search{ display:none; }
  .form-row{ grid-template-columns:1fr; }
}
@media (max-width: 620px){
  .kpi-grid{ grid-template-columns:1fr; }
  .page-body{ padding:16px; }
  .card-header{ padding:14px 16px; }
  .data-table thead th, .data-table tbody td{ padding:12px 14px; }
}
.mobile-scrim{ display:none; }
@media (max-width: 900px){
  .app-shell.mobile-open .mobile-scrim{ display:block; position:fixed; inset:0; background:rgba(15,17,21,.45); z-index:35; }
}
