/* =========================================================
   MyOwner CRM — Stylesheet
   Aesthetic: clean white surfaces, Google Calendar palette,
   Google Sans Text + Roboto, generous whitespace.
   ========================================================= */

:root {
  /* Google brand colours (Calendar / Workspace) */
  --g-blue:        #1a73e8;
  --g-blue-light:  #e8f0fe;
  --g-blue-dark:   #1765cc;
  --g-red:         #ea4335;
  --g-red-light:   #fce8e6;
  --g-green:       #34a853;
  --g-green-light: #e6f4ea;
  --g-yellow:      #fbbc04;
  --g-yellow-light:#fef7e0;
  --g-orange:      #f9ab00;
  --g-purple:      #8e24aa;
  --g-purple-light:#f3e5f5;
  --g-teal:        #00897b;
  --g-pink:        #d81b60;

  /* Neutrals */
  --grey-900: #202124;
  --grey-700: #3c4043;
  --grey-600: #5f6368;
  --grey-500: #80868b;
  --grey-400: #9aa0a6;
  --grey-300: #bdc1c6;
  --grey-200: #dadce0;
  --grey-100: #e8eaed;
  --grey-50:  #f1f3f4;
  --grey-25:  #f8f9fa;
  --white:    #ffffff;

  /* Tokens */
  --radius:     8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --shadow-1:   0 1px 2px 0 rgba(60,64,67,.10), 0 1px 3px 1px rgba(60,64,67,.05);
  --shadow-2:   0 1px 3px 0 rgba(60,64,67,.15), 0 4px 8px 3px rgba(60,64,67,.10);
  --shadow-3:   0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.30);

  --sidebar-w:  240px;
  --topbar-h:   64px;

  --font-sans: 'Google Sans Text', 'Roboto', system-ui, -apple-system, sans-serif;
  --font-body: 'Roboto', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--grey-900);
  background: var(--grey-25);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
 zoom: 0.78; 
}




a { color: var(--g-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-sans); font-weight: 500; color: var(--grey-900); margin: 0; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; height: 100vh;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--grey-100);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  z-index: 50;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 24px;
}
.brand-logo {
  width: 40px; height: 40px;
  background: var(--g-blue);
  border-radius: 12px;
  display: grid; place-items: center;
  color: white;
}
.brand-logo .material-symbols-rounded { font-size: 22px; }
.brand-name { font-family: var(--font-sans); font-weight: 500; font-size: 18px; color: var(--grey-900); }
.brand-sub { font-size: 11px; color: var(--grey-500); letter-spacing: 0.08em; text-transform: uppercase; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-foot { padding-top: 12px; border-top: 1px solid var(--grey-100); }

.nav-item {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--grey-700);
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  position: relative;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: var(--grey-50); text-decoration: none; color: var(--grey-900); }
.nav-item.active { background: var(--g-blue-light); color: var(--g-blue-dark); }
.nav-item .material-symbols-rounded { font-size: 20px; }
.nav-item.active .material-symbols-rounded { font-variation-settings: 'FILL' 1; }

.nav-badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
  min-width: 20px; text-align: center;
}
.nav-badge-red    { background: var(--g-red);    color: white; }
.nav-badge-blue   { background: var(--g-blue);   color: white; }
.nav-badge-green  { background: var(--g-green);  color: white; }
.nav-foot { color: var(--grey-600); }

/* ---------- Main + Topbar ---------- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--grey-100);
  display: flex; align-items: center;
  padding: 0 32px;
  gap: 16px;
}
.topbar-title h1 { font-size: 22px; line-height: 1.1; }
.topbar-sub { font-size: 12px; color: var(--grey-600); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.mobile-only { display: none; }

.page-body { padding: 28px 32px 60px; max-width: 1400px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--g-blue);
  color: white;
  font-family: var(--font-sans);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .05s;
  text-decoration: none;
  line-height: 1;
}
.btn:hover { background: var(--g-blue-dark); text-decoration: none; box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn .material-symbols-rounded { font-size: 18px; }

.btn-ghost { background: transparent; color: var(--grey-700); border-color: var(--grey-200); }
.btn-ghost:hover { background: var(--grey-50); }

.btn-danger { background: var(--g-red); }
.btn-danger:hover { background: #c5221f; }

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

.icon-btn {
  width: 40px; height: 40px;
  border: none; background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--grey-700);
  display: inline-grid; place-items: center;
  transition: background .15s;
}
.icon-btn:hover { background: var(--grey-100); }
.icon-btn .material-symbols-rounded { font-size: 20px; }

/* ---------- Cards / Surfaces ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--grey-100);
}
.card-header h2 { font-size: 15px; font-weight: 600; }
.card-header .text-sm { font-size: 13px; color: var(--g-blue); font-weight: 500; }

/* Cards that don't use task-list/dash-list still need inner padding */
.card > :not(.task-list):not(.dash-list):not(.card-header):not(.empty) {
  padding-left: 20px;
  padding-right: 20px;
}
.card > .empty { padding: 24px 20px; }

