/* Admin panel — sidebar layout, dashboard cards, tables, report form */

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

/* Sidebar */
.sidebar {
  width: 250px; flex-shrink: 0; background: var(--ink-900); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-brand { padding: 22px 22px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-brand .brand-mark { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--ink-900); }
.sidebar-brand b { font-family: var(--font-display); font-size: 15px; }
.sidebar-brand small { display:block; font-size: 11px; color: rgba(255,255,255,.45); }
.sidebar-nav { padding: 16px 12px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; margin-bottom: 3px;
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.65); transition: all .15s var(--ease);
}
.sidebar-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav a.active { background: rgba(201,162,39,.16); color: var(--gold-400); }
.sidebar-nav .nav-label { padding: 16px 14px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.3); }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-600); display:flex;align-items:center;justify-content:center; font-weight:700; font-size:13px; }
.sidebar-user b { font-size: 13px; display:block; }
.sidebar-user span { font-size: 11px; color: rgba(255,255,255,.4); }

/* Main area */
.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(245,247,251,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 { font-size: 19px; margin: 0; }
.topbar-sub { font-size: 12.5px; color: var(--text-400); margin-top: 2px; }
.page { padding: 26px 28px 60px; }
.menu-toggle { display: none; background: none; border: none; padding: 6px; }

/* Dashboard cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 26px; }
.stat-card { padding: 20px 20px 18px; }
.stat-card .stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-icon.gold { background: var(--gold-100); color: #8a6c14; }
.stat-icon.teal { background: rgba(14,156,148,.12); color: var(--teal-500); }
.stat-icon.blue { background: rgba(37,99,235,.1); color: var(--info); }
.stat-icon.green { background: rgba(23,163,74,.1); color: var(--success); }
.stat-value { font-family: var(--font-mono); font-size: 25px; font-weight: 700; color: var(--ink-900); }
.stat-label { font-size: 12.5px; color: var(--text-400); margin-top: 2px; }
.stat-delta { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.stat-delta.up { background: rgba(23,163,74,.1); color: var(--success); }
.stat-delta.down { background: rgba(220,42,42,.08); color: var(--danger); }

.charts-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; margin-bottom: 26px; }
.chart-card { padding: 22px; }
.chart-card h3 { font-size: 15px; margin-bottom: 4px; }
.chart-card .chart-sub { font-size: 12.5px; color: var(--text-400); margin-bottom: 16px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data-table th {
  text-align: left; padding: 11px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-400); border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
table.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text-900); white-space: nowrap; }
table.data-table tr:hover td { background: var(--surface-alt); }
table.data-table tr:last-child td { border-bottom: none; }

/* Report Form */
.form-section { margin-bottom: 22px; }
.form-section-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.form-section-num {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink-900); color: var(--gold-400);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.form-section-head h3 { font-size: 15.5px; margin: 0; }
.form-section-body { padding: 20px 22px 22px; }
.form-row { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }

.employee-card { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 14px; overflow: hidden; }
.employee-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--surface-alt); cursor: pointer; user-select: none; }
.employee-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink-900); color: var(--gold-400); display:flex;align-items:center;justify-content:center; font-weight:700; font-size:13px; flex-shrink:0; }
.employee-head b { font-size: 14px; display: block; }
.employee-head span { font-size: 12px; color: var(--text-400); }
.employee-body { padding: 18px; display: none; }
.employee-body.open { display: block; }
.chev { margin-left: auto; transition: transform .2s var(--ease); color: var(--text-400); }
.chev.open { transform: rotate(180deg); }

.calc-box { background: var(--gold-100); border: 1px dashed var(--gold-500); border-radius: var(--radius-sm); padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.calc-box b { font-family: var(--font-mono); font-size: 17px; color: #8a6c14; }

.sticky-submit { position: sticky; bottom: 0; background: rgba(245,247,251,.92); backdrop-filter: blur(8px); padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px; display:flex; justify-content:flex-end; gap:12px; }

/* Login page */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--ink-900); padding: 20px; position: relative; overflow: hidden; }
.auth-wrap::before { content:''; position:absolute; inset:0; background: radial-gradient(circle at 15% 20%, rgba(201,162,39,.15), transparent 45%), radial-gradient(circle at 85% 80%, rgba(14,156,148,.12), transparent 45%); }
.auth-card { background: #fff; border-radius: 20px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: var(--shadow-lg); position: relative; }
.auth-logo { display:flex; justify-content:center; margin-bottom: 18px; }
.auth-card h2 { text-align: center; font-size: 21px; }
.auth-card p.sub { text-align: center; font-size: 13.5px; margin-bottom: 26px; }

/* Success page */
.success-wrap { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding: 20px; background: var(--bg); }
.success-card { max-width: 480px; width: 100%; text-align: center; padding: 44px 36px; }
.success-check { width: 76px; height: 76px; border-radius: 50%; background: rgba(23,163,74,.1); color: var(--success); display:flex; align-items:center; justify-content:center; margin: 0 auto 22px; }
.wa-btn { background: #25D366; color: #fff; }
.wa-btn:hover { background: #1fbf5c; }

/* Badges for checklist review */
.check-pill { display:inline-flex; align-items:center; gap:6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight:600; margin: 3px 6px 3px 0; }
.check-pill.ok { background: rgba(23,163,74,.1); color: var(--success); }
.check-pill.miss { background: rgba(220,42,42,.08); color: var(--danger); }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: -260px; transition: left .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-flex; }
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; }
  .page { padding: 18px 16px 50px; }
  .topbar { padding: 14px 16px; }
}
@media (max-width: 560px) {
  .stats-grid { grid-template-columns: 1fr; }
}
