/* ── Google Font ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Google+Sans:wght@400;500;700&family=Roboto:wght@400;500&display=swap');

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

:root {
  --navy:       #1B3A5C;
  --navy-light: #234b75;
  --teal:       #0891B2;
  --teal-light: #e0f2fe;
  --gold:       #E8A820;
  --bg:         #F1F5F9;
  --card:       #FFFFFF;
  --text:       #0F172A;
  --muted:      #64748B;
  --border:     #E2E8F0;
  --border-focus: #0891B2;
  --red:        #EF4444;
  --amber:      #F59E0B;
  --green:      #22C55E;
  --purple:     #8B5CF6;
  --pink:       #EC4899;
  --sidebar-w:  224px;
  --sidebar-w-collapsed: 64px;
  --app-chrome-h: 66px;
  /* Topbar — navy-adjacent chrome (pairs with sidebar #1B3A5C) */
  --topbar-bg:          #E8EEF4;
  --topbar-bg-deep:     #DEE6EF;
  --topbar-border:      rgba(27, 58, 92, 0.14);
  --topbar-surface:     #FFFFFF;
  --topbar-surface-border: rgba(27, 58, 92, 0.12);
  --topbar-hover:       rgba(27, 58, 92, 0.07);
  --topbar-shadow:      0 1px 0 rgba(27, 58, 92, 0.08), 0 2px 10px rgba(27, 58, 92, 0.05);
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14);

  /* Google Material content tokens (module pages) */
  --gc-blue:       #1a73e8;
  --gc-blue-hover: #1765cc;
  --gc-red:        #d93025;
  --gc-red-hover:  #c5221f;
  --gc-green:      #137333;
  --gc-border:     #dadce0;
  --gc-border-light: #f1f3f4;
  --gc-surface:    #ffffff;
  --gc-bg:         #f8f9fa;
  --gc-text:       #202124;
  --gc-text-secondary: #3c4043;
  --gc-muted:      #70757a;
}

body {
  font-family: 'Inter', Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overflow-y: auto;
}

html {
  scrollbar-gutter: stable;
  overflow-y: scroll;
}

/* Visible scrollbars in scrollable regions (all modules) */
.sidebar-nav,
.table-wrap,
.gc-modal-body,
.topbar-notif-dropdown,
.topbar-notif-list,
.topbar-notif-attention,
.calendar-sidebar,
.move-tree,
.upload-queue,
.admin-activity-log .table-wrap,
.fm-tree-body,
.fm-page .fm-list-wrap,
.fm-page .fm-grid-wrap,
.fm-page #viewList,
.fm-page #viewGrid,
.fm-page #fmDetailsBody,
.page-body:has(.home-dashboard) {
  scrollbar-width: thin;
  scrollbar-color: #9aa0a6 #f1f3f4;
}
.sidebar-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.gc-modal-body::-webkit-scrollbar,
.topbar-notif-dropdown::-webkit-scrollbar,
.topbar-notif-list::-webkit-scrollbar,
.topbar-notif-attention::-webkit-scrollbar,
.calendar-sidebar::-webkit-scrollbar,
.move-tree::-webkit-scrollbar,
.upload-queue::-webkit-scrollbar,
.admin-activity-log .table-wrap::-webkit-scrollbar,
.fm-tree-body::-webkit-scrollbar,
.fm-page .fm-list-wrap::-webkit-scrollbar,
.fm-page .fm-grid-wrap::-webkit-scrollbar,
.fm-page #viewList::-webkit-scrollbar,
.fm-page #viewGrid::-webkit-scrollbar,
.fm-page #fmDetailsBody::-webkit-scrollbar,
.page-body:has(.home-dashboard)::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.sidebar-nav::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.gc-modal-body::-webkit-scrollbar-track,
.topbar-notif-dropdown::-webkit-scrollbar-track,
.topbar-notif-list::-webkit-scrollbar-track,
.topbar-notif-attention::-webkit-scrollbar-track,
.calendar-sidebar::-webkit-scrollbar-track,
.move-tree::-webkit-scrollbar-track,
.upload-queue::-webkit-scrollbar-track,
.admin-activity-log .table-wrap::-webkit-scrollbar-track,
.fm-tree-body::-webkit-scrollbar-track,
.fm-page .fm-list-wrap::-webkit-scrollbar-track,
.fm-page .fm-grid-wrap::-webkit-scrollbar-track,
.fm-page #viewList::-webkit-scrollbar-track,
.fm-page #viewGrid::-webkit-scrollbar-track,
.fm-page #fmDetailsBody::-webkit-scrollbar-track,
.page-body:has(.home-dashboard)::-webkit-scrollbar-track {
  background: #f1f3f4;
}
.sidebar-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.gc-modal-body::-webkit-scrollbar-thumb,
.topbar-notif-dropdown::-webkit-scrollbar-thumb,
.topbar-notif-list::-webkit-scrollbar-thumb,
.topbar-notif-attention::-webkit-scrollbar-thumb,
.calendar-sidebar::-webkit-scrollbar-thumb,
.move-tree::-webkit-scrollbar-thumb,
.upload-queue::-webkit-scrollbar-thumb,
.admin-activity-log .table-wrap::-webkit-scrollbar-thumb,
.fm-tree-body::-webkit-scrollbar-thumb,
.fm-page .fm-list-wrap::-webkit-scrollbar-thumb,
.fm-page .fm-grid-wrap::-webkit-scrollbar-thumb,
.fm-page #viewList::-webkit-scrollbar-thumb,
.fm-page #viewGrid::-webkit-scrollbar-thumb,
.fm-page #fmDetailsBody::-webkit-scrollbar-thumb,
.page-body:has(.home-dashboard)::-webkit-scrollbar-thumb {
  background: #bdc1c6;
  border-radius: 8px;
  border: 2px solid #f1f3f4;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.gc-modal-body::-webkit-scrollbar-thumb:hover,
.topbar-notif-dropdown::-webkit-scrollbar-thumb:hover,
.topbar-notif-list::-webkit-scrollbar-thumb:hover,
.topbar-notif-attention::-webkit-scrollbar-thumb:hover,
.calendar-sidebar::-webkit-scrollbar-thumb:hover,
.move-tree::-webkit-scrollbar-thumb:hover,
.upload-queue::-webkit-scrollbar-thumb:hover,
.admin-activity-log .table-wrap::-webkit-scrollbar-thumb:hover,
.fm-tree-body::-webkit-scrollbar-thumb:hover,
.fm-page .fm-list-wrap::-webkit-scrollbar-thumb:hover,
.fm-page .fm-grid-wrap::-webkit-scrollbar-thumb:hover,
.fm-page #viewList::-webkit-scrollbar-thumb:hover,
.fm-page #viewGrid::-webkit-scrollbar-thumb:hover,
.fm-page #fmDetailsBody::-webkit-scrollbar-thumb:hover,
.page-body:has(.home-dashboard)::-webkit-scrollbar-thumb:hover {
  background: #9aa0a6;
}

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

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

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform .25s, width .2s ease;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--app-chrome-h);
  min-height: var(--app-chrome-h);
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  flex-shrink: 0;
  position: relative;
  box-sizing: border-box;
  --accent: var(--gold);
}
.sidebar-brand:hover,
.sidebar-brand:focus {
  text-decoration: none;
  background: rgba(255,255,255,.04);
}
.sidebar-brand.active {
  background: rgba(255,255,255,.08);
}
.sidebar-brand.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-brand-name {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .1px;
}
.sidebar-brand-sub {
  display: block;
  font-size: 10.5px;
  color: rgba(255,255,255,.3);
  margin-top: 1px;
}

