/* ==========================================================================
   WebCodex Vault — Modern UI
   ========================================================================== */

:root {
  --ink: #1e1b2e;
  --ink-soft: #6b7280;
  --line: #e7e8f0;
  --bg: #f3f4fa;
  --card: #ffffff;

  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef0fe;
  --accent: #7c3aed;

  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #2563eb;
  --info-bg: #eff6ff;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(30, 27, 46, 0.06);
  --shadow: 0 6px 20px rgba(30, 27, 46, 0.08);
  --shadow-lg: 0 20px 50px rgba(30, 27, 46, 0.18);
  --sidebar-w: 240px;
}

/* --------------------------------------------------------------------------
   Reset (kept from original, lightly trimmed)
   -------------------------------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  vertical-align: baseline;
  box-sizing: border-box;
}
*, *::before, *::after { box-sizing: border-box; }
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after,
q:before, q:after { content: ''; content: none; }

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.5;
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body, html { width: 100%; height: 100%; }

a {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.18s ease;
}
a:link, a:visited, a:active { text-decoration: none; }
a:hover { text-decoration: none; color: var(--primary); }

::selection { background: var(--primary); color: #fff; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfd2e6; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #b7bade; }

h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  color: var(--ink);
}
h1 i { color: var(--primary); margin-right: 10px; }
h2 { font-size: 22px; letter-spacing: -0.5px; margin-bottom: 15px; font-weight: 700; }
h3 {
  font-size: 15px;
  letter-spacing: 0.2px;
  margin-bottom: 16px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}
h3 i { color: var(--primary); margin-right: 6px; }

.wrapper { max-width: 1380px; width: 95%; margin: auto; }
.split { clear: both; }
.fl { float: left; }
.fr { float: right; }
.mt { margin-top: 10px; }
.wtext { color: #fff !important; }
.gtext { color: var(--ink-soft); }
.grey { color: var(--ink-soft); cursor: pointer; }
.hline { border-top: solid 1px var(--line); margin: 14px 0; }
.twenty { width: 200px !important; margin: auto; }
.text-center { text-align: center; }

/* --------------------------------------------------------------------------
   Sidebar navigation (the old top <header> is re-purposed, CSS-only)
   -------------------------------------------------------------------------- */
header {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(190deg, #1e1b4b 0%, #312e81 55%, #4338ca 100%);
  box-shadow: 4px 0 24px rgba(20, 15, 60, 0.18);
  z-index: 1000;
  margin-bottom: 0;
  overflow-y: auto;
}
header .wrapper {
  max-width: none;
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 28px 0 20px 0;
}
header .split { display: none; }

header .logo {
  float: none;
  display: block;
  width: 80%;
  margin: 0 auto 28px auto;

 
}
header .logo img { width: 100%; display: block; }

header .rlink {
  float: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 14px;
  flex: 1;
}
header .rlink a {
  float: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,0.68);
  font-family: 'Inter', sans-serif;
}
header .rlink a i { width: 16px; text-align: center; font-size: 15px; }
header .rlink a:hover { background: rgba(255,255,255,0.09); color: #fff; }
header .rlink a[href="logout.php"] {
  margin-top: auto;
  color: #fca5a5;
  border-top: solid 1px rgba(255,255,255,0.1);
  padding-top: 14px;
  margin-top: 10px;
}
header .rlink a[href="logout.php"]:hover { background: rgba(248,113,113,0.14); color: #fecaca; }

/* --------------------------------------------------------------------------
   Main content area
   -------------------------------------------------------------------------- */
.lbody {
  float: none;
  width: auto;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg);
  padding: 32px 0 60px 0;
  position: relative;
}

/* header row on each page: title + action button */
.fl h1 { margin-bottom: 2px; }

.outlinetab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32);
  cursor: pointer;
}
.outlinetab:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.42);
}

/* search box */
.ftds {
  width: 100%;
  padding: 12px 18px;
  box-sizing: border-box;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  outline: none;
  border: solid 1px var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  background-color: var(--card);
}
.ftds:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.ftds::placeholder { color: #9aa0b4; }

/* --------------------------------------------------------------------------
   Tables → card style
   -------------------------------------------------------------------------- */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: solid 1px var(--line);
}
th, td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
th {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8f8fd; }

/* action icons in the last column */
td a[title] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--ink-soft);
}
td a[title]:hover { background: var(--primary-light); color: var(--primary); }
td a[title="Delete"]:hover { background: var(--danger-bg); color: var(--danger); }

