:root {
  --bg: #e8e9eb;
  --surface: #f2f3f5;
  --surface2: #eaebed;
  --surface3: #d8d9db;
  --border: #c5c8cd;
  --border-strong: #adb1b8;
  --accent: #4a6d8e;
  --accent-hover: #3b5d7a;
  --accent-light: rgba(74,109,142,0.1);
  --text: #1e2128;
  --text-muted: #5a6070;
  --text-dim: #9aa0ae;
  --green: #1e8a5e; --green-bg: rgba(30,138,94,0.1);
  --yellow: #7a5f08; --yellow-bg: rgba(122,95,8,0.1);
  --red: #a83535; --red-bg: rgba(168,53,53,0.1);
  --blue: #3d72b0; --blue-bg: rgba(61,114,176,0.1);
  --purple: #6248a8; --purple-bg: rgba(98,72,168,0.1);
  --orange: #8a5018; --orange-bg: rgba(138,80,24,0.1);
  --urgent: #6b1d1d; --urgent-bg: rgba(107,29,29,0.15);
  --font: 'Plus Jakarta Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}
.dark-mode {
  --bg: #12141a;
  --surface: #1c1f27;
  --surface2: #22262f;
  --surface3: #2a2e38;
  --border: #2e3340;
  --border-strong: #404759;
  --accent: #6a9bbd;
  --accent-hover: #83b2d0;
  --accent-light: rgba(106,155,189,0.15);
  --text: #e4e6ec;
  --text-muted: #909aba;
  --text-dim: #5a6278;
  --green: #3ab87e; --green-bg: rgba(58,184,126,0.12);
  --yellow: #c9a227; --yellow-bg: rgba(201,162,39,0.12);
  --red: #d96060; --red-bg: rgba(217,96,96,0.12);
  --blue: #5b91d4; --blue-bg: rgba(91,145,212,0.12);
  --purple: #9b7de0; --purple-bg: rgba(155,125,224,0.12);
  --orange: #d4843a; --orange-bg: rgba(212,132,58,0.12);
  --urgent: #e04545; --urgent-bg: rgba(224,69,69,0.18);
}
/* Theme-aware header backgrounds */
.dark-mode header { background: #242830; border-bottom-color: rgba(255,255,255,0.04); }
.dark-mode .notif-panel { border-color: var(--border); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); height: 100vh; height: 100dvh; overflow: hidden; font-size: 14px; -webkit-font-smoothing: antialiased; transition: background 0.2s, color 0.2s; padding-top: env(safe-area-inset-top); }

/* —— LOGIN —— */
#loginScreen {
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100vh; min-height: 100dvh; padding: 24px;
  padding-top: max(24px, 8vh);
  background: linear-gradient(145deg, #d8dade 0%, #e8e9eb 50%, #dfe0e3 100%);
  position: fixed; inset: 0; overflow: hidden;
}
.dark-mode #loginScreen {
  background: linear-gradient(145deg, #0e1016 0%, #12141a 50%, #14171f 100%);
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid #454b56;
  border-radius: 14px;
  padding: 40px 36px;
  width: 440px; max-width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  text-align: center;
}
.login-logo {
  width: 110px; height: 110px;
  border-radius: 50%;
  object-fit: contain;
  margin: 0 auto 20px;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}
.login-logo-shield {
  width: 90px; height: 90px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.18));
}
.login-logo-shield svg { width: 100%; height: 100%; }
.login-title {
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-agency {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.6;
}
.login-field {
  margin-bottom: 14px;
  text-align: left;
}
.login-field label {
  display: block; font-size: 11px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-muted); margin-bottom: 5px;
}
.login-field input {
  width: 100%; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--font); font-size: 13px;
  color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.login-btn {
  width: 100%; padding: 11px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .15s; margin-top: 4px;
  letter-spacing: 0.01em;
}
.login-btn:hover { background: var(--accent-hover); }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-error {
  background: var(--red-bg); border: 1px solid rgba(168,53,53,0.3);
  color: var(--red); border-radius: 5px; padding: 8px 10px;
  font-size: 12px; margin-top: 10px; display: none; text-align: left;
}
.login-note {
  font-size: 11px; color: var(--text-dim);
  margin-top: 14px; line-height: 1.5;
}
.loading-spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* —— APP CHROME —— */
#appShell { display: none; height: 100%; overflow: hidden; flex-direction: column; }
header {
  background: #242830; border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 10px 16px; display: flex; align-items: center;
  justify-content: space-between; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15); flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.header-logo {
  width: 36px; height: 36px; border-radius: 6px;
  object-fit: contain; flex-shrink: 0;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
  background: transparent;
}
.header-logo-shield {
  width: 40px; height: 40px; flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.25));
}
.header-logo-shield svg { width: 100%; height: 100%; }
.header-left h1 { font-family: 'Rajdhani', var(--font); font-size: 20px; font-weight: 700; letter-spacing: 0.01em; color: #ffffff; white-space: nowrap; }
.header-left p { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,0.55); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; gap: 7px; align-items: center; }
.version-tag {
  font-family: var(--mono); font-size: 10px; color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 6px; border-radius: 3px;
}
.user-badge {
  font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 8px; border-radius: 4px;
}
.user-badge .role { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: rgba(255,255,255,0.5); margin-left: 4px; }
/* —— NAV BAR —— */
.nav-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; display: flex; align-items: center; z-index: 99; flex-shrink: 0;
}
.nav-items {
  display: flex; align-items: center; flex: 1; overflow: visible;
}
.nav-item {
  padding: 10px 13px; font-size: 12px; font-weight: 600; font-family: var(--font);
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all .15s; margin-bottom: -1px; letter-spacing: 0.01em;
  white-space: nowrap; flex-shrink: 0;
}
.nav-item:hover { color: var(--text); }
.nav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-reports { margin-left: auto; }
.nav-caret { font-size: 9px; opacity: .6; margin-left: 2px; }
.nav-has-children { display: flex; align-items: center; gap: 1px; }
.nav-dropdown-wrap { position: relative; }
.nav-dropdown {
  display: none; position: absolute; top: calc(100% + 1px); left: 0; z-index: 300;
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
  box-shadow: 0 6px 20px rgba(0,0,0,.15); min-width: 170px; padding: 4px 0; overflow: hidden;
}
.nav-dropdown.open { display: block; }
.nav-dropdown-item {
  display: block; width: 100%; text-align: left; padding: 8px 16px;
  font-size: 12px; font-weight: 500; font-family: var(--font);
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  transition: background .1s; white-space: nowrap;
}
.nav-dropdown-item:hover { background: var(--surface2); color: var(--text); }
.nav-dropdown-item.active { color: var(--accent); }
.nav-coming-soon { opacity: .45; cursor: not-allowed !important; }
.nav-soon-tag {
  font-family: var(--mono); font-size: 9px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 4px;
  color: var(--text-dim); margin-left: 5px; vertical-align: middle;
}
/* Hamburger (mobile only) */
.nav-hamburger {
  display: none; background: none; border: none; font-size: 18px;
  color: var(--text-muted); cursor: pointer; padding: 10px 0 10px 0; margin-right: 8px;
}
/* Mobile overlay */
.mobile-nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 400;
}
.mobile-nav-overlay.open { display: block; }
.mobile-nav-menu {
  display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 260px;
  background: var(--surface); border-right: 1px solid var(--border);
  z-index: 500; padding: 0 0 24px; overflow-y: auto; flex-direction: column;
  box-shadow: 4px 0 20px rgba(0,0,0,.2);
}
.mobile-nav-menu.open { display: flex; }
.mobile-nav-header {
  padding: 16px 18px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-dim); border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.mobile-nav-item {
  display: block; width: 100%; text-align: left; padding: 10px 18px;
  font-size: 13px; font-weight: 500; font-family: var(--font);
  color: var(--text-muted); background: none; border: none; cursor: pointer;
}
.mobile-nav-item:hover { background: var(--surface2); color: var(--text); }
.mobile-nav-child { padding-left: 32px; font-size: 12px; }
.mobile-nav-soon { opacity: .4; cursor: not-allowed !important; }
.mobile-nav-group-label {
  padding: 10px 18px 3px; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim);
}
.tab-badge {
  display: inline-block; background: var(--red-bg); color: var(--red);
  font-family: var(--mono); font-size: 10px; padding: 1px 5px;
  border-radius: 10px; margin-left: 4px;
}
.stats-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 5px 16px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
  z-index: 98; flex-shrink: 0;
}
.stat { display: flex; flex-direction: column; gap: 0; }
.stat-value { font-family: var(--mono); font-size: 14px; font-weight: 500; line-height: 1.2; }
.stat-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.c-green { color: var(--green); } .c-yellow { color: var(--yellow); }
.c-red { color: var(--red); } .c-blue { color: var(--blue); }

