/* ==========================================================
   GaiaCare ERP — Design System
   gaiacare.css — All custom CSS (variables + components)
   ========================================================== */

/* ── CSS Variables ── */
:root {
  --ink:       #0b1f14;
  --ink-mid:   #1c4a30;
  --ink-lt:    #2e7d52;
  --sage:      #52b788;
  --sage-pale: #d8f3dc;
  --amber:     #f59e0b;
  --amber-pale:#fef3c7;
  --coral:     #ef4444;
  --coral-pale:#fee2e2;
  --sky:       #3b82f6;
  --sky-pale:  #dbeafe;
  --violet:    #8b5cf6;
  --vio-pale:  #ede9fe;
  --gold:      #d97706;
  --canvas:    #f2f5f2;
  --white:     #ffffff;
  --border:    #e3ebe5;
  --txt:       #0b1f14;
  --txt-mid:   #3d5445;
  --txt-soft:  #8aaa94;
  --sw:        258px;
  --topbar-h:  54px;
  --r:         8px;
  --sh:        0 1px 2px rgba(0,0,0,.05), 0 3px 10px rgba(0,0,0,.04);
  --sh-md:     0 4px 20px rgba(0,0,0,.08);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--txt);
  background: var(--canvas);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--ink); }
h2, h3 { font-size: 1rem; font-weight: 600; color: var(--txt); }
input, select, textarea, button { font-family: inherit; }
img { max-width: 100%; }

/* ── Layout Shell ── */
.shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.body-row {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--canvas);
}
.mb8  { margin-bottom: 8px; }
.mb12 { margin-bottom: 12px; }
.mb16 { margin-bottom: 16px; }
.mb18 { margin-bottom: 18px; }
.mb24 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap8  { gap: 8px; }
.gap12 { gap: 12px; }

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 18px 0 0;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: var(--sh);
  position: relative;
}
.tb-logo {
  width: var(--sw);
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border-right: 1px solid rgba(255,255,255,.12);
  background: var(--ink);
  cursor: pointer;
}
.tb-logo img { height: 28px; object-fit: contain; }
.tb-logo-text { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.tb-logo-text span { display: block; font-size: .62rem; font-weight: 400; color: var(--sage); letter-spacing: .4px; }
.tb-search {
  flex: 1;
  margin: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--canvas);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 6px 12px;
  max-width: 360px;
}
.tb-search input {
  border: none;
  background: none;
  font-size: .8rem;
  color: var(--txt);
  flex: 1;
  outline: none;
}
.tb-search input::placeholder { color: var(--txt-soft); }
.tb-search i { color: var(--txt-soft); font-size: .82rem; }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.tb-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--txt-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  transition: all .15s;
  position: relative;
}
.tb-btn:hover { background: var(--canvas); }
.tb-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--coral);
  border-radius: 50%;
  border: 1.5px solid #fff;
}
.tb-divider { width: 1px; height: 22px; background: var(--border); margin: 0 6px; }
.tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s;
  max-width: 180px;
}
.tb-user:hover { background: var(--canvas); }
.tb-user-name { font-size: .78rem; font-weight: 600; color: var(--txt); }
.tb-user-role { font-size: .65rem; color: var(--txt-soft); }
.tb-burger {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--txt-mid);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  margin-left: 8px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sw);
  background: var(--ink);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s;
  position: relative;
  z-index: 50;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Sidebar user card */
.sb-user {
  padding: 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-user-info { flex: 1; min-width: 0; }
.sb-user-name  { font-size: .82rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role  { font-size: .65rem; color: var(--txt-soft); }
.sb-online { display: flex; align-items: center; gap: 4px; font-size: .62rem; color: var(--sage); margin-top: 2px; }
.sb-online-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }

/* Back to modules button */
.sb-back-modules {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 10px 2px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: .75rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  transition: all .18s;
}
.sb-back-modules:hover {
  background: rgba(82,183,136,.15);
  color: var(--sage);
  border-color: rgba(82,183,136,.3);
}
.sb-back-modules i { font-size: .8rem; }

/* Sidebar nav */
.sb-nav { flex: 1; padding: 10px 0; overflow-y: auto; }
.sb-section { font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); padding: 12px 16px 4px; }