/* status pills (dates / renew / due) */
.red, .green, .blue {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}
.red   { background: var(--danger-bg);  color: var(--danger); }
.green { background: var(--success-bg); color: var(--success); }
.blue  { background: var(--info-bg);    color: var(--info); }

.renew {
  display: block;
  font-size: 11px;
  padding: 5px 0 0 2px;
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.redt   { color: var(--danger); }
.bluet  { color: var(--info); }
.greent { color: var(--success); }

.boxc1bor { border-bottom: solid 4px #f2b030; }
.boxc2bor { border-bottom: solid 4px #43d3e8; }
.boxc3bor { border-bottom: solid 4px #e0e505; }
.boxc4bor { border-bottom: solid 4px #ff7777; }
.c1bor { color: #f2b030 !important; }
.c2bor { color: #43d3e8 !important; }
.c3bor { color: #e0e505 !important; }
.c4bor { color: #ff7777 !important; }

/* --------------------------------------------------------------------------
   Slide-over "Add New" panel
   -------------------------------------------------------------------------- */
.rbody {
  right: 0;
  top: 0;
  width: 380px;
  max-width: 90vw;
  background-color: var(--card);
  height: 100vh;
  box-shadow: var(--shadow-lg);
  position: fixed;
  z-index: 1200;
  padding: 30px 26px;
  box-sizing: border-box;
  display: block;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow-y: auto;
  border-left: solid 1px var(--line);
}
.rbody.open,
body.panel-open .rbody { transform: translateX(0); }

/* dim backdrop behind the panel, CSS-only via pseudo-element */
body.panel-open .lbody::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 46, 0.35);
  z-index: 1100;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.rbody h3 {
  font-size: 17px;
  text-transform: none;
  color: var(--ink);
  padding-bottom: 14px;
  margin-bottom: 20px;
  border-bottom: solid 1px var(--line);
}
.rbody h3 i { color: var(--primary); }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.fgroup { width: 100%; margin-bottom: 14px; }
.label {
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  color: var(--ink-soft);
  width: 100%;
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
.fgroup input[type="text"], .fgroup input[type="email"], .fgroup input[type="password"], .fgroup input[type="date"],
.fgroup select, .fgroup textarea {
  padding: 11px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  outline: none;
  width: 100%;
  background-color: #fbfbfe;
  border: solid 1px var(--line);
  border-radius: var(--radius-sm);
  box-shadow: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="date"]:focus,
.fgroup select:focus, .fgroup textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background-color: #fff;
}
.fgroup textarea { resize: vertical; height: 260px; }

.fgroup button {
  padding: 12px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #fff;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.28);
}
.fgroup button:hover { transform: translateY(-1px); }

.redbut {
  background: #fff !important;
  border: solid 1px var(--line) !important;
  color: var(--ink-soft) !important;
  border-radius: var(--radius-sm);
  box-shadow: none !important;
}
.redbut:hover { border-color: var(--danger) !important; color: var(--danger) !important; }

.pbor {
  border: none !important;
  outline: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  width: auto !important;
}

/* --------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
body.login-page {
  background: radial-gradient(circle at top left, #4338ca 0%, #1e1b4b 45%, #0f0c29 100%);
  min-height: 100vh;
}
.login-form {
  max-width: 360px;
  width: 88%;
  margin: auto;
  height: auto;
  padding: 34px 28px 28px 28px;
  position: absolute;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background-color: #fff;
  transform: translateY(-50%) translateX(-50%);
  left: 50%;
  top: 50%;
}
.login-logo { width: 100%; text-align: center; }
.login-logo .logo {
  float: none;
  width: 140px;
  margin-top: -78px;
  box-shadow: 0 10px 24px rgba(20, 15, 60, 0.28);
  background-color: #fff;
  padding: 18px 14px;
  box-sizing: border-box;
  border-radius: 16px;
}
.login-form h3 {
  text-align: center;
  margin: 22px 0 22px 0;
  color: var(--ink);
  font-size: 15px;
}
.login-form h3 i { color: var(--primary); margin-right: 6px; }
.login-box .fgroup { margin-bottom: 14px; }
.login-box .redbut {
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32) !important;
}
.login-box .redbut:hover { color: #fff !important; transform: translateY(-1px); }

.logo {
  float: left;
  width: 160px;
  margin: 20px 0 15px 0;
}
.logo img { width: 100%; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
   Dark mode
   -------------------------------------------------------------------------- */
:root[data-theme="dark"] {
  --ink: #e7e8f5;
  --ink-soft: #9799b8;
  --line: #2b2a45;
  --bg: #14132a;
  --card: #1c1b36;
  --primary-light: #262454;
}
:root[data-theme="dark"] body { background-color: var(--bg); }
:root[data-theme="dark"] .ftds,
:root[data-theme="dark"] input[type="text"],
:root[data-theme="dark"] input[type="email"],
:root[data-theme="dark"] input[type="password"],
:root[data-theme="dark"] input[type="date"],
:root[data-theme="dark"] .fgroup select,
:root[data-theme="dark"] .fgroup textarea {
  background-color: #201f3d;
  color: var(--ink);
}
:root[data-theme="dark"] th { background: #201f3d; color: #a5b4fc; }
:root[data-theme="dark"] tbody tr:hover { background: #201f3d; }
:root[data-theme="dark"] .rbody { background-color: var(--card); }
:root[data-theme="dark"] .redbut { background: #201f3d !important; color: var(--ink-soft) !important; border-color: var(--line) !important; }

/* --------------------------------------------------------------------------
   Sidebar: search box, active state, theme toggle
   -------------------------------------------------------------------------- */
.nav-search {
  position: relative;
  margin: 0 14px 18px 14px;
}
.nav-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.45);
  font-size: 12px;
}
.nav-search input {
  width: 100%;
  padding: 9px 10px 9px 30px;
  border-radius: 8px;
  border: solid 1px rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 12px;
  outline: none;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.4); }
.nav-search input:focus { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }

header .rlink a.active {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.theme-toggle {
  float: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255,255,255,0.68);
  font-family: 'Inter', sans-serif;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  margin-top: 6px;
}
.theme-toggle:hover { background: rgba(255,255,255,0.09); color: #fff; }
.theme-toggle i { width: 16px; text-align: center; font-size: 15px; }

/* --------------------------------------------------------------------------
   Dashboard
   -------------------------------------------------------------------------- */
.page-subtitle { color: var(--ink-soft); font-size: 13px; margin-top: -2px; margin-bottom: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 20px 0 30px 0;
}
.stat-card {
  background: var(--card);
  border: solid 1px var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
}
.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); }
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
  margin-bottom: 4px;
}
.stat-icon.c-indigo { background: linear-gradient(135deg,#4f46e5,#7c3aed); }
.stat-icon.c-red    { background: linear-gradient(135deg,#dc2626,#f87171); }
.stat-icon.c-amber  { background: linear-gradient(135deg,#d97706,#fbbf24); }
.stat-icon.c-blue   { background: linear-gradient(135deg,#2563eb,#60a5fa); }
.stat-icon.c-green  { background: linear-gradient(135deg,#059669,#34d399); }
.stat-icon.c-purple { background: linear-gradient(135deg,#7c3aed,#c084fc); }
.stat-icon.c-teal   { background: linear-gradient(135deg,#0d9488,#5eead4); }
.stat-icon.c-grey   { background: linear-gradient(135deg,#6b7280,#9ca3af); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.stat-label { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.dash-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
}
.card-panel {
  background: var(--card);
  border: solid 1px var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-panel h3 { margin-bottom: 14px; }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table tr td { padding: 9px 4px; border-bottom: solid 1px var(--line); font-size: 13px; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-type { display: block; font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.3px; }
.text-right { text-align: right; }

.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-list li { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.activity-badge {
  font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.3px;
  padding: 3px 9px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); flex-shrink: 0;
}
.activity-desc { flex: 1; color: var(--ink); }
.activity-time { font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.view-all-link { display: inline-block; margin-top: 14px; font-size: 12px; font-weight: 700; color: var(--primary); }

/* --------------------------------------------------------------------------
   Favorites, favicons, sortable columns
   -------------------------------------------------------------------------- */
.fav-star {
  cursor: pointer;
  color: #d0d2e6;
  font-size: 15px;
  margin-right: 6px;
}
.fav-star:hover { color: #f2b030; }
.fav-star.active { color: #f2b030; }

.fav-icon { width: 16px; height: 16px; vertical-align: middle; margin-right: 6px; border-radius: 3px; }

table.sortable th { cursor: pointer; user-select: none; }
table.sortable th:hover { color: var(--primary); }
table.sortable th .sort-arrow { font-size: 9px; margin-left: 4px; opacity: 0.5; }

/* --------------------------------------------------------------------------
   Password strength meter
   -------------------------------------------------------------------------- */
.pw-field-row { display: flex; gap: 6px; align-items: center; }
.pw-field-row input { flex: 1; }
.pw-generate-btn {
  flex-shrink: 0;
  border: solid 1px var(--line);
  background: var(--card);
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 38px;
  cursor: pointer;
  font-size: 13px;
}
.pw-generate-btn:hover { background: var(--primary-light); }

.strength-meter { margin-top: 8px; }
.strength-bar-track { width: 100%; height: 5px; border-radius: 4px; background: var(--line); overflow: hidden; }
.strength-bar-fill { height: 100%; width: 0%; border-radius: 4px; transition: width 0.2s ease, background-color 0.2s ease; }
.strength-label { display: block; font-size: 11px; margin-top: 5px; font-weight: 700; letter-spacing: 0.2px; }

/* --------------------------------------------------------------------------
   Master-password re-auth modal
   -------------------------------------------------------------------------- */
.vault-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,17,46,0.5);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.vault-modal-overlay.open { display: flex; }
.vault-modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px;
  width: 92%;
  max-width: 340px;
  box-shadow: var(--shadow-lg);
}
.vault-modal-box h4 { font-size: 16px; margin-bottom: 6px; color: var(--ink); }
.vault-modal-box p { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }
.vault-modal-box .fgroup { margin-bottom: 12px; }
.vault-modal-actions { display: flex; gap: 8px; margin-top: 4px; }
.vault-modal-actions button { flex: 1; }
.vault-modal-error { color: var(--danger); font-size: 12px; margin-top: -6px; margin-bottom: 10px; display: none; }

/* --------------------------------------------------------------------------
   CSV import/export toolbar buttons
   -------------------------------------------------------------------------- */
.toolbar-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  border: solid 1px var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.toolbar-btn:hover { color: var(--primary); border-color: var(--primary); }

/* --------------------------------------------------------------------------
   Lead status badges & filter tabs
   -------------------------------------------------------------------------- */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
  white-space: nowrap;
}
.status-new       { background: var(--info-bg);    color: var(--info); }
.status-followup  { background: #fff7ed;            color: #d97706; }
.status-converted { background: var(--success-bg); color: var(--success); }
.status-lost      { background: var(--danger-bg);  color: var(--danger); }
:root[data-theme="dark"] .status-followup { background: #2a2010; }

.status-tabs {
  display: flex; flex-wrap: nowrap; gap: 8px;
  margin: 4px 0 16px 0;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 6px; /* room for the scrollbar so it doesn't sit on the tabs */
}
.status-tabs::-webkit-scrollbar { height: 6px; }
.status-tabs::-webkit-scrollbar-thumb { background: #cfd2e6; border-radius: 10px; }
:root[data-theme="dark"] .status-tabs::-webkit-scrollbar-thumb { background: #34335a; }
.status-tab {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px;
  border: solid 1px var(--line); background: var(--card); color: var(--ink-soft);
  font-size: 12px; font-weight: 700;
}
.status-tab:hover { color: var(--primary); border-color: var(--primary); }
.status-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.status-tab .tab-count {
  background: rgba(0,0,0,0.08); padding: 1px 7px; border-radius: 999px; font-size: 10px;
}
.status-tab.active .tab-count { background: rgba(255,255,255,0.25); }
.grey { color: var(--ink-soft); }

/* Task category group headers */
tr.group-header td {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 8px 16px;
  border-bottom: solid 1px var(--line);
}
tr.group-header:hover { background: var(--primary-light); }
tr.group-header td i { margin-right: 6px; }

@media screen and (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 900px) {
  header {
    position: static;
    width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(20,15,60,0.15);
  }
  header .wrapper {
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    overflow-x: auto;
  }
  header .logo {
    width: 70px;
    margin: 0 14px 0 0;
    padding: 8px;
    flex-shrink: 0;
  }
  header .rlink {
    flex-direction: row;
    flex: none;
    padding: 0;
    gap: 2px;
  }
  header .rlink a {
    flex-direction: column;
    font-size: 9px;
    padding: 8px 10px;
    gap: 4px;
    white-space: nowrap;
  }
  header .rlink a[href="logout.php"] {
    margin-top: 0;
    border-top: none;
    padding-top: 8px;
  }
  .lbody { margin-left: 0; padding: 20px 0 40px 0; }
  .rbody { width: 100%; max-width: 100vw; }
  table, thead, tbody, th, td, tr { font-size: 13px; }
  th, td { padding: 10px 10px; }
  .nav-search { display: none; }
  .theme-toggle { flex-direction: column; font-size: 9px; padding: 8px 10px; gap: 4px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