/* —— LAYOUT —— */
.project-panel { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
.panel-toolbar {
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  display: flex; gap: 6px; align-items: center;
  background: var(--surface2); flex-wrap: wrap; flex-shrink: 0;
}
.filter-toggle { display: none; }
.filter-group { display: contents; }
.project-list { overflow-y: auto; flex: 1; }

/* —— INPUTS —— */
input[type=text], input[type=date], input[type=datetime-local], input[type=number], input[type=password] {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 5px 9px; font-family: var(--font);
  font-size: 13px; border-radius: 4px; outline: none;
}
input[type=text] { flex: 1; }
input[type=text]::placeholder, input[type=number]::placeholder, input[type=password]::placeholder { color: var(--text-dim); }
input[type=text]:focus, input[type=date]:focus, input[type=datetime-local]:focus, input[type=number]:focus, input[type=password]:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
select {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 5px 7px; font-family: var(--font);
  font-size: 12px; border-radius: 4px; outline: none; cursor: pointer;
}
select:focus { border-color: var(--accent); }
textarea {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 7px 9px; font-family: var(--font);
  font-size: 13px; border-radius: 4px; outline: none;
  resize: vertical; width: 100%; line-height: 1.6;
}
textarea:focus { border-color: var(--accent); }

/* —— BUTTONS —— */
.btn {
  padding: 5px 12px; font-family: var(--font); font-size: 13px;
  font-weight: 600; border: none; border-radius: 4px;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface3); }
.btn-danger { background: transparent; border: 1px solid var(--border); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); border-color: var(--red); }
.btn-sm { padding: 3px 8px; font-size: 12px; }
.btn-xs { padding: 2px 6px; font-size: 11px; }

/* —— PROJECT ITEMS —— */
.project-item {
  padding: 10px 13px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
  display: grid; grid-template-columns: 1fr auto;
  gap: 7px; align-items: start; background: var(--surface);
}
.project-item:hover { background: var(--surface2); }
.project-item.stale { border-left: 3px solid var(--yellow); padding-left: 10px; }
.project-name { font-weight: 600; font-size: 13px; line-height: 1.4; }
.project-meta { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; align-items: center; }