/* ---------- Stats grid (dashboard) ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.stat-label {
  font-size: 12px; color: var(--grey-600);
  font-family: var(--font-sans); font-weight: 500;
  text-transform: uppercase; letter-spacing: .04em;
}
.stat-value {
  font-family: var(--font-sans);
  font-size: 32px; font-weight: 500;
  color: var(--grey-900);
  margin-top: 4px;
  line-height: 1.1;
}
.stat-icon {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
}
.stat-icon .material-symbols-rounded { font-size: 20px; }
.stat-foot { margin-top: 8px; font-size: 12px; color: var(--grey-600); }

/* Stat colour accents */
.stat-blue   .stat-icon { background: var(--g-blue-light);   color: var(--g-blue-dark); }
.stat-red    .stat-icon { background: var(--g-red-light);    color: var(--g-red); }
.stat-green  .stat-icon { background: var(--g-green-light);  color: var(--g-green); }
.stat-yellow .stat-icon { background: var(--g-yellow-light); color: #b06000; }

/* ---------- Two column layout (dashboard) ---------- */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap {
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 14px 16px;
  vertical-align: middle;
}
.table thead th {
  background: var(--grey-25);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  color: var(--grey-600);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--grey-100);
}
.table tbody tr { border-bottom: 1px solid var(--grey-100); transition: background .12s; }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--grey-25); }
.table .lead-name {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-sans); font-weight: 500;
  color: var(--grey-900);
}
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-sans); font-weight: 500;
  font-size: 14px;
  flex-shrink: 0;
}
.avatar-sm { width: 24px; height: 24px; font-size: 11px; }

.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* ---------- Status pills ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  font-family: var(--font-sans);
  white-space: nowrap;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-new        { background: var(--grey-50);       color: var(--grey-700); }
.pill-contacted  { background: var(--g-blue-light);  color: var(--g-blue-dark); }
.pill-hot        { background: var(--g-red-light);   color: var(--g-red); }
.pill-cold       { background: #e0f7fa;              color: var(--g-teal); }
.pill-meeting    { background: var(--g-purple-light);color: var(--g-purple); }
.pill-proposal   { background: var(--g-yellow-light);color: #b06000; }
.pill-closed_won { background: var(--g-green-light); color: var(--g-green); }
.pill-closed_lost{ background: #f5f5f5;              color: var(--grey-600); }

.pill-pri-low    { background: var(--grey-50);       color: var(--grey-600); }
.pill-pri-medium { background: var(--g-yellow-light);color: #b06000; }
.pill-pri-high   { background: var(--g-red-light);   color: var(--g-red); }

/* ---------- Forms ---------- */
.field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 14px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width:600px) { .field-row { grid-template-columns: 1fr; } }
.label {
  font-size: 12px;
  color: var(--grey-600);
  font-family: var(--font-sans); font-weight: 500;
}
.input, .textarea, .select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--grey-900);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--g-blue);
  box-shadow: 0 0 0 3px rgba(26,115,232,.15);
}
.textarea { resize: vertical; min-height: 80px; }

/* ---------- Search bar ---------- */
.search-box {
  display: flex; align-items: center;
  background: var(--grey-50);
  border-radius: 8px;
  padding: 6px 12px;
  width: 100%; max-width: 480px;
  transition: background .15s;
}
.search-box:focus-within { background: var(--white); box-shadow: var(--shadow-1); }
.search-box .material-symbols-rounded { color: var(--grey-600); font-size: 20px; margin-right: 8px; }
.search-box input {
  border: none; background: transparent; outline: none;
  flex: 1; font-size: 14px; font-family: var(--font-body);
  color: var(--grey-900); padding: 6px 0;
}

.filter-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 20px; flex-wrap: wrap;
}
.filter-bar .search-box { flex: 1; min-width: 240px; }

/* Chip filter */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--grey-200);
  background: var(--white);
  font-family: var(--font-sans); font-weight: 500; font-size: 13px;
  color: var(--grey-700);
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { background: var(--grey-50); }
.chip.active { background: var(--g-blue-light); border-color: var(--g-blue-light); color: var(--g-blue-dark); }