/* Collapsible sidebar groups */
.sb-group-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px 6px; cursor: pointer; user-select: none;
  border-radius: 6px; margin: 0 6px;
}
.sb-group-hd:hover { background: rgba(255,255,255,.04); }
.sb-group-label { flex: 1; font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); }
.sb-group-icon { font-size: .72rem; color: rgba(255,255,255,.25); width: 16px; text-align: center; flex-shrink: 0; }
.sb-group-hd .sb-arrow { font-size: .55rem; color: rgba(255,255,255,.2); transition: transform .2s ease; flex-shrink: 0; }
.sb-group.open .sb-group-hd .sb-arrow { transform: rotate(90deg); }
.sb-group-body { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.sb-group.open .sb-group-body { max-height: 600px; }
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  color: rgba(255,255,255,.65);
  font-size: .8rem;
  font-weight: 500;
  user-select: none;
}
.sb-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.sb-item.active { background: rgba(82,183,136,.15); color: var(--sage); }
.sb-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--sage);
  border-radius: 0 3px 3px 0;
}
.sb-item i { width: 18px; text-align: center; font-size: .85rem; flex-shrink: 0; }
.sb-item-label { flex: 1; }
.sb-badge {
  background: var(--coral);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.sb-badge-sage {
  background: rgba(82,183,136,.2);
  color: var(--sage);
  font-size: .58rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
}
.sb-arrow {
  font-size: .65rem;
  transition: transform .2s;
  color: rgba(255,255,255,.4);
}
.sb-item.open .sb-arrow { transform: rotate(90deg); }
.sb-children { overflow: hidden; }
.sb-child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 38px;
  cursor: pointer;
  color: rgba(255,255,255,.5);
  font-size: .76rem;
  transition: all .15s;
  position: relative;
  border-left: none;
}
.sb-child::before {
  content: '';
  position: absolute;
  left: 26px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
}
.sb-child:hover { color: #fff; background: rgba(255,255,255,.04); }
.sb-child.active { color: var(--sage); }
.sb-child.active::before { background: var(--sage); }
.sb-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.25);
  font-size: .62rem;
  text-align: center;
}
.sb-module-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 4px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}
.sb-module-icon {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
}
.sb-module-name { font-size: .72rem; font-weight: 600; color: rgba(255,255,255,.5); }

/* Sidebar overlay (mobile) */
.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 49;
}

/* ── Page Header ── */
.page-hd {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}
.page-hd-left h1 { margin-bottom: 2px; }
.page-hd-left p { font-size: .78rem; color: var(--txt-soft); }
.page-hd-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .74rem;
  color: var(--txt-soft);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--ink-lt); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb i { font-size: .55rem; }