/* —— BADGES —— */
.badge {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; font-weight: 500;
}
.b-staging { background: var(--surface2); color: var(--text-muted); }
.b-planning { background: var(--purple-bg); color: var(--purple); }
.b-active { background: var(--blue-bg); color: var(--blue); }
.b-onhold { background: var(--yellow-bg); color: var(--yellow); }
.b-monitoring { background: var(--blue-bg); color: #5a8ec8; }
.b-complete { background: var(--green-bg); color: var(--green); }
.b-cancelled { background: var(--red-bg); color: var(--red); }
.b-blocked { background: var(--red-bg); color: var(--red); }
.b-cat { background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border); }
.b-needsupdate { background: var(--orange-bg); color: var(--orange); }
.b-red { background: var(--red-bg); color: var(--red); }
.b-yellow { background: var(--yellow-bg); color: var(--yellow); }
.b-urgent { background: var(--urgent-bg); color: var(--urgent); font-weight: 700; }
.indicator-row { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pill { font-family: var(--mono); font-size: 10px; white-space: nowrap; }
.pill.ov { color: var(--red); } .pill.fu { color: var(--orange); }
.pill.op { color: var(--text-muted); } .pill.stale { color: var(--yellow); }
.proj-age { font-family: var(--mono); font-size: 10px; color: var(--text-dim); background: var(--surface2); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.proj-age-mid { color: var(--yellow); background: var(--yellow-bg); }
.proj-age-old { color: var(--orange, #b06318); background: rgba(176,99,24,0.1); }

/* —— PROJECT PAGE —— */
.proj-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; gap: 12px; }
.proj-page-title { font-size: 18px; font-weight: 700; line-height: 1.4; flex: 1; }
.proj-page-back { font-size: 13px; color: var(--accent); cursor: pointer; background: none; border: none; font-family: var(--font); font-weight: 600; padding: 0; margin-bottom: 12px; display: inline-block; }
.proj-page-back:hover { text-decoration: underline; }
.proj-page-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }

/* Collapsible sections */
.collapsible-section { border: 1px solid var(--border); border-radius: 6px; margin-top: 12px; overflow: hidden; }
.collapsible-header { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 10px 14px; font-family: var(--mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--surface2); border: none; cursor: pointer; transition: background .1s; }
.collapsible-header:hover { background: var(--surface3); }
.collapsible-arrow { font-size: 12px; color: var(--text-dim); transition: transform .15s; }
.collapsible-body { padding: 14px; }
.detail-title { font-size: 15px; font-weight: 700; line-height: 1.4; flex: 1; margin-right: 9px; }
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 11px; }
.section-label {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--text-muted); margin-bottom: 6px; margin-top: 13px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.field-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); }
.field-value { font-size: 13px; background: var(--bg); border: 1px solid var(--border); padding: 5px 8px; border-radius: 4px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 11px 0; }
.add-row { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.last-updated { font-family: var(--mono); font-size: 11px; color: var(--text-dim); margin-top: 10px; }
.last-updated.stale { color: var(--yellow); }

/* Activity log */
.activity-log { display: flex; flex-direction: column; gap: 1px; max-height: 240px; overflow-y: auto; }
.activity-item { display: flex; gap: 6px; align-items: flex-start; padding: 4px 0; font-size: 11px; line-height: 1.4; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 10px; color: var(--text-dim); flex-shrink: 0; width: 14px; text-align: center; margin-top: 1px; }
.activity-body { flex: 1; min-width: 0; }
.activity-label { font-weight: 600; color: var(--text-muted); }
.activity-detail { color: var(--text-dim); }
.activity-meta { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-left: 4px; }
.notes-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 9px 10px; font-size: 13px; line-height: 1.7; color: var(--text);
  min-height: 60px; cursor: text; white-space: pre-wrap; word-break: break-word;
  outline: none; font-family: var(--font);
}
.notes-box:focus { border-color: var(--accent); }
.notes-box:empty:before { content: 'Click to add notes...'; color: var(--text-dim); }
.desc-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 9px 10px; font-size: 13px; line-height: 1.7; color: var(--text);
  min-height: 48px; cursor: text; white-space: pre-wrap; word-break: break-word;
  outline: none; font-family: var(--font);
}
.desc-box:focus { border-color: var(--accent); }
.desc-box:empty:before { content: 'Click to add a description...'; color: var(--text-dim); }

/* —— ACTIONS —— */
.action-list { display: flex; flex-direction: column; gap: 4px; }
.action-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 8px; display: grid; grid-template-columns: auto 1fr auto;
  gap: 6px; align-items: start;
}
.action-item.done { opacity: .4; }
.action-item.done .action-text { text-decoration: line-through; color: var(--text-muted); }
.action-item.overdue { border-left: 3px solid var(--red); }
.action-item.due-today { border-left: 3px solid var(--orange); background: var(--orange-bg); }
.action-item.due-week { background: var(--yellow-bg); border-left: 3px solid var(--yellow); }
.action-text { font-size: 13px; line-height: 1.4; }
.action-due { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.action-due.ov { color: var(--red); }
.action-meta-col { display: flex; flex-direction: column; gap: 2px; }
input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--green); cursor: pointer; margin-top: 2px; flex-shrink: 0; }

/* —— DEPS —— */
.dep-list { display: flex; flex-direction: column; gap: 4px; }
.dep-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 6px 9px; display: flex; justify-content: space-between; align-items: center; gap: 6px;
}
.dep-item.blocking { border-left: 3px solid var(--red); }
.dep-item.satisfied { opacity: .5; }
.dep-name { font-size: 13px; flex: 1; }
.dep-selector { display: flex; gap: 6px; margin-top: 6px; }
.dep-selector select { flex: 1; }

/* —— FOLLOW-UPS —— */
.followup-item { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 7px 9px; margin-bottom: 4px; }
.followup-item.needs { border-left: 3px solid var(--orange); }
.followup-item.resolved { opacity: .4; }
.followup-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; }
.followup-text { font-size: 13px; line-height: 1.4; flex: 1; }
.followup-text.res { text-decoration: line-through; color: var(--text-muted); }
.followup-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.followup-meta.needs { color: var(--orange); font-weight: 500; }
.followup-btns { display: flex; gap: 3px; flex-shrink: 0; }
.add-followup-area { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }

