/* ============================================================
   NetConn Pro Ltd — Customer Portal Stylesheet
   Dark Mode · Professional · Responsive
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  --bg-base:        #070d1a;
  --bg-surface:     #0d1628;
  --bg-card:        #111e35;
  --bg-card-hover:  #162440;
  --bg-input:       #0d1628;
  --bg-sidebar:     #091320;
  --border:         #1e2f4a;
  --border-light:   #253a5c;

  --accent:         #3b82f6;
  --accent-hover:   #5b9bff;
  --accent-glow:    rgba(59,130,246,0.18);
  --accent-dim:     rgba(59,130,246,0.12);

  --success:        #22c55e;
  --success-dim:    rgba(34,197,94,0.12);
  --warning:        #f59e0b;
  --warning-dim:    rgba(245,158,11,0.12);
  --danger:         #ef4444;
  --danger-dim:     rgba(239,68,68,0.12);
  --purple:         #a855f7;
  --purple-dim:     rgba(168,85,247,0.12);
  --teal:           #14b8a6;
  --teal-dim:       rgba(20,184,166,0.12);

  --text-primary:   #e8edf8;
  --text-secondary: #7d92b5;
  --text-muted:     #4a5c7a;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.35);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.55);
  --shadow-glow: 0 0 30px rgba(59,130,246,0.15);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  22px;

  --sidebar-w:  260px;
  --header-h:   64px;

  --transition: 0.2s ease;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { display: block; max-width: 100%; }

ul { list-style: none; }

button { cursor: pointer; font-family: inherit; border: none; outline: none; }

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

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }

.text-sm   { font-size: 0.825rem; }
.text-xs   { font-size: 0.75rem; }
.text-muted { color: var(--text-secondary); }

/* ── Layout Shell ────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(59,130,246,0.4);
}

.brand-text { line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 0.95rem; color: var(--text-primary); }
.brand-sub  { font-size: 0.7rem; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 22px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 22px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--accent-dim);
}

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

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  line-height: 1.4;
}

.nav-item .nav-badge.warning { background: var(--warning); }
.nav-item .nav-badge.danger  { background: var(--danger); }

.sidebar-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}

.user-pill:hover { background: var(--bg-card-hover); }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem; color: #fff;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name  { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: 0.7rem; color: var(--text-muted); }

/* ── Main Content ────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top Header ──────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-title span {
  color: var(--text-secondary);
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
  background: var(--bg-card-hover);
}

.notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}

/* ── Page Body ───────────────────────────────────────────── */
.page-body {
  padding: 28px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-info h2 { color: var(--text-primary); }
.page-header-info p  { color: var(--text-secondary); font-size: 0.875rem; margin-top: 3px; }

/* ── Section View Management ─────────────────────────────── */
.section { display: none; }
.section.active { display: block; }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: var(--accent-dim);   color: var(--accent); }
.stat-icon.green  { background: var(--success-dim);  color: var(--success); }
.stat-icon.amber  { background: var(--warning-dim);  color: var(--warning); }
.stat-icon.red    { background: var(--danger-dim);   color: var(--danger); }
.stat-icon.purple { background: var(--purple-dim);   color: var(--purple); }
.stat-icon.teal   { background: var(--teal-dim);     color: var(--teal); }

.stat-info { flex: 1; min-width: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 3px; }
.stat-change { font-size: 0.72rem; margin-top: 5px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 { font-size: 0.95rem; }
.card-body { padding: 22px; }
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

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

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 14px 16px;
  color: var(--text-secondary);
  vertical-align: middle;
}

tbody td:first-child { color: var(--text-primary); font-weight: 500; }

/* ── Badges / Status Pills ───────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge.active      { background: var(--success-dim);  color: var(--success); }
.badge.paid        { background: var(--success-dim);  color: var(--success); }
.badge.completed   { background: var(--success-dim);  color: var(--success); }
.badge.pending     { background: var(--warning-dim);  color: var(--warning); }
.badge.in-progress { background: var(--accent-dim);   color: var(--accent); }
.badge.open        { background: var(--accent-dim);   color: var(--accent); }
.badge.overdue     { background: var(--danger-dim);   color: var(--danger); }
.badge.cancelled   { background: rgba(100,100,100,0.15); color: #888; }
.badge.declined    { background: var(--danger-dim);   color: var(--danger); }
.badge.sent        { background: var(--purple-dim);   color: var(--purple); }
.badge.admin       { background: var(--purple-dim);   color: var(--purple); }
.badge.client      { background: var(--teal-dim);     color: var(--teal); }
.badge.scheduled   { background: var(--teal-dim);     color: var(--teal); }
.badge.expired     { background: rgba(100,100,100,0.15); color: #888; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 13px 28px; font-size: 0.95rem; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

.input-group {
  position: relative;
}

.input-group .form-control { padding-left: 40px; }

.input-group .input-icon {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.input-group .input-action {
  position: absolute;
  right: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}

.input-group .input-action:hover { color: var(--text-primary); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5c7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Search Bar ──────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.search-input-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px 9px 36px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.search-input-wrap input:focus { border-color: var(--accent); outline: none; }
.search-input-wrap input::placeholder { color: var(--text-muted); }

/* ── Modal ───────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition);
}

.modal-backdrop.open .modal { transform: translateY(0); }

.modal-lg { max-width: 760px; }

.modal-xl {
  max-width: min(1160px, calc(100vw - 40px));
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.modal-xl .modal-body {
  overflow-y: auto;
  flex: 1;
}

.modal-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 1rem; }

.modal-close {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}

.modal-close:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
}

.tab-btn {
  padding: 11px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Alert / Toast ───────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

.alert.info    { background: var(--accent-dim);  color: var(--accent);  border: 1px solid rgba(59,130,246,0.25); }
.alert.success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.alert.warning { background: var(--warning-dim); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.alert.danger  { background: var(--danger-dim);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.25); }

/* Toast notification */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-md);
  pointer-events: all;
  animation: slideInToast 0.3s ease;
  max-width: 340px;
}

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