/* ══════════════════════════════════════════════════════════════
   Sidebar nav — Material style, pill flush-left rounded-right,
   colore di accento diverso per ogni voce/sezione attiva.
   ══════════════════════════════════════════════════════════════ */
.sidebar-nav {
  flex: 1;
  padding: 8px 0 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-group { margin-bottom: 2px; }

.sidebar-section-title {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: rgba(255,255,255,.4);
  padding: 0 24px 6px 16px;
  margin-top: 14px;
}
.sidebar-group:first-of-type .sidebar-section-title,
.sidebar-group-toggle .sidebar-section-title { margin-top: 0; }

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 16px);
  margin: 14px 16px 6px 0;
  padding: 0 8px 0 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.sidebar-group-toggle .sidebar-section-title {
  padding: 0;
  margin: 0;
}
.sidebar-group-chevron {
  display: flex;
  color: rgba(255,255,255,.35);
  transition: transform .15s;
}
.sidebar-group-collapsible:not(.collapsed) .sidebar-group-chevron {
  transform: rotate(180deg);
}

.sidebar-empty-state {
  margin: 4px 16px 12px 0;
  padding: 12px 14px;
  border-radius: 0 12px 12px 0;
  background: rgba(255,255,255,.06);
  border-left: 3px solid rgba(255,255,255,.12);
}
.sidebar-empty-state p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255,255,255,.55);
}
.sidebar-empty-hint {
  margin-top: 6px !important;
  font-size: 11px !important;
  color: rgba(255,255,255,.38) !important;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 40px;
  padding: 0 14px 0 16px;
  margin: 0 16px 2px 0;
  border-radius: 0 20px 20px 0;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255,255,255,.78);
  transition: background .12s, color .12s;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  --accent: var(--teal);
}
.sidebar-link-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-link-badge {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #ea4335;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.sidebar-link[data-section="tasks"] .sidebar-link-badge,
.sidebar-link[data-section="polls"] .sidebar-link-badge,
.sidebar-link[data-section="calendar"] .sidebar-link-badge { background: var(--accent); }
.sidebar-link[data-section="notifications"] .sidebar-link-badge { background: #1a73e8; }
.sidebar-link:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
  text-decoration: none;
}
.sidebar-link.active {
  background: rgba(255,255,255,.13);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.sidebar-link.active .sidebar-link-icon { color: var(--accent); opacity: 1; }

/* Colore di accento per categoria — applicato sul link attivo della sezione */
.sidebar-link[data-section="home"]         { --accent: var(--gold); }
.sidebar-link[data-section="tasks"]        { --accent: var(--teal); }
.sidebar-link[data-section="polls"]        { --accent: var(--purple); }
.sidebar-link[data-section="planning"]     { --accent: #4fc3f7; }
.sidebar-link[data-section="calendar"]     { --accent: var(--amber); }
.sidebar-link[data-section="files"]        { --accent: var(--pink); }
.sidebar-link[data-section="notifications"] { --accent: #8ab4f8; }
.sidebar-link[data-section="users"]        { --accent: var(--green); }
.sidebar-link[data-section="groups"]       { --accent: #81c995; }
.sidebar-link[data-section="activity_log"] { --accent: var(--red); }
.sidebar-link[data-section="admin_tools"]  { --accent: #fdd663; }

.sidebar-link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  flex-shrink: 0;
  opacity: .85;
  color: inherit;
  transition: color .12s, opacity .12s;
}
.sidebar-link-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.sidebar-link:hover .sidebar-link-icon { opacity: 1; }

.sidebar-link-sub {
  padding-left: 22px;
  font-size: 12px;
  color: rgba(255,255,255,.38);
}
.sidebar-link-sub::before {
  content: '└';
  margin-right: 6px;
  color: rgba(255,255,255,.15);
  font-size: 13px;
}
.sidebar-link-sub:hover { color: rgba(255,255,255,.8); }
.sidebar-link-sub.active { background: rgba(255,255,255,.09); color: #fff; font-weight: 600; }

@media (min-width: 769px) {
  .sidebar-group-collapsible .sidebar-group-toggle {
    pointer-events: none;
    cursor: default;
  }
  .sidebar-group-collapsible.collapsed .sidebar-group-items {
    display: block;
  }
  .sidebar-group-chevron { display: none; }
}

@media (max-width: 768px) {
  .sidebar-group-collapsible.collapsed .sidebar-group-items {
    display: none;
  }
  .sidebar-group-toggle {
    pointer-events: auto;
    cursor: pointer;
  }
  .sidebar-group-chevron { display: flex; }
}

.sidebar-version {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom, 0));
  border-top: 1px solid rgba(255,255,255,.06);
  user-select: none;
}
.sidebar-version-num {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255,255,255,.38);
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.sidebar-version-updated {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(255,255,255,.22);
  letter-spacing: 0.2px;
  line-height: 1.2;
  text-align: center;
}
.sidebar-version-updated-label {
  display: block;
  font-size: 8.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,.18);
  margin-bottom: 2px;
}
.sidebar-version-updated time {
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.28);
}

/* Footer / user block (legacy — user moved to topbar) */
.sidebar-footer {
  padding: 12px 16px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,.15);
}
.sidebar-user-avatar-lg {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,.4);
  text-transform: capitalize;
  margin-top: 1px;
}
.sidebar-logout-form,
.topbar-logout-form {
  margin: 0;
  padding: 0;
}
.topbar-logout-form {
  display: block;
}
.topbar-logout-form .topbar-dropdown-item {
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  font: inherit;
}
.sidebar-logout-form .sidebar-logout {
  cursor: pointer;
  padding: 0;
}
.sidebar-logout {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.12);
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
  text-decoration: none;
}
.sidebar-logout:hover {
  background: rgba(239,68,68,.25);
  border-color: rgba(239,68,68,.4);
  color: #FCA5A5;
  text-decoration: none;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  transition: margin-left .2s ease;
}

.topbar {
  background: linear-gradient(180deg, var(--topbar-bg) 0%, var(--topbar-bg-deep) 100%);
  border-bottom: 1px solid var(--topbar-border);
  padding: 0 28px;
  height: var(--app-chrome-h);
  min-height: var(--app-chrome-h);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--topbar-shadow);
}
.topbar-title {
  display: none;
}
.topbar-actions { display: flex; gap: 14px; align-items: center; margin-left: auto; }

/* Brand — mobile only (desktop uses sidebar brand) */
.topbar-brand-mobile {
  display: none;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}
.topbar-brand-mobile:hover,
.topbar-brand-mobile:focus {
  text-decoration: none;
}
.topbar-brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex-shrink: 0;
}
.topbar-brand-name {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -.1px;
  white-space: nowrap;
}


/* Clocks */
.topbar-clocks {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-clock {
  display: flex;
  align-items: center;
  gap: 7px;
}
img.topbar-clock-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1px solid var(--topbar-surface-border);
}
.topbar-clock-info {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.topbar-clock-time {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.topbar-clock-label {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: rgba(27, 58, 92, 0.55);
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1;
}
.topbar-clock-sep,
.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--topbar-border);
  flex-shrink: 0;
}