/* —— FULL VIEWS —— */
.full-view { padding: 6px 24px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.full-view h2 { font-size: 16px; font-weight: 700; margin: 4px 0 12px; }
.full-view h3 { margin-top: 4px; }
.full-view > :first-child { margin-top: 0; }
.fu-group-label {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 7px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
.archive-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 11px 14px; margin-bottom: 7px; display: grid;
  grid-template-columns: 1fr auto; gap: 10px; align-items: start;
  opacity: .75; transition: opacity .15s;
}
.archive-item:hover { opacity: 1; }

/* —— TASKS —— */
.task-add-form { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px; margin-bottom: 18px; }
.task-add-form textarea { width: 100%; font-family: var(--font); font-size: 13px; color: var(--text); background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 8px 10px; resize: vertical; min-height: 56px; box-sizing: border-box; }
.task-add-form textarea:focus { outline: none; border-color: var(--accent); }
.task-add-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; flex-wrap: wrap; }
.task-add-row select { font-size: 12px; padding: 5px 8px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-family: var(--font); }
.task-section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 0 0 8px; }
.task-item { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 10px 12px; margin-bottom: 7px; display: flex; gap: 10px; align-items: flex-start; transition: opacity .2s; }
.task-item.done { opacity: .55; }
.task-item-check { margin-top: 2px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.task-item-body { flex: 1; min-width: 0; }
.task-item-text { font-size: 13px; color: var(--text); line-height: 1.45; word-break: break-word; }
.task-item-text.done { text-decoration: line-through; color: var(--text-dim); }
.task-item-notes { font-size: 12px; color: var(--text-muted); margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.task-item-meta { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; align-items: center; }
.task-delete { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; padding: 0 2px; line-height: 1; flex-shrink: 0; }
.task-delete:hover { color: var(--red); }
.task-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.task-filters select { font-size: 12px; padding: 5px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); font-family: var(--font); }
.tasks-empty { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 13px; }
.task-item-edit { font-size: 11px; color: var(--accent); cursor: pointer; background: none; border: none; padding: 0; font-family: var(--font); margin-left: 4px; }
/* Task scope tabs */
.task-scope-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.task-scope-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 7px 14px; font-size: 13px; font-family: var(--font); color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all .15s; }
.task-scope-btn:hover { border-color: var(--accent); color: var(--text); }
.task-scope-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.task-scope-btn.active .tab-badge { background: rgba(255,255,255,0.3); color: #fff; }
.task-global-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--blue-bg,rgba(61,114,176,0.12)); color: var(--blue); border-radius: 3px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
/* Notification bell */
.notif-wrap { position: relative; }
.notif-bell { background: none; border: none; font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: 6px; position: relative; line-height: 1; color: rgba(255,255,255,0.45); transition: color .15s; }
.notif-bell:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }
.notif-badge { position: absolute; top: 0; right: 0; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 8px; padding: 1px 4px; min-width: 16px; text-align: center; line-height: 1.4; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 320px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 200; display: none; }
.notif-panel.open { display: block; }
.notif-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); }
.notif-item { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .1s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-item.unread { background: var(--blue-bg, rgba(61,114,176,0.07)); border-left: 3px solid var(--accent); }
.notif-msg { font-size: 13px; color: var(--text); line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; font-family: var(--mono); }
.task-item-edit:hover { text-decoration: underline; }

/* Task checklist items */
.task-checklist { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.task-cl-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 12px; }
.task-cl-item input[type=checkbox] { width: 12px; height: 12px; margin: 0; flex-shrink: 0; }
.task-cl-text { flex: 1; color: var(--text); line-height: 1.3; }
.task-cl-text.done { text-decoration: line-through; color: var(--text-dim); }
.task-cl-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 11px; padding: 0 2px; line-height: 1; opacity: 0; transition: opacity .15s; }
.task-cl-item:hover .task-cl-remove { opacity: 1; }
.task-cl-remove:hover { color: var(--red); }
.task-cl-add { margin-top: 4px; }
.task-cl-input { font-size: 11px; padding: 3px 6px; border: 1px dashed var(--border); border-radius: 3px; background: transparent; color: var(--text); width: 100%; outline: none; }
.task-cl-input:focus { border-style: solid; border-color: var(--accent); }
.task-cl-input::placeholder { color: var(--text-dim); }
.dashboard { padding: 6px 24px 20px; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
#dashboardContent { display: flex; flex-direction: column; flex: 1; }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.dash-card.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.dash-card.accent .dash-label { color: rgba(255,255,255,0.75); }
.dash-card.accent .dash-sublabel { color: rgba(255,255,255,0.6); }
.dash-number { font-family: var(--mono); font-size: 32px; font-weight: 500; line-height: 1; margin-bottom: 4px; }
.dash-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.dash-sublabel { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.dash-number.red { color: var(--red); } .dash-number.yellow { color: var(--yellow); } .dash-number.green { color: var(--green); }
.dash-section { }
.dash-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
  margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.dash-row-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.priority-list { display: flex; flex-direction: column; gap: 6px; }
.priority-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; display: flex; justify-content: space-between;
  align-items: center; gap: 10px; cursor: pointer; transition: background .1s;
}
.priority-item:hover { background: var(--surface2); }
.priority-item.high-pri { border-left: 3px solid var(--red); }
.priority-item-name { font-size: 13px; font-weight: 600; flex: 1; }
.priority-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.alert-list { display: flex; flex-direction: column; gap: 6px; }
.alert-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 12px; font-size: 13px;
  display: flex; align-items: flex-start; gap: 8px;
  transition: background .15s;
}
.alert-item.clickable { cursor: pointer; }
.alert-item.clickable:hover { background: var(--surface2) !important; }
.alert-item.red-alert { border-left: 3px solid var(--red); }
.alert-item.yellow-alert { border-left: 3px solid var(--yellow); }
.alert-item.orange-alert { border-left: 3px solid var(--orange); }
.alert-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-text { flex: 1; line-height: 1.4; }
.alert-text strong { font-weight: 600; }
.alert-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-family: var(--mono); }
.dept-breakdown { display: flex; flex-direction: column; gap: 5px; }
.dept-bar-row { display: flex; align-items: center; gap: 8px; }
.dept-name { font-size: 12px; color: var(--text-muted); width: 180px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dept-bar-wrap { flex: 1; background: var(--surface3); border-radius: 3px; height: 8px; overflow: hidden; }
.dept-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.dept-count { font-family: var(--mono); font-size: 11px; color: var(--text-muted); width: 20px; text-align: right; }

/* —— HOMEPAGE (v1.20) —— */
.home-greeting { background: var(--surface); border-radius: 8px; padding: 22px 28px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.home-greeting-left { }
.home-greeting-right { text-align: right; }
.home-greeting-title { font-size: 22px; font-weight: 500; margin-bottom: 2px; }
.home-greeting-sub { font-size: 13px; color: var(--text-muted); }
.home-greeting-date { font-size: 17px; font-weight: 500; color: var(--text); }
.home-card-divider { height: 1px; background: var(--border); margin: 14px 0; }
.home-banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.home-banner { border-radius: 6px; padding: 12px 18px; display: flex; align-items: center; gap: 12px; font-size: 13px; }
.home-banner-icon { font-size: 16px; flex-shrink: 0; }
.home-banner-critical { background: var(--red-bg); color: var(--red); }
.home-banner-important { background: var(--yellow-bg); color: var(--yellow); }
.home-banner-info { background: var(--accent-light); color: var(--accent); }
.home-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.home-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px 24px; }
.home-card-compact { padding: 14px 24px; }
.home-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; margin-bottom: 12px; }
.home-oncall-highlight { border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.home-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 13px; color: var(--accent); }
.home-att-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 6px; cursor: pointer; transition: opacity .15s; }
.home-att-row:hover { opacity: .85; }
.home-att-row + .home-att-row { margin-top: 6px; }
.home-att-danger { background: var(--red-bg); color: var(--red); }
.home-att-warning { background: var(--yellow-bg); color: var(--yellow); }
.home-att-clear { background: var(--green-bg, #eaf3de); color: var(--green); cursor: default; }
.home-att-count { font-size: 15px; font-weight: 500; }
.home-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 999px; font-size: 12px; cursor: pointer; transition: opacity .15s; }
.home-pill:hover { opacity: .8; }
.home-pill-danger { background: var(--red-bg); color: var(--red); }
.home-pill-warning { background: var(--yellow-bg); color: var(--yellow); }
.home-pill-info { background: var(--accent-light); color: var(--accent); }
.home-pill-clear { background: var(--green-bg, #eaf3de); color: var(--green); cursor: default; }
.home-pill-detail { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.home-pill-detail.open { max-height: 400px; }
.home-pill-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; margin-top: 6px; background: var(--surface2); border-radius: 6px; font-size: 12px; cursor: pointer; }
.home-pill-item:hover { background: var(--surface3); }
.home-divider { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-top: 8px; border-top: 1px solid var(--border); }
.home-divider span { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.home-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.home-checklist-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.home-checklist-row + .home-checklist-row { border-top: 1px solid var(--border); }
.home-tag { font-size: 10px; padding: 2px 8px; background: var(--surface2); border-radius: 4px; color: var(--text-muted); }
.home-tag-danger { background: var(--red-bg); color: var(--red); }
.home-tag-warning { background: var(--yellow-bg); color: var(--yellow); }
.home-tag-default { background: var(--surface2); color: var(--text-muted); }
.home-pulse { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.home-pulse-tile { background: var(--surface); border-radius: 6px; padding: 16px 18px; cursor: pointer; transition: border-color .15s; border: 1px solid transparent; }
.home-pulse-tile:hover { border-color: var(--accent); }
.home-pulse-num { font-size: 22px; font-weight: 500; font-family: var(--mono); }
.home-pulse-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.home-quicklinks { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.home-qlink { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; text-decoration: none; color: var(--text); transition: border-color .15s; flex: 1; min-width: 140px; max-width: 220px; }
.home-qlink:hover { border-color: var(--accent); }
.home-qlink-icon { font-size: 18px; flex-shrink: 0; }
.home-qlink-label { font-size: 12px; font-weight: 500; }
.home-footer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 0; margin-top: auto; padding-top: 40px; padding-bottom: 8px; font-size: 11px; color: var(--text-dim); font-family: var(--mono); letter-spacing: .02em; }
.home-footer::before, .home-footer::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.home-footer-inner { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 0 16px; }

.app-footer { flex-shrink: 0; text-align: center; padding: 4px 16px; font-size: 10px; font-family: var(--mono); color: var(--text-dim); letter-spacing: .02em; border-top: 1px solid var(--border); background: var(--surface); }

/* —— REPORTS (v1.20.2) —— */
.report-section { margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.report-section:last-child { border-bottom: none; }
.report-title { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.report-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.report-select { padding: 6px 10px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: var(--font); }
.rpt-header { font-size: 16px; font-weight: 500; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.rpt-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.rpt-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; text-align: center; }
.rpt-stat-num { font-size: 22px; font-weight: 500; font-family: var(--mono); }
.rpt-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.rpt-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin: 14px 0 6px; }
.rpt-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-bottom: 1px solid var(--border); gap: 8px; }
.rpt-row:hover { background: var(--surface); }
.rpt-detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 16px; font-size: 12px; color: var(--text-muted); padding: 8px 10px; background: var(--surface); border-radius: 6px; }
.rpt-detail-grid strong { color: var(--text); }
.rpt-agency-group { margin-bottom: 16px; }
.rpt-agency-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px 6px 0 0; border-bottom: 2px solid var(--accent); }

/* —— SETTINGS —— */
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 14px; }
.settings-section h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin-bottom: 11px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.tag-item { display: flex; align-items: center; gap: 5px; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 4px 9px; font-size: 12px; }
.tag-remove { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.tag-remove:hover { color: var(--red); }
.add-tag-row { display: flex; gap: 7px; }
.settings-info { font-size: 12px; color: var(--text-muted); background: var(--surface2); border-radius: 4px; padding: 8px 10px; line-height: 1.5; margin-top: 10px; }

/* —— MODAL —— */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 20px; width: 520px; max-width: 95vw; box-shadow: 0 8px 32px rgba(0,0,0,0.15); max-height: 90vh; overflow-y: auto; }
.modal h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 7px; margin-top: 16px; }
.form-group { margin-bottom: 10px; }
.form-group label { display: block; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* —— BLOCKERS —— */
.blocker-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 7px 9px; margin-bottom: 4px;
}
.blocker-item.open { border-left: 3px solid var(--red); }
.blocker-item.resolved { opacity: .45; }
.blocker-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; }
.blocker-text { font-size: 13px; line-height: 1.4; flex: 1; }
.blocker-text.res { text-decoration: line-through; color: var(--text-muted); }
.blocker-meta { font-family: var(--mono); font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.blocker-btns { display: flex; gap: 3px; flex-shrink: 0; }
.add-blocker-area { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }
.blocker-type-tag { font-family: var(--mono); font-size: 10px; background: var(--red-bg); color: var(--red); padding: 1px 5px; border-radius: 3px; }
.blocker-type-tag.resolved { background: var(--surface3); color: var(--text-dim); }

/* —— COMMENTS —— */
.comment-thread { display: flex; flex-direction: column; gap: 6px; }
.comment-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 7px 9px;
}
.comment-body { font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.comment-meta { font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-top: 4px; display: flex; justify-content: space-between; align-items: center; }
.comment-author { color: var(--text-muted); font-weight: 500; }
.add-comment-area { margin-top: 7px; display: flex; flex-direction: column; gap: 5px; }

/* —— AVATAR DROPDOWN —— */
.avatar-wrap { position: relative; }
.avatar-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: #454b56; color: #fff;
  font-size: 16px; font-weight: 700; font-family: 'Rajdhani', var(--mono);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; user-select: none;
  border: 2px solid transparent; transition: border-color .15s;
}
.avatar-circle:hover { border-color: rgba(255,255,255,.35); }
.avatar-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; min-width: 210px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  z-index: 300; overflow: hidden;
}
.avatar-dropdown.open { display: block; }
.avatar-dd-header {
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.avatar-dd-name { font-size: 13px; font-weight: 600; color: var(--text); }
.avatar-dd-role { font-size: 11px; font-family: var(--mono); color: var(--text-muted); margin-top: 2px; }
.avatar-dd-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; font-size: 13px; color: var(--text);
  cursor: pointer; transition: background .1s; border: none;
  background: none; width: 100%; text-align: left;
}
.avatar-dd-item:hover { background: var(--surface2); }
.avatar-dd-item.danger { color: var(--red); }
.avatar-dd-item .dd-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.avatar-dd-divider { height: 1px; background: var(--border); margin: 3px 0; }
.avatar-dd-select { padding: 3px 6px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px; color: var(--text); flex: 1; }

