*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f3;
  --surface:   #ffffff;
  --border:    rgba(0,0,0,0.09);
  --border-md: rgba(0,0,0,0.16);
  --text:      #1a1a1a;
  --text-2:    #555;
  --text-3:    #999;
  --blue:      #185FA5;
  --blue-lt:   #E6F1FB;
  --blue-mid:  #378ADD;
  --rad:       10px;
  --rad-sm:    6px;
  --shadow:    0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}

body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ══ LOGIN ══════════════════════════════════════════════════════════ */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #edf3fb 0%, #e8eff7 100%); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 36px 32px; width: 420px; box-shadow: 0 4px 24px rgba(0,0,0,0.09); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.brand-logo { width: 44px; height: 44px; background: var(--blue-lt); border-radius: var(--rad); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.login-company { font-size: 11px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.8px; }
.login-title { font-size: 16px; font-weight: 600; color: var(--text); margin-top: 2px; }
.login-hint { font-size: 12px; color: var(--text-3); text-align: center; margin-top: 10px; }

/* OTP boxes */
.otp-info { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.5; background: var(--blue-lt); border-radius: var(--rad-sm); padding: 10px 14px; }
.otp-boxes-wrap { display: flex; justify-content: center; margin-bottom: 12px; }
.otp-inputs { display: flex; gap: 8px; }
.otp-box { width: 46px; height: 54px; text-align: center; font-size: 24px; font-weight: 700; border: 2px solid var(--border-md); border-radius: var(--rad-sm); background: var(--surface); color: var(--text); font-family: 'Courier New', monospace; transition: border-color 0.12s; }
.otp-box:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(24,95,165,0.15); }
.otp-box.filled { border-color: var(--blue); }
.otp-timer { font-size: 12px; color: var(--text-3); text-align: center; margin-bottom: 16px; }
.otp-timer.expiring { color: #c0392b; }

/* ══ LAYOUT ═════════════════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; min-height: 100vh; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 20px; height: 52px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 100; }
.logo { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.logo-sep { color: #ddd; }
.logo-sub { font-weight: 400; color: var(--text-2); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 9px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.chip-name  { font-size: 13px; font-weight: 600; }
.chip-email { font-size: 11px; color: var(--text-3); }

/* avatar colors */
.av-blue   { background: #E6F1FB; color: #185FA5; }
.av-teal   { background: #E1F5EE; color: #0F6E56; }
.av-coral  { background: #FAECE7; color: #993C1D; }
.av-amber  { background: #FAEEDA; color: #854F0B; }
.av-purple { background: #EEEDFE; color: #534AB7; }
.av-green  { background: #EAF3DE; color: #3B6D11; }

.layout { display: flex; flex: 1; }
.sidebar { width: 188px; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 0; flex-shrink: 0; position: sticky; top: 52px; height: calc(100vh - 52px); overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 16px; font-size: 13px; color: var(--text-2); cursor: pointer; border-left: 2px solid transparent; transition: all 0.12s; }
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { color: var(--blue); background: var(--blue-lt); border-left-color: var(--blue); font-weight: 600; }
.nav-divider { height: 1px; background: var(--border); margin: 6px 12px; }

.content { flex: 1; padding: 24px; overflow-y: auto; max-width: 1100px; }
.page { display: none; }
.page.active { display: block; }
.page-header { margin-bottom: 20px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 13px; color: var(--text-3); margin-top: 3px; }

/* ══ CARDS ══════════════════════════════════════════════════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-title { font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ══ METRICS ════════════════════════════════════════════════════════ */
.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--rad); padding: 14px 16px; box-shadow: var(--shadow); }
.metric-label { font-size: 11px; color: var(--text-3); font-weight: 500; margin-bottom: 4px; }
.metric-val { font-size: 26px; font-weight: 700; line-height: 1; }
.metric-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ══ FORMS ══════════════════════════════════════════════════════════ */
.form-row { display: grid; gap: 12px; margin-bottom: 14px; }
.form-row.two { grid-template-columns: 1fr 1fr; }
.form-row.one { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { font-size: 13px; padding: 8px 10px; border: 1px solid var(--border-md); border-radius: var(--rad-sm); background: var(--surface); color: var(--text); font-family: inherit; transition: border-color 0.12s, box-shadow 0.12s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(55,138,221,0.12); }
.field textarea { resize: vertical; min-height: 80px; }
.field.sm input, .field.sm select { font-size: 12px; padding: 7px 9px; }

.email-field-wrap { display: flex; align-items: center; border: 1px solid var(--border-md); border-radius: var(--rad-sm); overflow: hidden; background: var(--surface); }
.email-field-wrap:focus-within { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(55,138,221,0.12); }
.email-prefix-input { border: none !important; box-shadow: none !important; border-radius: 0 !important; flex: 1; min-width: 0; }
.email-domain { font-size: 12px; color: var(--text-3); padding: 0 10px; white-space: nowrap; background: var(--bg); border-left: 1px solid var(--border); height: 100%; display: flex; align-items: center; }

.hours-preview { background: var(--blue-lt); color: var(--blue); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: var(--rad-sm); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

/* ══ BUTTONS ════════════════════════════════════════════════════════ */
.btn { padding: 8px 16px; border-radius: var(--rad-sm); font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid var(--border-md); background: var(--surface); color: var(--text); font-family: inherit; transition: all 0.12s; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: #0C447C; }
.btn.danger { background: #FEF0F0; color: #c0392b; border-color: #f5c6c6; }
.btn.danger:hover { background: #f5c6c6; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }

/* ══ ALERTS ═════════════════════════════════════════════════════════ */
.alert { padding: 10px 14px; border-radius: var(--rad-sm); font-size: 13px; margin-bottom: 14px; }
.alert.success { background: #EAF3DE; color: #2d6a1f; border: 1px solid #C0DD97; }
.alert.error   { background: #FEF0F0; color: #c0392b; border: 1px solid #f5c6c6; }

/* ══ FILTER BAR ═════════════════════════════════════════════════════ */
.filter-bar { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ══ TABLES ═════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { font-size: 11px; font-weight: 600; color: var(--text-3); text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--bg); text-transform: uppercase; letter-spacing: 0.3px; }
.data-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafafa; }
.table-footer { font-size: 12px; color: var(--text-3); text-align: right; margin-top: 8px; font-weight: 500; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 13px; }

/* ══ BADGES ═════════════════════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge.weekend { background: #E1F5EE; color: #0F6E56; }
.badge.holiday { background: #EEEDFE; color: #534AB7; }
.badge.admin   { background: #E6F1FB; color: #185FA5; }
.hours-tag { display: inline-block; background: var(--blue-lt); color: var(--blue); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; }

/* ══ TABS ═══════════════════════════════════════════════════════════ */
.tab-bar { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab { padding: 9px 18px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--text-3); background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.12s; font-family: inherit; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ══ REPORTS ════════════════════════════════════════════════════════ */
.report-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 16px; }

/* ══ USER LIST ══════════════════════════════════════════════════════ */
.users-list-header { padding: 12px 18px; font-size: 13px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.count-badge { background: var(--bg); border: 1px solid var(--border); border-radius: 99px; font-size: 11px; font-weight: 600; padding: 1px 8px; color: var(--text-2); }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: #fafafa; }
.user-info { flex: 1; }
.uname { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.uemail { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.urole  { font-size: 11px; color: var(--text-2); margin-top: 1px; }
.user-actions { display: flex; gap: 6px; }

@media (max-width: 768px) {
  .metrics { grid-template-columns: repeat(2,1fr); }
  .form-row.two { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 16px; }
  .login-card { width: 95vw; padding: 28px 20px; }
}