/* ── Buttons ── */
.btn {
  padding: 7px 15px;
  border-radius: 7px;
  font-size: .77rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
}
.btn-p  { background: var(--ink-lt); color: #fff; }
.btn-p:hover { background: var(--ink-mid); }
.btn-o  { background: var(--white); color: var(--txt-mid); border: 1.5px solid var(--border); }
.btn-o:hover { border-color: var(--sage); color: var(--ink-lt); }
.btn-d  { background: var(--coral); color: #fff; }
.btn-d:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: .72rem; }
.btn-ic { width: 28px; height: 28px; padding: 0; justify-content: center; }
.btn-am { background: var(--amber); color: #fff; }
.btn-am:hover { background: var(--gold); }

/* ── Status Badges ── */
.bx {
  font-size: .67rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}
.bx-p    { background: var(--amber-pale); color: var(--gold); }
.bx-a    { background: var(--sage-pale);  color: var(--ink-lt); }
.bx-r    { background: var(--coral-pale); color: var(--coral); }
.bx-o    { background: var(--sky-pale);   color: var(--sky); }
.bx-ip   { background: var(--vio-pale);   color: var(--violet); }
.bx-cl   { background: var(--canvas); color: var(--txt-soft); border: 1px solid var(--border); }
.bx-crit { background: var(--coral-pale); color: var(--coral); }
.bx-hi   { background: var(--amber-pale); color: var(--gold); }
.bx-med  { background: var(--sky-pale);   color: var(--sky); }
.bx-lo   { background: var(--sage-pale);  color: var(--ink-lt); }

/* ── Stat Cards ── */
.sg4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
.sg5 { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; margin-bottom: 18px; }
.sg3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.sg2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin-bottom: 18px; }
.st  { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; box-shadow: var(--sh); }
.st-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.si  { width: 38px; height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; flex-shrink: 0; }
.si-gr { background: var(--sage-pale); color: var(--ink-lt); }
.si-am { background: var(--amber-pale); color: var(--gold); }
.si-co { background: var(--coral-pale); color: var(--coral); }
.si-sk { background: var(--sky-pale);   color: var(--sky); }
.si-vi { background: var(--vio-pale);   color: var(--violet); }
.st-val { font-size: 1.7rem; font-weight: 700; line-height: 1; color: var(--txt); }
.st-lbl { font-size: .72rem; color: var(--txt-soft); margin-top: 2px; }
.tag-up { background: var(--sage-pale); color: var(--ink-lt); font-size: .64rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; }
.tag-dn { background: var(--coral-pale); color: var(--coral); font-size: .64rem; padding: 2px 7px; border-radius: 20px; font-weight: 600; }

/* ── Tables ── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .8rem; }
.tbl th {
  padding: 8px 13px;
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--txt-soft);
  border-bottom: 1px solid var(--border);
  background: var(--canvas);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.tbl td { padding: 10px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #f8fbf9; }
.tbl th input[type="checkbox"],
.tbl td input[type="checkbox"] { cursor: pointer; width: 14px; height: 14px; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .fi {
  width: auto;
  min-width: 140px;
  padding: 6px 10px;
  font-size: .76rem;
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 300px;
}
.search-wrap i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--txt-soft);
  font-size: .78rem;
}
.search-wrap input { padding-left: 32px; }

/* Bulk action bar */
.bulk-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: var(--sage-pale);
  border-radius: 7px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.bulk-bar span { font-size: .78rem; font-weight: 600; color: var(--ink-lt); }

/* ── Forms ── */
.fl { font-size: .74rem; font-weight: 600; color: var(--txt-mid); margin-bottom: 4px; display: block; }
.fi {
  width: 100%;
  padding: 7px 11px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: .8rem;
  font-family: inherit;
  color: var(--txt);
  background: var(--white);
  transition: border .15s;
}
.fi:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(82,183,136,.1); }
.fi::placeholder { color: var(--txt-soft); }
textarea.fi { resize: vertical; min-height: 75px; }
.fg  { margin-bottom: 14px; }
.fr2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fr3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.fr4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--txt-soft);
  font-size: .78rem;
  cursor: pointer;
  transition: all .15s;
}
.upload-zone:hover { border-color: var(--sage); background: var(--sage-pale); }
.upload-zone i { font-size: 1.5rem; margin-bottom: 6px; display: block; }

/* Info block */
.info-block {
  background: var(--sage-pale);
  border: 1px solid rgba(82,183,136,.3);
  border-radius: 7px;
  padding: 10px 14px;
  font-size: .78rem;
  color: var(--ink-lt);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.info-block-am { background: var(--amber-pale); border-color: rgba(245,158,11,.3); color: var(--gold); }
.info-block-co { background: var(--coral-pale); border-color: rgba(239,68,68,.3); color: var(--coral); }
.info-block-sk { background: var(--sky-pale); border-color: rgba(59,130,246,.3); color: var(--sky); }

/* Days counter */
.days-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--sage-pale);
  color: var(--ink-lt);
  border-radius: 7px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ── Cards ── */