/* —— GLOBAL SEARCH —— */
.global-search-wrap { position: relative; flex: 1; max-width: 280px; margin: 0 8px; }
.global-search-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1); border-radius: 6px;
  cursor: text; transition: all .15s;
}
.global-search-bar:focus-within {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 2px rgba(58,125,92,0.25);
}
.gs-icon { font-size: 12px; opacity: 0.55; flex-shrink: 0; }
.global-search-bar input {
  flex: 1; background: none; border: none; outline: none;
  font-family: var(--font); font-size: 12px; color: rgba(255,255,255,0.85);
  padding: 0; min-width: 0;
}
.global-search-bar input::placeholder { color: rgba(255,255,255,0.4); }
.gs-kbd {
  font-family: var(--mono); font-size: 9px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 3px; padding: 1px 5px; color: rgba(255,255,255,0.4);
  flex-shrink: 0; line-height: 1.4;
}
.global-search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  min-width: 360px; max-height: 400px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  z-index: 500;
}
.global-search-results.open { display: block; }
.gs-group-label {
  padding: 8px 12px 4px; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim);
}
.gs-item {
  padding: 7px 12px; cursor: pointer; transition: background .1s;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.gs-item:hover { background: var(--surface2); }
.gs-item-name { font-size: 12px; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-item-name mark { background: rgba(58,125,92,0.2); color: inherit; border-radius: 2px; padding: 0 1px; }
.gs-item-badge {
  font-family: var(--mono); font-size: 9px; padding: 1px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .03em; flex-shrink: 0;
}
.gs-b-project { background: var(--blue-bg); color: var(--blue); }
.gs-b-contact { background: var(--purple-bg); color: var(--purple); }
.gs-b-vendor { background: var(--orange-bg); color: var(--orange); }
.gs-b-agency { background: var(--green-bg); color: var(--green); }
.gs-b-contract { background: var(--green-bg); color: var(--green); }
.gs-b-purchase { background: var(--yellow-bg); color: var(--yellow); }
.gs-b-saas { background: var(--blue-bg); color: var(--blue); }
.gs-b-meeting { background: var(--purple-bg); color: var(--purple); }
.gs-b-task { background: var(--yellow-bg); color: var(--yellow); }
.gs-b-calendar { background: var(--green-bg); color: var(--green); }
.gs-hint {
  padding: 6px 12px; font-size: 10px; color: var(--text-dim);
  border-top: 1px solid var(--border); font-family: var(--mono);
}
.gs-empty { padding: 20px 12px; text-align: center; color: var(--text-dim); font-size: 12px; }

/* —— MISC —— */
.sync-indicator { font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,0.4); }
.sync-indicator.syncing { color: rgba(255,255,255,0.6); }
.sync-indicator.error { color: #d96060; }
.view { display: none; } .view.active { display: flex; flex: 1; flex-direction: column; overflow: hidden; min-height: 0; }
#projectsView.active { display: grid; }
.scrollbar-thin::-webkit-scrollbar { width: 4px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.empty-state { text-align: center; padding: 14px 0; color: var(--text-dim); font-size: 13px; }
a { color: var(--accent); }

/* —— PURCHASES —— */
.purchase-form { margin-bottom: 20px; }
.purchase-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
.purchase-table thead tr { border-bottom: 2px solid var(--border); }
.purchase-table th { padding: 8px 10px; text-align: left; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-family: var(--mono); white-space: nowrap; }
.purchase-row { border-bottom: 1px solid var(--border); transition: background .1s; }
.purchase-row:hover { background: var(--surface2); }
.purchase-row.received { opacity: .6; }
.pc { padding: 9px 10px; vertical-align: top; color: var(--text); }
.pc.vendor { font-weight: 600; white-space: nowrap; }
.pc.amt { font-family: var(--mono); white-space: nowrap; }
.pc.po { color: var(--text-muted); }
.pc.dt { font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--text-muted); }
.pc.status-col { white-space: nowrap; }

/* —— RESPONSIVE — Tablet (≤1024px) —— */
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr 340px; }
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-row-grid { grid-template-columns: 1fr; }
  .dept-name { width: 140px; }
  .stats-bar { gap: 12px; padding: 4px 12px; }
  .stat-value { font-size: 13px; }
  .global-search-wrap { max-width: 220px; }
}

