/* ── FILE: public/assets/style.css ──
   CallerPro — Complete Dark Design System
   ══════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   1. DESIGN TOKENS
   ───────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg: #0d0d0d;
  --bg2: #111111;
  --card: #1a1a1a;
  --card2: #222222;
  --border: #2a2a2a;
  --border2: #333333;

  /* Text */
  --text: #e2e8f0;
  --muted: #9ca3af;
  --hint: #6b7280;

  /* Semantic colors */
  --purple: #7c3aed;
  --purple-dim: #7c3aed22;
  --purple-light: #a78bfa;

  --green: #10b981;
  --green-dim: #10b98122;

  --amber: #f59e0b;
  --amber-dim: #f59e0b22;

  --red: #ef4444;
  --red-dim: #ef444422;

  --blue: #3b82f6;
  --blue-dim: #3b82f622;

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h: 52px;
  --radius: 10px;
  --radius-sm: 6px;

  /* Chart series (validated against --card #1a1a1a via the dataviz skill's
     palette checker — deeper steps of the UI's blue/amber/green/red so they
     clear the dark-surface lightness band; UI tokens above are unaffected). */
  --chart-1: #3b82f6;
  --chart-2: #b45309;
  --chart-3: #059669;
  --chart-4: #ef4444;
  --chart-grid: #2c2c2a;
  --chart-axis: #383835;
  --chart-tooltip-bg: #222222;

  /* Status palette (fixed — not themed; used for state, never as a series color) */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
}

/* ─────────────────────────────────────────────────────────
   2. RESET & BASE
   ───────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--purple-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ─────────────────────────────────────────────────────────
   3. TYPOGRAPHY
   ───────────────────────────────────────────────────────── */
h1 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

p {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.sm {
  font-size: 13px;
  color: var(--muted);
}

.xs {
  font-size: 12px;
  color: var(--muted);
}

.label {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.text-muted {
  color: var(--muted);
}

.text-hint {
  color: var(--hint);
}

.text-purple {
  color: var(--purple-light);
}

.text-green {
  color: var(--green);
}

.text-amber {
  color: var(--amber);
}

.text-red {
  color: var(--red);
}

.text-blue {
  color: var(--blue);
}

/* ─────────────────────────────────────────────────────────
   4. SKIP LINK (Accessibility)
   ───────────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--purple);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  border-radius: 0 0 var(--radius-sm) 0;
  font-size: 13px;
  transition: top .2s;
}

.skip-link:focus {
  top: 0;
}

/* ─────────────────────────────────────────────────────────
   5. LAYOUT SHELL
   ───────────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  transition: width .2s ease, transform .25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar.collapsed {
  width: 64px;
}

.sidebar-logo {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sidebar-logo .brand {
  font-size: 15px;
  font-weight: 600;
  color: var(--purple-light);
  letter-spacing: -.01em;
}

.sidebar-logo .tagline {
  font-size: 11px;
  color: var(--hint);
  margin-top: 1px;
}

.sidebar-agent {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
}

.agent-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--purple-dim);
  border: 1px solid var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-light);
  flex-shrink: 0;
  text-transform: uppercase;
}

.agent-info {
  flex: 1;
  min-width: 0;
}

.agent-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-status {
  font-size: 11px;
  color: var(--hint);
  display: flex;
  align-items: center;
  gap: 4px;
}

.agent-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.agent-status .dot.offline {
  background: var(--hint);
}

.agent-status.online {
  color: var(--green);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.nav-group-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 12px 16px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  padding: 9px 16px;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: background .15s, color .15s;
  position: relative;
}

.nav-item svg {
  opacity: .7;
  flex-shrink: 0;
}

.nav-item:hover {
  color: var(--text);
  background: #ffffff08;
  text-decoration: none;
}

.nav-item.active {
  color: var(--purple-light);
  background: var(--purple-dim);
  border-left-color: var(--purple);
}

.nav-item.active svg {
  opacity: 1;
}

.nav-item.danger {
  color: var(--red);
}

.nav-item.danger:hover {
  background: var(--red-dim);
  color: var(--red);
}

.nav-badge {
  margin-left: auto;
  border-radius: 10px;
}

.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .agent-info,
.sidebar.collapsed .tagline,
.sidebar.collapsed .brand,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .label,
.sidebar.collapsed .shift-timer,
.sidebar.collapsed .nav-item span:not(.nav-badge) {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 12px;
}

.sidebar.collapsed .sidebar-logo,
.sidebar.collapsed .sidebar-agent {
  justify-content: center;
  padding: 12px 0;
}

.sidebar.collapsed .sidebar-footer {
  text-align: center;
  padding: 12px 0;
}

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

/* Sidebar footer — clock in/out */
.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  min-height: 72px;
}

.clock-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: opacity .15s, transform .1s;
  cursor: pointer;
}