/* ---------- Slide-over (lead detail) ---------- */
.overlay {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(32,33,36,.45);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  z-index: 60;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.slideover {
  position: fixed; top: 0; right: 0;
  height: 100vh;
  width: min(560px, 100vw);
  background: var(--white);
  box-shadow: var(--shadow-3);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 70;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.slideover.open { transform: translateX(0); }

.slideover-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--grey-100);
  display: flex; align-items: center; gap: 14px;
}
.slideover-head .avatar { width: 44px; height: 44px; font-size: 16px; }
.slideover-head .who { flex: 1; min-width: 0; }
.slideover-head .who-name { font-family: var(--font-sans); font-weight: 500; font-size: 18px; color: var(--grey-900); }
.slideover-head .who-sub { font-size: 13px; color: var(--grey-600); }

.slideover-body { overflow-y: auto; padding: 20px 24px; flex: 1; }
.slideover-foot { padding: 14px 24px; border-top: 1px solid var(--grey-100); display: flex; gap: 8px; justify-content: flex-end; background: var(--grey-25); }

/* Tabs inside slideover */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--grey-100); margin: 0 -24px 20px; padding: 0 24px; }
.tab {
  padding: 10px 16px;
  font-family: var(--font-sans); font-weight: 500; font-size: 13px;
  color: var(--grey-600);
  border: none; background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--grey-900); }
.tab.active { color: var(--g-blue); border-bottom-color: var(--g-blue); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Detail rows */
.detail-list { display: flex; flex-direction: column; gap: 12px; }
.detail-row {
  display: grid; grid-template-columns: 130px 1fr;
  gap: 16px; align-items: start;
  font-size: 14px;
}
.detail-row .k { color: var(--grey-600); font-family: var(--font-sans); font-weight: 500; font-size: 13px; }
.detail-row .v { color: var(--grey-900); word-break: break-word; }

/* Activity timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--grey-100);
}
.timeline li:last-child { border-bottom: none; }
.tl-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--g-blue-light); color: var(--g-blue-dark);
}
.tl-icon .material-symbols-rounded { font-size: 18px; }
.tl-icon.call     { background: var(--g-green-light); color: var(--g-green); }
.tl-icon.whatsapp { background: var(--g-green-light); color: var(--g-green); }
.tl-icon.email    { background: var(--g-blue-light); color: var(--g-blue-dark); }
.tl-icon.meeting  { background: var(--g-purple-light); color: var(--g-purple); }
.tl-icon.note     { background: var(--grey-50); color: var(--grey-600); }
.tl-icon.status_change { background: var(--g-yellow-light); color: #b06000; }
.tl-msg { font-size: 14px; color: var(--grey-900); }
.tl-meta { font-size: 12px; color: var(--grey-500); margin-top: 2px; }

/* Add-activity composer */
.composer { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; }
.composer .textarea { min-height: 60px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(32,33,36,.45);
  display: none; align-items: center; justify-content: center;
  z-index: 80; padding: 20px;
}
.modal.open { display: flex; }
.modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-3);
}
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--grey-100); display: flex; align-items: center; }
.modal-head h3 { flex: 1; font-family: var(--font-sans); font-weight: 500; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--grey-100); display: flex; gap: 8px; justify-content: flex-end; background: var(--grey-25); }

/* ---------- Calendar ---------- */
.calendar-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.cal-month {
  font-family: var(--font-sans); font-weight: 500;
  font-size: 22px; flex: 1;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--white);
  border: 1px solid var(--grey-100);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cal-day-name {
  padding: 10px 8px;
  text-align: center;
  font-family: var(--font-sans); font-weight: 500; font-size: 11px;
  color: var(--grey-600);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--grey-100);
  background: var(--grey-25);
}
.cal-cell {
  min-height: 110px;
  padding: 8px;
  border-right: 1px solid var(--grey-100);
  border-bottom: 1px solid var(--grey-100);
  font-size: 12px;
  background: var(--white);
  position: relative;
  cursor: pointer;
  transition: background .12s;
}
.cal-cell:hover { background: var(--grey-25); }
.cal-cell.muted { background: var(--grey-25); color: var(--grey-400); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-date {
  font-family: var(--font-sans); font-weight: 500; font-size: 13px;
  margin-bottom: 6px;
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
}
.cal-cell.today .cal-date { background: var(--g-blue); color: white; }
.cal-event {
  display: block;
  font-size: 11px; font-family: var(--font-sans); font-weight: 500;
  padding: 3px 6px; margin-bottom: 2px;
  border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: white;
  cursor: pointer;
}
.cal-event:hover { opacity: .9; text-decoration: none; }
.cal-more { font-size: 10px; color: var(--grey-600); padding: 2px 6px; }

/* ---------- Dashboard lists (Upcoming meetings / Follow-up) ---------- */
.dash-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dash-list li { list-style: none; }
.dash-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px 20px;
  border-bottom: 1px solid var(--grey-100);
  transition: background .12s;
}
.dash-item:last-child { border-bottom: none; }
.dash-item:hover { background: var(--grey-25); }

