.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg-card); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 100; transition: transform 0.3s ease;
  box-shadow: 2px 0 12px rgba(0,0,0,0.04);
}
.sidebar-brand {
  padding: 20px 16px 16px; display: flex; align-items: center; gap: 11px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-logo {
  width: 38px; height: 38px; background: var(--grad-primary); border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.sidebar-logo svg { width: 20px; height: 20px; color: #fff; }
.sidebar-title { font-family: var(--font-display); font-weight: 800; font-size: 15.5px; color: var(--text); letter-spacing: -0.02em; }
.sidebar-subtitle { font-size: 11px; color: var(--text-dim); font-weight: 500; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-section-label { font-size: 10.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; padding: 12px 10px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-muted); font-size: 13.5px; font-weight: 500; transition: all 0.15s;
  margin-bottom: 2px; text-decoration: none; cursor: pointer;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text); opacity: 1; }
.nav-item.active { background: var(--accent-lighter); color: var(--accent); font-weight: 600; }
.nav-item.active .nav-icon { background: var(--accent); box-shadow: 0 3px 8px rgba(16,185,129,0.3); }
.nav-item.active .nav-icon svg { color: #fff; }
.nav-icon {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; background: var(--bg-hover); flex-shrink: 0; transition: all 0.15s;
}
.nav-icon svg { width: 15px; height: 15px; color: var(--text-muted); transition: color 0.15s; }
.nav-item:hover .nav-icon { background: var(--border); }
.nav-item:hover .nav-icon svg { color: var(--text); }

.sidebar-user {
  padding: 12px 14px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-shrink: 0; cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--bg-hover); }
.user-avatar {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info { min-width: 0; flex: 1; }
.user-name { font-weight: 700; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.user-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.user-role-badge.admin { background: #fef3c7; color: #d97706; }
.user-role-badge.staff { background: var(--accent-lighter); color: var(--accent); }
.user-role-badge.user  { background: #ede9fe; color: #7c3aed; }

.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between; padding: 0 16px;
  z-index: 99; box-shadow: var(--shadow-sm);
}
.mobile-header-brand { display: flex; align-items: center; gap: 9px; }
.mobile-header-brand .logo-xs { width: 30px; height: 30px; background: var(--grad-primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.mobile-header-brand .logo-xs svg { width: 16px; height: 16px; color: #fff; }
.mobile-header-brand span { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--text); }

.main-content { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ── Dashboard hero bar ── */
.db-hero-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 22px 30px 18px; flex-wrap: wrap; flex-shrink: 0;
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 40%, #eff6ff 100%);
  border-bottom: 1.5px solid #d1fae5;
}
.db-hero-left {}
.db-hero-greeting {
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  color: #0f172a; margin: 0 0 3px; letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 8px;
}
.db-hero-sub { font-size: 13px; color: #64748b; }
.db-hero-right { display: flex; align-items: center; gap: 10px; }
.db-search { margin: 0 !important; }
.db-refresh-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1.5px solid #bbf7d0; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #10b981; transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.db-refresh-btn:hover { background: #ecfdf5; border-color: #10b981; transform: rotate(90deg); }
.db-refresh-btn svg { width: 15px; height: 15px; }

/* ── Legacy top-bar (other views) ── */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 30px 0; margin-bottom: 22px; gap: 16px;
}
.top-bar-left { flex: 1; }
.page-title { font-size: 24px; margin-bottom: 3px; letter-spacing: -0.025em; font-weight: 800; }
.page-sub { color: var(--text-muted); font-size: 13.5px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

/* ── Stat cards with coloured left accent ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px;
  padding: 20px 30px 0; margin-bottom: 0;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px 16px; transition: all 0.2s; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm); cursor: default;
  border-left: 4px solid var(--sc-color, var(--accent));
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--sc-bg, var(--accent-lighter));
  transform: translate(20px, -20px); opacity: 0.6;
  transition: transform 0.3s;
}
.stat-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card:hover::before { transform: translate(16px, -16px); }
.stat-icon-wrap {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--sc-bg, var(--accent-lighter));
  border: 1.5px solid var(--sc-border, var(--accent-light));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; flex-shrink: 0; position: relative;
}
.stat-icon-wrap svg { width: 20px; height: 20px; }
.stat-value {
  font-family: var(--font-display); font-size: 26px; font-weight: 800;
  letter-spacing: -0.03em; margin-bottom: 2px; color: var(--text);
  display: flex; align-items: baseline; gap: 4px;
}
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 600; margin-bottom: 2px; }
.stat-sub { font-size: 11.5px; color: var(--text-dim); }
.stat-sparkline { display: none; }

.top-search {
  position: relative; display: flex; align-items: center;
}
.top-search svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--text-dim); pointer-events: none; }
.top-search input {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-body); font-size: 13.5px;
  padding: 9px 14px 9px 36px; width: 240px; transition: all 0.2s; box-shadow: var(--shadow-sm);
}
.top-search input:focus { outline: none; border-color: var(--accent); width: 280px; background: #fff; box-shadow: 0 0 0 3px rgba(16,185,129,0.1); }

.notif-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm); background: var(--bg-card);
  border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; color: var(--text-muted); box-shadow: var(--shadow-sm);
  position: relative;
}
.notif-btn:hover { border-color: var(--border2); color: var(--text); background: var(--bg-hover); }
.notif-btn svg { width: 17px; height: 17px; }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 1.5px solid #fff; }

/* ── Dashboard section spacing ── */
.db-section { padding: 20px 30px; }

.charts-row { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin: 20px 30px 0; }

.chart-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.chart-title { font-size: 15px; font-weight: 700; font-family: var(--font-display); color: var(--text); }
.chart-select {
  background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius-xs);
  color: var(--text-muted); font-family: var(--font-body); font-size: 12.5px;
  padding: 5px 10px; cursor: pointer; outline: none;
}
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-center-num { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--text); line-height: 1; }
.donut-center-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.chart-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.legend-item { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.legend-left { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-name { color: var(--text-muted); font-weight: 500; }
.legend-count { font-weight: 700; color: var(--text); margin-right: 4px; }
.legend-pct { color: var(--text-dim); font-size: 11.5px; }

.bottom-row { display: grid; grid-template-columns: 1fr 360px; gap: 18px; margin: 20px 30px 30px; }
.section-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.section-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-card-title { font-size: 15px; font-weight: 700; font-family: var(--font-display); }
.section-card-link { font-size: 13px; color: var(--accent); font-weight: 600; display: flex; align-items: center; gap: 4px; transition: gap 0.2s; }
.section-card-link:hover { gap: 7px; opacity: 1; }
.section-card-link svg { width: 14px; height: 14px; }

.file-table { width: 100%; border-collapse: collapse; }
.file-table th { font-size: 11.5px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; padding: 0 12px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.file-table td { padding: 11px 12px; font-size: 13.5px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: var(--bg-hover); }
.file-table-name { display: flex; align-items: center; gap: 10px; }
.file-table-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-table-icon svg { width: 16px; height: 16px; }
.file-table-icon.xlsx, .file-table-icon.xls { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.file-table-icon.csv { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.file-table-icon.other { background: var(--bg-hover); }
.file-table-fname { font-weight: 600; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.file-table-size, .file-table-date { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.file-table-actions { text-align: right; }
.file-menu-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; padding: 5px 7px; border-radius: 6px; transition: all 0.14s; display: inline-flex; align-items: center; }
.file-menu-btn:hover { background: var(--bg-hover); color: var(--text); }
.file-menu-btn svg { width: 16px; height: 16px; }

.activity-list { display: flex; flex-direction: column; gap: 0; }
.activity-item { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.activity-icon svg { width: 16px; height: 16px; }
.activity-icon.upload { background: var(--accent-lighter); }
.activity-icon.upload svg { color: var(--accent); }
.activity-body { flex: 1; min-width: 0; }
.activity-action { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; }
.activity-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-time { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; margin-top: 2px; }

.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 14px; flex-wrap: wrap; }
.view-toggle { display: flex; gap: 2px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 3px; box-shadow: var(--shadow-sm); }
.view-btn { padding: 5px 8px; border: none; cursor: pointer; border-radius: 5px; background: transparent; color: var(--text-muted); transition: all 0.14s; display: flex; align-items: center; }
.view-btn.active { background: var(--accent); color: #fff; }
.view-btn svg { width: 14px; height: 14px; }

.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 22px; }
.files-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }

.file-card {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; cursor: pointer; transition: all 0.2s; display: flex; flex-direction: column;
  gap: 10px; box-shadow: var(--shadow-sm);
}
.file-card:hover { border-color: #6ee7b7; transform: translateY(-2px); box-shadow: 0 8px 28px rgba(16,185,129,0.12); }
.file-card-list {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; cursor: pointer; transition: all 0.18s; display: flex; align-items: center;
  gap: 12px; box-shadow: var(--shadow-sm);
}
.file-card-list:hover { border-color: #6ee7b7; box-shadow: 0 4px 16px rgba(16,185,129,0.1); }
.file-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.file-icon-wrap { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.file-icon-xlsx, .file-icon-xls { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.file-icon-csv { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.file-icon-other { background: var(--bg-hover); }
.file-menu { position: relative; }
.file-dropdown {
  position: absolute; right: 0; top: calc(100% + 4px); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius); min-width: 168px;
  box-shadow: var(--shadow-lg); z-index: 20; display: none; overflow: hidden;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-6px) scale(.97); } to { opacity:1; transform:none; } }
.file-dropdown.open { display: block; }
.dropdown-item { padding: 9px 14px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 9px; transition: background 0.12s; color: var(--text-muted); font-weight: 500; }
.dropdown-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.dropdown-item:hover { background: var(--bg-hover); color: var(--text); }
.dropdown-item.danger:hover { background: var(--danger-light); color: var(--danger); }

.file-name { font-weight: 700; font-size: 13.5px; word-break: break-all; line-height: 1.4; color: var(--text); }
.file-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.file-meta-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.file-meta-item svg { width: 11px; height: 11px; }
.file-sheets { display: flex; flex-wrap: wrap; gap: 5px; }
.sheet-tag { padding: 2px 9px; background: var(--accent-lighter); border-radius: 20px; font-size: 11px; color: var(--accent); font-weight: 600; border: 1px solid var(--accent-light); }
.file-uploader { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-dim); padding-top: 2px; }

.drop-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-lg); padding: 44px 24px;
  text-align: center; cursor: pointer; transition: all 0.2s; background: var(--bg-card);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-lighter); }
.drop-icon { width: 64px; height: 64px; border-radius: 18px; background: var(--accent-lighter); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; border: 1px solid var(--accent-light); }
.drop-icon svg { width: 30px; height: 30px; color: var(--accent); }
.drop-title { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.drop-sub { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; }
.drop-types { font-size: 12px; color: var(--text-dim); background: var(--bg-hover); display: inline-block; padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border); }
.upload-progress { padding: 8px 0; }
.progress-file-name { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.progress-bar-wrap { height: 7px; background: var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 9px; }
.progress-bar { height: 100%; background: var(--grad-primary); border-radius: 10px; width: 0; transition: width 0.3s ease; }
.progress-text { font-size: 12.5px; color: var(--text-muted); text-align: center; font-weight: 500; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 8px; }
.page-btn { padding: 7px 13px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); cursor: pointer; font-size: 13px; transition: all 0.14s; font-family: var(--font-body); box-shadow: var(--shadow-sm); }
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--accent-lighter); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; box-shadow: var(--shadow-accent); }
.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.empty-state { text-align: center; padding: 64px 24px; }
.empty-icon { width: 76px; height: 76px; border-radius: 20px; background: var(--accent-lighter); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; border: 1px solid var(--accent-light); }
.empty-icon svg { width: 34px; height: 34px; color: var(--accent); }
.empty-state h3 { font-size: 19px; margin-bottom: 8px; }
.empty-state p { color: var(--text-muted); margin-bottom: 22px; font-size: 14px; line-height: 1.6; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(17,24,39,0.3); z-index: 99; backdrop-filter: blur(2px); }

/* ─── Form Elements ─── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-hover); border-radius: 10px; border: 1px solid var(--border); }
.toggle-label { font-size: 13.5px; color: var(--text); font-weight: 500; }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--border2); border-radius: 24px; cursor: pointer; transition: 0.3s; }
.toggle-slider:before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(18px); }
.check-input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* ─── Staff Management ─── */
.staff-search-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.role-filter-group { display: flex; gap: 4px; background: var(--bg-hover); border-radius: 10px; padding: 3px; border: 1px solid var(--border); }
.role-filter-btn {
  padding: 6px 14px; border: none; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--text-muted); transition: all 0.15s; font-family: var(--font-body);
}
.role-filter-btn.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

.staff-table-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.staff-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.staff-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.staff-table thead tr { background: var(--bg-hover); }
.staff-table th {
  padding: 11px 14px; font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.staff-table td { padding: 12px 14px; font-size: 13.5px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.staff-table tr:last-child td { border-bottom: none; }
.staff-table tr:hover td { background: var(--bg-hover); }

.staff-user-cell { display: flex; align-items: center; gap: 11px; }
.staff-avatar {
  width: 36px; height: 36px; border-radius: 10px; background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 12px; flex-shrink: 0; overflow: hidden;
}
.staff-avatar img { width: 100%; height: 100%; object-fit: cover; }
.staff-name { font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 1px; }
.staff-email { font-size: 12px; color: var(--text-muted); }
.staff-date { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }

.self-badge { font-size: 10px; background: var(--accent-lighter); color: var(--accent); padding: 1px 7px; border-radius: 20px; font-weight: 600; vertical-align: middle; }

.role-badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
}
.role-badge.admin { background: #fef3c7; color: #d97706; }
.role-badge.staff { background: var(--accent-lighter); color: var(--accent); }
.role-badge.user  { background: #ede9fe; color: #7c3aed; }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-badge.active { background: #ecfdf5; color: #059669; }
.status-badge.active::before { background: #10b981; }
.status-badge.inactive { background: #fff7ed; color: #d97706; }
.status-badge.inactive::before { background: #f59e0b; }

.staff-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.btn-icon-sm {
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg-card); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.14s;
}
.btn-icon-sm svg { width: 13px; height: 13px; }
.btn-icon-sm:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lighter); }
.btn-icon-sm.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }
.btn-icon-sm.warn:hover { border-color: #f59e0b; color: #d97706; background: #fef3c7; }
.btn-icon-sm.success:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-lighter); }

.staff-table-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-hover);
}
.staff-count { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

/* ─── Permissions ─── */
.perm-role-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--bg-hover); border-radius: 10px; padding: 3px; border: 1px solid var(--border); width: fit-content; }
.perm-role-tab { padding: 8px 18px; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; background: transparent; color: var(--text-muted); transition: all 0.15s; font-family: var(--font-body); }
.perm-role-tab.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); }

.perm-info-banner {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; background: #eff6ff;
  border: 1px solid #bfdbfe; border-radius: 10px; margin-bottom: 18px;
  font-size: 13.5px; color: #1d4ed8; line-height: 1.5;
}

.perm-table-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.perm-table { width: 100%; border-collapse: collapse; }
.perm-table th {
  padding: 11px 16px; font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border);
  text-align: left; background: var(--bg-hover);
}
.perm-table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.perm-table tr:last-child td { border-bottom: none; }
.perm-table tr:hover td { background: var(--bg-hover); }
.perm-col-name { font-weight: 700; font-size: 13.5px; color: var(--text); margin-bottom: 2px; }
.perm-col-key { font-size: 11.5px; color: var(--text-dim); font-family: monospace; }

.col-type-badge { font-size: 11.5px; padding: 2px 9px; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 20px; color: var(--text-muted); font-weight: 600; }
.encrypted-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #7c3aed; background: #ede9fe; padding: 2px 9px; border-radius: 20px; font-weight: 600; }

.perm-options { display: flex; gap: 6px; flex-wrap: wrap; }
.perm-option {
  padding: 5px 13px; border-radius: 8px; border: 1.5px solid var(--border); font-size: 12.5px;
  font-weight: 600; cursor: pointer; transition: all 0.14s; color: var(--text-muted);
  background: var(--bg-hover); user-select: none;
}
.perm-option:hover { border-color: var(--perm-color, var(--accent)); color: var(--perm-color, var(--accent)); }
.perm-option.selected {
  border-color: var(--perm-color, var(--accent));
  background: color-mix(in srgb, var(--perm-color, var(--accent)) 12%, transparent);
  color: var(--perm-color, var(--accent));
}

/* ─── Responsive ─── */
@media (max-width: 1400px) { .bottom-row { grid-template-columns: 1fr; } }
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .charts-row { grid-template-columns: 1fr; margin: 16px 20px 0; }
  .bottom-row { margin: 16px 20px 24px; }
}
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); padding: 16px 20px 0; }
  .charts-row { margin: 16px 20px 0; }
  .bottom-row { grid-template-columns: 1fr; margin: 16px 20px 24px; }
  .top-search input { width: 180px; }
  .top-search input:focus { width: 220px; }
  .db-hero-bar { padding: 16px 20px 14px; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .mobile-header { display: flex; }
  .main-content { margin-left: 0; }
  .db-hero-bar { padding: 72px 14px 14px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 12px 14px 0; }
  .charts-row { margin: 12px 14px 0; }
  .bottom-row { margin: 12px 14px 20px; }
  .stat-value { font-size: 22px; }
  .top-bar { padding: 14px 14px 0; flex-direction: column; align-items: flex-start; gap: 12px; }
  .top-bar-right { width: 100%; }
  .top-search { flex: 1; }
  .top-search input { width: 100%; }
  .top-search input:focus { width: 100%; }
  .files-grid { grid-template-columns: 1fr; }
  .perm-role-tabs { width: 100%; }
  .staff-search-bar { flex-direction: column; align-items: stretch; }
  .role-filter-group { justify-content: center; }
}
@media (max-width: 600px) {
  .stat-card { padding: 14px 16px; }
  .stat-icon-wrap { width: 38px; height: 38px; border-radius: 10px; margin-bottom: 8px; }
  .stat-value { font-size: 20px; }
  .perm-options { flex-direction: column; }
}
@media (min-width: 769px) and (max-width: 1023px) {
  .main-content { margin-left: var(--sidebar-w); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .charts-row { grid-template-columns: 1fr; }
  .bottom-row { grid-template-columns: 1fr; }
}
.stat-sparkline { display: none; }