@keyframes slideInToast {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);   opacity: 1; }
}

/* ── Activity Feed ───────────────────────────────────────── */
.activity-list { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.activity-dot.blue   { background: var(--accent-dim);  color: var(--accent); }
.activity-dot.green  { background: var(--success-dim); color: var(--success); }
.activity-dot.amber  { background: var(--warning-dim); color: var(--warning); }
.activity-dot.red    { background: var(--danger-dim);  color: var(--danger); }
.activity-dot.purple { background: var(--purple-dim);  color: var(--purple); }

.activity-content { flex: 1; }
.activity-title { font-size: 0.86rem; color: var(--text-primary); font-weight: 500; }
.activity-sub   { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.activity-time  { font-size: 0.73rem; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; margin-top: 4px; }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h4 { color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 0.85rem; color: var(--text-muted); }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  transition: width 0.8s ease;
}

/* ── Info rows (detail views) ────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}

.info-item {}
.info-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 3px; font-weight: 600; }
.info-value { font-size: 0.9rem; color: var(--text-primary); font-weight: 500; }

/* ── Login Page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

.login-bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
  top: -200px; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.login-bg-glow2 {
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  bottom: -100px; right: 10%;
  pointer-events: none;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 430px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  z-index: 1;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  width: 54px; height: 54px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 0 30px rgba(59,130,246,0.4);
}

.login-brand h1 { font-size: 1.4rem; color: var(--text-primary); }
.login-brand p  { font-size: 0.82rem; color: var(--text-secondary); margin-top: 4px; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-submit {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.login-submit:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 24px var(--accent-glow);
}

.login-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-error {
  background: var(--danger-dim);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--danger);
  margin-bottom: 16px;
  display: none;
}

.login-error.show { display: block; }

.login-lockout {
  background: var(--warning-dim);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--warning);
  margin-bottom: 16px;
  display: none;
}

.login-lockout.show { display: block; }

.attempt-bar {
  display: flex;
  gap: 5px;
  margin-top: 12px;
}

.attempt-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.attempt-dot.used { background: var(--danger); }

.security-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.sec-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sec-badge i { color: var(--success); }

.demo-hint {
  background: var(--accent-dim);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.demo-hint strong { color: var(--accent); }

.demo-hint code {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: monospace;
  color: var(--text-primary);
  font-size: 0.78rem;
}

/* ── Two-Factor ──────────────────────────────────────────── */
.tfa-section { display: none; }
.tfa-section.show { display: block; }

.tfa-code-wrap {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.tfa-digit {
  width: 46px; height: 54px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  transition: border-color var(--transition);
}

.tfa-digit:focus { border-color: var(--accent); }

/* ── Responsive Grid ─────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── Utility ─────────────────────────────────────────────── */
.d-flex  { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.mt-16   { margin-top: 16px; }
.w-full  { width: 100%; }
.text-right { text-align: right; }
.text-center { text-align: center; }

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

/* ── Avatars ─────────────────────────────────────────────── */
.avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; color: #fff;
  flex-shrink: 0;
}

.avatar-sm { width: 30px; height: 30px; font-size: 0.72rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.1rem; }

/* Colour assignments for avatars */
.av-blue   { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.av-green  { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.av-amber  { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.av-purple { background: linear-gradient(135deg, #a855f7, #ec4899); }
.av-teal   { background: linear-gradient(135deg, #14b8a6, #3b82f6); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }

  .sidebar {
    transform: translateX(-260px);
  }

  .sidebar.mobile-open {
    transform: translateX(0);
    width: 260px;
  }

  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row  { grid-template-columns: 1fr; }
  .grid-2    { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }

  .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn { display: none; }

/* ── Shimmer / Skeleton ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }

/* ── Dropdown ────────────────────────────────────────────── */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  z-index: 500;
  overflow: hidden;
  display: none;
}

.dropdown-menu.open { display: block; animation: fadeIn 0.15s ease; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.dropdown-item.danger:hover { color: var(--danger); }

.dropdown-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Session Timer ───────────────────────────────────────── */
.session-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.session-timer.warning { color: var(--warning); border-color: rgba(245,158,11,0.3); }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}

.page-num {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
}

.page-num:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.page-num.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-num:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Client Profile Header ───────────────────────────────── */
.client-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.client-header-info { flex: 1; }
.client-header-info h2 { font-size: 1.2rem; }
.client-header-info p  { font-size: 0.82rem; color: var(--text-secondary); margin-top: 3px; }
.client-header-meta    { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ── Audit Log ───────────────────────────────────────────── */
.audit-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.83rem;
}

.audit-row:last-child { border-bottom: none; }
.audit-action { flex: 1; color: var(--text-primary); }
.audit-user   { color: var(--text-secondary); }
.audit-time   { color: var(--text-muted); white-space: nowrap; }