.card    { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--sh); }
.card-hd {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-hd h6 { font-size: .82rem; font-weight: 600; margin: 0; color: var(--txt); }
.card-bd { padding: 18px; }

/* Two column grid for cards */
.col-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
.col-half { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }

/* Chart containers */
.chart-wrap { position: relative; height: 240px; }
.chart-wrap-lg { position: relative; height: 300px; }

/* ── Modals ── */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11,31,20,.45);
  z-index: 500;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.ov.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: 12px;
  width: 560px;
  max-width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  animation: modalIn .2s ease;
}
.modal-lg { width: 720px; }
.modal-sm { width: 420px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(-12px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-hd {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}
.modal-hd h5 { font-size: .92rem; font-weight: 600; color: var(--txt); margin: 0; }
.modal-bd { padding: 20px 22px; }
.modal-ft {
  padding: 13px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  position: sticky;
  bottom: 0;
  background: var(--white);
}
.mx {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: var(--canvas);
  color: var(--txt-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  transition: background .15s;
}
.mx:hover { background: var(--border); }

/* ── Progress Bars ── */
.pw { background: var(--border); border-radius: 20px; height: 5px; overflow: hidden; }
.pf { height: 100%; border-radius: 20px; background: var(--ink-lt); }
.pf-am { background: var(--amber); }
.pf-co { background: var(--coral); }
.pf-sk { background: var(--sky); }
.pf-vi { background: var(--violet); }

/* ── Avatar ── */
.av   { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .64rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.av-md { width: 36px; height: 36px; font-size: .76rem; }
.av-lg { width: 44px; height: 44px; font-size: .88rem; }
.av-1 { background: linear-gradient(135deg, var(--ink-lt), var(--sage)); }
.av-2 { background: linear-gradient(135deg, var(--sky), #1a5fb4); }
.av-3 { background: linear-gradient(135deg, var(--coral), #b91c1c); }
.av-4 { background: linear-gradient(135deg, var(--amber), #b45309); }
.av-5 { background: linear-gradient(135deg, var(--violet), #5b21b6); }
.av-6 { background: linear-gradient(135deg, #0891b2, #164e63); }

/* ── Notification Drawer ── */
.notif-drawer {
  position: fixed;
  top: 0;
  right: -380px;
  width: 350px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  z-index: 600;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0,0,0,.1);
  transition: right .3s cubic-bezier(.4,0,.2,1);
}
.notif-drawer.open { right: 0; }
.nd-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nd-header span { font-weight: 600; font-size: .88rem; flex: 1; }
.nd-mark-all { font-size: .72rem; color: var(--ink-lt); cursor: pointer; }
.nd-body { flex: 1; overflow-y: auto; padding: 8px 0; }
.nd-group-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--txt-soft);
  padding: 10px 18px 4px;
}
.nd-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  transition: background .15s;
}
.nd-item:hover { background: var(--canvas); }
.nd-item.nd-action { border-left: 3px solid var(--coral); }
.nd-item.nd-info   { border-left: 3px solid var(--sky); }
.nd-item.nd-warn   { border-left: 3px solid var(--amber); }
.nd-icon { width: 32px; height: 32px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: .78rem; flex-shrink: 0; }
.nd-content { flex: 1; }
.nd-title { font-size: .78rem; font-weight: 500; color: var(--txt); line-height: 1.4; }
.nd-time  { font-size: .65rem; color: var(--txt-soft); margin-top: 2px; }
.nd-dismiss {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: none;
  background: none;
  color: var(--txt-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity .15s;
}
.nd-item:hover .nd-dismiss { opacity: 1; }
.nd-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .74rem;
  color: var(--ink-lt);
}

/* Notification widget */
.notif-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
}
.notif-item:last-child { border-bottom: none; }
.notif-item i { font-size: .85rem; flex-shrink: 0; }
.notif-warn { color: var(--gold); }
.notif-info { color: var(--sky); }
.notif-crit { color: var(--coral); }
.notif-ok   { color: var(--ink-lt); }

/* ── Activity Feed ── */
.activity-feed { padding: 0; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-text { flex: 1; font-size: .78rem; color: var(--txt); line-height: 1.4; }
.activity-text strong { color: var(--ink-lt); }
.activity-time { font-size: .65rem; color: var(--txt-soft); white-space: nowrap; }

/* ── Quick Actions ── */
.qa-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.qa-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  transition: all .15s;
  font-size: .78rem;
  font-weight: 500;
  color: var(--txt-mid);
  background: var(--white);
}
.qa-item:hover { border-color: var(--sage); color: var(--ink-lt); background: var(--sage-pale); }
.qa-item i { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: .72rem; background: var(--canvas); }

/* ── Coming Soon ── */
.cs { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; text-align: center; color: var(--txt-soft); }
.cs-ico { width: 70px; height: 70px; border-radius: 50%; background: var(--white); display: flex; align-items: center; justify-content: center; font-size: 1.7rem; margin-bottom: 16px; border: 1px solid var(--border); box-shadow: var(--sh); }
.cs-title { font-family: 'Playfair Display', serif; font-size: 1.35rem; color: var(--txt-mid); margin-bottom: 6px; }
.cs-sub { font-size: .8rem; color: var(--txt-soft); max-width: 310px; line-height: 1.6; }
.cs-badge { display: inline-block; margin-top: 14px; background: var(--sage-pale); color: var(--ink-lt); font-size: .72rem; font-weight: 600; padding: 4px 14px; border-radius: 20px; }

/* ── Hub / Home Page ── */
.hub-page {
  min-height: 100vh;
  background: var(--canvas);
  display: flex;
  flex-direction: column;
}
.hub-topbar {
  background: var(--ink);
  padding: 0 28px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0,0,0,.2);
}
.hub-logo { display: flex; align-items: center; gap: 10px; }
.hub-logo img { height: 30px; }
.hub-logo-text { color: #fff; font-weight: 600; font-size: .9rem; }
.hub-logo-text span { font-size: .62rem; color: var(--sage); font-weight: 400; display: block; }
.hub-right { display: flex; align-items: center; gap: 12px; }
.hub-user-info { text-align: right; }
.hub-user-info .name { font-size: .8rem; font-weight: 600; color: #fff; }
.hub-user-info .role { font-size: .65rem; color: var(--sage); }
.hub-logout {
  padding: 6px 14px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: rgba(255,255,255,.8);
  font-size: .75rem;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.hub-logout:hover { background: rgba(255,255,255,.18); color: #fff; }

.hub-body { flex: 1; padding: 32px 28px; max-width: 1280px; margin: 0 auto; width: 100%; }
.hub-welcome { margin-bottom: 24px; }
.hub-welcome h1 { margin-bottom: 6px; font-size: 1.6rem; }
.hub-welcome p { font-size: .85rem; color: var(--txt-soft); }
.hub-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.hub-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--txt-mid);
  box-shadow: var(--sh);
}
.hub-pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.hub-pill .dot-gr  { background: var(--ink-lt); }
.hub-pill .dot-am  { background: var(--amber); }
.hub-pill .dot-co  { background: var(--coral); }
.hub-pill .dot-sk  { background: var(--sky); }
.hub-pill strong { color: var(--txt); }
.hub-section-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-soft); margin-bottom: 14px; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.module-tile {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  box-shadow: var(--sh);
}
.module-tile:hover { transform: translateY(-3px); border-color: var(--sage); box-shadow: var(--sh-md); }
.tile-notif {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--coral);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}
.tile-icon { width: 52px; height: 52px; border-radius: 12px; margin: 0 auto 12px; font-size: 1.3rem; display: flex; align-items: center; justify-content: center; }
.tile-name { font-weight: 600; font-size: .9rem; color: var(--txt); margin-bottom: 4px; }
.tile-desc { font-size: .72rem; color: var(--txt-soft); line-height: 1.4; }

/* ── Auth Pages ── */
.auth-page {
  min-height: 100vh;
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--sh-md);
  text-align: center;
}
.auth-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--ink); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 1.6rem; color: var(--sage); }
.auth-logo img { height: 36px; }
.auth-card h2 { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.auth-card .tagline { font-size: .8rem; color: var(--txt-soft); margin-bottom: 28px; font-style: italic; }
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  font-size: .85rem;
  font-weight: 600;
  color: var(--txt);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  text-decoration: none;
}
.google-btn:hover { border-color: var(--sage); box-shadow: var(--sh); }
.google-btn img { width: 20px; }
.auth-note { font-size: .72rem; color: var(--txt-soft); margin-top: 16px; }
.auth-footer { font-size: .68rem; color: var(--txt-soft); margin-top: 28px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ── Kanban Board ── */
.kanban-wrap { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.kanban-col { background: var(--canvas); border-radius: 10px; overflow: hidden; }
.kanban-col-hd {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border);
}
.kanban-col-hd h6 { font-size: .78rem; font-weight: 700; margin: 0; }
.kanban-count {
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--white);
  border: 1px solid var(--border);
}
.kanban-cards { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.k-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: grab;
  transition: all .15s;
  box-shadow: var(--sh);
}
.k-card:hover { box-shadow: var(--sh-md); border-color: var(--sage); }
.k-card:active { cursor: grabbing; }
.k-card-id { font-size: .62rem; color: var(--txt-soft); margin-bottom: 4px; font-weight: 600; }
.k-card-title { font-size: .78rem; font-weight: 600; color: var(--txt); margin-bottom: 8px; line-height: 1.4; }
.k-card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.k-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.k-card-date { font-size: .62rem; color: var(--txt-soft); }

/* ── Calendar ── */
.cal-wrap { }
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-header h5 { font-size: .95rem; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-day-label {
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--txt-soft);
  text-align: center;
  padding: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px;
  font-size: .7rem;
  background: var(--white);
  position: relative;
  min-height: 56px;
  cursor: pointer;
  transition: background .15s;
}
.cal-cell:hover { background: var(--canvas); }
.cal-cell.today { border-color: var(--ink-lt); background: rgba(82,183,136,.06); }
.cal-cell.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell-num { font-size: .7rem; color: var(--txt-soft); margin-bottom: 2px; font-weight: 600; }
.cal-cell.today .cal-cell-num { color: var(--ink-lt); }
.cal-events { display: flex; flex-direction: column; gap: 2px; }
.cal-event {
  font-size: .58rem;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event-a { background: var(--amber-pale); color: var(--gold); }
.cal-event-p { background: var(--coral-pale); color: var(--coral); }
.cal-legend { display: flex; gap: 14px; margin-top: 10px; font-size: .68rem; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; color: var(--txt-soft); }
.cal-legend-dot { width: 8px; height: 8px; border-radius: 2px; }

/* ── Role Matrix ── */
.role-matrix { }
.role-matrix th:first-child { min-width: 150px; }
.role-matrix td, .role-matrix th { text-align: center; }
.role-matrix td:first-child { text-align: left; font-weight: 600; }
.role-check { width: 16px; height: 16px; cursor: pointer; }

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab {
  padding: 8px 18px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--txt-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
}
.tab:hover { color: var(--txt); }
.tab.active { color: var(--ink-lt); border-bottom-color: var(--ink-lt); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Misc ── */
.sep { height: 1px; background: var(--border); margin: 16px 0; }
.text-soft { color: var(--txt-soft); }
.text-sm { font-size: .75rem; }
.text-xs { font-size: .68rem; }
.text-sage { color: var(--ink-lt); }
.text-amber { color: var(--gold); }
.text-coral { color: var(--coral); }
.text-sky { color: var(--sky); }
.fw600 { font-weight: 600; }
.fw700 { font-weight: 700; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px 3px 4px;
  font-size: .72rem;
  font-weight: 500;
}
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--txt-soft);
  font-size: .82rem;
}
.empty-state i { font-size: 2rem; margin-bottom: 10px; display: block; }

/* ── Ticket detail rows ── */
.detail-row { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .8rem; }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 130px; flex-shrink: 0; color: var(--txt-soft); font-weight: 600; font-size: .74rem; }
.detail-val { flex: 1; color: var(--txt); }

/* ── Section chips ── */
.section-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--sage-pale);
  color: var(--ink-lt);
  font-size: .7rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet: 768–1023 */
@media (max-width: 1023px) {
  :root { --sw: 60px; }
  .sidebar { width: 60px; }
  .sb-item-label, .sb-section, .sb-arrow, .sb-badge, .sb-badge-sage,
  .sb-user-info, .sb-footer, .sb-children, .sb-module-name,
  .sb-group-label, .sb-group-hd .sb-arrow { display: none; }
  .sb-group-body { max-height: 600px !important; }
  .sb-item { justify-content: center; padding: 10px; }
  .sb-item i { width: auto; }
  .sb-user { justify-content: center; padding: 12px 8px; }
  .sb-back-modules { justify-content: center; padding: 7px; margin: 6px 4px 2px; }
  .sb-back-modules span { display: none; }
  .sb-group-hd { justify-content: center; padding: 6px; }
  .sb-group-icon { width: auto; }
  .tb-search { display: none; }
  .sg4 { grid-template-columns: repeat(2,1fr); }
  .sg5 { grid-template-columns: repeat(3,1fr); }
  .col-2 { grid-template-columns: 1fr; }
  .col-half { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: repeat(3,1fr); }
  .kanban-wrap { grid-template-columns: repeat(2,1fr); }
}

/* Mobile: < 768px */
@media (max-width: 767px) {
  :root { --sw: 0px; }
  .sidebar { display: none; position: fixed; top: 0; left: 0; width: 280px; height: 100vh; z-index: 200; }
  .sidebar.open { display: flex; }
  .sb-overlay.open { display: block; }
  .sidebar { --sw: 280px; }
  .sidebar .sb-item-label, .sidebar .sb-section, .sidebar .sb-arrow,
  .sidebar .sb-badge, .sidebar .sb-badge-sage, .sidebar .sb-user-info,
  .sidebar .sb-footer, .sidebar .sb-children, .sidebar .sb-module-name,
  .sidebar .sb-group-label, .sidebar .sb-group-hd .sb-arrow { display: unset; }
  .sidebar .sb-group-body { max-height: 0 !important; }
  .sidebar .sb-group.open .sb-group-body { max-height: 600px !important; }
  .sidebar .sb-group-hd { justify-content: flex-start; padding: 10px 14px 6px; }
  .sidebar .sb-item { justify-content: flex-start; padding: 8px 14px; }
  .sidebar .sb-user { justify-content: flex-start; }
  .tb-search { display: none; }
  .tb-logo-text { display: none; }
  .tb-burger { display: flex; }
  .tb-btn:not(.tb-bell):not(.tb-notif) { display: none; }
  .sg4 { grid-template-columns: repeat(2,1fr); }
  .sg5 { grid-template-columns: repeat(2,1fr); }
  .sg3 { grid-template-columns: repeat(2,1fr); }
  .col-2 { grid-template-columns: 1fr; }
  .col-half { grid-template-columns: 1fr; }
  .fr2 { grid-template-columns: 1fr; }
  .fr3 { grid-template-columns: 1fr; }
  .fr4 { grid-template-columns: 1fr 1fr; }
  .module-grid { grid-template-columns: repeat(2,1fr); gap: 10px; }
  .kanban-wrap { grid-template-columns: 1fr; }
  .page-hd { flex-direction: column; gap: 12px; }
  .page-hd-actions { width: 100%; justify-content: flex-start; }
  .filter-bar { gap: 6px; }
  .filter-bar .fi { min-width: 120px; }
  .main-content { padding: 16px; }
  .hub-body { padding: 20px 16px; }
  .hub-topbar { padding: 0 16px; }
  .hub-user-info { display: none; }
  .modal { width: 96vw; }
  .cal-grid { gap: 2px; }
  .cal-cell { min-height: 44px; }
}