.clock-btn:hover {
  opacity: .85;
}

.clock-btn:active {
  transform: scale(.98);
}

.clock-btn.clocked-in {
  background: var(--red-dim);
  border: 1px solid var(--red);
  color: var(--red);
}

.clock-btn.clocked-out {
  background: var(--green);
  color: #fff;
}

.shift-timer {
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--hint);
  margin-top: 6px;
}

.shift-timer.not-clocked {
  color: var(--red);
}

.shift-timer.warning {
  color: var(--amber);
}

/* Main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  /* Prevents flex items from overflowing */
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--hint);
}

.breadcrumb .sep {
  margin: 0 6px;
}

.breadcrumb .current {
  color: var(--text);
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.clock-pill {
  background: var(--purple-dim);
  border: 1px solid #7c3aed22;
  color: var(--purple-light);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  padding: 4px 12px;
  border-radius: 20px;
}

.lan-pill {
  background: var(--blue-dim);
  border: 1px solid #3b82f633;
  color: var(--blue);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.notif-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.notif-btn:hover {
  background: var(--card2);
  color: var(--text);
}

.notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  border-radius: 10px;
  padding: 0 4px;
  min-width: 14px;
  text-align: center;
  line-height: 14px;
}

.hamburger {
  display: flex;
  background: none;
  border: none;
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: background .15s;
}

.hamburger:hover {
  background: var(--card2);
}

/* Page content */
.page-content {
  padding: 24px;
  background: var(--bg);
  flex: 1;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--muted);
}

/* Stats strip (Public Home) */
.stats-strip {
  background: var(--card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}

.stat-item {
  background: var(--card);
  padding: 28px;
  text-align: center;
}

.stat-item-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--purple-light);
  font-variant-numeric: tabular-nums;
}

.stat-item-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .stat-item {
    padding: 20px;
  }
}

/* ─────────────────────────────────────────────────────────
   6. CARDS
   ───────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-link {
  font-size: 13px;
  color: var(--purple-light);
}

/* Stat card */
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-delta {
  font-size: 12px;
  margin-top: 4px;
}

.stat-delta.pos {
  color: var(--green);
}

.stat-delta.neg {
  color: var(--red);
}

/* Earnings strip */
.earnings-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.earn-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.earn-card-accent {
  height: 2px;
  width: 100%;
}

.earn-card-body {
  padding: 14px;
}