/* User pill + dropdown */
.topbar-user-wrap {
  position: relative;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 12px 4px 6px;
  border-radius: 24px;
  border: 1px solid var(--topbar-surface-border);
  background: var(--topbar-surface);
  transition: background .12s, border-color .12s;
  cursor: pointer;
  user-select: none;
  font: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.topbar-user:hover {
  background: var(--topbar-surface);
  border-color: rgba(27, 58, 92, 0.22);
  box-shadow: 0 1px 4px rgba(27, 58, 92, 0.08);
}
.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topbar-user-name {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.topbar-user-chevron {
  width: 15px;
  height: 15px;
  color: rgba(27, 58, 92, 0.45);
  flex-shrink: 0;
  transition: transform .15s;
}
.topbar-user-wrap.open .topbar-user-chevron {
  transform: rotate(180deg);
}
.topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.topbar-user-wrap.open .topbar-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.topbar-dropdown-header {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.topbar-dropdown-fullname {
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.topbar-dropdown-role {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
  margin-top: 1px;
}
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .1s;
  cursor: pointer;
}
.topbar-dropdown-item:hover {
  background: var(--bg);
  text-decoration: none;
}
.topbar-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted);
}
.topbar-dropdown-item.danger {
  color: var(--red);
}
.topbar-dropdown-item.danger svg {
  color: var(--red);
}
.topbar-dropdown-item.danger:hover {
  background: #fce8e6;
}
.topbar-dropdown-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}
.topbar-dropdown-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #1a73e8;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.change-pwd-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: #80868b;
}