.dash-icon {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  flex-shrink: 0;
  align-self: center;
}
.dash-avatar {
  width: 32px; height: 32px;
  min-width: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
  color: #fff;
  font-family: var(--font-sans);
  align-self: center;
}
.dash-main { min-width: 0; }
.dash-title {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--grey-900);
}
.dash-title a { color: var(--grey-900); }
.dash-title a:hover { color: var(--g-blue); text-decoration: none; }
.dash-meta {
  font-size: 12px;
  color: var(--grey-500);
  margin-top: 2px;
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.dash-meta a { color: var(--g-blue); font-weight: 500; }


.task-list { display: flex; flex-direction: column; gap: 0; }
.task {
  background: var(--white);
  border: none;
  border-bottom: 1px solid var(--grey-100);
  border-radius: 0;
  padding: 13px 20px;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  transition: background .12s;
}
.task:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.task:last-child  { border-bottom: none; border-radius: 0 0 var(--radius) var(--radius); }
.task:only-child  { border-radius: var(--radius); border-bottom: none; }
.task:hover { background: var(--grey-25); }
.task.done .task-title { text-decoration: line-through; color: var(--grey-500); }
.task-check {
  width: 28px; height: 28px;
  border: 2px solid var(--grey-200);
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all .15s;
  flex-shrink: 0;
}
.task.done .task-check { background: var(--g-green); border-color: var(--g-green); }
.task.done .task-check::after {
  content: 'check'; font-family: 'Material Symbols Rounded';
  color: white; font-size: 14px;
}
.task-main { min-width: 0; }
.task-title { font-family: var(--font-sans); font-weight: 500; color: var(--grey-900); font-size: 14px; }
.task-title a { color: var(--grey-900); }
.task-title a:hover { color: var(--g-blue); text-decoration: none; }
.task-meta { font-size: 12px; color: var(--grey-500); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.task-meta a { color: var(--g-blue); font-weight: 500; }
.task-actions { display: flex; gap: 2px; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--grey-500);
}
.empty .material-symbols-rounded { font-size: 56px; color: var(--grey-300); }
.empty h3 { color: var(--grey-700); margin: 12px 0 4px; }
.empty p { font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--grey-900);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font-sans);
  box-shadow: var(--shadow-2);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.toast-error { background: var(--g-red); }

/* ---------- Section header ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 24px 0 12px;
}
.section-head h2 { font-size: 16px; color: var(--grey-700); font-weight: 500; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--grey-25);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2);
  padding: 40px 36px;
  width: 100%; max-width: 380px;
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px;
  background: var(--g-blue);
  border-radius: 16px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  color: white;
}
.login-logo .material-symbols-rounded { font-size: 28px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card .login-sub { font-size: 13px; color: var(--grey-600); margin-bottom: 28px; }
.login-card .field { text-align: left; }
.login-card .btn { width: 100%; justify-content: center; padding: 12px; font-size: 14px; margin-top: 6px; }
.login-error {
  background: var(--g-red-light); color: var(--g-red);
  padding: 10px; border-radius: 6px; font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .page-body { padding: 20px 16px 60px; }
  .topbar { padding: 0 16px; }
  .field-row { grid-template-columns: 1fr; }
  .table th:nth-child(3), .table td:nth-child(3),
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
  .detail-row { grid-template-columns: 100px 1fr; }
}

/* Avatar colour palette helpers */
.av-blue   { background: var(--g-blue); }
.av-red    { background: var(--g-red); }
.av-green  { background: var(--g-green); }
.av-yellow { background: #f9ab00; }
.av-purple { background: var(--g-purple); }
.av-teal   { background: var(--g-teal); }
.av-pink   { background: var(--g-pink); }
.av-orange { background: var(--g-orange); }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-grey { color: var(--grey-600); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.font-medium { font-weight: 500; }
.hidden { display: none !important; }


/* ── Fix: modals/overlays/toast misalign due to body zoom ── */
.modal,
.overlay,
.slideover,
.toast {
  zoom: calc(1 / 0.78);   /* counteract body zoom */
}