.earn-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.earn-value {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.earn-sub {
  font-size: 12px;
  color: var(--hint);
  margin-top: 4px;
}

.earn-progress {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.earn-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .5s ease;
}

/* ─────────────────────────────────────────────────────────
   7. STATUS PILLS / BADGES
   ───────────────────────────────────────────────────────── */
.pill {
  font-size: 10px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* Ticket status */
.pill-open {
  background: var(--blue-dim);
  color: var(--blue);
}

.pill-in_progress {
  background: var(--amber-dim);
  color: var(--amber);
}

.pill-resolved {
  background: var(--green-dim);
  color: var(--green);
}

.pill-closed {
  background: #ffffff0a;
  color: var(--hint);
}

/* Priority */
.pill-low {
  background: var(--green-dim);
  color: var(--green);
}

.pill-medium {
  background: var(--amber-dim);
  color: var(--amber);
}

.pill-high {
  background: var(--red-dim);
  color: var(--red);
}

/* Attendance */
.pill-ontime {
  background: var(--green-dim);
  color: var(--green);
}

.pill-late {
  background: var(--red-dim);
  color: var(--red);
}

.pill-absent {
  background: var(--red-dim);
  color: var(--red);
  font-weight: 600;
}

.pill-half-day {
  background: var(--amber-dim);
  color: var(--amber);
}

/* Leave status */
.pill-pending {
  background: var(--amber-dim);
  color: var(--amber);
}

.pill-approved {
  background: var(--green-dim);
  color: var(--green);
}

.pill-rejected {
  background: var(--red-dim);
  color: var(--red);
}

/* Ticket reference badge */
.ref-badge {
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--purple-dim);
  color: var(--purple-light);
  border: 1px solid #7c3aed33;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────────────────────
   8. TABLES
   ───────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

thead {
  background: var(--bg2);
  border-bottom: 1px solid var(--border2);
}

th {
  font-size: 11px;
  font-weight: 500;
  color: var(--hint);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

th .sort-icon {
  margin-left: 4px;
  color: var(--hint);
  font-size: 9px;
}

th.sorted .sort-icon {
  color: var(--purple-light);
}

td {
  font-size: 13px;
  color: var(--text);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #ffffff05;
}

.table-search-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* ─────────────────────────────────────────────────────────
   9. FORMS & INPUTS
   ───────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}

.required {
  color: var(--red);
  margin-left: 2px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #444;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 2px var(--purple-dim);
}

input.error,
select.error,
textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 2px var(--red-dim);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

.field-error {
  font-size: 12px;
  color: var(--red);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.error-summary {
  background: var(--red-dim);
  border: 1px solid #ef444433;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.error-summary p {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 8px;
}

.error-summary ul {
  padding-left: 20px;
}

.error-summary li {
  font-size: 13px;
  color: var(--text);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  opacity: .85;
  text-decoration: none;
}

.btn:active {
  transform: scale(.98);
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.25);
  transition: all .2s ease;
}

.btn-primary:hover {
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
  opacity: .95;
}

.btn-success {
  background: var(--green);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all .2s ease;
}

.btn-success:hover {
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  opacity: .95;
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transition: all .2s ease;
}

.btn-danger:hover {
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4);
  opacity: .95;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border2);
  color: var(--muted);
  transition: all .2s ease;
}

.btn-ghost:hover {
  background: var(--card2);
  color: var(--text);
  border-color: #555;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-xs {
  padding: 4px 10px;
  font-size: 12px;
}

/* ─────────────────────────────────────────────────────────
   10. TOAST NOTIFICATIONS
   ───────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  min-width: 240px;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(110%);
  transition: transform .2s ease;
  pointer-events: all;
  cursor: pointer;
}

.toast.show {
  transform: translateX(0);
}

.toast.dismiss {
  transform: translateX(110%);
}

.toast-success {
  border-left: 3px solid var(--green);
}

.toast-error {
  border-left: 3px solid var(--red);
}

.toast-warning {
  border-left: 3px solid var(--amber);
}

.toast-info {
  border-left: 3px solid var(--blue);
}

.toast-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.toast-success .toast-icon {
  color: var(--green);
}

.toast-error .toast-icon {
  color: var(--red);
}

.toast-warning .toast-icon {
  color: var(--amber);
}

.toast-info .toast-icon {
  color: var(--blue);
}

.toast-msg {
  font-size: 13px;
  color: var(--text);
}

/* ─────────────────────────────────────────────────────────
   11. EMPTY STATES
   ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.empty-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--hint);
}

.empty-heading {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 4px;
}

.empty-sub {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 16px;
}

/* ─────────────────────────────────────────────────────────
   12. PAGINATION
   ───────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  justify-content: center;
}

.page-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.page-btn:hover {
  background: var(--card2);
  color: var(--text);
}

.page-btn.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

/* ─────────────────────────────────────────────────────────
   14. CHARTS
   ───────────────────────────────────────────────────────── */
.mt-24 {
  margin-top: 24px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.chart-canvas-wrap {
  position: relative;
  height: 220px;
}

.chart-empty {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hint);
  font-size: 13px;
}

/* Attendance status strip — a plain HTML/CSS component, not a chart:
   one cell per day, color communicates state, never color alone (title = state). */
.attendance-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 4px;
}

.attendance-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--hint);
  cursor: default;
}

.attendance-cell[data-status="present"] {
  background: color-mix(in srgb, var(--status-good) 22%, var(--card));
  border-color: var(--status-good);
  color: var(--text);
}

.attendance-cell[data-status="late"] {
  background: color-mix(in srgb, var(--status-warning) 22%, var(--card));
  border-color: var(--status-warning);
  color: var(--text);
}

.attendance-cell[data-status="absent"] {
  background: color-mix(in srgb, var(--status-critical) 22%, var(--card));
  border-color: var(--status-critical);
  color: var(--text);
}

.attendance-cell[data-status="off"] {
  border-style: dashed;
}