/* ── Topbar notifications ─────────────────────────────────── */
.topbar-notif-wrap {
  position: relative;
}
.topbar-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--navy-light);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.topbar-notif-btn:hover {
  background: var(--topbar-hover);
  border-color: var(--topbar-surface-border);
  color: var(--navy);
}
.topbar-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: #d93025;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}
.topbar-notif-badge[hidden] {
  display: none;
}
.topbar-notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(60,64,67,.18);
  z-index: 200;
  overflow: hidden;
}
.topbar-notif-wrap.open .topbar-notif-dropdown {
  display: flex;
  flex-direction: column;
  max-height: min(560px, calc(100dvh - 80px));
}
.topbar-notif-attention-wrap {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}
.topbar-notif-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px 6px;
}
.topbar-notif-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #5f6368;
}
.topbar-notif-section-clear {
  font-size: 11px;
  font-weight: 500;
  color: #137333;
}
.topbar-notif-section-clear[hidden] {
  display: none;
}
.topbar-notif-attention {
  max-height: 180px;
  overflow-y: auto;
  padding: 0 8px 8px;
}
.topbar-notif-attention:empty {
  display: none;
}
.topbar-notif-attention-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  border: 1px solid #e8eaed;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: background .12s, border-color .12s;
}
.topbar-notif-attention-item:last-child {
  margin-bottom: 0;
}
.topbar-notif-attention-item:hover {
  background: #f1f3f4;
  border-color: #dadce0;
}
.topbar-notif-attention-item--high {
  border-color: #fad2cf;
  background: #fef7f6;
}
.topbar-notif-attention-item--high:hover {
  background: #fce8e6;
}
.topbar-notif-attention-label {
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-notif-attention-meta {
  font-size: 11px;
  color: #70757a;
  line-height: 1.3;
}
.topbar-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.topbar-notif-title {
  font-size: 14px;
  font-weight: 600;
  color: #202124;
}
.topbar-notif-mark-all {
  border: none;
  background: none;
  color: #1a73e8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}
.topbar-notif-mark-all:hover:not(:disabled) {
  text-decoration: underline;
}
.topbar-notif-mark-all:disabled {
  color: #9aa0a6;
  cursor: default;
}
.topbar-notif-list {
  max-height: 240px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.topbar-notif-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid #f1f3f4;
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.topbar-notif-item:hover {
  background: #f8f9fa;
}
.topbar-notif-item.unread {
  background: #e8f0fe;
}
.topbar-notif-item.unread:hover {
  background: #d2e3fc;
}
.topbar-notif-msg {
  font-size: 13px;
  color: #202124;
  line-height: 1.4;
}
.notif-task-link {
  color: #1a73e8;
  text-decoration: none;
  font-weight: 500;
}
.notif-task-link:hover {
  text-decoration: underline;
}
.notif-page-message .notif-task-link {
  color: #1a73e8;
}
.topbar-notif-time {
  font-size: 11px;
  color: #80868b;
}
.topbar-notif-empty,
.topbar-notif-loading {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #80868b;
}
.topbar-notif-footer {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #1a73e8;
  text-decoration: none;
  border-top: 1px solid var(--border);
  background: #fafafa;
}
.topbar-notif-footer:hover {
  background: #f1f3f4;
}

/* Notifications full page */
.notif-page {
  max-width: 720px;
}
.notif-page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.notif-page-count {
  font-size: 13px;
  color: #5f6368;
}
.notif-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.notif-page-item {
  padding: 14px 18px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: background .12s;
}
.notif-page-item:last-child {
  border-bottom: none;
}
.notif-page-item.unread {
  background: #e8f0fe;
}
.notif-page-item:hover {
  background: #f8f9fa;
}
.notif-page-item.unread:hover {
  background: #d2e3fc;
}
.notif-page-message {
  font-size: 14px;
  color: #202124;
  margin-bottom: 4px;
}
.notif-page-meta {
  font-size: 12px;
  color: #80868b;
}
.notif-page-empty {
  text-align: center;
  padding: 48px 24px;
  color: #80868b;
}
.notif-page-empty-icon {
  margin-bottom: 12px;
  color: #dadce0;
}

.page-body { padding: 24px 28px; flex: 1; min-width: 0; max-width: 100%; }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.card-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .1px;
  min-width: 0;
  word-break: break-word;
}
.card-body { padding: 20px; }

/* ── KPI Grid ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
.kpi-value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--text); }
.kpi-sub   { font-size: 12px; color: var(--muted); }
.kpi-card.navy  .kpi-value { color: var(--navy); }
.kpi-card.teal  .kpi-value { color: var(--teal); }
.kpi-card.green .kpi-value { color: var(--green); }
.kpi-card.amber .kpi-value { color: var(--amber); }
.kpi-card.red   .kpi-value { color: var(--red); }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .1px;
}
.badge-done        { background: #DCFCE7; color: #15803D; }
.badge-progress    { background: #FEF3C7; color: #B45309; }
.badge-notstarted  { background: #F1F5F9; color: #475569; }
.badge-high        { background: #FEE2E2; color: #B91C1C; }
.badge-medium      { background: #FEF3C7; color: #B45309; }
.badge-low         { background: #DCFCE7; color: #15803D; }

/* ── Table ─────────────────────────────────────────────────── */
.table-wrap {
  overflow: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  background: #F8FAFC;
  color: var(--muted);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .08s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #F8FAFC; }
tbody td { padding: 10px 14px; vertical-align: middle; }
td.task-title { max-width: 300px; }

/* Quick-status select in table */
.quick-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: auto;
}
.quick-status:focus { border-color: var(--teal); }

/* ── Filters / Toolbar ─────────────────────────────────────── */
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: flex-end;
}
.filters select,
.filters input[type=text] {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.filters select:focus,
.filters input[type=text]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background .12s, box-shadow .12s, transform .08s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--gc-blue); color: #fff; box-shadow: 0 1px 3px rgba(60,64,67,.3); }
.btn-primary:hover { background: var(--gc-blue-hover); filter: none; }
.btn-navy      { background: var(--gc-blue); color: #fff; }
.btn-navy:hover { background: var(--gc-blue-hover); color: #fff; }
.btn-danger    { background: var(--gc-red); color: #fff; }
.btn-danger:hover { background: var(--gc-red-hover); filter: none; }
.btn-secondary { background: var(--gc-bg); color: var(--gc-text-secondary); border: 1px solid var(--gc-border); box-shadow: none; }
.btn-secondary:hover { background: var(--gc-border-light); filter: none; }
.btn-sm        { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.text-muted { color: var(--gc-muted); }

/* ── Forms / Modal ─────────────────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

/* Legacy .modal-overlay removed — use .gc-modal-overlay + GcModal */
.alert {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }

/* ── Login page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--card);
  border-radius: 14px;
  padding: 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}
.login-box h1 { font-size: 22px; color: var(--text); font-weight: 800; margin-bottom: 4px; }
.login-box p  { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login-box .btn { width: 100%; justify-content: center; padding: 11px; font-size: 14px; }

/* ── Overdue pill ──────────────────────────────────────────── */
.overdue-yes { color: var(--red); font-weight: 700; font-size: 12px; }
.overdue-no  { color: var(--green); font-size: 14px; }

/* ── Mobile nav (toggle + backdrop) ───────────────────────── */
.topbar-start {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-shrink: 1;
}

@media (min-width: 769px) {
  .topbar-start {
    flex: 1;
    min-height: 1px;
  }
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--topbar-surface-border);
  border-radius: var(--radius-sm);
  background: var(--topbar-surface);
  color: var(--navy);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.sidebar-toggle:hover {
  background: var(--topbar-surface);
  border-color: rgba(27, 58, 92, 0.22);
  box-shadow: 0 1px 4px rgba(27, 58, 92, 0.08);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  z-index: 90;
  opacity: 0;
  transition: opacity .25s;
}
.sidebar-backdrop.visible {
  display: block;
  opacity: 1;
}

body.gc-modal-open,
body.fm-modal-open,
body.sidebar-open {
  overflow: hidden;
}

/* Desktop — compressed sidebar (icon rail) */
@media (min-width: 769px) {
  body.sidebar-collapsed {
    --sidebar-w: var(--sidebar-w-collapsed);
  }

  body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    gap: 0;
    padding: 0 8px;
  }
  body.sidebar-collapsed .sidebar-brand-name,
  body.sidebar-collapsed .sidebar-brand-sub,
  body.sidebar-collapsed .sidebar-link-label,
  body.sidebar-collapsed .sidebar-section-title,
  body.sidebar-collapsed .sidebar-group-chevron,
  body.sidebar-collapsed .sidebar-version,
  body.sidebar-collapsed .sidebar-empty-state {
    display: none;
  }
  body.sidebar-collapsed .sidebar-group-toggle {
    display: none;
  }
  body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0 8px 2px 0;
  }
  body.sidebar-collapsed .sidebar-link-badge {
    position: absolute;
    top: 4px;
    right: 10px;
    min-width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
  }
  body.sidebar-collapsed .sidebar-logo-img {
    width: 32px;
    height: 32px;
  }
}

/* ── File Manager ──────────────────────────────────────────── */
.fm-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.fm-toolbar-actions { display: flex; gap: 8px; }

.fm-breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.fm-crumb {
  font-size: 13px;
  color: var(--teal);
  font-weight: 500;
  text-decoration: none;
}
.fm-crumb:hover { text-decoration: underline; }
.fm-crumb-active { color: var(--text); font-weight: 700; pointer-events: none; }
.fm-crumb-sep { color: var(--muted); font-size: 14px; }

.fm-icon-cell { text-align: center; padding: 9px 8px; }
.fm-icon      { font-size: 20px; }
.fm-icon-folder { filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }

.fm-name-link {
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  font-size: 13px;
}
.fm-name-link:hover { color: var(--teal); text-decoration: underline; }

.fm-name { font-size: 13px; color: var(--text); }
.fm-mime { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }

.fm-children-badge {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 6px;
}

.fm-actions { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.fm-row-parent { background: #FAFBFC; }
.fm-row-parent td { padding: 6px 14px; }

.fm-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.fm-empty-icon { font-size: 44px; margin-bottom: 12px; opacity: .3; }
.fm-empty p { font-size: 14px; }

/* ── Permissions page ──────────────────────────────────────── */
.perm-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.perm-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.perm-table thead th { text-align: left; }
.perm-table tbody tr:hover { background: #F8FAFC; }

.perm-select {
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid transparent;
  cursor: pointer;
  outline: none;
  appearance: auto;
  min-width: 110px;
  font-family: inherit;
  transition: border-color .12s;
}
.perm-select-no_access { background: #F1F5F9; color: #64748B; border-color: #CBD5E1; }
.perm-select-read      { background: #EFF6FF; color: #1D4ED8; border-color: #93C5FD; }
.perm-select-write     { background: #FFFBEB; color: #B45309; border-color: #FCD34D; }
.perm-select-admin     { background: #F0FDF4; color: #166534; border-color: #86EFAC; }

/* ── Toolbar (list.php) ────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.toolbar-filters input[type="text"],
.toolbar-filters select,
.toolbar .btn {
  height: 34px;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1;
  vertical-align: middle;
  font-family: inherit;
}
.toolbar-filters input[type="text"] {
  min-width: 180px;
  flex: 1;
  max-width: 220px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.toolbar-filters input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(8,145,178,.1);
}
.toolbar-filters select {
  min-width: 120px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.toolbar-filters select:focus { border-color: var(--border-focus); }
.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* ── Results meta row ──────────────────────────────────────── */
.results-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Table helpers ─────────────────────────────────────────── */
td.task-id   { color: var(--teal); font-weight: 700; font-size: 12px; }
th.col-id    { width: 40px; }
th.col-actions { width: 100px; }
.table-empty-cell { text-align: center; padding: 32px 24px; color: var(--muted); font-size: 13px; }

/* ── Pagination ────────────────────────────────────────────── */
.pagination-bar {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.pagination-info  { font-size: 12px; color: var(--muted); }
.pagination-pages { display: flex; gap: 3px; align-items: center; }
.pagination-ellipsis { padding: 4px 6px; color: var(--muted); font-size: 13px; }

/* ── Delete form inline ────────────────────────────────────── */
.delete-form { display: inline; }

/* ── Modal 2-col grid ──────────────────────────────────────── */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Dashboard ─────────────────────────────────────────────── */
.dash-progress-card { margin-bottom: 24px; }

.progress-track {
  background: var(--border);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.progress-track-sm { height: 6px; margin-top: 4px; }
.progress-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width .4s ease;
}
.progress-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

/* Priority list */
.dash-priority-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.prio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prio-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prio-dot-high   { background: #DC2626; }
.prio-dot-medium { background: #D97706; }
.prio-dot-low    { background: #16A34A; }
.prio-label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.prio-count-badge {
  font-size: 13px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}
.prio-pct {
  font-size: 12px;
  color: var(--muted);
  width: 36px;
  text-align: right;
}

/* Category list */
.dash-category-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 220px;
  overflow-y: auto;
}
.cat-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2px;
}
.cat-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.cat-count {
  font-size: 12px;
  color: var(--muted);
}

/* Recent tasks — "View all" button in card-header (light header) */
.card-header .btn-secondary {
  font-size: 12px;
  padding: 4px 10px;
}

/* ── gcToast (Google-style, top-right) ──────────────────────── */
#gc-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
}
.gc-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  max-width: 420px;
  padding: 12px 16px 12px 14px;
  border-radius: 10px;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  background: #fff;
  box-shadow: 0 4px 12px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.1);
  border-left: 4px solid #8ab4f8;
  transform: translateX(120%);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}
.gc-toast.show { transform: translateX(0); opacity: 1; }
.gc-toast.hide { transform: translateX(120%); opacity: 0; }
.gc-toast .gc-toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: #f1f3f4;
  color: #5f6368;
}
.gc-toast .gc-toast-msg { flex: 1; line-height: 1.35; }
.gc-toast-add     { border-left-color: #34a853; }
.gc-toast-add     .gc-toast-icon { background: #34a853; color: #fff; }
.gc-toast-update  { border-left-color: #4285f4; }
.gc-toast-update  .gc-toast-icon { background: #4285f4; color: #fff; }
.gc-toast-delete  { border-left-color: #d93025; }
.gc-toast-delete  .gc-toast-icon { background: #d93025; color: #fff; }
.gc-toast-success { border-left-color: #34a853; }
.gc-toast-success .gc-toast-icon { background: #34a853; color: #fff; }
.gc-toast-error   { border-left-color: #ea4335; }
.gc-toast-error   .gc-toast-icon { background: #ea4335; color: #fff; }
.gc-toast-info    { border-left-color: #4285f4; }
.gc-toast-info    .gc-toast-icon { background: #4285f4; color: #fff; }

/* Brand area — align with Google Sans heading style */
.sidebar-brand-name {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-weight: 700;
}

/* ── Shared stroke icons (modals, forms) ──────────────────── */
.gc-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5f6368;
  flex-shrink: 0;
}
.gc-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.gc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gc-icon-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}
.poll-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.poll-modal-close svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ── Google buttons (homepage / module pages) ───────────────── */
.gc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, box-shadow .15s;
  white-space: nowrap;
  letter-spacing: .25px;
  line-height: 1.4;
}
.gc-btn:hover { text-decoration: none; }
.gc-btn svg { flex-shrink: 0; }
.gc-btn-ghost        { background: transparent; color: var(--gc-blue); }
.gc-btn-ghost:hover  { background: #e8f0fe; }
.gc-btn-secondary    { background: var(--gc-bg); color: var(--gc-text-secondary); border: 1px solid var(--gc-border); }
.gc-btn-secondary:hover { background: var(--gc-border-light); }
.gc-btn-primary      { background: var(--gc-blue); color: #fff; box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15); }
.gc-btn-primary:hover{ background: var(--gc-blue-hover); box-shadow: 0 2px 6px rgba(60,64,67,.3), 0 6px 12px rgba(60,64,67,.15); }
.gc-btn-danger       { background: var(--gc-red); color: #fff; }
.gc-btn-danger:hover { background: var(--gc-red-hover); }
.gc-btn-danger:disabled { opacity: .6; cursor: not-allowed; }
.gc-btn-warn         { background: transparent; color: #f9ab00; }
.gc-btn-warn:hover   { background: #fef3c7; }
.gc-btn-success      { background: transparent; color: var(--gc-green); }
.gc-btn-success:hover{ background: #e6f4ea; }
.gc-btn-icon         { width: 32px; height: 32px; padding: 0; border-radius: 50%; justify-content: center; gap: 0; }
.gc-btn-icon.gc-btn-danger  { background: transparent; color: var(--gc-red); }
.gc-btn-icon.gc-btn-danger:hover { background: #fce8e6; }
.gc-btn-sm           { font-size: 12px; padding: 4px 12px; min-height: 28px; }

/* Admin stat chips */
.gc-stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.gc-stat-chip {
  background: var(--gc-surface); border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 14px 20px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 3px rgba(60,64,67,.1); flex: 1; min-width: 110px;
}
.gc-stat-chip-value {
  font-family: 'Google Sans', sans-serif; font-size: 28px;
  font-weight: 400; line-height: 1; color: var(--gc-text-secondary);
}
.gc-stat-chip-value--green { color: #1e7e34; }
.gc-stat-chip-value--red   { color: var(--gc-red); }
.gc-stat-chip-value--blue  { color: var(--gc-blue); }
.gc-stat-chip-label {
  font-family: 'Roboto', sans-serif; font-size: 12px;
  color: var(--gc-muted); margin-top: 3px;
}

/* ── Module page hero (white card — matches root index.php) ─── */
.page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(60,64,67,.12);
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e8f0fe 0%, #fff 60%);
  pointer-events: none;
}
.page-hero-main {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.page-hero-aside {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  margin-left: auto;
  position: relative;
  z-index: 1;
}
.page-hero-title {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: #3c4043;
  position: relative;
  margin: 0;
}
.page-hero-sub {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 13px;
  color: #70757a;
  margin-top: 4px;
  position: relative;
}
.page-hero-stat-wrap {
  text-align: right;
  min-width: 88px;
  position: relative;
}
.page-hero-stat {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: #1a73e8;
  line-height: 1;
}
.page-hero-stat-label {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 11px;
  color: #70757a;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.page-hero-actions { position: relative; flex-shrink: 0; }

/* ── Shared project cards (module lists) ────────────────────── */
.project-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(60,64,67,.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.project-card-header {
  padding: 18px 20px 14px;
}
.project-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 6px;
}
.project-badge-icon {
  display: flex;
  align-items: center;
}
.project-badge-icon svg { width: 13px; height: 13px; display: block; }
.project-title {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #3c4043;
  margin-top: 2px;
}
.project-card-footer {
  padding: 12px 20px;
  border-top: 1px solid #f1f3f4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  background: #fafafa;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  color: #9aa0a6;
  gap: 8px;
}
.empty-state-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .4;
}
.empty-state-icon svg { width: 36px; height: 36px; display: block; }
.empty-state-text {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 13px;
}

.projects-grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.project-card > .gc-form-modal-head,
.project-card > .project-card-head {
  padding: 12px 16px 10px;
  border-radius: 0;
}

.project-card > .gc-form-modal-head::after,
.project-card > .project-card-head::after {
  height: 1px;
}

.project-card > .gc-form-modal-head .gc-header,
.project-card > .project-card-head .gc-header {
  gap: 10px;
}

.project-card > .gc-form-modal-head-icon,
.project-card > .project-card-head .gc-form-modal-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.project-card > .gc-form-modal-head-icon svg,
.project-card > .project-card-head .gc-form-modal-head-icon svg {
  width: 18px;
  height: 18px;
}

.project-card > .gc-form-modal-head .gc-title-display,
.project-card > .project-card-head .gc-title-display {
  font-size: 15px;
  line-height: 1.25;
}

.project-card > .gc-form-modal-head .gc-subtitle,
.project-card > .project-card-head .gc-subtitle {
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-top: 2px;
}

.project-card-accent {
  height: 6px;
  width: 100%;
  flex-shrink: 0;
}
.project-badge-planning { background: #fff7ed !important; color: #c2410c !important; border: 1px solid #fdba74 !important; }
.project-meta-line {
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 12px;
  color: #70757a;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── Google modals ──────────────────────────────────────────── */
.gc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.gc-modal-overlay.show { opacity: 1; pointer-events: auto; }
.gc-modal-overlay[data-backdrop] {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  /* Keep card opaque — do not fade the whole overlay (card would look transparent) */
  opacity: 1;
  visibility: hidden;
  pointer-events: none;
  transition: visibility .18s ease;
}
.gc-modal-overlay[data-backdrop].show {
  visibility: visible;
  pointer-events: auto;
}
.gc-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(60,64,67,.35), 0 2px 8px rgba(60,64,67,.15);
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Roboto', Arial, sans-serif;
  transform: scale(.97) translateY(8px);
  transition: transform .18s ease;
  max-height: calc(100vh - 48px);
}
.gc-modal-overlay.show .gc-modal { transform: scale(1) translateY(0); }
.gc-modal-strip { height: 8px; width: 100%; flex-shrink: 0; }
.gc-modal-strip-blue   { background: #1a73e8; }
.gc-modal-strip-red    { background: #d93025; }
.gc-modal-strip-del    { background: #d93025; }
.gc-modal-strip-pwd    { background: #f9ab00; }
.gc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
  flex-shrink: 0;
}
.gc-modal-head h2, .gc-modal-head h3 {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #202124;
  margin: 0;
}
.gc-modal-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: transparent; color: #5f6368; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background .12s;
}
.gc-modal-close:hover { background: #f1f3f4; }
.gc-modal-body { padding: 8px 24px 20px; overflow-y: auto; flex: 1; }
.gc-modal-foot {
  padding: 8px 16px 16px;
  display: flex; gap: 8px;
  justify-content: flex-end;
  flex-shrink: 0;
}
.gc-modal-foot .gc-btn { border-radius: 4px; }
.gc-modal-wide { max-width: 1100px; width: 92vw; height: 85vh; }
.gc-modal-md   { max-width: 560px; }
.gc-modal-sm   { max-width: 420px; }

/* Event-style form modal card (shared: events, new user, new group) */
.gc-modal-card {
  background: #fff;
  background-color: #fff;
  width: 100%;
  max-width: 448px;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 8px 30px rgba(60,64,67,.35), 0 2px 8px rgba(60,64,67,.15);
  transform: scale(.97) translateY(8px);
  transition: transform .18s ease;
  font-family: 'Roboto', sans-serif;
  overflow: hidden;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.gc-modal-card > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  background: #fff;
}
.gc-modal-card--md { max-width: 520px; }
.gc-modal-card--lg { max-width: 560px; }
.gc-modal-overlay.show .gc-modal-card,
#event-modal.show .gc-modal-card {
  transform: scale(1) translateY(0);
}
.gc-modal-card .gc-modal-body {
  padding: 20px 24px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  background: #fff;
}
.gc-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.gc-header-left { flex: 1; min-width: 0; }
.gc-title-display {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: #202124;
  line-height: 1.3;
  margin: 0 0 2px;
}
h1.gc-title-display {
  margin: 0 0 2px;
  font-weight: 400;
}
.gc-subtitle {
  font-size: 13px;
  color: #70757a;
  margin-bottom: 0;
  line-height: 1.45;
}
.gc-actions {
  display: flex;
  gap: 4px;
  margin-top: -4px;
  flex-shrink: 0;
}
.gc-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #5f6368;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background .12s;
  padding: 0;
}
.gc-icon-btn:hover { background: #f1f3f4; }
.gc-info-rows {
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gc-info-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #3c4043;
}
.gc-info-row .gc-icon { margin-top: 1px; }
.gc-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 16px 0;
}
.gc-edit {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gc-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: #fff;
}
.gc-footer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.gc-modal-card .gc-footer .gc-btn {
  border-radius: 4px;
  font-size: 13px;
  padding: 8px 16px;
  min-height: 36px;
}
.gc-edit small {
  font-size: 12px;
  color: #80868b;
  line-height: 1.4;
}

/* ── Form modal shell + colored header (all modules) ─────────────────────── */
.gc-form-modal {
  background: #fff;
}

.gc-form-modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  background: #fff;
}

.gc-form-modal .gc-modal-body {
  padding: 20px 24px 16px;
  background: #fff;
}

.gc-form-modal .gc-footer,
.gc-form-modal .gc-modal-foot {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
  background: #fff;
}

.gc-form-modal .gc-footer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.gc-form-modal .gc-footer .gc-btn,
.gc-form-modal .gc-modal-foot .gc-btn {
  border-radius: 4px;
  font-size: 13px;
  padding: 8px 16px;
  min-height: 36px;
}

.gc-form-modal-head {
  position: relative;
  padding: 20px 24px 18px;
  flex-shrink: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--gc-mh-border, #dbeafe);
  background: var(--gc-mh-bg, linear-gradient(135deg, #e8f0fe 0%, #eef6ff 55%, #fff 100%));
}

.gc-form-modal-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gc-mh-accent, linear-gradient(90deg, #1b3a5c 0%, #0891b2 50%, #1a73e8 100%));
}

.gc-form-modal-head .gc-header {
  position: relative;
  z-index: 1;
  align-items: center;
  margin-bottom: 0;
  gap: 14px;
}

.gc-form-modal-head-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--gc-mh-icon-bg, linear-gradient(145deg, #1a73e8 0%, #0891b2 100%));
  color: #fff;
  box-shadow: var(--gc-mh-icon-shadow, 0 4px 12px rgba(26, 115, 232, .28));
}

.gc-form-modal-head-icon svg { display: block; }

.gc-form-modal-head .gc-title-display {
  font-family: 'Google Sans', 'Roboto', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--gc-mh-title, #1b3a5c);
  letter-spacing: -.01em;
  line-height: 1.3;
}

.gc-form-modal-head .gc-subtitle {
  font-size: 13px;
  color: #5f6368;
  margin-top: 2px;
  line-height: 1.45;
}

.gc-form-modal-head .gc-title-display .gc-modal-head-meta {
  color: #70757a;
  font-weight: 400;
}

.gc-form-modal-head .gc-icon-btn {
  background: rgba(255, 255, 255, .65);
}

.gc-form-modal-head .gc-icon-btn:hover {
  background: #fff;
}

/* Themes */
.gc-form-modal-head--blue {
  --gc-mh-border: #dbeafe;
  --gc-mh-bg: linear-gradient(135deg, #e8f0fe 0%, #eef6ff 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #1b3a5c 0%, #0891b2 50%, #1a73e8 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #1a73e8 0%, #0891b2 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(26, 115, 232, .28);
  --gc-mh-title: #1b3a5c;
}

.gc-form-modal-head--user {
  --gc-mh-border: #dbeafe;
  --gc-mh-bg: linear-gradient(135deg, #e8f0fe 0%, #eef6ff 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #1b3a5c 0%, #0891b2 50%, #1a73e8 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #1a73e8 0%, #0891b2 100%);
  --gc-mh-title: #1b3a5c;
}

.gc-form-modal-head--group {
  --gc-mh-border: #e9d5ff;
  --gc-mh-bg: linear-gradient(135deg, #f3e8ff 0%, #f5f3ff 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #6b21a8 0%, #8b5cf6 50%, #a78bfa 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #7c3aed 0%, #8b5cf6 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(124, 58, 237, .28);
  --gc-mh-title: #4c1d95;
}

.gc-form-modal-head--warn {
  --gc-mh-border: #fde68a;
  --gc-mh-bg: linear-gradient(135deg, #fffbeb 0%, #fef3c7 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #b45309 0%, #f59e0b 50%, #fbbf24 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #f59e0b 0%, #d97706 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(245, 158, 11, .28);
  --gc-mh-title: #92400e;
}

.gc-form-modal-head--danger {
  --gc-mh-border: #fecaca;
  --gc-mh-bg: linear-gradient(135deg, #fef2f2 0%, #fee2e2 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #991b1b 0%, #dc2626 50%, #ef4444 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #dc2626 0%, #b91c1c 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(220, 38, 38, .28);
  --gc-mh-title: #991b1b;
}

.gc-form-modal-head--pwd {
  --gc-mh-border: #fde68a;
  --gc-mh-bg: linear-gradient(135deg, #fffbeb 0%, #fef9c3 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #a16207 0%, #eab308 50%, #facc15 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #eab308 0%, #ca8a04 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(234, 179, 8, .28);
  --gc-mh-title: #854d0e;
}

.gc-form-modal-head--files {
  --gc-mh-border: #fbcfe8;
  --gc-mh-bg: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #9d174d 0%, #ec4899 50%, #f472b6 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #ec4899 0%, #db2777 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(236, 72, 153, .28);
  --gc-mh-title: #9d174d;
}

.gc-form-modal-head--task {
  --gc-mh-border: #99f6e4;
  --gc-mh-bg: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #0f766e 0%, #0891b2 50%, #14b8a6 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #0891b2 0%, #0d9488 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(8, 145, 178, .28);
  --gc-mh-title: #115e59;
}

.gc-form-modal-head--poll {
  --gc-mh-border: #ddd6fe;
  --gc-mh-bg: linear-gradient(135deg, #ede9fe 0%, #f5f3ff 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #5b21b6 0%, #7c3aed 50%, #8b5cf6 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #7c3aed 0%, #6d28d9 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(124, 58, 237, .28);
  --gc-mh-title: #5b21b6;
}

.gc-form-modal-head--planning {
  --gc-mh-border: #fed7aa;
  --gc-mh-bg: linear-gradient(135deg, #fff7ed 0%, #ffedd5 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #c2410c 0%, #f59e0b 50%, #fb923c 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #f59e0b 0%, #ea580c 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(245, 158, 11, .28);
  --gc-mh-title: #9a3412;
}

.gc-form-modal-head--event {
  --gc-mh-border: #bfdbfe;
  --gc-mh-bg: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  --gc-mh-title: #1e3a8a;
}

.gc-form-modal-head--neutral {
  --gc-mh-border: #e2e8f0;
  --gc-mh-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 55%, #fff 100%);
  --gc-mh-accent: linear-gradient(90deg, #475569 0%, #64748b 50%, #94a3b8 100%);
  --gc-mh-icon-bg: linear-gradient(145deg, #64748b 0%, #475569 100%);
  --gc-mh-icon-shadow: 0 4px 12px rgba(100, 116, 139, .22);
  --gc-mh-title: #334155;
}

#event-modal.show .gc-modal {
  transform: scale(1) translateY(0);
}

#event-modal .gc-modal {
  transform: scale(.97) translateY(8px);
  transition: transform .18s ease;
  max-width: 448px;
}

.gc-form-modal-wizard-top .gc-wizard-steps {
  padding: 12px 24px 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

.gc-field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #70757a;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.gc-field input[type=text],
.gc-field input[type=number],
.gc-field input[type=time],
.gc-field input[type=color],
.gc-field select,
.gc-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 13px;
  color: #202124;
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
.gc-field input:focus, .gc-field select:focus, .gc-field textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,.18);
}
.gc-field input[type=color] { height: 40px; padding: 3px 6px; }
.gc-section-title {
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #202124;
  margin: 8px 0 12px;
}
.gc-link-btn {
  background: none; border: none; color: #1a73e8;
  font-size: 13px; font-weight: 500; cursor: pointer; padding: 4px 0;
  font-family: 'Google Sans', 'Roboto', Arial, sans-serif;
}
.gc-link-btn:hover { text-decoration: underline; }
.gc-field-error { color: #d93025; font-size: 12px; margin-top: 6px; display: none; }
.gc-field-error.is-visible { display: block; }
.gc-field-hint { font-size: 12px; color: #80868b; margin-top: 4px; }

.gc-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1049;
  display: none;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.gc-backdrop.show {
  display: block;
}
.gc-modal-overlay:not(.show),
#event-modal:not(.show) {
  pointer-events: none !important;
}
.gc-backdrop:not(.show) {
  display: none !important;
  pointer-events: none !important;
}

.gc-field-group {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.gc-field-group .gc-icon {
  margin-top: 8px;
  flex-shrink: 0;
  color: #5f6368;
}
.gc-field-group .gc-field-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gc-field-label {
  font-size: 11px;
  color: #70757a;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.gc-field-row {
  display: flex;
  gap: 6px;
}
.gc-edit input[type="text"],
.gc-edit input[type="email"],
.gc-edit input[type="password"],
.gc-edit input[type="date"],
.gc-edit input[type="time"],
.gc-edit input[type="datetime-local"],
.gc-edit input[type="number"],
.gc-edit input[type="color"],
.gc-edit select,
.gc-edit textarea,
.side-panel-body.gc-edit input[type="text"],
.side-panel-body.gc-edit input[type="email"],
.side-panel-body.gc-edit input[type="password"],
.side-panel-body.gc-edit input[type="date"],
.side-panel-body.gc-edit input[type="time"],
.side-panel-body.gc-edit input[type="datetime-local"],
.side-panel-body.gc-edit input[type="number"],
.side-panel-body.gc-edit input[type="color"],
.side-panel-body.gc-edit select,
.side-panel-body.gc-edit textarea,
.card-body.gc-edit input[type="text"],
.card-body.gc-edit input[type="email"],
.card-body.gc-edit input[type="password"],
.card-body.gc-edit input[type="date"],
.card-body.gc-edit input[type="time"],
.card-body.gc-edit input[type="datetime-local"],
.card-body.gc-edit input[type="number"],
.card-body.gc-edit input[type="color"],
.card-body.gc-edit select,
.card-body.gc-edit textarea {
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  color: #202124;
  padding: 6px 10px;
  border: 1px solid #dadce0;
  border-radius: 4px;
  background: #fff;
  width: 100%;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.gc-edit input:focus,
.gc-edit select:focus,
.gc-edit textarea:focus,
.side-panel-body.gc-edit input:focus,
.side-panel-body.gc-edit select:focus,
.side-panel-body.gc-edit textarea:focus,
.card-body.gc-edit input:focus,
.card-body.gc-edit select:focus,
.card-body.gc-edit textarea:focus {
  outline: none;
  border-color: #1a73e8;
  box-shadow: 0 0 0 2px rgba(26,115,232,.18);
}
.gc-edit input[type="time"],
.side-panel-body.gc-edit input[type="time"] { width: 100px; flex-shrink: 0; }
.gc-edit input[type="date"],
.gc-edit input[type="datetime-local"],
.side-panel-body.gc-edit input[type="date"],
.side-panel-body.gc-edit input[type="datetime-local"],
.card-body.gc-edit input[type="date"],
.card-body.gc-edit input[type="datetime-local"] { flex: 1; }
.side-panel-body.gc-edit .gc-field-group { margin-bottom: 12px; }
.card-body.gc-edit .gc-field-group { margin-bottom: 12px; }
.side-panel-body.gc-edit .gc-btn { width: 100%; justify-content: center; border-radius: 4px; margin-top: 8px; }

/* Planning form blocks */
.plan-day-block {
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 12px 36px 12px 12px;
  margin-bottom: 10px;
  position: relative;
  background: #fafafa;
}
.plan-day-block .plan-day-field {
  margin-bottom: 8px;
}
.plan-day-block .plan-day-field:last-child {
  margin-bottom: 0;
}
.plan-day-remove {
  position: absolute; top: 8px; right: 8px; width: 28px; height: 28px;
  border-radius: 50%; border: none; background: transparent; color: #5f6368;
  font-size: 16px; cursor: pointer;
}
.plan-day-remove:hover { background: #f1f3f4; }
.plan-day-remove.hidden { display: none; }
.plan-time-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}
.plan-time-row > .gc-field-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.plan-time-row input[type="time"] {
  width: 100%;
}
.plan-state-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.plan-state-block .plan-state-field {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}
.plan-state-block .plan-state-color-field {
  flex: 0 0 auto;
  width: 120px;
  margin-bottom: 0;
}
.plan-state-block .plan-state-color-field input[type="color"] {
  width: 100%;
  height: 40px;
  padding: 3px 6px;
}
.plan-state-remove {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: transparent; color: #5f6368; cursor: pointer; font-size: 16px;
  flex-shrink: 0;
  margin-top: 22px;
}
.plan-state-remove:hover { background: #f1f3f4; }

/* ── Responsive (tablet + phone) ───────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    padding-top: env(safe-area-inset-top, 0);
  }
  .sidebar.open { transform: translateX(0); }

  .main-content { margin-left: 0; }

  .topbar-brand-mobile { display: flex; }

  .topbar {
    padding: 0 max(12px, env(safe-area-inset-right, 0)) 0 max(12px, env(safe-area-inset-left, 0));
    height: var(--app-chrome-h);
    min-height: var(--app-chrome-h);
    gap: 8px;
  }
  .topbar-clocks,
  .topbar-divider-clocks { display: none; }
  .topbar-brand-logo { width: 36px; height: 36px; }
  .topbar-brand-name { font-size: 16px; }
  .topbar-actions { gap: 8px; }
  .topbar-clock-label { display: none; }
  .topbar-clock-sep { display: none; }
  .topbar-divider { display: none; }
  .topbar-user-name,
  .topbar-user-chevron { display: none; }
  .topbar-user { padding: 4px; border-radius: 50%; }
  .topbar-clocks { gap: 10px; }
  .topbar-user-wrap { position: relative; }
  .topbar-dropdown {
    right: 0;
    left: auto;
    min-width: 0;
    width: min(280px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
  }

  .page-body { padding: 16px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card { padding: 14px 16px; }
  .kpi-value { font-size: 24px; }

  .dash-grid-2 { grid-template-columns: 1fr; }

  .page-hero {
    padding: 20px;
    gap: 16px;
    flex-direction: column;
    align-items: stretch;
  }
  .page-hero-aside {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }
  .page-hero-stat-wrap { text-align: left; min-width: 0; }
  .page-hero-stat { font-size: 28px; }
  .page-hero-title { font-size: 20px; word-break: break-word; }
  .page-hero-sub { word-break: break-word; }
  .page-hero-actions { width: auto; flex-shrink: 0; }
  .page-hero-actions .gc-btn,
  .page-hero-actions .btn { width: auto; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-filters {
    width: 100%;
    flex-wrap: wrap;
  }
  .toolbar-filters input[type="text"],
  .toolbar-filters select {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
  }
  .toolbar > .btn,
  .toolbar > a.btn,
  .toolbar-actions { width: 100%; }
  .toolbar > .btn,
  .toolbar > a.btn { justify-content: center; }

  .form-grid-2 { grid-template-columns: 1fr; }

  .table-wrap {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .pagination-pages { justify-content: center; flex-wrap: wrap; }

  .modal,
  .gc-modal-md,
  .gc-modal-sm {
    max-width: calc(100vw - 32px);
  }
  .gc-modal-wide {
    width: 100%;
    max-width: calc(100vw - 24px);
    height: calc(100vh - 32px);
    max-height: calc(100vh - 32px);
  }
  .gc-modal-overlay { padding: 12px; align-items: flex-end; }
  .gc-modal-overlay.show .gc-modal { transform: translateY(0); }
  .gc-modal { transform: translateY(12px); border-radius: 12px 12px 0 0; }

  #selfChangePwdModal {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    transform: translateY(-50%) !important;
    margin: 0 16px;
  }

  #gc-toast-container {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
  .gc-toast {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .projects-grid-auto { grid-template-columns: 1fr; }

  .card:has(#calendar) {
    height: auto;
    min-height: calc(100dvh - 108px);
  }
  .fc .fc-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    row-gap: 6px;
  }
  .fc .fc-toolbar-chunk { display: flex; flex-wrap: wrap; gap: 4px; }
  .fc .fc-toolbar-title { font-size: 17px !important; }
}

@media (max-width: 480px) {
  .topbar { padding: 0 10px; }
  .topbar-brand-name { display: none; }

  .page-body { padding: 12px; }

  .kpi-grid { grid-template-columns: 1fr; }

  .toolbar-filters input[type="text"],
  .toolbar-filters select { flex: 1 1 100%; }

  .fm-toolbar { flex-direction: column; align-items: stretch; }
  .fm-toolbar-actions { justify-content: stretch; }
  .fm-toolbar-actions .btn { flex: 1; justify-content: center; }

  .mini-stats { flex-wrap: wrap; }
  .mini-stat { flex: 1 1 calc(50% - 6px); }

  .perm-select { min-width: 0; width: 100%; }

  .plan-time-row { flex-direction: column; }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .card-header > div {
    width: 100%;
    min-width: 0;
  }

  .notif-page-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .notif-page-toolbar .gc-btn { width: 100%; justify-content: center; }
  .notif-page-message { word-break: break-word; }
  .notif-page { max-width: 100%; }

  .page-hero-stat-wrap { width: 100%; }
  .page-hero-actions { width: 100%; }
  .page-hero-actions .gc-btn,
  .page-hero-actions .btn { flex: 1; justify-content: center; min-width: 0; }

  img, svg, video { max-width: 100%; height: auto; }
}

/* ── Shared fetch / empty states ───────────────────────────── */
.gc-loading { opacity: 0.55; pointer-events: none; }
.gc-error-banner {
  display: block;
  margin: 8px 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fce8e6;
  color: #c5221f;
  font-size: 13px;
}
.gc-empty {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.admin-tool-inline-form { display: inline-block; margin-right: 8px; }