/* —— RESPONSIVE — Mobile (≤768px) —— */
@media (max-width: 768px) {
  .header-left p { display: none; }
  .header-left h1 { font-size: 12px; }
  .header-logo { width: 28px; height: 28px; }
  header { padding: 8px 12px; }
  .header-right .btn { font-size: 11px; padding: 4px 8px; }
  .nav-hamburger { display: block; }
  .nav-items { display: none; }
  .global-search-wrap { max-width: 160px; margin: 0 4px; }
  .gs-kbd { display: none; }
  .global-search-results { min-width: 280px; right: -40px; left: auto; }
  .stats-bar { gap: 10px; padding: 4px 12px; }
  .stat-value { font-size: 12px; }
  .stat-label { font-size: 8px; }
  .panel-toolbar { padding: 8px; gap: 4px; }
  .panel-toolbar input[type=text] { font-size: 14px; padding: 8px; flex: 1; }
  .panel-toolbar select { font-size: 11px; padding: 4px 6px; }
  .filter-toggle { display: inline-block; flex-shrink: 0; }
  .filter-group { display: none; width: 100%; gap: 4px; flex-wrap: wrap; }
  .filter-group.open { display: flex; }
  .filter-group select { flex: 1; min-width: 45%; }
  .project-item { padding: 12px; min-height: 48px; }
  .field-row-3, .field-row-4 { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .proj-page-title { font-size: 16px; }
  .dashboard { padding: 14px 12px; }
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-number { font-size: 26px; }
  .dash-card { padding: 12px; }
  .dash-row-grid { grid-template-columns: 1fr; }
  .home-row-2 { grid-template-columns: 1fr; }
  .home-pulse { grid-template-columns: 1fr 1fr; }
  .rpt-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .rpt-detail-grid { grid-template-columns: 1fr 1fr; }
  .dept-name { width: 120px; font-size: 11px; }
  .full-view { padding: 4px 12px 14px; }
  .modal { width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; margin: 0; }
  .modal-overlay.open { align-items: stretch; }
  .form-row { grid-template-columns: 1fr; }
  .task-add-row { flex-direction: column; align-items: stretch; }
  .task-add-row select { width: 100%; }
}

/* —— RESPONSIVE — Small phone (≤430px) —— */
@media (max-width: 430px) {
  .dash-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
  .login-logo { width: 80px; height: 80px; }
  .login-title { font-size: 17px; }
  .version-tag { display: none; }
  .header-right .sync-indicator { display: none; }
}

/* —— PURCHASES TAB —— */
.purchase-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.purchase-table th { padding: 7px 10px; text-align: left; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.purchase-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.purchase-row:hover td { background: var(--surface2); }
.purchase-row.p-received td { color: var(--text-muted); }
.purchase-row.p-archived td { opacity: .5; font-style: italic; }

/* —— CONTACTS TAB —— */
.contact-list { display: flex; flex-direction: column; gap: 8px; }
.contact-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; transition: border-color .15s; }
.contact-item:hover { border-color: var(--blue); }
.contact-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.contact-body { flex: 1; min-width: 0; }
.contact-name { font-size: 14px; font-weight: 600; color: var(--text); }
.contact-org { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.contact-details { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.contact-note { font-style: italic; color: var(--text-dim); }
.contact-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* —— ORGANIZATION DIRECTORY —— */
.dir-division-chip { display: inline-block; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; font-size: 11px; color: var(--text-muted); font-family: var(--mono); }
.dir-role-chip { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 1px 8px; font-size: 10px; font-family: var(--mono); color: var(--text-muted); text-transform: capitalize; margin-right: 4px; }

/* —— MEETINGS TAB —— */
.minute-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; }
.minute-card:hover { border-color: var(--blue-muted, var(--blue)); }
.minute-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 8px; }
.minute-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.minute-card-meta { font-size: 11px; color: var(--text-muted); font-family: var(--mono); margin-top: 2px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.minute-section-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-family: var(--mono); margin: 8px 0 3px; }
.minute-body { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }
.minute-attendees { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.attendee-chip-display { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 10px; font-size: 12px; color: var(--text-muted); }

/* Attendee input */
.attendee-input-wrap { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1px solid var(--border); border-radius: 6px; padding: 5px 8px; background: var(--bg); min-height: 38px; cursor: text; }
.attendee-input-wrap:focus-within { border-color: var(--blue); }
.attendee-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--blue); color: #fff; border-radius: 12px; padding: 2px 8px 2px 10px; font-size: 12px; }
.attendee-chip button { background: none; border: none; color: rgba(255,255,255,.8); cursor: pointer; font-size: 14px; padding: 0; line-height: 1; }
.attendee-chip button:hover { color: #fff; }
.attendee-input-wrap input { border: none; background: none; outline: none; font-size: 13px; color: var(--text); min-width: 120px; flex: 1; padding: 0; }
.attendee-dropdown { position: absolute; z-index: 200; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.15); min-width: 280px; max-height: 240px; overflow-y: auto; margin-top: 2px; }
.attendee-dd-item { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.attendee-dd-item:hover { background: var(--surface2); }
.attendee-dd-add { border-top: 1px solid var(--border); color: var(--blue); }

/* —— CALENDAR MODULE —— */
.cal-layout { display: grid; grid-template-columns: 1fr 220px; flex: 1; min-height: 0; }
.cal-main { display: flex; flex-direction: column; overflow: hidden; }
.cal-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-month-label { font-size: 15px; font-weight: 700; min-width: 160px; text-align: center; }
.cal-view-toggle { display: flex; gap: 4px; }

.cal-day-headers { display: grid; grid-template-columns: repeat(7, 1fr); position: sticky; top: 0; z-index: 1; }
.cal-day-header { padding: 6px 4px; text-align: center; font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--surface2); }
.cal-weeks-wrap { flex: 1; overflow-y: auto; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 80px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 4px; overflow: hidden; transition: background .1s; }
.cal-cell:hover { background: var(--surface2); }
.cal-cell:nth-child(7n+7) { border-right: none; }
.cal-date { font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.cal-date.today { background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.cal-date.muted { color: var(--text-dim); }

.cal-event { font-size: 10px; padding: 2px 5px; border-radius: 3px; margin-bottom: 2px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; cursor: pointer; }

/* Sidebar */
.cal-sidebar { border-left: 1px solid var(--border); padding: 14px; background: var(--surface); overflow-y: auto; }
.cal-sidebar-title { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 12px; font-weight: 700; }
.cal-sidebar-rotation { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.cal-sidebar-rotation:last-of-type { border-bottom: none; }
.cal-sidebar-rot-name { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono); }
.cal-sidebar-rot-person { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 6px; }
.cal-sidebar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.cal-sidebar-rot-phone { font-family: var(--mono); font-size: 12px; color: var(--text-muted); margin-top: 2px; margin-left: 14px; }
.cal-sidebar-next { font-family: var(--mono); font-size: 11px; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 8px; }
.cal-override-tag { font-size: 9px; font-family: var(--mono); background: var(--yellow-bg); color: var(--yellow); padding: 1px 5px; border-radius: 3px; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* Agenda view */
.agenda-list { padding: 12px 16px; overflow-y: auto; flex: 1; }
.agenda-day { margin-bottom: 16px; }
.agenda-day.agenda-today { }
.agenda-day-header { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.agenda-today .agenda-day-header { color: var(--accent); border-bottom-color: var(--accent); }
.agenda-item { background: var(--surface); border: 1px solid var(--border); border-radius: 5px; padding: 8px 10px; margin-bottom: 5px; }
.agenda-item-title { font-size: 13px; font-weight: 600; color: var(--text); }
.agenda-item-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.agenda-item-actions { display: flex; gap: 4px; margin-top: 4px; }

/* Calendar responsive */
@media (max-width: 768px) {
  .cal-layout { grid-template-columns: 1fr; height: auto; }
  .cal-sidebar { border-left: none; border-top: 1px solid var(--border); }
  .cal-cell { min-height: 56px; }
  .cal-month-label { min-width: auto; font-size: 14px; }
}

/* ── Projects Dashboard ───────────────────────────────────────────── */
.pdb-wrap { padding: 6px 24px 0; }
.pdb-top { display: flex; gap: 20px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.pdb-chart-wrap { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.pdb-chart-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; }
.pdb-chart-legend { flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.pdb-top-metrics { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.pdb-att { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-muted); transition: background .15s; }
.pdb-att:hover { background: var(--surface2); }
.pdb-att-danger { border-left: 3px solid var(--red); }
.pdb-att-warning { border-left: 3px solid var(--yellow); }
.pdb-att-clear { border-left: 3px solid var(--green); }
.pdb-att-num { font-size: 18px; font-weight: 600; }
.pdb-att-danger .pdb-att-num { color: var(--red); }
.pdb-att-warning .pdb-att-num { color: var(--yellow); }
.pdb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 8px; }
.pdb-col { min-width: 0; }
.pdb-section-title { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.pdb-att-list { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pdb-att-row { display: flex; align-items: center; padding: 10px 16px; gap: 10px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .15s; }
.pdb-att-row:last-child { border-bottom: none; }
.pdb-att-row:hover { background: var(--surface2); }
.pdb-att-row-inner { flex: 1; min-width: 0; }
.pdb-att-row-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdb-att-row-issues { font-size: 12px; color: var(--text-muted); }
.pdb-pri { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--surface2); color: var(--text-muted); flex-shrink: 0; }
.pdb-pri-danger { background: var(--red-bg); color: var(--red); }
.pdb-pri-warning { background: var(--yellow-bg); color: var(--yellow); }
.pdb-empty { font-size: 13px; color: var(--text-dim); padding: 12px 16px; }
@media (max-width: 768px) { .pdb-two-col { grid-template-columns: 1fr; } .pdb-top { flex-direction: column; } }

/* ── Training Module ──────────────────────────────────────────────── */
.trn-section { margin-bottom: 16px; }
.trn-section-title { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 8px; }
.trn-empty { font-size: 13px; color: var(--text-dim); padding: 8px 0; }
.trn-type-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; }
.trn-type-info { flex: 1; min-width: 0; }
.trn-type-name { font-size: 14px; font-weight: 600; }
.trn-type-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.trn-person-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; overflow: hidden; }
.trn-person-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.trn-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.trn-cert-list { padding: 0; }
.trn-cert-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--border); }
.trn-cert-row:last-child { border-bottom: none; }
.trn-event-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; gap: 10px; }
.trn-event-info { flex: 1; min-width: 0; }
.trn-collapsible { display: none; }
.trn-expanded .trn-collapsible { display: block; }
.trn-expand-icon { font-size: 11px; color: var(--text-dim); transition: transform .15s; }
.trn-expanded .trn-expand-icon { transform: rotate(180deg); }