.attendance-cell[data-status="future"] {
  opacity: 0.35;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.page-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────
   13. UTILITY
   ───────────────────────────────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

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

.form-inline-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr) auto;
  gap: 12px;
  align-items: flex-end;
}

@media (max-width: 992px) {
  .form-inline-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .form-inline-grid {
    grid-template-columns: 1fr;
  }
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-16 {
  margin-bottom: 16px;
}

.mb-24 {
  margin-bottom: 24px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.w-full {
  width: 100%;
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* Flash alert (non-JS fallback) */
.flash-alert {
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

/* Divider */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* Mobile FAB */
.fab-clock {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  z-index: 200;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px #0007;
  transition: transform .2s;
}

.fab-clock:active {
  transform: scale(.95);
}

.fab-clock.clocked-out {
  background: var(--green);
  color: #fff;
}

.fab-clock.clocked-in {
  background: var(--red-dim);
  border: 2px solid var(--red);
  color: var(--red);
}

/* ─────────────────────────────────────────────────────────
   14. PUBLIC WEBSITE
   ───────────────────────────────────────────────────────── */
.pub-nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.pub-brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--purple-light);
}

.pub-brand span {
  color: var(--text);
}

.pub-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.pub-nav-links a {
  font-size: 14px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}

.pub-nav-links a:hover {
  color: var(--text);
  background: var(--card2);
  text-decoration: none;
}

.pub-nav-links .cta {
  background: var(--purple);
  color: #fff;
  margin-left: 8px;
}

.pub-nav-links .cta:hover {
  opacity: .85;
}

.pub-footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 40px;
}

.pub-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto 32px;
}

.pub-footer .brand-col .brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--purple-light);
}

.pub-footer .brand-col p {
  font-size: 13px;
  color: var(--hint);
  margin-top: 8px;
  line-height: 1.6;
}

.pub-footer h4 {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 12px;
}

.pub-footer ul {
  list-style: none;
}

.pub-footer li {
  margin-bottom: 8px;
}

.pub-footer li a {
  font-size: 13px;
  color: var(--hint);
}

.pub-footer li a:hover {
  color: var(--text);
  text-decoration: none;
}

.pub-footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pub-footer-bottom p {
  font-size: 12px;
  color: var(--hint);
}

.compliance-note {
  font-size: 12px;
  color: var(--hint);
}

/* Hero */
.hero {
  padding: 80px 40px;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--purple-dim);
  border: 1px solid #7c3aed33;
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: 52px;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero h1 .accent {
  color: var(--purple-light);
}

.hero p {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Section */
.pub-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 64px 40px;
}

.section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--purple-light);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 16px;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, transform .2s;
}

.feature-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--purple-dim);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-light);
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

/* Pricing cards */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.pricing-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--purple);
  background: linear-gradient(135deg, #1a1a1a, #1a1230);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  letter-spacing: .06em;
}

