/* ZET dashboard. Its own copy of the mPokket dashboard's look; the two sites share no files. */
:root {
  --bg-base: #f1f5f9; --bg-card: #ffffff; --bg-card-hover: #f8fafc;
  --sidebar-bg: #1e293b; --sidebar-hover: rgba(255, 255, 255, 0.06); --sidebar-border: rgba(255, 255, 255, 0.08);
  --border: #e2e8f0; --border-strong: #cbd5e1;
  --accent-indigo: #6366f1; --accent-indigo-light: #ede9fe;
  --accent-green: #16a34a; --accent-green-light: #dcfce7;
  --accent-amber: #d97706; --accent-amber-light: #fef3c7;
  --accent-red: #dc2626; --accent-red-light: #fee2e2;
  --accent-blue: #0284c7; --accent-blue-light: #e0f2fe;
  --accent-purple: #7c3aed; --accent-purple-light: #ede9fe;
  --text-primary: #0f172a; --text-secondary: #475569; --text-muted: #94a3b8;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px;
  --sidebar-width: 228px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --fast: 0.15s ease;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg-base); color: var(--text-primary); -webkit-font-smoothing: antialiased; }
.is-hidden { display: none !important; }
.muted { color: var(--text-muted); }
.material-icons-round { font-size: 18px; line-height: 1; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-card); color: var(--text-secondary); cursor: pointer; transition: all var(--fast); }
.btn:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn .material-icons-round { font-size: 16px; }
.btn-primary { background: var(--accent-indigo); border-color: var(--accent-indigo); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.btn-primary:hover { background: #4f46e5; color: #fff; }
.btn-small { padding: 4px 9px; font-size: 11.5px; }
.btn-small .material-icons-round { font-size: 14px; }
.input { font: inherit; font-size: 12.5px; padding: 6px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-primary); }
.input:focus { outline: none; border-color: var(--accent-indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(1200px 600px at 50% -10%, #334155 0%, var(--sidebar-bg) 60%); }
.login-card { width: 380px; max-width: 100%; background: var(--bg-card); border-radius: var(--radius-lg); padding: 34px 32px 30px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent-indigo); }
.login-logo { height: 22px; display: block; margin-bottom: 14px; }
.login-card h1 { font-family: 'Outfit', sans-serif; font-size: 1.45rem; font-weight: 700; }
.login-sub { font-size: 11px; color: var(--text-muted); letter-spacing: 0.07em; text-transform: uppercase; margin: 3px 0 18px; }
.login-card label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin: 14px 0 5px; }
.login-card .input { width: 100%; padding: 10px 12px; font-size: 13.5px; }
.login-card .btn { width: 100%; justify-content: center; margin-top: 22px; padding: 11px; font-size: 13.5px; }
.login-error { margin-top: 14px; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--accent-red-light); color: var(--accent-red); font-size: 12.5px; border: 1px solid rgba(220,38,38,0.2); }

/* Shell */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); flex: none; background: var(--sidebar-bg); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { padding: 18px 16px 14px; border-bottom: 1px solid var(--sidebar-border); }
.brand-logo { height: 18px; filter: brightness(0) invert(1); display: block; }
.brand-sub { margin-top: 6px; font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 0.07em; text-transform: uppercase; }
.nav { padding: 6px 8px; flex: 1; }
.nav-section-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.3); letter-spacing: 0.09em; text-transform: uppercase; padding: 12px 10px 5px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: rgba(255,255,255,0.55); font-size: 13px; font-weight: 500; border: 1px solid transparent; }
.nav-item.active { background: rgba(99,102,241,0.2); color: #a5b4fc; border-color: rgba(99,102,241,0.3); }
.nav-icon { font-size: 17px; }
.sidebar-foot { padding: 14px 12px 16px; border-top: 1px solid var(--sidebar-border); }
.env-badge { display: inline-flex; align-items: center; gap: 5px; background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; padding: 4px 8px; border-radius: 5px; font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.env-badge .material-icons-round { font-size: 11px; }
.env-project { margin-top: 6px; font-size: 10.5px; color: rgba(255,255,255,0.3); }
.user-email { margin-top: 10px; font-size: 11px; color: rgba(255,255,255,0.5); word-break: break-all; }
.btn-logout { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 9px 12px; font: inherit; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.75); background: transparent; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; cursor: pointer; transition: all var(--fast); }
.btn-logout:hover { background: var(--sidebar-hover); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 24px; background: #fff; border-bottom: 1px solid var(--border); }
.topbar-title { font-family: 'Outfit', sans-serif; font-size: 17px; font-weight: 700; }
.topbar-subtitle { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.last-updated { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.search-box { display: flex; align-items: center; gap: 4px; width: 260px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 99px; background: #f8fafc; transition: all var(--fast); }
.search-box:focus-within { border-color: var(--accent-indigo); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); background: #fff; }
.search-box .material-icons-round { color: var(--text-muted); }
.search-box input { border: none; outline: none; background: transparent; font: inherit; font-size: 12.5px; color: var(--text-primary); flex: 1; min-width: 0; padding: 2px 4px; }
.search-box input::placeholder { color: var(--text-muted); }
.page { padding: 22px 24px 40px; }

/* Banners and the data note */
.banner, .notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 12.5px; }
.banner { background: var(--accent-red-light); color: var(--accent-red); border: 1px solid rgba(220,38,38,0.2); }
.notice { background: var(--accent-amber-light); color: var(--accent-amber); border: 1px solid rgba(217,119,6,0.2); }
.run-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 12px; line-height: 1.4; }
.run-line .material-icons-round { font-size: 16px; color: var(--text-muted); flex: none; }

/* Count cards */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.kpi-card { position: relative; overflow: hidden; text-align: left; font: inherit; color: inherit; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px; box-shadow: var(--shadow-sm); cursor: pointer; transition: all 0.25s ease; --kpi-accent: var(--accent-indigo); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--kpi-accent); }
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kpi-card.selected { border-color: var(--kpi-accent); box-shadow: 0 0 0 2px var(--kpi-accent); }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 32px; }
.kpi-value { font-family: 'Outfit', sans-serif; font-size: 28px; font-weight: 700; color: var(--kpi-accent); line-height: 1; margin-bottom: 5px; }
.kpi-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-icon { position: absolute; top: 14px; right: 14px; font-size: 26px; opacity: 0.12; color: var(--kpi-accent); }
.kpi-indigo { --kpi-accent: var(--accent-indigo); }
.kpi-blue { --kpi-accent: var(--accent-blue); }
.kpi-purple { --kpi-accent: var(--accent-purple); }
.kpi-amber { --kpi-accent: var(--accent-amber); }
.kpi-green { --kpi-accent: var(--accent-green); }
.kpi-red { --kpi-accent: var(--accent-red); }

/* Table card */
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.table-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table-title { display: flex; align-items: center; gap: 8px; font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 700; }
.table-title .material-icons-round { font-size: 17px; color: var(--accent-indigo); }
.table-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.table-count { font-size: 11px; color: var(--text-muted); margin-left: 6px; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); padding: 10px 16px; text-align: left; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; cursor: pointer; transition: background var(--fast); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table td { padding: 11px 16px; font-size: 13px; vertical-align: middle; white-space: nowrap; }
.data-table .num { text-align: right; }
.data-table td.num { font-family: 'Outfit', sans-serif; font-weight: 600; }
.col-sno { width: 44px; text-align: right; font-size: 11px; color: var(--text-muted); }
/* Names arrive in whatever case the customer typed; show them all in capitals. */
.borrower-name { font-weight: 600; font-size: 12.5px; letter-spacing: 0.01em; text-transform: uppercase; }
.borrower-mobile { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
.cell-sub { font-size: 10.5px; color: var(--text-muted); margin-top: 4px; }
.row-open { display: inline-flex; color: var(--text-muted); text-decoration: none; }
.row-chevron { color: var(--text-muted); font-size: 16px; vertical-align: middle; }
.row-open:hover .row-chevron { color: var(--accent-indigo); }
.skeleton td { color: transparent; }
.skeleton td::after { content: ''; display: block; height: 12px; border-radius: 4px; background: var(--border); }
.empty { padding: 44px 20px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.empty h2 { font-family: 'Outfit', sans-serif; margin-bottom: 8px; color: var(--text-primary); }
.empty .btn { margin-top: 16px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 99px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; margin-right: 4px; }
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge-green { background: var(--accent-green-light); color: var(--accent-green); border: 1px solid rgba(22,163,74,0.2); }
.badge-red { background: var(--accent-red-light); color: var(--accent-red); border: 1px solid rgba(220,38,38,0.2); }
.badge-amber { background: var(--accent-amber-light); color: var(--accent-amber); border: 1px solid rgba(217,119,6,0.2); }
.badge-blue { background: var(--accent-blue-light); color: var(--accent-blue); border: 1px solid rgba(2,132,199,0.2); }
.badge-indigo { background: var(--accent-indigo-light); color: var(--accent-indigo); border: 1px solid rgba(99,102,241,0.2); }
.badge-purple { background: var(--accent-purple-light); color: var(--accent-purple); border: 1px solid rgba(124,58,237,0.2); }
.badge-grey { background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border); }

/* Customer page (customer.html), opened in its own tab */
.customer-page { min-height: 100vh; }
.customer-page a.btn { text-decoration: none; }
.cp-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.cp-logo { height: 18px; flex: none; }
.cp-name { text-transform: uppercase; }
.cp-main { max-width: 1080px; margin: 0 auto; padding: 22px 24px 48px; display: grid; gap: 16px; }
.cp-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; }
.cp-summary-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.cp-summary-item .badge { font-size: 11px; padding: 4px 10px; }
.cp-summary-note { margin-top: 8px; font-size: 12.5px; color: var(--text-secondary); }
.cp-card-body { padding: 6px 18px 10px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 10px; font-size: 13px; }
.kv dt { color: var(--text-secondary); }
.kv dd { overflow-wrap: anywhere; }

/* The ZET timeline */
.zt-list { list-style: none; }
.zt-item { display: grid; grid-template-columns: 104px 12px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.zt-item:last-child { border-bottom: none; }
.zt-at { font-size: 11.5px; color: var(--text-muted); text-align: right; padding-top: 1px; white-space: nowrap; }
.zt-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: #94a3b8; }
.zt-green { background: var(--accent-green); }
.zt-red { background: var(--accent-red); }
.zt-amber { background: var(--accent-amber); }
.zt-blue { background: var(--accent-blue); }
.zt-indigo { background: var(--accent-indigo); }
.zt-purple { background: var(--accent-purple); }
.zt-grey { background: #94a3b8; }
.zt-title { font-size: 13px; font-weight: 600; }
.zt-detail { font-size: 12px; color: var(--text-secondary); margin-top: 2px; overflow-wrap: anywhere; }

@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { flex-wrap: wrap; }
  .search-box { flex: 1 1 200px; width: auto; }
}
@media (max-width: 860px) { .cp-summary { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .sidebar { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page, .cp-main { padding: 14px 16px 30px; }
  .topbar { padding: 11px 16px; }
  .data-table td, .data-table thead th { padding: 8px 10px; font-size: 12px; }
  .kv { grid-template-columns: 110px 1fr; }
  .zt-item { grid-template-columns: 84px 10px minmax(0, 1fr); gap: 8px; }
}

/* Channel cards and the day table */
.kpi-grid.channels { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.kpi-card.static { cursor: default; }
.kpi-card.static:hover { transform: none; box-shadow: var(--shadow-sm); }
.kpi-link { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 10px; color: var(--text-muted); margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-teal { --kpi-accent: #0d9488; }
.kpi-grey { --kpi-accent: #64748b; }
.section-gap { margin-top: 18px; }
.days-table tbody tr { cursor: default; }
.days-table tbody tr:hover { background: transparent; }
.days-table tr.today td { background: #f5f3ff; font-weight: 600; }
.days-table td.zero { color: var(--text-muted); font-weight: 400; }
.cp-big { color: var(--accent-indigo); margin-top: 6px; }
@media (max-width: 1400px) { .kpi-grid.channels { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpi-grid.channels { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