.pricing-tier {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.pricing-price span {
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.pricing-desc {
  font-size: 13px;
  color: var(--hint);
  margin-bottom: 24px;
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
}

.pricing-features li {
  font-size: 13px;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
}

/* FAQ accordion */
.faq-list {
  margin-top: 48px;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  padding: 20px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-q:hover {
  color: var(--purple-light);
}

.faq-q .arrow {
  transition: transform .2s;
  color: var(--hint);
  flex-shrink: 0;
}

.faq-item.open .faq-q .arrow {
  transform: rotate(180deg);
}

.faq-a {
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 20px;
  line-height: 1.7;
  display: none;
}

.faq-item.open .faq-a {
  display: block;
}

/* ─────────────────────────────────────────────────────────
   15. REVIEWS / SUCCESS STORIES
   ───────────────────────────────────────────────────────── */
.reviews-section {
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.reviews-section::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: var(--purple-dim);
  filter: blur(80px);
  border-radius: 50%;
  opacity: 0.3;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.review-stars {
  color: var(--amber);
  display: flex;
  gap: 2px;
}

.review-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.review-author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.review-author-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.review-author-info p {
  font-size: 12px;
  color: var(--hint);
}

@media (max-width: 992px) {
  .review-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 576px) {
  .review-grid {
    grid-template-columns: 1fr;
  }
}

/* ─────────────────────────────────────────────────────────
   16. TICKET THREADS
   ───────────────────────────────────────────────────────── */
.thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.thread-msg {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.thread-msg.internal {
  border-color: var(--amber);
  background: var(--amber-dim);
}

.thread-msg.client {
  border-color: var(--border2);
}

.thread-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--hint);
}

.thread-author {
  font-weight: 500;
  color: var(--muted);
}

.thread-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ─────────────────────────────────────────────────────────
   16. RESPONSIVE
   ───────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .earnings-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .pub-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .sidebar.open {
    transform: none;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: #0008;
    z-index: 99;
  }

  .sidebar-overlay.show {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: none;
  }

  .main-content {
    margin-left: 0;
  }

  .hamburger {
    display: flex;
  }

  .breadcrumb .sep,
  .breadcrumb:not(:last-child) {
    display: none;
  }

  .fab-clock {
    display: flex;
  }

  .feature-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pub-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 576px) {
  .earnings-strip {
    grid-template-columns: 1fr 1fr;
  }

  .hero h1 {
    font-size: 32px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .pub-section {
    padding: 40px 20px;
  }

  .pub-nav {
    padding: 0 20px;
  }

  .hero {
    padding: 48px 20px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .pub-footer {
    padding: 32px 20px;
  }

  .pub-footer-grid {
    grid-template-columns: 1fr;
  }

  .pub-footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .page-content {
    padding: 16px;
  }
}

/* Focus ring for accessibility */
:focus-visible {
  outline: 2px solid #7c3aed66;
  outline-offset: 2px;
}

/* ─────────────────────────────────────────────────────────
   20. INCENTIVES, PAYOUT & SHARED UTILITIES (2026-09 update)
   ───────────────────────────────────────────────────────── */
.num { text-align: right; }
.text-purple-light { color: var(--purple-light); }
.accent-top-amber  { border-top: 2px solid var(--amber); }
.accent-top-green  { border-top: 2px solid var(--green); }
.accent-top-blue   { border-top: 2px solid var(--blue); }
.accent-top-purple { border-top: 2px solid var(--purple); }

.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.notice {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--muted);
}
.notice-warning { border-color: var(--amber); background: var(--amber-dim); color: var(--text); }
.notice-info    { border-color: var(--blue);  background: var(--blue-dim);  color: var(--text); }

.preview-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
  font-size: 13px;
}
.preview-row { display: flex; gap: 20px; flex-wrap: wrap; }

/* Earnings table total row */
.total-row { background: var(--bg2); font-size: 15px; }
.total-amount { font-size: 18px; }

/* Final vs live markers */
.final-dot, .live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.final-dot { background: var(--green); }
.live-dot  { background: transparent; border: 1px solid var(--amber); }

/* Payout summary table */
.payout-table th, .payout-table td { white-space: nowrap; }
.payout-table tfoot td {
  border-top: 2px solid var(--border2);
  background: var(--bg2);
  font-weight: 600;
}

/* Tier ladder (agent dashboard) */
.tier-ladder {
  position: relative;
  height: 64px;
  margin: 8px 24px 4px 8px;
}
.tier-ladder-track {
  position: absolute;
  left: 0; right: 0; top: 10px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.tier-ladder-fill {
  height: 100%;
  width: 0;
  background: var(--blue);
  border-radius: 3px;
  transition: width .6s ease;
}
.tier-step {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
}
.tier-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border2);
}
.tier-amount { color: var(--muted); font-variant-numeric: tabular-nums; }
.tier-bonus  { color: var(--hint); font-weight: 600; }
.tier-step.next .tier-dot    { border-color: var(--amber); }
.tier-step.next .tier-bonus  { color: var(--amber); }
.tier-step.reached .tier-dot { border-color: var(--green); background: var(--green); }
.tier-step.reached .tier-bonus,
.tier-step.reached .tier-amount { color: var(--green); }
.tier-ladder-caption { margin-top: 12px; }

/* Tier cards (agent incentives page) */
.tier-list { display: flex; flex-direction: column; gap: 10px; }
.tier-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.tier-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.tier-card-head .tier-target { color: var(--muted); }
.tier-card-head .tier-reward { font-weight: 600; color: var(--amber); }
.tier-card.is-reached { border-color: var(--green); }
.tier-card.is-reached .tier-target,
.tier-card.is-reached .tier-reward { color: var(--green); }
.tier-card.is-next { border-color: var(--amber); }
.big-figure { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }

@media (max-width: 576px) {
  .tier-ladder { margin-right: 16px; }
  .tier-bonus { font-size: 11px; }
}
