/*
 * app.css — the template's styles, on top of Bootstrap 5.3.
 *
 * The only stylesheet a page links. It imports Bootstrap, the plugins' CSS,
 * the fonts and the icon sets first, so its own rules come after them and can
 * theme Bootstrap and the plugins. Customize through the tokens below (or in
 * your project's own CSS, loaded after this file) rather than by editing the
 * rules further down.
 *
 * Contents
 *   Imports · Design tokens · Bootstrap bridge
 *   Base · Shell · Topbar menus · Content area · Content helpers
 *   Authentication and error pages · Chat · Data table · Dashboard · Email
 *   Calendar · Command palette · Responsive
 *   Sidebar collapsed · Menu tree · Horizontal layout
 *   Topbar user · Form helpers · Select2 · flatpickr · SweetAlert2 · Wizard
 *   Other plugins · .rich-text · Bootstrap theme · Authentication extras
 *   Profile page · Settings page · Icon pages · Widgets page · Your customizations
 */

/* Imports. They must stay here, before every other rule (the browser ignores an
   @import that comes later). Bootstrap first, then the plugins, so the rules in
   this file override them. Each file is still downloaded and cached on its own.
   The paths are relative to this file, so they keep working wherever the
   template is served from.

   ClockPicker and Nestable come from stylesheets adapted for the template (the
   original ones clash with Bootstrap 5 and with the topbar's .dd-* classes;
   the header of each file says how). TinyMCE isn't imported: it loads its own
   skin. */
@import url("../vendor/bootstrap/bootstrap.min.css");
@import url("../vendor/select2/select2.min.css");
@import url("../vendor/flatpickr/flatpickr.min.css");
@import url("../vendor/sweetalert2/sweetalert2.min.css");
@import url("../vendor/jsvectormap/jsvectormap.min.css");
@import url("../vendor/fullcalendar/skeleton.min.css");
@import url("../vendor/fullcalendar/themes/classic/theme.min.css");
@import url("../vendor/fullcalendar/themes/classic/palette.min.css");
@import url("../vendor/clockpicker/clockpicker-bootstrap5.css");
@import url("../vendor/datatables/css/datatables.min.css"); /* the build in js/datatables.min.js: DataTables, its extensions, Bootstrap 5 styling */
@import url("../vendor/nestable/nestable-scoped.css");
@import url("../vendor/toast/jquery.toast.min.css");

/* Fonts: assets/fonts/fonts.css imports every family the template ships (each
   in its own folder with a fonts.css). */
@import url("../fonts/fonts.css");

/* Icons: assets/fonts/icons/icons.css imports every icon set the template ships. */
@import url("../fonts/icons/icons.css");

/* Design tokens (independent of the theme) */
:root {
  /* Typography. Every size in this file is in rem, so --font-scale (or the
     browser's own font-size setting) resizes all text proportionally. */
  --font-sans: "Inter", system-ui, Segoe UI, Ubuntu, Cantarell, Noto Sans, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Inter Tight", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --font-features: "cv11", "ss01", "ss03"; /* Inter-specific; use normal with other fonts */
  --font-scale: 1;
  --font-weight-base: 400;
  --line-height-base: 1.55;
  --letter-spacing-base: -0.003em;

  /* Corner radius. Everything derives from --radius: 0 = square UI. */
  --radius: 8px;
  --radius-xs: calc(var(--radius) * 0.5);
  --radius-sm: calc(var(--radius) * 0.75);
  --radius-md: calc(var(--radius) * 1.25);
  --radius-lg: calc(var(--radius) * 1.5);
  --radius-xl: calc(var(--radius) * 1.75);

  /* Layout */
  --sidebar-width: 248px;
  --sidebar-rail-width: 72px;
  --sidebar-drawer-width: 280px;
  --topbar-height: 60px;

  /* Form controls and buttons (inputs, selects, plugins and buttons share them,
     so a form row stays aligned) */
  --control-font-size: 0.8125rem;
  --control-padding-y: 9px;
  --control-padding-x: 12px;
  --control-line-height: 1.55;
  --button-padding-x: 14px;
  --focus-ring: 0 0 0 3px var(--primary-soft);
}

html {
  font-size: calc(var(--font-scale) * 100%);
}

/* Typography preferences — the profile page sets these on <html> through
   preferences.js (no attribute = the defaults above). The font family itself
   is set inline on <html> as --font-sans / --font-display. */
:root[data-font-size=sm] { --font-scale: 0.9375; }
:root[data-font-size=lg] { --font-scale: 1.0625; }
:root[data-font-size=xl] { --font-scale: 1.125; }
:root[data-font-weight=light] { --font-weight-base: 300; }
:root[data-font-weight=medium] { --font-weight-base: 500; }
:root[data-line-height=compact] { --line-height-base: 1.4; }
:root[data-line-height=relaxed] { --line-height-base: 1.75; }
:root[data-letter-spacing=tight] { --letter-spacing-base: -0.015em; }
:root[data-letter-spacing=wide] { --letter-spacing-base: 0.02em; }

/* Theme colors — light */
:root[data-theme=light] {
  --bg-body: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-sidebar: #FFFFFF;
  --bg-hover: #F8FAFC;
  --bg-muted: #F1F5F9;
  --t-base: #1E293B;
  --t-muted: #64748B;
  --t-light: #94A3B8;
  --t-inverse: #FFFFFF;
  --border: #E4E8EF;
  --border-soft: #EEF1F5;
  --primary: #2563EB;
  --primary-light: #3B82F6;
  --primary-dark: #1D4ED8;
  --primary-soft: #EFF6FF;
  --primary-ring: rgba(37, 99, 235, 0.18);
  --success: #10B981;
  --success-soft: #ECFDF5;
  --warning: #F59E0B;
  --warning-soft: #FFFBEB;
  --danger: #EF4444;
  --danger-soft: #FEF2F2;
  --info: #0EA5E9;
  --info-soft: #F0F9FF;
  --purple: #8B5CF6;
  --purple-soft: #F5F3FF;
  --pink: #EC4899;
  --pink-soft: #FDF2F8;
  --teal: #14B8A6;
  --teal-soft: #F0FDFA;
  --orange: #F97316;
  --orange-soft: #FFF7ED;
  --shadow-sm: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-card: 0 1px 3px 0 rgb(15 23 42 / 0.06), 0 1px 2px -1px rgb(15 23 42 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(15 23 42 / 0.08), 0 4px 6px -4px rgb(15 23 42 / 0.05);
  --overlay: rgba(240, 244, 248, 0.72);
  /* The same colors as "r, g, b" — Bootstrap's opacity utilities need them.
     Change them together with the colors above. */
  --primary-rgb: 37, 99, 235;
  --primary-dark-rgb: 29, 78, 216;
  --success-rgb: 16, 185, 129;
  --warning-rgb: 245, 158, 11;
  --danger-rgb: 239, 68, 68;
  --info-rgb: 14, 165, 233;
  --t-base-rgb: 30, 41, 59;
  --t-muted-rgb: 100, 116, 139;
  --t-light-rgb: 148, 163, 184;
  --bg-body-rgb: 240, 244, 248;
  --bg-card-rgb: 255, 255, 255;
  --bg-muted-rgb: 241, 245, 249;
  --bg-hover-rgb: 248, 250, 252;
}

/* Theme colors — dark */
:root[data-theme=dark] {
  --bg-body: #0B1120;
  --bg-card: #141B2D;
  --bg-sidebar: #141B2D;
  --bg-hover: #1C2438;
  --bg-muted: #1A2237;
  --t-base: #F1F5F9;
  --t-muted: #94A3B8;
  --t-light: #64748B;
  --t-inverse: #0B1120;
  --border: #222C42;
  --border-soft: #1A2237;
  --primary: #60A5FA;
  --primary-light: #93C5FD;
  --primary-dark: #3B82F6;
  --primary-soft: #0F2847;
  --primary-ring: rgba(96, 165, 250, 0.24);
  --success: #34D399;
  --success-soft: #0F2A20;
  --warning: #FBBF24;
  --warning-soft: #2B1F08;
  --danger: #F87171;
  --danger-soft: #2B1414;
  --info: #38BDF8;
  --info-soft: #0D2232;
  --purple: #A78BFA;
  --purple-soft: #1E1A2C;
  --pink: #F472B6;
  --pink-soft: #2A1424;
  --teal: #2DD4BF;
  --teal-soft: #0E2826;
  --orange: #FB923C;
  --orange-soft: #2A1810;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 1px 2px -1px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  --overlay: rgba(11, 17, 32, 0.72);
  --primary-rgb: 96, 165, 250;
  --primary-dark-rgb: 59, 130, 246;
  --success-rgb: 52, 211, 153;
  --warning-rgb: 251, 191, 36;
  --danger-rgb: 248, 113, 113;
  --info-rgb: 56, 189, 248;
  --t-base-rgb: 241, 245, 249;
  --t-muted-rgb: 148, 163, 184;
  --t-light-rgb: 100, 116, 139;
  --bg-body-rgb: 11, 17, 32;
  --bg-card-rgb: 20, 27, 45;
  --bg-muted-rgb: 26, 34, 55;
  --bg-hover-rgb: 28, 36, 56;
}

/* Bootstrap, themed by the tokens above. Its components and utilities follow
   the template's fonts, sizes, radius and colors, in light and dark
   (preferences.js also sets <html data-bs-theme>). */
:root[data-theme] {
  --bs-font-sans-serif: var(--font-sans);
  --bs-font-monospace: var(--font-mono);
  --bs-body-font-family: var(--font-sans);
  --bs-body-font-size: 0.875rem;
  --bs-body-font-weight: var(--font-weight-base);
  --bs-body-line-height: var(--line-height-base);
  --bs-body-color: var(--t-base);
  --bs-body-color-rgb: var(--t-base-rgb);
  --bs-body-bg: var(--bg-body);
  --bs-body-bg-rgb: var(--bg-body-rgb);
  --bs-emphasis-color: var(--t-base);
  --bs-emphasis-color-rgb: var(--t-base-rgb);
  --bs-secondary-color: var(--t-muted);
  --bs-secondary-color-rgb: var(--t-muted-rgb);
  --bs-secondary-bg: var(--bg-muted);
  --bs-secondary-bg-rgb: var(--bg-muted-rgb);
  --bs-tertiary-color: var(--t-light);
  --bs-tertiary-color-rgb: var(--t-light-rgb);
  --bs-tertiary-bg: var(--bg-hover);
  --bs-tertiary-bg-rgb: var(--bg-hover-rgb);
  --bs-heading-color: inherit;
  --bs-link-color: var(--primary);
  --bs-link-color-rgb: var(--primary-rgb);
  --bs-link-decoration: none;
  --bs-link-hover-color: var(--primary-dark);
  --bs-link-hover-color-rgb: var(--primary-dark-rgb);
  --bs-code-color: var(--pink);
  --bs-highlight-color: var(--t-base);
  --bs-highlight-bg: var(--warning-soft);
  --bs-border-color: var(--border);
  --bs-border-color-translucent: var(--border);
  --bs-border-radius: var(--radius);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-border-radius-xl: var(--radius-xl);
  --bs-border-radius-xxl: calc(var(--radius) * 2.25);
  --bs-box-shadow: var(--shadow-lg);
  --bs-box-shadow-sm: var(--shadow-sm);
  --bs-box-shadow-lg: var(--shadow-lg);
  --bs-focus-ring-width: 3px;
  --bs-focus-ring-color: var(--primary-soft);
  --bs-form-valid-color: var(--success);
  --bs-form-valid-border-color: var(--success);
  --bs-form-invalid-color: var(--danger);
  --bs-form-invalid-border-color: var(--danger);

  --bs-primary: var(--primary);
  --bs-primary-rgb: var(--primary-rgb);
  --bs-secondary: var(--t-muted);
  --bs-secondary-rgb: var(--t-muted-rgb);
  --bs-success: var(--success);
  --bs-success-rgb: var(--success-rgb);
  --bs-info: var(--info);
  --bs-info-rgb: var(--info-rgb);
  --bs-warning: var(--warning);
  --bs-warning-rgb: var(--warning-rgb);
  --bs-danger: var(--danger);
  --bs-danger-rgb: var(--danger-rgb);
  --bs-light: var(--bg-muted);
  --bs-light-rgb: var(--bg-muted-rgb);
  --bs-dark: var(--t-base);
  --bs-dark-rgb: var(--t-base-rgb);

  --bs-primary-text-emphasis: var(--primary);
  --bs-secondary-text-emphasis: var(--t-muted);
  --bs-success-text-emphasis: var(--success);
  --bs-info-text-emphasis: var(--info);
  --bs-warning-text-emphasis: var(--warning);
  --bs-danger-text-emphasis: var(--danger);
  --bs-light-text-emphasis: var(--t-muted);
  --bs-dark-text-emphasis: var(--t-base);
  --bs-primary-bg-subtle: var(--primary-soft);
  --bs-secondary-bg-subtle: var(--bg-muted);
  --bs-success-bg-subtle: var(--success-soft);
  --bs-info-bg-subtle: var(--info-soft);
  --bs-warning-bg-subtle: var(--warning-soft);
  --bs-danger-bg-subtle: var(--danger-soft);
  --bs-light-bg-subtle: var(--bg-hover);
  --bs-dark-bg-subtle: var(--bg-muted);
  --bs-primary-border-subtle: color-mix(in oklab, var(--primary) 30%, var(--bg-card));
  --bs-secondary-border-subtle: var(--border);
  --bs-success-border-subtle: color-mix(in oklab, var(--success) 30%, var(--bg-card));
  --bs-info-border-subtle: color-mix(in oklab, var(--info) 30%, var(--bg-card));
  --bs-warning-border-subtle: color-mix(in oklab, var(--warning) 30%, var(--bg-card));
  --bs-danger-border-subtle: color-mix(in oklab, var(--danger) 30%, var(--bg-card));
  --bs-light-border-subtle: var(--border);
  --bs-dark-border-subtle: var(--border);
}

/* --------------------------------------------------------------------------
 * Base — reset, body, text helpers, shared animations
 * ------------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; -webkit-text-decoration: none; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
input, select, textarea { font: inherit; color: inherit; }
body {
  font-family: var(--font-sans);
  font-feature-settings: var(--font-features);
  font-weight: var(--font-weight-base);
  background: var(--bg-body);
  color: var(--t-base);
  font-size: 0.875rem;
  line-height: var(--line-height-base);
  letter-spacing: var(--letter-spacing-base);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 280ms ease,color 280ms ease;
}
::-moz-selection { background: var(--primary); color: #fff; }
::selection { background: var(--primary); color: #fff; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--t-light);
  font-weight: 500;
}
@keyframes rise-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bar-in {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* --------------------------------------------------------------------------
 * Shell — page grid, sidebar and menu, topbar, footer
 * ------------------------------------------------------------------------ */
.shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.d-sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  padding: 22px 16px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
}
.d-sidebar::-webkit-scrollbar { width: 4px; }
.d-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px -2px color-mix(in oklab, var(--primary) 40%, transparent);
}
.brand-logo svg { width: 18px; height: 18px; }
.brand-text { line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.96875rem;
  color: var(--t-base);
  letter-spacing: -0.02em;
}
.brand-tag { font-family: var(--font-mono); font-size: 0.59375rem; color: var(--t-light); letter-spacing: .1em; }
.menu-section { display: flex; flex-direction: column; gap: 2px; }
.menu-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--t-light);
  padding: 0 10px 6px;
}
.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: var(--t-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background-color 180ms ease,color 180ms ease,box-shadow 180ms ease;
  line-height: 1.2;
}
.menu-link>svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.75;
  fill: none;
  flex-shrink: 0;
  display: block;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-link>span:not(.menu-badge) { min-width: 0; flex: 1; }
.menu-link:hover { background: var(--bg-hover); color: var(--t-base); }
.menu-link.is-active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}
.menu-badge {
  flex: 0 0 auto;
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 6px;
  line-height: 1.4;
  border-radius: 999px;
}
.menu-badge.pro { background: var(--primary); color: #fff; }
.menu-badge.hot { background: var(--danger-soft); color: var(--danger); }
.menu-badge.new { background: var(--success-soft); color: var(--success); }
.menu-group .menu-link .chev { width: 11px; height: 11px; margin-left: auto; transition: transform 200ms ease; }
.menu-group.is-open>.menu-link .chev { transform: rotate(90deg); }
.menu-sub {
  overflow: hidden;
  max-height: 0;
  margin-left: 20px;
  padding-left: 14px;
  position: relative;
  transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-sub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--border);
}
.menu-group.is-open>.menu-sub { max-height: none; padding-top: 4px; padding-bottom: 6px; }
.menu-sub a {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  font-size: 0.78125rem;
  color: var(--t-muted);
  border-radius: var(--radius-sm);
  transition: color 160ms ease,background-color 160ms ease,padding-left 160ms ease;
}
.menu-sub a:hover { color: var(--t-base); background: var(--bg-hover); padding-left: 13px; }
.menu-sub a.is-active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }
.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.workspace {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: background-color 180ms ease;
}
.workspace:hover { background: var(--bg-hover); }
.workspace-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.78125rem;
  flex-shrink: 0;
}
.workspace-text { line-height: 1.2; min-width: 0; }
.workspace-name { font-size: 0.8125rem; color: var(--t-base); font-weight: 600; }
.workspace-role { font-size: 0.6875rem; color: var(--t-light); }
.workspace-chev { margin-left: auto; color: var(--t-light); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; min-height: 100dvh; }
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--t-base);
  margin-right: 4px;
  transition: background 160ms;
}
.hamburger:hover { background: var(--bg-hover); }
.hamburger svg { width: 20px; height: 20px; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease,visibility 240ms;
}
body.has-drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
.d-topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  background: var(--overlay);
}
.topbar-start { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.cmd {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--t-light);
  font-size: 0.8125rem;
  transition: all 200ms ease;
  width: 220px;
  min-width: 0;
}
.cmd:hover { border-color: var(--primary); color: var(--t-muted); box-shadow: var(--focus-ring); }
.cmd svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.cmd span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.kbd {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
  color: var(--t-muted);
  border: 1px solid var(--border);
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: var(--t-muted);
  transition: background 180ms,color 180ms;
  position: relative;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--t-base); }
.icon-btn>svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.icon-btn .count {
  position: absolute;
  top: 5px;
  right: 5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.59375rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-body);
  line-height: 1;
}
.icon-btn .count.danger { background: var(--danger); color: #fff; }
.icon-btn .count.info { background: var(--info); color: #fff; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.8125rem;
  margin-left: 6px;
  border: 2px solid var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
/* Foto de perfil no lugar das iniciais: enche o círculo sem deformar */
.avatar img,
.workspace-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.d-footer {
  padding: 24px 32px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--t-muted);
  font-size: 0.75rem;
}
.d-footer a { color: var(--primary); font-weight: 600; }
.d-footer a:hover { color: var(--primary-dark); }
.d-footer-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  letter-spacing: .06em;
}

/* --------------------------------------------------------------------------
 * Topbar menus — notifications, messages, account (inside .dropdown-menu)
 * ------------------------------------------------------------------------ */
.dd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--t-base);
  letter-spacing: .01em;
}
.dd-head svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; color: var(--t-muted); }
/* Nestable uses .dd-list and .dd-item too: :where(.dropdown-menu) keeps these
   rules off its trees without adding specificity. */
:where(.dropdown-menu) .dd-list { max-height: 320px; overflow-y: auto; }
:where(.dropdown-menu) .dd-list::-webkit-scrollbar { width: 4px; }
:where(.dropdown-menu) .dd-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
:where(.dropdown-menu) .dd-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  transition: background 150ms ease;
}
:where(.dropdown-menu) .dd-item:last-child { border-bottom: 0; }
:where(.dropdown-menu) .dd-item:hover { background: var(--bg-hover); }
.dd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.dd-avatar.a1 { background: linear-gradient(135deg, var(--primary), var(--purple)); }
.dd-avatar.a2 { background: linear-gradient(135deg, var(--success), var(--teal)); }
.dd-avatar.a3 { background: linear-gradient(135deg, var(--danger), var(--warning)); }
.dd-body { min-width: 0; }
.dd-text { font-size: 0.8125rem; color: var(--t-muted); line-height: 1.4; margin-bottom: 3px; }
.dd-text strong { color: var(--t-base); font-weight: 600; }
.dd-text em { color: var(--primary); font-style: normal; }
.dd-preview {
  font-size: 0.78125rem;
  color: var(--t-muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: 2px;
}
.dd-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.dd-row-head strong { font-size: 0.8125rem; color: var(--t-base); font-weight: 600; }
.dd-time {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.dd-footer {
  display: block;
  padding: 12px 18px;
  text-align: center;
  font-size: 0.78125rem;
  color: var(--primary);
  font-weight: 600;
  border-top: 1px solid var(--border-soft);
  transition: color 180ms,background 180ms;
}
.dd-footer:hover { color: var(--primary-dark); background: var(--bg-hover); }
.dd-profile-head { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.dd-profile-name { font-size: 0.8125rem; font-weight: 600; color: var(--t-base); }
.dd-profile-email {
  font-size: 0.71875rem;
  color: var(--t-muted);
  margin-top: 2px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

/* --------------------------------------------------------------------------
 * Content area and page header (.hero)
 * ------------------------------------------------------------------------ */
.content { flex: 1 0 auto; padding: 32px 32px 24px; width: 100%; }
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 28px;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero-text .eyebrow { display: block; margin-bottom: 10px; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem,3.2vw,2.25rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
  color: var(--t-base);
  margin: 0 0 8px;
}
.hero-title .accent { color: var(--primary); }
.hero-sub { font-size: 0.875rem; color: var(--t-muted); max-width: 60ch; line-height: 1.6; }
.hero-sub strong { color: var(--success); font-weight: 600; }
.hero-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* --------------------------------------------------------------------------
 * Content helpers — card titles, table cells, tags, fields with an icon,
 * form actions, spinner, avatar group, demo rows
 * ------------------------------------------------------------------------ */
.card-title-wrap { min-width: 0; }
.card-title-wrap .eyebrow { display: block; margin-bottom: 4px; }
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--t-base);
  margin: 0;
}
.card-action {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 180ms;
}
.card-action:hover { color: var(--primary-dark); }
.card-action svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.table .cell-name { color: var(--t-base); font-weight: 600; }
.table .cell-date { color: var(--t-muted); font-size: 0.75rem; }
.table .cell-price { font-weight: 600; color: var(--t-base); text-align: right; }
.table .cell-price.pos { color: var(--success); }
.table .cell-price.neg { color: var(--danger); }
.tag {
  font-size: 0.65625rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.tag.t-new { background: var(--purple-soft); color: var(--purple); }
.tag.t-used { background: var(--orange-soft); color: var(--orange); }
.tag.t-old { background: var(--warning-soft); color: var(--warning); }
.tag.t-unavail { background: var(--danger-soft); color: var(--danger); }
.tag.t-active { background: var(--success-soft); color: var(--success); }
.tag.t-info { background: var(--info-soft); color: var(--info); }
.input-icon { position: relative; }
.input-icon .ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--t-light);
  pointer-events: none;
}
.input-icon .ico svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 2; fill: none; }
.input-icon .form-control { padding-left: 34px; }
.form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--border-soft);
}
.form-actions .spacer { flex: 1; }
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--bg-muted);
  border-top-color: var(--primary);
  animation: spin 700ms linear infinite;
  display: inline-block;
}
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.avatar-group { display: inline-flex; align-items: center; }
.avatar-group .av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.71875rem;
  font-weight: 600;
  border: 2px solid var(--bg-card);
  margin-left: -8px;
  flex-shrink: 0;
}
.avatar-group .av:first-child { margin-left: 0; }
.avatar-group .av.more { background: var(--bg-muted); color: var(--t-muted); font-size: 0.65625rem; }
.section-h {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--t-base);
  letter-spacing: -0.012em;
  margin: 0 0 14px;
}
.section-h .num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--t-light);
  font-weight: 500;
  letter-spacing: .06em;
}
.demo-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* --------------------------------------------------------------------------
 * Authentication and error pages
 * ------------------------------------------------------------------------ */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: var(--bg-body); }
.auth-aside {
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-aside::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 80%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: auto auto -30% -20%;
  width: 80%;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 60%);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.auth-brand .logo {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: calc(var(--radius) * 1.125);
  display: grid;
  place-items: center;
}
.auth-brand .logo svg { width: 20px; height: 20px; }
.auth-brand .name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; letter-spacing: -0.018em; }
.auth-aside-body { margin-top: auto; position: relative; z-index: 1; max-width: 440px; }
.auth-aside-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  margin-bottom: 14px;
  display: block;
}
.auth-aside h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem,3vw,2.375rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 14px;
}
.auth-aside p { font-size: 0.90625rem; color: rgba(255,255,255,.85); line-height: 1.6; margin: 0 0 24px; }
.auth-quote {
  margin-top: 32px;
  padding: 18px 20px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-lg);
  font-size: 0.8125rem;
  color: rgba(255,255,255,.9);
  line-height: 1.6;
}
.auth-quote-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 0.75rem;
  color: rgba(255,255,255,.75);
}
.auth-quote-author .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  display: grid;
  place-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
}
.auth-aside-footer {
  margin-top: auto;
  padding-top: 24px;
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: rgba(255,255,255,.55);
  letter-spacing: .06em;
}
.auth-main { display: flex; flex-direction: column; padding: 32px 48px; min-height: 100vh; }
.auth-main-top { display: flex; justify-content: space-between; align-items: center; }
.auth-main-top .switch-link { font-size: 0.78125rem; color: var(--t-muted); }
.auth-main-top .switch-link a { color: var(--primary); font-weight: 600; margin-left: 4px; }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 8px 0; }
.auth-card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.625rem;
  letter-spacing: -0.022em;
  color: var(--t-base);
  margin: 0 0 6px;
}
.auth-card .sub { font-size: 0.84375rem; color: var(--t-muted); margin: 0 0 24px; line-height: 1.55; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.auth-form .field-row .form-label { margin: 0; }
.auth-form .field-row a { color: var(--primary); font-size: 0.75rem; font-weight: 600; }
.auth-submit { margin-top: 4px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 18px 0;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.social-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--t-base);
  font-size: 0.78125rem;
  font-weight: 600;
  transition: border-color 160ms,box-shadow 160ms,background 160ms;
}
.social-btn:hover { border-color: var(--t-light); box-shadow: var(--shadow-sm); }
.social-btn svg { width: 14px; height: 14px; }
.auth-main-bottom { margin-top: 24px; font-size: 0.71875rem; color: var(--t-light); text-align: center; }
.auth-main-bottom a { color: var(--t-muted); }
.error-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg-body);
  position: relative;
  overflow: hidden;
}
.error-shell::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 60vmax;
  aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in oklab, var(--primary) 10%, transparent), transparent 70%);
  pointer-events: none;
}
.error-shell::after {
  content: "";
  position: absolute;
  inset: auto auto -20% -10%;
  width: 60vmax;
  aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in oklab, var(--purple) 8%, transparent), transparent 70%);
  pointer-events: none;
}
.error-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 2.25);
  box-shadow: var(--shadow-lg);
  padding: 48px 56px;
  max-width: 540px;
  width: 100%;
  text-align: center;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@media (max-width: 600px) {
  .error-card { padding: 32px 24px; }
}
.error-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--t-light);
  margin-bottom: 14px;
  display: block;
}
.error-code {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(6rem,16vw,10rem);
  line-height: .95;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: rgba(0,0,0,0);
  margin-bottom: 8px;
}
.error-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: -0.022em;
  color: var(--t-base);
  margin: 0 0 10px;
}
.error-sub {
  font-size: 0.875rem;
  color: var(--t-muted);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.error-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.error-meta {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  letter-spacing: .06em;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.error-meta strong { color: var(--t-muted); font-weight: 600; }

/* --------------------------------------------------------------------------
 * Chat (chat.html)
 * ------------------------------------------------------------------------ */
.chat-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: calc(100vh - 220px);
  min-height: 560px;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.chat-rail {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-card);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.chat-rail-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-rail-title-row { display: flex; align-items: center; justify-content: space-between; }
.chat-rail-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.90625rem;
  color: var(--t-base);
  letter-spacing: -0.012em;
}
.chat-rail-title .meta {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  font-weight: 500;
  margin-left: 8px;
  letter-spacing: .04em;
}
.chat-search { position: relative; }
.chat-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-size: 0.78125rem;
  color: var(--t-base);
  outline: 0;
  transition: border-color 180ms,box-shadow 180ms,background 180ms;
}
.chat-search input::-moz-placeholder { color: var(--t-light); }
.chat-search input::placeholder { color: var(--t-light); }
.chat-search input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: var(--focus-ring); }
.chat-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  stroke: var(--t-light);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
}
.chat-list-scroll { flex: 1; overflow-y: auto; padding: 4px 0; }
.chat-list-scroll::-webkit-scrollbar { width: 4px; }
.chat-list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.chat-conv {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 160ms ease;
  position: relative;
}
.chat-conv:hover { background: var(--bg-hover); }
.chat-conv.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.chat-conv-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
  position: relative;
}
.chat-conv-avatar .presence {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-card);
}
.chat-conv-avatar .presence.away { background: var(--warning); }
.chat-conv-avatar .presence.off { background: var(--t-light); }
.chat-conv-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.chat-conv-name {
  font-size: 0.8125rem;
  color: var(--t-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-conv-time {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.chat-conv-preview {
  font-size: 0.75rem;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-conv.is-unread .chat-conv-preview { color: var(--t-base); font-weight: 500; }
.chat-conv.is-unread .chat-conv-time { color: var(--primary); }
.chat-conv-badge {
  position: absolute;
  right: 14px;
  top: 14px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.chat-pane { display: flex; flex-direction: column; background: var(--bg-card); min-width: 0; overflow: hidden; }
.chat-pane-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-soft);
}
.chat-pane-head .av {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  position: relative;
}
.chat-pane-head .av .presence {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-card);
}
.chat-pane-head .meta { line-height: 1.3; min-width: 0; flex: 1; }
.chat-pane-head .name { font-size: 0.875rem; font-weight: 600; color: var(--t-base); }
.chat-pane-head .status { font-size: 0.71875rem; color: var(--t-muted); display: flex; align-items: center; gap: 4px; }
.chat-pane-head .status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.chat-pane-head-tools { display: flex; gap: 2px; }
.chat-thread {
  flex: 1;
  overflow-y: auto;
  padding: 22px 28px;
  background: var(--bg-muted);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.chat-thread::-webkit-scrollbar { width: 5px; }
.chat-thread::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.chat-day-sep {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  color: var(--t-light);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.chat-day-sep::before, .chat-day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chat-msg { display: flex; gap: 10px; max-width: min(75%,600px); }
.chat-msg.me { margin-left: auto; flex-direction: row-reverse; }
.chat-msg-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.71875rem;
  flex-shrink: 0;
  align-self: flex-end;
}
.chat-msg-av.me { background: linear-gradient(135deg, var(--primary), var(--purple)); }
.chat-msg-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-msg.me .chat-msg-stack { align-items: flex-end; }
.chat-bub {
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  border-top-left-radius: var(--radius-xs);
  font-size: 0.84375rem;
  color: var(--t-base);
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
}
.chat-msg.me .chat-bub {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xs);
}
.chat-msg-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.59375rem;
  color: var(--t-light);
  letter-spacing: .04em;
  padding: 0 4px;
}
.chat-msg-meta .read { color: var(--primary); }
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.71875rem;
  color: var(--t-muted);
  margin-top: 4px;
}
.chat-typing-dots { display: inline-flex; gap: 3px; }
.chat-typing-dots span {
  width: 4px;
  height: 4px;
  background: var(--t-light);
  border-radius: 50%;
  animation: typing 1.2s infinite ease-in-out;
}
.chat-typing-dots span:nth-child(2) { animation-delay: .15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.chat-composer { padding: 14px 22px 18px; border-top: 1px solid var(--border-soft); background: var(--bg-card); }
.chat-composer-input {
  display: flex;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  padding: 8px 10px;
  transition: border-color 180ms,box-shadow 180ms;
}
.chat-composer-input:focus-within {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: var(--focus-ring);
}
.chat-composer-input textarea {
  flex: 1;
  background: rgba(0,0,0,0);
  border: 0;
  outline: 0;
  resize: none;
  min-height: 22px;
  max-height: 120px;
  font-size: 0.84375rem;
  color: var(--t-base);
  padding: 4px 4px;
  font-family: inherit;
  line-height: 1.5;
}
.chat-composer-input textarea::-moz-placeholder { color: var(--t-light); }
.chat-composer-input textarea::placeholder { color: var(--t-light); }
.chat-composer-tools { display: flex; gap: 2px; align-items: center; flex-shrink: 0; }
.chat-composer-tools .tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--t-muted);
  transition: background 160ms,color 160ms;
}
.chat-composer-tools .tool:hover { background: var(--bg-hover); color: var(--t-base); }
.chat-composer-tools .tool svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.chat-composer-send {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background 180ms;
  flex-shrink: 0;
}
.chat-composer-send:hover { background: var(--primary-dark); }
.chat-composer-send svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

/* --------------------------------------------------------------------------
 * Data table — toolbar, row cells, footer and pagination (datatable.html)
 * ------------------------------------------------------------------------ */
.data-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.data-toolbar-left { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 240px; }
.data-toolbar-right { display: flex; align-items: center; gap: 8px; }
.data-toolbar .input-icon { flex: 1; max-width: 320px; }
.data-table thead th .sort { display: inline-flex; vertical-align: middle; margin-left: 4px; color: var(--t-light); }
.data-table thead th.sorted-asc .sort, .data-table thead th.sorted-desc .sort { color: var(--primary); }
.data-table thead th.sorted-asc .sort svg { transform: rotate(180deg); }
.data-table thead th .sort svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 160ms;
}
.data-cell-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.data-cell-user .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.6875rem;
  flex-shrink: 0;
}
.data-cell-user-meta { line-height: 1.3; min-width: 0; }
.data-cell-user-name { font-size: 0.8125rem; font-weight: 600; color: var(--t-base); }
.data-cell-user-email {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--t-muted);
  letter-spacing: .02em;
}
.data-cell-mono { font-family: var(--font-mono); font-size: 0.75rem; color: var(--t-muted); letter-spacing: .02em; }
.data-cell-actions { display: flex; gap: 2px; }
.data-cell-actions .btn-icon {
  padding: 6px;
  background: rgba(0,0,0,0);
  border: 0;
  color: var(--t-muted);
  border-radius: var(--radius-sm);
  transition: background 140ms,color 140ms;
}
.data-cell-actions .btn-icon:hover { background: var(--bg-hover); color: var(--t-base); }
.data-cell-actions .btn-icon svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.data-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px solid var(--border-soft);
  font-size: 0.75rem;
  color: var(--t-muted);
}
.data-foot-info { display: flex; align-items: center; gap: 16px; }
.data-foot-info .form-select { width: auto; padding: 6px 28px 6px 10px; font-size: 0.75rem; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) * 0.875);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t-muted);
  transition: background 160ms,color 160ms;
}
.pager-btn:hover:not(:disabled) { background: var(--bg-hover); color: var(--t-base); }
.pager-btn.is-active { background: var(--primary); color: #fff; }
.pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.pager-btn svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2; fill: none; }

/* --------------------------------------------------------------------------
 * Dashboard widgets (index.html)
 * ------------------------------------------------------------------------ */
.chart-canvas-wrap { position: relative; width: 100%; min-height: 240px; }
.chart-meta-row {
  display: flex;
  gap: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-soft);
  margin-top: 14px;
  flex-wrap: wrap;
}
.chart-meta-cell { display: flex; flex-direction: column; gap: 3px; min-width: 90px; }
.chart-meta-label {
  font-size: 0.65625rem;
  color: var(--t-light);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-family: var(--font-mono);
}
.chart-meta-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--t-base);
}
.chart-meta-value.up { color: var(--success); }
.chart-meta-value.down { color: var(--danger); }
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-card);
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  position: relative;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1),box-shadow 220ms ease,border-color 220ms ease;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at top right, currentColor, transparent 65%);
  opacity: .08;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-card:hover::before { opacity: .14; }
.kpi-card.c-success { color: var(--success); }
.kpi-card.c-danger { color: var(--danger); }
.kpi-card.c-purple { color: var(--purple); }
.kpi-card.c-primary { color: var(--primary); }
:nth-child(1)>.kpi-card { animation-delay: 60ms; }
:nth-child(2)>.kpi-card { animation-delay: 120ms; }
:nth-child(3)>.kpi-card { animation-delay: 180ms; }
:nth-child(4)>.kpi-card { animation-delay: 240ms; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; }
.kpi-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: calc(var(--radius) * 1.125);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9; fill: none; }
.kpi-icon.primary { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.success { background: var(--success-soft); color: var(--success); }
.kpi-icon.info { background: var(--info-soft); color: var(--info); }
.kpi-icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi-icon.danger { background: var(--danger-soft); color: var(--danger); }
.kpi-icon.warning { background: var(--warning-soft); color: var(--warning); }
.kpi-label {
  font-size: 0.8125rem;
  color: var(--t-muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--t-base);
  position: relative;
}
.kpi-value sup {
  font-size: 1.0625rem;
  color: var(--t-muted);
  vertical-align: top;
  font-weight: 500;
  margin-left: 3px;
  line-height: 2.1;
}
.kpi-compare {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.75rem;
  color: var(--t-light);
  font-weight: 500;
  padding-top: 12px;
  border-top: 1px dashed var(--border-soft);
  margin-top: auto;
}
.kpi-compare strong {
  color: var(--t-base);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  letter-spacing: -0.01em;
}
.kpi-compare svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; fill: none; flex-shrink: 0; }
.kpi-compare .up { color: var(--success); }
.kpi-compare .down { color: var(--danger); }
.kpi-compare .flat { color: var(--purple); }
.kpi-compare .info { color: var(--info); }
.kpi-compare .sep { color: var(--t-light); opacity: .45; font-weight: 400; }
.kpi-pill {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: .02em;
  flex-shrink: 0;
}
.kpi-pill.up { background: var(--success-soft); color: var(--success); }
.kpi-pill.down { background: var(--danger-soft); color: var(--danger); }
.kpi-pill.flat { background: var(--purple-soft); color: var(--purple); }
.kpi-pill.info { background: var(--info-soft); color: var(--info); }
.kpi-pill svg { width: 10px; height: 10px; stroke: currentColor; stroke-width: 2.5; fill: none; }
.sv-regions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; }
.sv-region { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sv-region-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.8125rem;
  color: var(--t-muted);
  font-weight: 500;
}
.sv-region-head .marker { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sv-region-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--t-base);
  letter-spacing: -0.03em;
  line-height: 1.05;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.sv-region-value .pct {
  font-family: var(--font-mono);
  font-size: 0.71875rem;
  color: var(--t-light);
  font-weight: 500;
  letter-spacing: .02em;
}
.sv-region-bar { height: 3px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; margin-top: 2px; }
.sv-region-bar-fill {
  height: 100%;
  border-radius: 99px;
  transform-origin: left;
  animation: bar-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 300ms both;
}
.sv-divider { height: 1px; background: var(--border-soft); margin: 28px 0; }
.sv-radials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.sv-radial { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; }
.sv-radial-chart { width: 72px; height: 72px; position: relative; flex-shrink: 0; }
.sv-radial-chart svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.radial-track { stroke: var(--bg-muted); stroke-width: 5; fill: none; }
.radial-fill { stroke-width: 5; fill: none; stroke-linecap: round; }
.radial-fill.danger { stroke: var(--danger); }
.radial-fill.info { stroke: var(--info); }
.radial-fill.warning { stroke: var(--warning); }
.sv-radial-chart .pct {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--t-base);
  letter-spacing: -0.022em;
}
.sv-radial-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sv-radial-name { font-size: 0.84375rem; font-weight: 600; color: var(--t-base); letter-spacing: -0.005em; }
.sv-radial-caption { font-size: 0.71875rem; color: var(--t-muted); }
.monthly-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  margin-top: 18px;
}
.stat-cell { display: flex; flex-direction: column; gap: 4px; }
.stat-cell-label { font-size: 0.6875rem; color: var(--t-muted); font-weight: 500; }
.stat-cell-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.022em;
  color: var(--t-base);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-cell-value .trend-ic { width: 11px; height: 11px; color: var(--success); flex-shrink: 0; }
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-soft);
}
.todo-item:last-child { border-bottom: 0; }
.todo-check {
  -moz-appearance: none;
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--t-light);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: all 160ms ease;
  background: rgba(0,0,0,0);
}
.todo-check:hover { border-color: var(--primary); }
.todo-check:checked { background: var(--primary); border-color: var(--primary); }
.todo-check:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 4px;
  height: 9px;
  border: solid #fff;
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}
.todo-item.is-done .todo-text {
  color: var(--t-light);
  -webkit-text-decoration: line-through;
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.todo-text { font-size: 0.84375rem; color: var(--t-base); cursor: pointer; }
.todo-badge {
  font-size: 0.65625rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .02em;
  line-height: 1;
}
.todo-badge.low { background: var(--bg-muted); color: var(--t-muted); }
.todo-badge.upcoming { background: var(--info-soft); color: var(--info); }
.todo-badge.urgent { background: var(--danger-soft); color: var(--danger); }
.todo-badge.warn { background: var(--warning-soft); color: var(--warning); }
.todo-badge.done { background: var(--success-soft); color: var(--success); }
.sales-summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 0 20px;
  margin-bottom: 4px;
}
.sales-summary-label .eyebrow { display: block; margin-bottom: 4px; }
.sales-summary h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--t-base);
  margin: 0;
}
.sales-summary-total {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  color: var(--t-base);
  line-height: 1;
}
.sales-summary-total sup {
  font-size: 0.9375rem;
  color: var(--t-muted);
  vertical-align: top;
  font-weight: 500;
  margin-right: 1px;
  line-height: 2;
}
.sales-all { padding: 18px 0 0; text-align: center; margin-top: 6px; border-top: 1px solid var(--border-soft); }
.sales-all a {
  font-size: 0.78125rem;
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 180ms;
}
.sales-all a:hover { color: var(--primary-dark); }
.sales-all svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.wx-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 8px 0; }
.wx-temp-block { display: flex; align-items: center; gap: 16px; }
.wx-icon {
  width: 60px;
  height: 60px;
  border-radius: calc(var(--radius) * 2);
  background: linear-gradient(135deg, var(--info-soft), var(--primary-soft));
  color: var(--info);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.wx-icon svg { width: 34px; height: 34px; stroke: currentColor; stroke-width: 1.3; fill: none; }
.wx-temp {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.035em;
  color: var(--t-base);
}
.wx-temp sup { font-size: 1.125rem; color: var(--t-muted); vertical-align: top; font-weight: 500; line-height: 1.6; }
.wx-condition { margin-top: 4px; color: var(--t-muted); font-size: 0.8125rem; }
.wx-condition strong { color: var(--t-base); font-weight: 600; }
.wx-date { text-align: right; }
.wx-date h5 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--t-base);
  margin: 0 0 2px;
  letter-spacing: -0.02em;
}
.wx-date p {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  letter-spacing: .06em;
  margin: 0;
}
.wx-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0 16px;
}
.wx-stats>div { display: flex; flex-direction: column; gap: 4px; }
.wx-stat-label { font-size: 0.6875rem; color: var(--t-muted); font-weight: 500; }
.wx-stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--t-base);
  letter-spacing: -0.018em;
}
.wx-stat-value .unit {
  font-size: 0.6875rem;
  color: var(--t-light);
  margin-left: 3px;
  font-weight: 500;
  letter-spacing: 0;
}
.wx-forecast { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.wx-day { padding: 10px 4px; border-radius: var(--radius-md); cursor: pointer; transition: background 160ms ease; }
.wx-day:hover { background: var(--bg-hover); }
.wx-day.is-today { background: var(--primary); color: #fff; }
.wx-day-name {
  font-size: 0.65625rem;
  font-weight: 600;
  color: var(--t-muted);
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.wx-day.is-today .wx-day-name { color: rgba(255,255,255,.85); }
.wx-day-icon { width: 22px; height: 22px; margin: 0 auto 6px; color: var(--t-muted); }
.wx-day-icon svg { width: 100%; height: 100%; stroke: currentColor; stroke-width: 1.6; fill: none; }
.wx-day.is-today .wx-day-icon { color: #fff; }
.wx-day-temp { font-size: 0.78125rem; color: var(--t-base); font-weight: 600; }
.wx-day.is-today .wx-day-temp { color: #fff; }
.chat-frame { margin: -6px -6px 0; border-radius: var(--radius-lg); background: var(--bg-muted); overflow: hidden; }
.chat-messages { padding: 20px; display: flex; flex-direction: column; gap: 16px; min-height: 200px; }
.chat-row { display: flex; gap: 10px; max-width: min(85%,560px); }
.chat-row.me { margin-left: auto; flex-direction: row-reverse; }
.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--t-base);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 0.71875rem;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.chat-avatar.me { background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; border: 0; }
.chat-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chat-row.me .chat-stack { align-items: flex-end; }
.chat-bubble {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  border-top-left-radius: var(--radius-xs);
  font-size: 0.8125rem;
  color: var(--t-base);
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}
.chat-row.me .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xs);
}
.chat-ts {
  font-family: var(--font-mono);
  font-size: 0.59375rem;
  color: var(--t-light);
  letter-spacing: .04em;
  padding: 0 4px;
}
.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  background: rgba(0,0,0,0);
  border: 0;
  outline: 0;
  font-size: 0.84375rem;
  color: var(--t-base);
  padding: 4px 0;
}
.chat-input::-moz-placeholder { color: var(--t-light); }
.chat-input::placeholder { color: var(--t-light); }
.chat-send {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  transition: background 180ms;
  flex-shrink: 0;
  box-shadow: 0 2px 6px -1px color-mix(in oklab, var(--primary) 40%, transparent);
}
.chat-send:hover { background: var(--primary-dark); }
.chat-send svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; }

/* --------------------------------------------------------------------------
 * Email (email.html, compose.html, chat.html header)
 * ------------------------------------------------------------------------ */
.mail-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 20px;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.mail-hero .hero-title { font-size: clamp(1.5rem,2.4vw,1.75rem); margin-bottom: 6px; }
.mail-hero .hero-sub { font-size: 0.84375rem; }
.mail-shell {
  display: grid;
  grid-template-columns: 220px minmax(320px, 1fr) minmax(0, 1.4fr);
  gap: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  height: calc(100vh - 240px);
  min-height: 560px;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: 80ms;
}
.mail-rail {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-card);
  overflow-y: auto;
  gap: 18px;
}
.mail-rail::-webkit-scrollbar { width: 4px; }
.mail-rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.mail-compose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  border-radius: calc(var(--radius) * 1.125);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 2px 6px -1px var(--primary-ring);
  transition: background 180ms;
}
.mail-compose:hover { background: var(--primary-dark); }
.mail-compose svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.mail-rail-section { display: flex; flex-direction: column; gap: 1px; }
.mail-rail-label {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--t-light);
  padding: 0 10px 8px;
}
.mail-folder {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--t-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 160ms ease,color 160ms ease;
  cursor: pointer;
}
.mail-folder svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.75; fill: none; flex-shrink: 0; }
.mail-folder:hover { background: var(--bg-hover); color: var(--t-base); }
.mail-folder.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.mail-folder-name { flex: 1; min-width: 0; }
.mail-folder-count { font-family: var(--font-mono); font-size: 0.65625rem; color: var(--t-light); font-weight: 500; }
.mail-folder.is-active .mail-folder-count { color: var(--primary); }
.mail-folder-count.is-strong {
  background: var(--primary);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.625rem;
}
.mail-folder.is-active .mail-folder-count.is-strong { background: var(--primary); color: #fff; }
.mail-label-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mail-rail-storage { margin-top: auto; padding: 14px 10px 4px; border-top: 1px solid var(--border-soft); }
.mail-storage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.71875rem;
  color: var(--t-muted);
  font-weight: 500;
  margin-bottom: 8px;
}
.mail-storage-head .num {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  letter-spacing: .04em;
}
.mail-storage-bar { height: 4px; background: var(--bg-muted); border-radius: 99px; overflow: hidden; }
.mail-storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: 99px;
  animation: bar-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 300ms both;
  transform-origin: left;
}
.mail-storage-foot { font-size: 0.6875rem; color: var(--t-light); margin-top: 6px; }
.mail-storage-foot a { color: var(--primary); font-weight: 600; }
.mail-list {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: var(--bg-card);
  min-width: 0;
  overflow: hidden;
}
.mail-list-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mail-list-toptools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mail-list-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--t-base);
  letter-spacing: -0.018em;
}
.mail-list-title .meta {
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  font-weight: 500;
  margin-left: 8px;
  letter-spacing: .04em;
}
.mail-list-tools { display: flex; gap: 2px; }
.mail-tool {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) * 0.875);
  color: var(--t-muted);
  transition: background 160ms,color 160ms;
}
.mail-tool:hover { background: var(--bg-hover); color: var(--t-base); }
.mail-tool svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.mail-search { position: relative; }
.mail-search input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-muted);
  font-size: 0.78125rem;
  color: var(--t-base);
  outline: 0;
  transition: border-color 180ms,box-shadow 180ms,background 180ms;
}
.mail-search input::-moz-placeholder { color: var(--t-light); }
.mail-search input::placeholder { color: var(--t-light); }
.mail-search input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: var(--focus-ring); }
.mail-search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  stroke: var(--t-light);
  stroke-width: 2;
  fill: none;
  pointer-events: none;
}
.mail-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.mail-tab {
  padding: 10px 4px;
  margin-right: 14px;
  font-size: 0.75rem;
  color: var(--t-muted);
  font-weight: 500;
  border-bottom: 2px solid rgba(0,0,0,0);
  transition: color 160ms,border-color 160ms;
  position: relative;
  top: 1px;
}
.mail-tab:hover { color: var(--t-base); }
.mail-tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.mail-tab .num {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  margin-left: 4px;
  letter-spacing: .04em;
}
.mail-tab.is-active .num { color: var(--primary); }
.mail-list-scroll { flex: 1; overflow-y: auto; padding: 4px 0; }
.mail-list-scroll::-webkit-scrollbar { width: 4px; }
.mail-list-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.mail-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background 160ms ease;
  position: relative;
}
.mail-row:hover { background: var(--bg-hover); }
.mail-row.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.mail-row.is-unread::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 18px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}
.mail-row-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.ma-1 { background: linear-gradient(135deg, var(--primary), var(--purple)); }
.ma-2 { background: linear-gradient(135deg, var(--success), var(--teal)); }
.ma-3 { background: linear-gradient(135deg, var(--danger), var(--warning)); }
.ma-4 { background: linear-gradient(135deg, var(--info), var(--primary-light)); }
.ma-5 { background: linear-gradient(135deg, var(--orange), var(--pink)); }
.ma-6 { background: linear-gradient(135deg, var(--purple), var(--pink)); }
.mail-row-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mail-row-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mail-row-from {
  font-size: 0.8125rem;
  color: var(--t-base);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.mail-row.is-unread .mail-row-from { font-weight: 700; }
.mail-row-time {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.mail-row.is-unread .mail-row-time { color: var(--primary); }
.mail-row-subject {
  font-size: 0.78125rem;
  color: var(--t-base);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-row.is-unread .mail-row-subject { font-weight: 600; }
.mail-row-preview {
  font-size: 0.75rem;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-row-tags { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.mail-tag {
  font-size: 0.59375rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
}
.mail-tag.work { background: var(--primary-soft); color: var(--primary); }
.mail-tag.team { background: var(--success-soft); color: var(--success); }
.mail-tag.finance { background: var(--purple-soft); color: var(--purple); }
.mail-tag.invoice { background: var(--warning-soft); color: var(--warning); }
.mail-tag.travel { background: var(--info-soft); color: var(--info); }
.mail-tag.attach {
  background: var(--bg-muted);
  color: var(--t-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.mail-tag.attach svg { width: 9px; height: 9px; stroke: currentColor; stroke-width: 2.4; fill: none; }
.mail-star {
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: var(--t-light);
  cursor: pointer;
  transition: color 160ms;
}
.mail-star svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.mail-star:hover { color: var(--warning); }
.mail-star.is-on { color: var(--warning); }
.mail-star.is-on svg { fill: var(--warning); }
.mail-reader { display: flex; flex-direction: column; background: var(--bg-card); min-width: 0; overflow: hidden; }
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border-soft);
  gap: 10px;
}
.reader-tools-group { display: flex; gap: 2px; align-items: center; }
.reader-tools-group .sep { width: 1px; height: 18px; background: var(--border-soft); margin: 0 6px; }
.reader-scroll { flex: 1; overflow-y: auto; padding: 24px 28px 28px; }
.reader-scroll::-webkit-scrollbar { width: 5px; }
.reader-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.reader-head { margin-bottom: 18px; }
.reader-subject {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.022em;
  color: var(--t-base);
  margin: 0 0 10px;
}
.reader-meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.reader-meta-row .mail-tag { font-size: 0.625rem; padding: 3px 8px; }
.reader-card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.reader-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-soft);
}
.reader-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  flex-shrink: 0;
}
.reader-from-block { flex: 1; min-width: 0; line-height: 1.3; }
.reader-from-name { font-size: 0.84375rem; color: var(--t-base); font-weight: 600; }
.reader-from-email {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--t-muted);
  letter-spacing: .02em;
}
.reader-from-meta { font-size: 0.71875rem; color: var(--t-light); margin-top: 4px; }
.reader-time-block { text-align: right; font-size: 0.71875rem; color: var(--t-muted); flex-shrink: 0; }
.reader-time-block .mono {
  font-family: var(--font-mono);
  color: var(--t-light);
  font-size: 0.65625rem;
  letter-spacing: .04em;
  display: block;
  margin-top: 2px;
}
.reader-actions { display: flex; gap: 4px; margin-left: 4px; }
.reader-body {
  padding: 18px 16px;
  font-size: 0.84375rem;
  color: var(--t-base);
  line-height: 1.65;
  background: var(--bg-card);
}
.reader-body p { margin: 0 0 12px; }
.reader-body p:last-child { margin-bottom: 0; }
.reader-body strong { color: var(--t-base); font-weight: 600; }
.reader-body a { color: var(--primary); font-weight: 500; }
.reader-body ul { margin: 0 0 12px; padding-left: 18px; list-style: disc; }
.reader-body li { margin: 4px 0; }
.reader-quote {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-left: 2px solid var(--border);
  background: var(--bg-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.78125rem;
  color: var(--t-muted);
}
.reader-attach { padding: 14px 16px; border-top: 1px solid var(--border-soft); background: var(--bg-card); }
.reader-attach-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  color: var(--t-light);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.reader-attach-head svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2; fill: none; }
.reader-attach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.reader-attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius) * 1.125);
  background: var(--bg-card);
  transition: border-color 160ms,box-shadow 160ms,transform 160ms;
  cursor: pointer;
}
.reader-attach-item:hover { border-color: var(--primary); box-shadow: var(--focus-ring); }
.attach-ico {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.59375rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
}
.attach-ico.pdf { background: var(--danger); }
.attach-ico.doc { background: var(--primary); }
.attach-ico.xls { background: var(--success); }
.attach-ico.img { background: var(--purple); }
.attach-ico.zip { background: var(--orange); }
.attach-meta { line-height: 1.3; min-width: 0; }
.attach-name {
  font-size: 0.78125rem;
  color: var(--t-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attach-size { font-family: var(--font-mono); font-size: 0.625rem; color: var(--t-light); letter-spacing: .04em; }
.reader-collapsed {
  padding: 12px 16px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 160ms;
}
.reader-collapsed:hover { background: var(--bg-hover); }
.reader-collapsed .reader-avatar { width: 28px; height: 28px; font-size: 0.6875rem; }
.reader-collapsed-from { font-size: 0.78125rem; color: var(--t-base); font-weight: 600; }
.reader-collapsed-preview {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--t-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.reader-collapsed-time {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .04em;
}
.reader-replybar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 16px;
  margin-top: 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
}
.reader-replybar input {
  flex: 1;
  background: rgba(0,0,0,0);
  border: 0;
  outline: 0;
  font-size: 0.8125rem;
  color: var(--t-base);
  padding: 4px 6px;
}
.reader-replybar input::-moz-placeholder { color: var(--t-light); }
.reader-replybar input::placeholder { color: var(--t-light); }
.reader-replybar .reply-send {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  transition: background 180ms;
  flex-shrink: 0;
}
.reader-replybar .reply-send:hover { background: var(--primary-dark); }
.reader-replybar .reply-send svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }

/* --------------------------------------------------------------------------
 * Calendar (calendar.html) and the FullCalendar theme
 * ------------------------------------------------------------------------ */
.cal-hero { margin-bottom: 20px; }
.cal-hero .hero-title { font-size: clamp(1.5rem,2.4vw,1.75rem); margin-bottom: 6px; }
.cal-hero .hero-sub { font-size: 0.84375rem; }
.cal-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 20px;
  animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: 80ms;
}
.cal-rail { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cal-quickadd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 600;
  box-shadow: 0 2px 6px -1px var(--primary-ring);
  transition: background 180ms;
}
.cal-quickadd:hover { background: var(--primary-dark); }
.cal-quickadd svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.cal-rail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cal-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-rail-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84375rem;
  color: var(--t-base);
  letter-spacing: -0.01em;
}
.cal-rail-tools { display: flex; gap: 2px; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.mini-cal-wd {
  font-family: var(--font-mono);
  font-size: 0.59375rem;
  color: var(--t-light);
  text-align: center;
  padding: 4px 0 6px;
  letter-spacing: .06em;
}
.mini-cal-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  font-size: 0.71875rem;
  color: var(--t-base);
  border-radius: calc(var(--radius) * 0.875);
  cursor: pointer;
  transition: background 140ms ease,color 140ms ease;
  position: relative;
}
.mini-cal-day:hover { background: var(--bg-hover); }
.mini-cal-day.is-other { color: var(--t-light); }
.mini-cal-day.is-today { background: var(--primary); color: #fff; font-weight: 700; }
.mini-cal-day.has-event::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--primary);
}
.mini-cal-day.is-today.has-event::after { background: #fff; }
.cal-list { display: flex; flex-direction: column; gap: 2px; }
.cal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: calc(var(--radius) * 0.875);
  cursor: pointer;
  transition: background 140ms ease;
}
.cal-list-item:hover { background: var(--bg-hover); }
.cal-list-check {
  width: 14px;
  height: 14px;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
  position: relative;
  border: 1.5px solid currentColor;
  background: currentColor;
}
.cal-list-check::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 3px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.cal-list-check.is-off { background: rgba(0,0,0,0); }
.cal-list-check.is-off::after { display: none; }
.cal-list-name { font-size: 0.78125rem; color: var(--t-base); flex: 1; min-width: 0; }
.cal-list-item.is-off .cal-list-name { color: var(--t-light); }
.cal-list-count { font-family: var(--font-mono); font-size: 0.625rem; color: var(--t-light); letter-spacing: .04em; }
.upc-list { display: flex; flex-direction: column; }
.upc-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border-soft);
  align-items: center;
}
.upc-item:first-child { border-top: 0; padding-top: 4px; }
.upc-date {
  text-align: center;
  line-height: 1.05;
  padding: 6px 0;
  border-radius: var(--radius);
  background: var(--bg-muted);
}
.upc-date .day {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  color: var(--t-base);
  letter-spacing: -0.022em;
}
.upc-date .mo {
  font-family: var(--font-mono);
  font-size: 0.5625rem;
  color: var(--t-light);
  letter-spacing: .08em;
  margin-top: 2px;
  display: block;
  text-transform: uppercase;
}
.upc-date.is-today { background: var(--primary-soft); }
.upc-date.is-today .day { color: var(--primary); }
.upc-date.is-today .mo { color: var(--primary); }
.upc-meta { min-width: 0; line-height: 1.35; }
.upc-title {
  font-size: 0.8125rem;
  color: var(--t-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upc-time {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.71875rem;
  color: var(--t-muted);
  margin-top: 3px;
}
.upc-time .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.upc-time .mono { font-family: var(--font-mono); font-size: 0.65625rem; letter-spacing: .04em; color: var(--t-light); }
.cal-main {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.cal-toolbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cal-month {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  color: var(--t-base);
  letter-spacing: -0.022em;
  line-height: 1;
  white-space: nowrap;
}
.cal-month .yr { color: var(--t-light); font-weight: 500; margin-left: 4px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: calc(var(--radius) * 0.875);
  color: var(--t-muted);
  transition: background 160ms,color 160ms;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.cal-nav-btn:hover { background: var(--bg-hover); color: var(--t-base); border-color: var(--t-light); }
.cal-nav-btn svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2; fill: none; }
.cal-today-btn {
  padding: 0 12px;
  height: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t-base);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.875);
  background: var(--bg-card);
  transition: border-color 160ms,background 160ms;
}
.cal-today-btn:hover { background: var(--bg-hover); border-color: var(--t-light); }
.cal-views { display: flex; background: var(--bg-muted); border-radius: var(--radius); padding: 3px; gap: 2px; }
.cal-view-tab {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--t-muted);
  border-radius: var(--radius-sm);
  transition: background 160ms,color 160ms,box-shadow 160ms;
}
.cal-view-tab:hover { color: var(--t-base); }
.cal-view-tab.is-active { background: var(--bg-card); color: var(--t-base); box-shadow: var(--shadow-sm); }
.cal-toolbar-right { display: flex; align-items: center; gap: 8px; }
[data-fc], .fc {
  --fc-classic-background: var(--bg-card);
  --fc-classic-foreground: var(--t-base);
  --fc-classic-muted: var(--bg-muted);
  --fc-classic-muted-foreground: var(--t-muted);
  --fc-classic-faint: var(--bg-hover);
  --fc-classic-faint-foreground: var(--t-light);
  --fc-classic-strong: var(--bg-hover);
  --fc-classic-stronger: var(--bg-muted);
  --fc-classic-strongest: var(--t-base);
  --fc-classic-border: var(--border);
  --fc-classic-strong-border: var(--border);
  --fc-classic-border-style: solid;
  --fc-classic-primary: var(--primary);
  --fc-classic-primary-foreground: var(--t-inverse);
  --fc-classic-ring-color: var(--primary-ring);
  --fc-classic-today: var(--primary-soft);
  --fc-classic-now: var(--danger);
  --fc-classic-highlight: var(--primary-soft);
  --fc-classic-button: var(--bg-muted);
  --fc-classic-button-border: var(--border);
  --fc-classic-button-foreground: var(--t-base);
  --fc-classic-button-strong: var(--primary);
  --fc-classic-button-strong-border: var(--primary);
  --fc-classic-button-outline: var(--primary-ring);
  --fc-classic-event: var(--primary-soft);
  --fc-classic-event-contrast: var(--primary);
  --fc-classic-background-event: var(--success);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  height: 100%;
}
.fc-cat-work { --fc-classic-event: var(--primary-soft); --fc-classic-event-contrast: var(--primary); }
.fc-cat-team { --fc-classic-event: var(--success-soft); --fc-classic-event-contrast: var(--success); }
.fc-cat-personal { --fc-classic-event: var(--purple-soft); --fc-classic-event-contrast: var(--purple); }
.fc-cat-travel { --fc-classic-event: var(--info-soft); --fc-classic-event-contrast: var(--info); }
.fc-cat-finance { --fc-classic-event: var(--warning-soft); --fc-classic-event-contrast: var(--warning); }
.fc-cat-birthday { --fc-classic-event: var(--pink-soft); --fc-classic-event-contrast: var(--pink); }
.fc-dow {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--t-light);
}

/* --------------------------------------------------------------------------
 * Command palette (⌘K / Ctrl+K)
 * ------------------------------------------------------------------------ */
.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  animation: palette-fade 160ms ease both;
}
body.has-palette-open .palette-backdrop { display: flex; }
@keyframes palette-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.palette-modal {
  width: 100%;
  max-width: 560px;
  max-height: 70vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: palette-rise 200ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes palette-rise {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.palette-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.palette-icon { width: 18px; height: 18px; color: var(--t-muted); flex-shrink: 0; }
.palette-input {
  flex: 1;
  background: rgba(0,0,0,0);
  border: 0;
  outline: 0;
  font-size: 0.9375rem;
  color: var(--t-base);
  font-family: inherit;
  padding: 4px 0;
  min-width: 0;
}
.palette-input::-moz-placeholder { color: var(--t-light); }
.palette-input::placeholder { color: var(--t-light); }
.palette-esc {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  padding: 3px 7px;
  border-radius: calc(var(--radius) * 0.625);
  background: var(--bg-muted);
  color: var(--t-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
  text-transform: lowercase;
  letter-spacing: .04em;
}
.palette-results { flex: 1; overflow-y: auto; padding: 6px; }
.palette-results::-webkit-scrollbar { width: 4px; }
.palette-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }
.palette-result {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 120ms;
}
.palette-result:hover { background: var(--bg-hover); }
.palette-result.is-selected { background: var(--primary-soft); color: var(--primary); }
.palette-result-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
  color: var(--t-muted);
  flex-shrink: 0;
}
.palette-result.is-selected .palette-result-icon {
  background: color-mix(in oklab, var(--primary) 14%, transparent);
  color: var(--primary);
}
.palette-result-icon svg { width: 14px; height: 14px; }
.palette-result-label {
  font-size: 0.84375rem;
  font-weight: 500;
  color: var(--t-base);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.palette-result.is-selected .palette-result-label { color: var(--primary); font-weight: 600; }
.palette-result-section {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  color: var(--t-light);
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.palette-result.is-selected .palette-result-section { color: var(--primary); opacity: .8; }
.palette-empty { padding: 32px 16px; text-align: center; color: var(--t-muted); font-size: 0.8125rem; }
.palette-foot {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-card);
  font-size: 0.6875rem;
  color: var(--t-muted);
}
.palette-foot kbd {
  font-family: var(--font-mono);
  font-size: 0.59375rem;
  padding: 1.5px 5px;
  border-radius: var(--radius-xs);
  background: var(--bg-muted);
  color: var(--t-muted);
  border: 1px solid var(--border);
  margin-right: 4px;
  letter-spacing: .04em;
}
@media (max-width: 600px) {
  .palette-backdrop { padding-top: 6vh; }
  .palette-foot { flex-wrap: wrap; gap: 10px; font-size: 0.625rem; }
}

/* --------------------------------------------------------------------------
 * Responsive — up to 1200px, 1100px (tablets), 720px (phones), 480px
 * ------------------------------------------------------------------------ */
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 1200px) {
  .sv-regions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
  .sv-radials { grid-template-columns: 1fr; gap: 18px; }
  .mail-shell { grid-template-columns: 200px 1fr; height: auto; min-height: 0; }
  .mail-reader { display: none; }
  .cal-shell { grid-template-columns: 240px 1fr; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }
  .d-sidebar { padding: 20px 10px; overflow-y: auto; overflow-x: hidden; z-index: 20; }
  .brand-text,
  .brand-tag,
  .menu-label,
  .menu-link>span:not(.menu-badge),
  .menu-link .menu-badge,
  .workspace-text,
  .workspace-chev,
  .menu-link .chev {
    display: none;
  }
  .brand { justify-content: center; padding: 0 0 18px; }
  .menu-link { justify-content: center; padding: 10px; }
  .menu-link.is-active::before { left: -10px; }
  .workspace { justify-content: center; padding: 6px; }
  .menu-sub {
    position: fixed;
    left: calc(var(--sidebar-rail-width) + 10px);
    top: 0;
    width: 200px;
    max-height: 0;
    margin-left: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    z-index: 50;
    transition: opacity 180ms ease,visibility 180ms;
  }
  .menu-sub::before { display: none; }
  .menu-group.is-open>.menu-sub { max-height: none; padding: 6px 0; opacity: 1; visibility: visible; }
  .menu-sub a { padding: 8px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); margin: 0 6px; }
  .menu-sub a:hover { padding-left: 14px; }
  .chat-shell { grid-template-columns: 240px 1fr; }
}
@media (max-width: 720px) {
  .shell { display: block; }
  .d-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-drawer-width);
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 240ms;
    padding: 22px 16px 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .brand-text,
  .brand-tag,
  .menu-label,
  .menu-link>span:not(.menu-badge),
  .menu-link .menu-badge,
  .workspace-text,
  .workspace-chev,
  .menu-sub,
  .menu-link .chev {
    display: revert;
  }
  .brand { justify-content: flex-start; padding: 4px 10px 20px; }
  .menu-link { justify-content: flex-start; padding: 9px 12px; }
  .workspace { justify-content: flex-start; padding: 6px 10px; }
  .menu-group { position: static; }
  .menu-sub {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin-left: 20px;
    padding: 0 0 0 14px;
    background: rgba(0,0,0,0);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    max-height: 0;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  .menu-sub::before { display: block; }
  .menu-group.is-open>.menu-sub { max-height: none; padding: 4px 0 6px 14px; opacity: 1; visibility: visible; }
  .menu-sub a { margin: 0; padding: 7px 10px; font-size: 0.78125rem; border-radius: var(--radius-sm); }
  .menu-sub a:hover { padding-left: 13px; }
  body.has-drawer-open .d-sidebar { transform: translateX(0); box-shadow: 0 12px 40px -8px rgba(0,0,0,.4); } /* shadow only while open: closed, it showed at the left edge */
  body.has-drawer-open { overflow: hidden; }
  .hamburger { display: inline-flex; }
  .d-topbar { padding: 0 12px; }
  .topbar-actions { gap: 2px; }
  .topbar-start { gap: 2px; }
  .cmd {
    flex-shrink: 0;
    padding: 0;
    width: 36px;
    height: 36px;
    justify-content: center;
    border-color: rgba(0,0,0,0);
    background: none;
    color: var(--t-muted);
  }
  .cmd:hover { border-color: rgba(0,0,0,0); box-shadow: none; background: var(--bg-hover); color: var(--t-base); }
  .cmd span, .cmd .kbd { display: none; }
  .cmd svg { width: 17px; height: 17px; stroke-width: 1.8; }
  .avatar { margin-left: 2px; }
  .content { padding: 20px 16px 16px; }
  .d-footer { padding: 20px 16px; flex-direction: column; gap: 10px; align-items: flex-start; }
  .hero { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-actions { flex-wrap: wrap; }
  .sv-regions { grid-template-columns: 1fr; gap: 22px; }
  .monthly-footer { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .wx-forecast { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .wx-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
  .wx-date { text-align: left; }
  .sales-summary { flex-direction: column; align-items: flex-start; gap: 12px; }
  .chart-canvas-wrap { min-height: 200px; }
  .data-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .data-toolbar-left, .data-toolbar-right { min-width: 0; flex-wrap: wrap; }
  .data-foot { flex-direction: column; gap: 12px; align-items: flex-start; }
  .mail-shell { grid-template-columns: 1fr; }
  .mail-rail { display: none; }
  .mail-hero { flex-direction: column; align-items: flex-start; gap: 16px; }
  .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 0; overflow: visible; }
  .chat-rail { display: flex; border-right: 0; border-bottom: 1px solid var(--border-soft); max-height: 260px; }
  .chat-pane { overflow: visible; }
  .chat-pane-head { padding: 12px 16px; }
  .chat-thread { flex: 0 0 auto; overflow: visible; padding: 16px; }
  .chat-composer { padding: 12px 16px 16px; }
  .cal-shell { grid-template-columns: 1fr; }
  .cal-toolbar { flex-wrap: wrap; gap: 10px; padding: 14px; }
  .cal-toolbar-left { width: 100%; justify-content: space-between; }
  .cal-views { order: 3; }
  .compose-row { grid-template-columns: 1fr !important; gap: 6px !important; }
  .compose-row-actions { justify-content: flex-start !important; }
  .auth-main { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .monthly-footer { grid-template-columns: 1fr; }
  .wx-forecast { grid-template-columns: repeat(2, 1fr); }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .form-actions .spacer { display: none; }
  .social-row { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
 * Sidebar collapsed to icons on desktop — toggled by the hamburger and kept
 * across pages (<html data-sidebar="collapsed">, set by preferences.js before
 * the first paint). Mirrors the tablet "rail" rules in app.css.
 * ------------------------------------------------------------------------ */
@media (min-width: 1101px) {
  .hamburger { display: inline-flex; }

  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .shell { grid-template-columns: var(--sidebar-rail-width) 1fr; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .d-sidebar { padding: 20px 10px; overflow-x: hidden; z-index: 20; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .brand-text,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .brand-tag,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-label,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-link > span:not(.menu-badge),
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-link .menu-badge,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .workspace-text,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .workspace-chev,
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-link .chev { display: none; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .brand { justify-content: center; padding: 0 0 18px; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-link { justify-content: center; padding: 10px; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-link.is-active::before { left: -10px; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .workspace { justify-content: center; padding: 6px; }

  /* Submenus open as flyouts next to the icon (positioned by app.js). */
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub {
    position: fixed;
    left: calc(var(--sidebar-rail-width) + 10px);
    top: 0;
    width: 200px;
    max-height: 0;
    margin-left: 0;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    z-index: 50;
    transition: none; /* no fade-out of every submenu when the sidebar collapses */
  }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub::before { display: none; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub a { padding: 8px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); margin: 0 6px; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub a:hover { padding-left: 14px; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-group.is-flyout > .menu-sub {
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    padding: 6px 0;
    opacity: 1;
    visibility: visible;
    transition: opacity 180ms ease, visibility 180ms;
  }
  /* groups inside the flyout open in place */
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub .menu-sub {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 0 0 20px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: inherit;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub .menu-sub::before { display: block; }
  :root[data-sidebar="collapsed"]:not([data-layout="horizontal"]) .menu-sub .menu-group.is-open > .menu-sub { max-height: none; padding: 2px 0 4px; }
}

/* Tablet (sidebar always icons): flyouts open only on click (.is-flyout), so
   the group of the current page doesn't pop open over the topbar on load.
   Groups inside a flyout open in place. */
@media (min-width: 721px) and (max-width: 1100px) {
  :root:not([data-layout="horizontal"]) .menu-section > .menu-group.is-open > .menu-sub { max-height: 0; padding: 0; opacity: 0; visibility: hidden; }
  :root:not([data-layout="horizontal"]) .menu-section > .menu-group.is-flyout > .menu-sub { max-height: calc(100vh - 16px); overflow-y: auto; padding: 6px 0; opacity: 1; visibility: visible; }
  :root:not([data-layout="horizontal"]) .menu-sub .menu-sub {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin: 0 0 0 20px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: inherit;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  :root:not([data-layout="horizontal"]) .menu-sub .menu-sub::before { display: block; }
  :root:not([data-layout="horizontal"]) .menu-sub .menu-group.is-open > .menu-sub { max-height: none; padding: 2px 0 4px; }
}

/* --------------------------------------------------------------------------
 * Menu tree — groups inside groups, any depth, with the same markup in every
 * layout. A group inside a submenu has a plain toggle: text + chevron.
 * app.js marks the link to the current page and every group above it
 * (.is-active, opened), and animates the height when a group is clicked.
 * ------------------------------------------------------------------------ */
.menu-sub > .menu-group > [data-menu-toggle] > span { flex: 1; min-width: 0; }
.menu-sub > .menu-group > [data-menu-toggle] .chev { width: 11px; height: 11px; flex-shrink: 0; margin-left: 8px; transition: transform 200ms ease; }
.menu-sub > .menu-group.is-open > [data-menu-toggle] .chev { transform: rotate(90deg); }
.menu-sub .menu-sub { margin-left: 10px; } /* the guide line sits under the parent's text */

/* --------------------------------------------------------------------------
 * Horizontal layout (<html data-layout="horizontal">) — the same menu markup:
 *   desktop   a bar under the topbar; section titles and badges hidden,
 *             groups as dropdowns (hover or click), and what doesn't fit goes
 *             into "More" (app.js); the brand moves to the topbar
 *   smaller   the hamburger opens the menu as a panel under the topbar
 * ------------------------------------------------------------------------ */
:root { --layout-max-width: 90%; } /* page width in the horizontal layout (100% = full width) */

.topbar-brand { display: none; align-items: center; gap: 10px; margin-right: 14px; flex-shrink: 0; }
.menu-more { display: none; }
:root[data-layout="horizontal"] .topbar-brand { display: flex; }
:root[data-layout="horizontal"] .d-sidebar > .brand,
:root[data-layout="horizontal"] .d-sidebar > .sidebar-footer,
:root[data-layout="horizontal"] .menu-label,
:root[data-layout="horizontal"] .menu-link .menu-badge { display: none; }

@media (min-width: 1101px) {
  /* Topbar, menu bar, content and footer stacked (the bar is the sidebar itself) */
  :root[data-layout="horizontal"] .shell { display: flex; flex-direction: column; }
  :root[data-layout="horizontal"] .main { display: contents; }
  :root[data-layout="horizontal"] .d-topbar { order: 1; }
  :root[data-layout="horizontal"] .d-sidebar { order: 2; }
  :root[data-layout="horizontal"] .content { order: 3; }
  :root[data-layout="horizontal"] .d-footer { order: 4; }
  :root[data-layout="horizontal"] .hamburger { display: none; }
  :root[data-layout="horizontal"] .d-topbar,
  :root[data-layout="horizontal"] .d-sidebar,
  :root[data-layout="horizontal"] .content,
  :root[data-layout="horizontal"] .d-footer { padding-inline: max(32px, calc((100% - var(--layout-max-width)) / 2)); }

  :root[data-layout="horizontal"] .d-sidebar {
    position: sticky;
    top: var(--topbar-height);
    z-index: 9;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding-block: 6px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: clip; /* closed dropdowns that stick out never make the page scroll sideways */
    overflow-y: visible;
  }
  :root[data-layout="horizontal"] .menu-section { flex-direction: row; align-items: center; gap: 2px; flex-shrink: 0; }
  :root[data-layout="horizontal"] .menu-link { gap: 8px; padding: 8px 12px; white-space: nowrap; }
  :root[data-layout="horizontal"] .menu-link > span:not(.menu-badge) { flex: none; }
  :root[data-layout="horizontal"] .menu-link.is-active { box-shadow: none; }
  :root[data-layout="horizontal"] .menu-group { position: relative; flex-shrink: 0; }
  :root[data-layout="horizontal"] .menu-group > .menu-link .chev { margin-left: 0; transform: rotate(90deg); }
  :root[data-layout="horizontal"] .menu-more.has-items { display: block; }

  /* Dropdowns */
  :root[data-layout="horizontal"] .menu-sub {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    min-width: 200px;
    max-height: none;
    margin: 0;
    padding: 6px;
    overflow: visible;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: opacity 150ms ease, visibility 150ms;
  }
  :root[data-layout="horizontal"] .menu-sub::before { display: none; }
  /* invisible bridge over the gap, so the pointer can travel to the dropdown */
  :root[data-layout="horizontal"] .menu-sub::after { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }
  :root[data-layout="horizontal"] .menu-group.is-open > .menu-sub { max-height: none; padding: 6px; }
  :root[data-layout="horizontal"] .menu-group.is-flyout > .menu-sub { opacity: 1; visibility: visible; }
  :root[data-layout="horizontal"] .menu-group.is-flip > .menu-sub { left: auto; right: 0; }
  :root[data-layout="horizontal"] .menu-sub a { padding: 8px 10px; white-space: nowrap; }
  :root[data-layout="horizontal"] .menu-sub a:hover { padding-left: 10px; }

  /* Groups inside a dropdown (any depth, and whatever moved into "More") open to the side */
  :root[data-layout="horizontal"] .menu-sub .menu-sub { top: -7px; left: calc(100% + 13px); } /* past the list's padding and border: a 6px gap */
  :root[data-layout="horizontal"] .menu-sub .menu-group.is-flip > .menu-sub { left: auto; right: calc(100% + 13px); }
  :root[data-layout="horizontal"] .menu-sub .menu-sub::after { top: 0; bottom: 0; left: auto; right: 100%; width: 14px; height: auto; }
  :root[data-layout="horizontal"] .menu-sub .menu-group.is-flip > .menu-sub::after { right: auto; left: 100%; }
  :root[data-layout="horizontal"] .menu-sub .menu-group > [data-menu-toggle] .chev { margin-left: auto; transform: none; }

  /* "More": the moved items as a list */
  :root[data-layout="horizontal"] .menu-more > .menu-sub { left: auto; right: 0; }
  :root[data-layout="horizontal"] .menu-more .menu-sub > .menu-link,
  :root[data-layout="horizontal"] .menu-more .menu-sub > .menu-group > .menu-link { gap: 10px; padding: 8px 10px; font-size: 0.8125rem; }
}

/* With a mouse, dropdowns also open on hover (touch and keyboard use the click). */
@media (min-width: 1101px) and (hover: hover) and (pointer: fine) {
  :root[data-layout="horizontal"] .menu-group:hover > .menu-sub { opacity: 1; visibility: visible; }
}

@media (max-width: 1100px) {
  /* Smaller screens: the hamburger opens the menu as a panel under the topbar */
  :root[data-layout="horizontal"] .shell { display: block; }
  :root[data-layout="horizontal"] .hamburger { display: inline-flex; }
  :root[data-layout="horizontal"] .d-sidebar {
    display: none;
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    z-index: 100;
    width: auto;
    height: auto;
    max-height: calc(100vh - var(--topbar-height));
    padding: 10px 16px 16px;
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    transform: none;
    transition: none;
    overflow-x: hidden;
    overflow-y: auto;
  }
  :root[data-layout="horizontal"] body.has-drawer-open { overflow: visible; }
  :root[data-layout="horizontal"] body.has-drawer-open .d-sidebar { display: flex; }
  :root[data-layout="horizontal"] .drawer-backdrop { display: none; }
  /* the vertical list, also on tablet (undoes the icon rail) */
  :root[data-layout="horizontal"] .menu-link { justify-content: flex-start; padding: 9px 12px; }
  :root[data-layout="horizontal"] .menu-link > span:not(.menu-badge) { display: block; }
  :root[data-layout="horizontal"] .menu-link .chev { display: block; }
  :root[data-layout="horizontal"] .menu-group { position: static; }
  :root[data-layout="horizontal"] .menu-sub {
    position: relative; /* holds its guide line (::before) */
    left: auto;
    top: auto;
    width: auto;
    max-height: 0;
    margin-left: 20px;
    padding: 0 0 0 14px;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transition: max-height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  }
  :root[data-layout="horizontal"] .menu-sub::before { display: block; }
  :root[data-layout="horizontal"] .menu-group.is-open > .menu-sub { max-height: none; padding: 4px 0 6px 14px; opacity: 1; visibility: visible; }
  :root[data-layout="horizontal"] .menu-sub .menu-sub { margin-left: 10px; }
  :root[data-layout="horizontal"] .menu-sub a { margin: 0; padding: 7px 10px; font-size: 0.78125rem; }
  :root[data-layout="horizontal"] .menu-sub a:hover { padding-left: 13px; }
}

@media (max-width: 720px) {
  /* Phones: the logo without the name, like Velzon's small logo */
  :root[data-layout="horizontal"] .topbar-brand { margin-right: 4px; }
  :root[data-layout="horizontal"] .topbar-brand .brand-name { display: none; }
}

/* --------------------------------------------------------------------------
 * Topbar user: name beside the avatar (hidden on mobile); both open the
 * account menu.
 * ------------------------------------------------------------------------ */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 6px;
  padding: 3px 3px 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms;
}
.topbar-user:hover,
.topbar-user.show { background: var(--bg-hover); }
.topbar-user .avatar { margin-left: 0; }
.topbar-user-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--t-base);
}

@media (max-width: 720px) {
  .topbar-user { margin-left: 2px; padding: 0; }
  .topbar-user:hover,
  .topbar-user.show { background: none; }
  .topbar-user-name { display: none; }
}

/* --------------------------------------------------------------------------
 * Form helpers (forms.js): show/hide button on passwords, calendar/clock icon
 * on date & time fields. The icon sits inside the field, on the right.
 * ------------------------------------------------------------------------ */
.input-wrap { position: relative; display: block; }
.input-icon > .ico { z-index: 1; } /* the leading icon stays above a wrapped field */
.input-wrap.has-action > .form-control,
.input-wrap.has-adorn > .form-control { padding-right: calc(var(--control-padding-x) + 1.5rem); }

.input-action,
.input-adorn {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  color: var(--t-light);
}
.input-adorn { pointer-events: none; } /* clicks reach the field, which opens the picker */
.input-action { transition: color 160ms, background 160ms; }
.input-action:hover { color: var(--t-base); background: var(--bg-hover); }
.input-action:focus-visible { outline: 0; color: var(--t-base); box-shadow: var(--focus-ring); }
.input-action svg,
.input-adorn svg { width: 1rem; height: 1rem; stroke: currentColor; stroke-width: 1.8; fill: none; }
.input-action [data-icon="hide"],
.input-action[aria-pressed="true"] [data-icon="show"] { display: none; }
.input-action[aria-pressed="true"] [data-icon="hide"] { display: block; }
.form-control:disabled ~ .input-action { pointer-events: none; opacity: .5; }

input::-ms-reveal,
input::-ms-clear { display: none; } /* Edge's own eye / clear buttons */

/* Field stays highlighted while its picker is open. */
.form-control.flatpickr-input.active { border-color: var(--primary); box-shadow: var(--focus-ring); }

/* --------------------------------------------------------------------------
 * Select2 — same box, sizes and states as .input / .select, so a form row
 * lines up whichever control it uses.
 * ------------------------------------------------------------------------ */
.select2-container { font-family: inherit; font-size: var(--control-font-size); }

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--t-base);
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}

.select2-container .select2-selection--single {
  height: auto;
  padding: var(--control-padding-y) 32px var(--control-padding-y) var(--control-padding-x);
  /* Same chevron as .select in app.css */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns=%27http://www.w3.org/2000/svg%27 width=%2712%27 height=%2712%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27%2364748B%27 stroke-width=%272%27><path d=%27m6 9 6 6 6-6%27/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  padding: 0;
  color: var(--t-base);
  line-height: inherit;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder,
.select2-container--default .select2-selection--multiple .select2-search__field::placeholder { color: var(--t-light); }
.select2-container--default .select2-selection--single .select2-selection__arrow { display: none; }
.select2-container--default .select2-selection--single .select2-selection__clear {
  position: absolute;
  top: 50%;
  right: 30px;
  transform: translateY(-50%);
  float: none;
  height: auto;
  margin: 0;
  padding: 0 4px;
  color: var(--t-light);
  font-size: 1.125em;
  line-height: 1;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover { color: var(--danger); }

.select2-container--default.select2-container--focus .select2-selection,
.select2-container--default.select2-container--open .select2-selection {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
  outline: 0;
}
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,
.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple { border-radius: var(--radius); }

.select2-container--default.select2-container--disabled .select2-selection--single,
.select2-container--default.select2-container--disabled .select2-selection--multiple {
  background-color: var(--bg-muted);
  cursor: not-allowed;
}
.select2-container--default.select2-container--disabled .select2-selection__rendered { color: var(--t-light); }

select.is-invalid + .select2-container--default .select2-selection { border-color: var(--danger); }
select.is-invalid + .select2-container--default.select2-container--focus .select2-selection,
select.is-invalid + .select2-container--default.select2-container--open .select2-selection { box-shadow: 0 0 0 3px var(--danger-soft); }

/* Multiple: chips inside a box that is exactly .input-high when empty */
.select2-container .select2-selection--multiple { min-height: 0; }
.select2-container--default .select2-selection--multiple {
  padding: 3px 4px 3px calc(var(--control-padding-x) - 4px);
  cursor: text;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered { display: inline; margin: 0; }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  margin: 3px 4px 3px 0;
  padding: 0 8px 0 22px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.75;
  vertical-align: middle;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__display { padding: 0; cursor: default; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  top: 50%;
  transform: translateY(-50%);
  height: auto;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 1.1em;
  line-height: 1;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus { background: none; color: var(--danger); outline: 0; }
.select2-container .select2-search--inline .select2-search__field {
  /* one line high (it's a <textarea>, which defaults to two rows) */
  height: calc(var(--control-font-size) * 1.55 + 2 * (var(--control-padding-y) - 3px));
  height: calc(1lh + 2 * (var(--control-padding-y) - 3px));
  margin: 0;
  padding: calc(var(--control-padding-y) - 3px) 4px;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: var(--t-base);
  vertical-align: middle;
}

/* Dropdown */
.select2-container--default .select2-dropdown {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  color: var(--t-base);
  overflow: hidden;
}
.select2-container--default .select2-dropdown--below { margin-top: 4px; border-top: 1px solid var(--border); border-radius: var(--radius-lg); }
.select2-container--default .select2-dropdown--above { margin-top: -4px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg); }
.select2-container--default .select2-search--dropdown { padding: 6px 6px 2px; }
.select2-container--default .select2-search--dropdown .select2-search__field {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--t-base);
  font: inherit;
  outline: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.select2-container--default .select2-results > .select2-results__options { max-height: 15rem; padding: 4px; }
.select2-container--default .select2-results__option { padding: 8px 10px; border-radius: var(--radius-sm); }
.select2-container--default .select2-results__option--selected { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--bg-hover); color: var(--t-base); }
.select2-container--default .select2-results__option--highlighted.select2-results__option--selected { color: var(--primary); }
.select2-container--default .select2-results__option--disabled { color: var(--t-light); }
.select2-container--default .select2-results__group {
  padding: 8px 10px 4px;
  color: var(--t-light);
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.select2-container--default .select2-results__message { color: var(--t-muted); }

/* --------------------------------------------------------------------------
 * flatpickr — date / time picker in the template's look. Sizes are in rem so
 * the calendar grows with the text (--font-scale).
 * ------------------------------------------------------------------------ */
.flatpickr-calendar {
  width: 19.2421875rem; /* 307.875px at the default size */
  font-family: inherit;
  font-size: var(--control-font-size);
  line-height: 1.5rem;
  color: var(--t-base);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
}
.flatpickr-calendar::before,
.flatpickr-calendar::after { display: none; } /* no arrow, like the other dropdowns */
.flatpickr-calendar.arrowTop { margin-top: 4px; }
.flatpickr-calendar.arrowBottom { margin-top: -4px; }
.flatpickr-days,
.dayContainer { width: 19.2421875rem; min-width: 19.2421875rem; max-width: 19.2421875rem; }

.flatpickr-months .flatpickr-month,
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month { height: 2.75rem; color: var(--t-base); fill: var(--t-base); }
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month { padding: 0.875rem; color: var(--t-muted); fill: var(--t-muted); }
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg { fill: var(--primary); }
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg { width: 0.75rem; height: 0.75rem; }
.flatpickr-current-month { height: 2.75rem; padding-top: 0.75rem; font-size: 0.875rem; font-weight: 600; }
.flatpickr-current-month span.cur-month,
.flatpickr-current-month input.cur-year { font-weight: 600; }
.flatpickr-current-month span.cur-month:hover,
.flatpickr-current-month .numInputWrapper:hover { background: var(--bg-hover); border-radius: var(--radius-xs); }

.flatpickr-weekdays { height: 1.75rem; }
span.flatpickr-weekday {
  color: var(--t-light);
  font-family: var(--font-mono);
  font-size: 0.65625rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.flatpickr-day {
  max-width: 2.4375rem;
  height: 2.4375rem;
  line-height: 2.4375rem;
  border-radius: var(--radius);
  color: var(--t-base);
}
.flatpickr-day:hover,
.flatpickr-day:focus,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover,
.flatpickr-day.prevMonthDay:focus,
.flatpickr-day.nextMonthDay:focus { background: var(--bg-hover); border-color: var(--bg-hover); }
.flatpickr-day.today { border-color: var(--border); font-weight: 600; }
.flatpickr-day.today:hover,
.flatpickr-day.today:focus { background: var(--bg-hover); border-color: var(--border); color: var(--t-base); }
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.flatpickr-day.inRange,
.flatpickr-day.inRange:hover { background: var(--primary-soft); border-color: var(--primary-soft); box-shadow: -5px 0 0 var(--primary-soft), 5px 0 0 var(--primary-soft); }
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay,
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.notAllowed { color: var(--t-light); }

.flatpickr-time { height: 2.5rem; max-height: 2.5rem; line-height: 2.5rem; border-top: 1px solid var(--border-soft); }
.flatpickr-calendar.noCalendar .flatpickr-time,
.flatpickr-calendar.hasTime.noCalendar .flatpickr-time { border-top: 0; }
.flatpickr-calendar.hasTime .flatpickr-time { height: 2.5rem; }
.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm,
.flatpickr-time .flatpickr-time-separator { color: var(--t-base); font-family: inherit; font-size: var(--control-font-size); }
.flatpickr-time input.flatpickr-hour { font-weight: 600; }
.flatpickr-time input:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time .flatpickr-am-pm:focus { background: var(--bg-hover); }
.numInputWrapper:hover { background: var(--bg-hover); }
.numInputWrapper span { border-color: var(--border-soft); }
.numInputWrapper span:hover { background: var(--bg-muted); }
.numInputWrapper span.arrowUp::after { border-bottom-color: var(--t-muted); }
.numInputWrapper span.arrowDown::after { border-top-color: var(--t-muted); }

/* --------------------------------------------------------------------------
 * SweetAlert2 — its CSS variables mapped to the template tokens (so it also
 * follows the light / dark theme), plus the template's type sizes.
 * ------------------------------------------------------------------------ */
:root {
  --swal2-width: 28rem;
  --swal2-padding: 0 0 1.5rem;
  --swal2-border: 1px solid var(--border);
  --swal2-border-radius: var(--radius-xl);
  --swal2-background: var(--bg-card);
  --swal2-color: var(--t-base);
  --swal2-backdrop: rgba(15, 23, 42, 0.5);
  --swal2-outline: var(--focus-ring);
  --swal2-title-padding: 1.5rem 1.5rem 0;
  --swal2-html-container-padding: 0.5rem 1.5rem 0;
  --swal2-input-border: 1px solid var(--border);
  --swal2-input-border-radius: var(--radius);
  --swal2-input-box-shadow: none;
  --swal2-input-hover-box-shadow: none;
  --swal2-input-background: var(--bg-card);
  --swal2-input-focus-border: 1px solid var(--primary);
  --swal2-input-focus-box-shadow: var(--focus-ring);
  --swal2-validation-message-background: var(--danger-soft);
  --swal2-validation-message-color: var(--danger);
  --swal2-footer-border-color: var(--border-soft);
  --swal2-close-button-color: var(--t-light);
  --swal2-actions-margin: 1.25rem auto 0;
  --swal2-confirm-button-background-color: var(--primary);
  --swal2-confirm-button-color: #fff;
  --swal2-confirm-button-border-radius: var(--radius);
  --swal2-deny-button-background-color: var(--danger);
  --swal2-deny-button-color: #fff;
  --swal2-deny-button-border-radius: var(--radius);
  --swal2-cancel-button-background-color: var(--bg-card);
  --swal2-cancel-button-color: var(--t-base);
  --swal2-cancel-button-border-radius: var(--radius);
  --swal2-progress-step-background: var(--primary-soft);
  --swal2-timer-progress-bar-background: var(--primary);
  --swal2-toast-border: 1px solid var(--border);
}
.swal2-popup { font-family: inherit; font-size: 0.875rem; box-shadow: var(--shadow-lg); }
.swal2-title {
  color: var(--t-base);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.swal2-html-container { color: var(--t-muted); font-size: 0.875rem; line-height: 1.55; }
.swal2-styled {
  margin: 0.3125rem;
  padding: var(--control-padding-y) var(--button-padding-x);
  border: 1px solid transparent; /* every button as tall as the template's .btn and inputs */
  font-size: var(--control-font-size);
  font-weight: 600;
}
.swal2-styled.swal2-cancel { border: 1px solid var(--border); }
/* .swal2-popup raises the specificity over the plugin's
   "div:where(.swal2-container) .swal2-input" (fixed height, no padding). */
.swal2-popup .swal2-input,
.swal2-popup .swal2-file,
.swal2-popup .swal2-textarea,
.swal2-popup .swal2-select {
  margin: 1rem 1.5rem 0.25rem;
  padding: var(--control-padding-y) var(--control-padding-x);
  color: var(--t-base);
  font-family: inherit;
  font-size: var(--control-font-size);
}
.swal2-popup .swal2-input { height: auto; } /* as tall as the template's inputs */
.swal2-validation-message,
.swal2-footer { font-size: 0.8125rem; }
.swal2-footer { color: var(--t-muted); }
.swal2-icon.swal2-success { border-color: var(--success); color: var(--success); }
.swal2-icon.swal2-success [class^="swal2-success-line"] { background-color: var(--success); }
.swal2-icon.swal2-success .swal2-success-ring { border-color: color-mix(in oklab, var(--success) 30%, transparent); }
.swal2-icon.swal2-error { border-color: var(--danger); color: var(--danger); }
.swal2-icon.swal2-error [class^="swal2-x-mark-line"] { background-color: var(--danger); }
.swal2-icon.swal2-warning { border-color: var(--warning); color: var(--warning); }
.swal2-icon.swal2-info { border-color: var(--info); color: var(--info); }
.swal2-icon.swal2-question { border-color: var(--purple); color: var(--purple); }

/* --------------------------------------------------------------------------
 * Wizard (jQuery Steps, see wizard.js), in two step styles:
 *   .wizard--circle   numbered circles joined by a line, edge to edge (default)
 *   .wizard--arrow    a bar of tabs with arrows between the steps
 * Previous / Next / Submit are styled as the template's buttons.
 * ------------------------------------------------------------------------ */
.wizard > .steps .current-info,
.wizard > .content > .title { position: absolute; left: -99999px; } /* screen-reader only */
.wizard > .steps > ul { display: flex; margin: 0 0 24px; padding: 0; list-style: none; }
.wizard > .steps > ul > li { position: relative; flex: 1 1 0; min-width: 0; text-align: center; }
.wizard > .steps a {
  position: relative;
  z-index: 1;
  color: var(--t-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.wizard > .steps .disabled a { cursor: default; }
/* jQuery Steps focuses the current step after each move: no browser outline
   (keyboard users get a ring instead, see each style). */
.wizard > .steps a:focus { outline: 0; }

/* Circle — full width like the arrow bar: the first and last circles touch
   the edges and all of them are evenly spread. The circle centres run on a
   track one radius (1.0625rem) in from each edge: the end steps take half a
   column, with the circle centred on the outer edge of the step. Each step
   draws the line from the previous circle to its own. */
.wizard--circle > .steps > ul { padding-inline: 1.0625rem; }
.wizard--circle > .steps > ul > li { flex-grow: 2; }
.wizard--circle > .steps > ul > li:first-child,
.wizard--circle > .steps > ul > li:last-child { flex-grow: 1; }
.wizard--circle > .steps > ul > li + li::before {
  content: "";
  position: absolute;
  top: 1.0625rem;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--border);
}
.wizard--circle > .steps > ul > li:last-child::before { left: -100%; right: 0; }
.wizard--circle > .steps > ul > li.done::before,
.wizard--circle > .steps > ul > li.current::before { background: var(--primary); }
.wizard--circle > .steps a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
}
.wizard--circle > .steps > ul > li:first-child a { align-items: flex-start; margin-left: -1.0625rem; padding-left: 0; text-align: left; }
.wizard--circle > .steps > ul > li:last-child a { align-items: flex-end; margin-right: -1.0625rem; padding-right: 0; text-align: right; }
.wizard--circle > .steps a:focus-visible .step { box-shadow: var(--focus-ring); }
.wizard--circle > .steps .current a { color: var(--t-base); }
.wizard--circle > .steps .step {
  display: grid;
  place-items: center;
  width: 2.125rem;
  height: 2.125rem;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--t-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  transition: background 180ms, border-color 180ms, color 180ms;
}
.wizard--circle > .steps .current .step { border-color: var(--primary); color: var(--primary); box-shadow: var(--focus-ring); }
.wizard--circle > .steps .done .step { border-color: var(--primary); background: var(--primary); color: #fff; }
.wizard--circle > .steps .error .step { border-color: var(--danger); color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.wizard--circle > .steps .error a { color: var(--danger); }

/* Arrow — the background and the arrow live on the <li>, which carries the
   jQuery Steps state classes (current / done / error). */
.wizard--arrow > .steps > ul { background: var(--bg-muted); border-radius: var(--radius); }
.wizard--arrow > .steps > ul > li { transition: background 180ms; }
.wizard--arrow > .steps > ul > li:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.wizard--arrow > .steps > ul > li:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.wizard--arrow > .steps > ul > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -14px;
  z-index: 2;
  transform: translateY(-50%);
  border: 7px solid transparent;
}
.wizard--arrow > .steps a {
  display: block;
  padding: 0.75rem 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 180ms;
}
.wizard--arrow > .steps a:focus-visible { box-shadow: inset var(--focus-ring); }
.wizard--arrow > .steps .step { display: none; }
.wizard--arrow > .steps > ul > li.done { background: color-mix(in oklab, var(--primary) 6%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.done::after { border-left-color: color-mix(in oklab, var(--primary) 6%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.done a { color: var(--primary); }
.wizard--arrow > .steps > ul > li.current { background: color-mix(in oklab, var(--primary) 12%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.current::after { border-left-color: color-mix(in oklab, var(--primary) 12%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.current a { color: var(--primary); }
.wizard--arrow > .steps > ul > li.error { background: color-mix(in oklab, var(--danger) 12%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.error::after { border-left-color: color-mix(in oklab, var(--danger) 12%, var(--bg-muted)); }
.wizard--arrow > .steps > ul > li.error a { color: var(--danger); }

/* Buttons (both styles) */
.wizard > .actions > ul {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--border-soft);
  list-style: none;
}
.wizard > .actions a {
  display: inline-flex;
  align-items: center;
  padding: var(--control-padding-y) var(--button-padding-x);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-size: var(--control-font-size);
  font-weight: 600;
  transition: background 180ms, border-color 180ms, box-shadow 180ms;
}
.wizard > .actions a:hover { background: var(--primary-dark); }
.wizard > .actions a:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.wizard > .actions a[href="#previous"] { background: var(--bg-card); border-color: var(--border); color: var(--t-base); }
.wizard > .actions a[href="#previous"]:hover { border-color: var(--t-light); box-shadow: var(--shadow-sm); }
.wizard > .actions .disabled a { opacity: .5; cursor: not-allowed; pointer-events: none; }

@media (max-width: 720px) {
  /* Small screens: only the numbers, the current step keeps its title. */
  .wizard--circle > .steps a { font-size: 0; gap: 6px; }
  .wizard--circle > .steps .current a { font-size: 0.75rem; }
  .wizard--circle > .steps .step { font-size: 0.75rem; }

  .wizard--arrow > .steps a { padding: 0.625rem 0.5rem; font-size: 0; }
  .wizard--arrow > .steps .step { display: inline; font-family: var(--font-mono); font-size: 0.75rem; }
  .wizard--arrow > .steps .current a { font-size: 0.75rem; }
  .wizard--arrow > .steps .current .step { display: none; }
}

/* --------------------------------------------------------------------------
 * Other plugins following the template fonts and colors
 * ------------------------------------------------------------------------ */
/* FullCalendar's classic theme ships fixed px sizes on generated class names
   (stable across its 7.x releases): restated in rem so the calendar follows
   --font-scale. */
.fc-classic-n5m { font-size: 1rem; }
.fc-classic-AVD { font-size: 1.5rem; }
.fc-classic-vQz { font-size: 0.6875rem; }
.fc-classic-1Po { font-size: 1rem; }
.fc-classic-9yp { font-size: 0.875rem; }
.fc-classic-a3B { font-size: 0.75rem; }

/* ApexCharts (assets/libs/apexcharts.js sets fonts and colors from the tokens) */
.apex-chart { min-height: 0; }
.apex-chart .apexcharts-tooltip { border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.apex-chart .apexcharts-tooltip.apexcharts-theme-light { border-color: var(--border); background: var(--bg-card); color: var(--t-base); }
.apex-chart .apexcharts-tooltip.apexcharts-theme-light .apexcharts-tooltip-title { border-bottom-color: var(--border-soft); background: var(--bg-muted); }
.apex-chart .apexcharts-tooltip.apexcharts-theme-dark { border: 1px solid var(--border); background: var(--bg-card); color: var(--t-base); }
.apex-chart .apexcharts-tooltip.apexcharts-theme-dark .apexcharts-tooltip-title { border-bottom-color: var(--border-soft); background: var(--bg-muted); }

/* jsvectormap tooltip, zoom buttons and legend */
:root {
  --jvm-border-color: var(--border);
  --jvm-tooltip-font-size: 0.75rem;
  --jvm-tooltip-bg-color: var(--t-base);
  --jvm-tooltip-color: var(--bg-card);
  --jvm-tooltip-padding: 6px 10px;
  --jvm-tooltip-radius: var(--radius-sm);
  --jvm-tooltip-shadow: var(--shadow-lg);
  --jvm-zoom-btn-bg-color: var(--t-base);
  --jvm-zoom-btn-color: var(--bg-card);
  --jvm-zoom-btn-radius: var(--radius-xs);
  --jvm-legend-bg-color: var(--bg-card);
  --jvm-legend-tick-text-font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
 * .rich-text — for HTML you don't control (editor output, CMS content):
 * restores what app.css resets globally (list bullets, inline images,
 * underlined links, spacing).
 * ------------------------------------------------------------------------ */
.rich-text { line-height: 1.65; }
.rich-text :where(p, ul, ol, blockquote, pre, table, figure) { margin: 0 0 1em; }
.rich-text :where(h1, h2, h3, h4, h5, h6) { margin: 1.4em 0 0.5em; font-family: var(--font-display); line-height: 1.25; }
.rich-text :where(ul, ol) { padding-left: 1.5em; }
.rich-text :where(ul) { list-style: disc; }
.rich-text :where(ol) { list-style: decimal; }
.rich-text :where(li + li) { margin-top: 0.25em; }
.rich-text :where(a) { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.rich-text :where(img, svg, video, canvas) { display: inline; max-width: 100%; height: auto; vertical-align: middle; }
.rich-text :where(blockquote) { padding-left: 1em; border-left: 3px solid var(--border); color: var(--t-muted); }
.rich-text :where(code) { padding: 0.1em 0.35em; border-radius: var(--radius-xs); background: var(--bg-muted); font-family: var(--font-mono); font-size: 0.9em; }
.rich-text :where(pre) { padding: 1em; border-radius: var(--radius); background: var(--bg-muted); overflow: auto; }
.rich-text :where(pre code) { padding: 0; background: none; }

/* --------------------------------------------------------------------------
 * Bootstrap theme — Bootstrap's components with the template's look. Sizes,
 * radius and colors come from the tokens at the top of app.css (and the
 * --bs-* bridge right after them), in light and dark.
 * ------------------------------------------------------------------------ */

/* Buttons: every .btn (md) is as tall as the form controls, .btn-icon is
   square at any size. Variants: primary, secondary, success, danger,
   warning, info, light (neutral), dark, soft-*, outline-*, link. */
.btn {
  --bs-btn-padding-x: var(--button-padding-x);
  --bs-btn-padding-y: var(--control-padding-y);
  --bs-btn-font-size: var(--control-font-size);
  --bs-btn-font-weight: 600;
  --bs-btn-line-height: var(--control-line-height);
  --bs-btn-border-radius: var(--radius);
  --bs-btn-focus-box-shadow: var(--focus-ring);
  --bs-btn-disabled-opacity: 0.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  transition: all 180ms ease;
}
.btn svg { width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor; stroke-width: 2; fill: none; }
.btn > i { line-height: inherit; } /* fontes de ícones (Font Awesome, Bootstrap Icons...) põem line-height: 1; um botão só com ícone ficava mais baixo que os campos */
.btn .badge { margin-block: -4px; } /* a badge inside doesn't make the button taller */
.btn-sm { --bs-btn-padding-y: 6px; --bs-btn-padding-x: 10px; --bs-btn-font-size: 0.71875rem; --bs-btn-border-radius: var(--radius); }
.btn-lg { --bs-btn-padding-y: 12px; --bs-btn-padding-x: 18px; --bs-btn-font-size: 0.875rem; --bs-btn-border-radius: var(--radius); }
.btn-icon { --bs-btn-padding-x: var(--bs-btn-padding-y); }
.btn.btn-icon > svg { box-sizing: content-box; margin: 0; padding: 3px; padding: calc((1lh - 14px) / 2); } /* a line-high box: as tall as a text button */

.btn-primary, .btn-soft-primary, .btn-outline-primary { --btn-c: var(--primary); --btn-soft: var(--primary-soft); }
.btn-success, .btn-soft-success, .btn-outline-success { --btn-c: var(--success); --btn-soft: var(--success-soft); }
.btn-danger, .btn-soft-danger, .btn-outline-danger { --btn-c: var(--danger); --btn-soft: var(--danger-soft); }
.btn-warning, .btn-soft-warning, .btn-outline-warning { --btn-c: var(--warning); --btn-soft: var(--warning-soft); }
.btn-info, .btn-soft-info, .btn-outline-info { --btn-c: var(--info); --btn-soft: var(--info-soft); }
.btn-soft-secondary, .btn-outline-secondary { --btn-c: var(--t-muted); --btn-soft: var(--bg-muted); }

.btn-primary, .btn-success, .btn-danger, .btn-warning, .btn-info {
  --btn-c-hover: color-mix(in oklab, var(--btn-c) 90%, black);
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--btn-c);
  --bs-btn-border-color: var(--btn-c);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--btn-c-hover);
  --bs-btn-hover-border-color: var(--btn-c-hover);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--btn-c-hover);
  --bs-btn-active-border-color: var(--btn-c-hover);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--btn-c);
  --bs-btn-disabled-border-color: var(--btn-c);
}
.btn-primary { --btn-c-hover: var(--primary-dark); box-shadow: 0 1px 2px var(--primary-ring); }

.btn-soft-primary, .btn-soft-secondary, .btn-soft-success, .btn-soft-danger, .btn-soft-warning, .btn-soft-info {
  --bs-btn-color: var(--btn-c);
  --bs-btn-bg: var(--btn-soft);
  --bs-btn-border-color: transparent;
  --bs-btn-hover-color: var(--btn-c);
  --bs-btn-hover-bg: color-mix(in oklab, var(--btn-soft) 80%, var(--btn-c) 8%);
  --bs-btn-hover-border-color: transparent;
  --bs-btn-active-color: var(--btn-c);
  --bs-btn-active-bg: color-mix(in oklab, var(--btn-soft) 80%, var(--btn-c) 8%);
  --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-color: var(--btn-c);
  --bs-btn-disabled-bg: var(--btn-soft);
  --bs-btn-disabled-border-color: transparent;
}

.btn-outline-primary, .btn-outline-secondary, .btn-outline-success, .btn-outline-danger, .btn-outline-warning, .btn-outline-info {
  --bs-btn-color: var(--btn-c);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--btn-c);
  --bs-btn-hover-color: var(--btn-c);
  --bs-btn-hover-bg: var(--btn-soft);
  --bs-btn-hover-border-color: var(--btn-c);
  --bs-btn-active-color: var(--btn-c);
  --bs-btn-active-bg: var(--btn-soft);
  --bs-btn-active-border-color: var(--btn-c);
  --bs-btn-disabled-color: var(--btn-c);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--btn-c);
}

.btn-secondary {
  --bs-btn-color: var(--t-base);
  --bs-btn-bg: var(--bg-muted);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--t-base);
  --bs-btn-hover-bg: var(--bg-hover);
  --bs-btn-hover-border-color: var(--t-light);
  --bs-btn-active-color: var(--t-base);
  --bs-btn-active-bg: var(--bg-hover);
  --bs-btn-active-border-color: var(--t-light);
  --bs-btn-disabled-color: var(--t-base);
  --bs-btn-disabled-bg: var(--bg-muted);
  --bs-btn-disabled-border-color: var(--border);
}
.btn-light {
  --bs-btn-color: var(--t-base);
  --bs-btn-bg: var(--bg-card);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-color: var(--t-base);
  --bs-btn-hover-bg: var(--bg-card);
  --bs-btn-hover-border-color: var(--t-light);
  --bs-btn-active-color: var(--t-base);
  --bs-btn-active-bg: var(--bg-hover);
  --bs-btn-active-border-color: var(--t-light);
  --bs-btn-disabled-color: var(--t-base);
  --bs-btn-disabled-bg: var(--bg-card);
  --bs-btn-disabled-border-color: var(--border);
}
.btn-light:hover { box-shadow: var(--shadow-sm); }
.btn-dark {
  --bs-btn-color: var(--t-inverse);
  --bs-btn-bg: var(--t-base);
  --bs-btn-border-color: var(--t-base);
  --bs-btn-hover-color: var(--t-inverse);
  --bs-btn-hover-bg: color-mix(in oklab, var(--t-base) 88%, var(--bg-body));
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--t-inverse);
  --bs-btn-active-bg: var(--bs-btn-hover-bg);
  --bs-btn-active-border-color: var(--bs-btn-hover-bg);
}
.btn-link { --bs-btn-font-weight: 600; --bs-btn-color: var(--primary); --bs-btn-hover-color: var(--primary-dark); text-decoration: none; }

/* Form controls: one height for inputs, selects and buttons (the control
   tokens); a single focus ring; errors in red without Bootstrap's icon (the
   right side of a field holds the password / date buttons). */
.form-label { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 0.75rem; font-weight: 600; letter-spacing: -0.005em; color: var(--t-base); }
.form-label .req { color: var(--danger); }
.form-text { margin-top: 6px; font-size: 0.71875rem; line-height: 1.45; color: var(--t-muted); }
.invalid-feedback { align-items: center; gap: 4px; margin-top: 6px; font-size: 0.71875rem; color: var(--danger); }
.is-invalid ~ .invalid-feedback { display: flex; } /* icon and text on one line */
.form-control,
.form-select {
  padding: var(--control-padding-y) var(--control-padding-x);
  font-size: var(--control-font-size);
  line-height: var(--control-line-height);
  color: var(--t-base);
  background-color: var(--bg-card);
  border-color: var(--border);
  border-radius: var(--radius);
  transition: border-color 180ms, box-shadow 180ms;
}
.form-control::placeholder { color: var(--t-light); }
.form-control:focus,
.form-select:focus { color: var(--t-base); background-color: var(--bg-card); border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-control:disabled,
.form-select:disabled { color: var(--t-light); background-color: var(--bg-muted); cursor: not-allowed; }
textarea.form-control { min-height: 96px; line-height: 1.5; resize: vertical; }
:root[data-theme] .form-select {
  --bs-form-select-bg-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  padding-right: calc(var(--control-padding-x) + 20px);
  background-position: right var(--control-padding-x) center;
  background-size: 12px 12px;
}
.form-control.is-invalid,
.form-select.is-invalid { border-color: var(--danger); background-image: none; padding-right: var(--control-padding-x); }
.form-select.is-invalid { --bs-form-select-bg-icon: none; padding-right: calc(var(--control-padding-x) + 20px); }
.form-control.is-invalid:focus,
.form-select.is-invalid:focus { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-control.is-valid,
.form-select.is-valid { background-image: none; }

/* Input groups: the addon in the mono font, on the muted background */
.input-group-text { padding: var(--control-padding-y) var(--control-padding-x); font-family: var(--font-mono); font-size: 0.75rem; line-height: var(--control-line-height); color: var(--t-muted); background-color: var(--bg-muted); border-color: var(--border); }

/* Checkboxes, radios and switches: the label is the whole row */
.form-check { display: flex; align-items: center; gap: 8px; min-height: 0; margin: 0; padding: 0; font-size: 0.8125rem; color: var(--t-base); cursor: pointer; user-select: none; }
.form-check .form-check-input { float: none; margin: 0; flex-shrink: 0; }
.form-check-input { width: 16px; height: 16px; margin-top: 0; background-color: var(--bg-card); border: 1.5px solid var(--t-light); cursor: pointer; }
.form-check-input[type="checkbox"] { border-radius: calc(var(--radius) * 0.625); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { border-color: var(--primary); box-shadow: var(--focus-ring); }
.form-check:hover .form-check-input:not(:disabled) { border-color: var(--primary); }
.form-check-input:disabled ~ .form-check-label { opacity: 0.6; }
.form-switch { gap: 10px; }
.form-switch .form-check-input { width: 34px; height: 20px; border: 1px solid var(--border); border-radius: 999px; background-color: var(--bg-muted); }
.form-switch .form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
:root[data-theme] .form-switch .form-check-input,
:root[data-theme] .form-switch .form-check-input:focus,
:root[data-theme] .form-switch .form-check-input:not(:checked):not(:focus) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2.8' fill='%23fff'/%3E%3C/svg%3E");
}
:root[data-theme] .form-switch .form-check-input:not(:checked) {
  --bs-form-switch-bg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='2.75' fill='%23fff' stroke='%23CBD5E1' stroke-width='.35'/%3E%3C/svg%3E");
}

/* Cards: an optional header (eyebrow, title, action) over an inset line, then
   the body. Spacing on --bs-card-spacer-x / -y. */
.card {
  --bs-card-spacer-x: 22px;
  --bs-card-spacer-y: 22px;
  --bs-card-border-color: var(--border);
  --bs-card-border-radius: var(--radius-xl);
  --bs-card-inner-border-radius: calc(var(--radius-xl) - 1px);
  --bs-card-bg: var(--bg-card);
  --bs-card-color: var(--t-base);
  --bs-card-title-color: var(--t-base);
  --bs-card-cap-bg: transparent;
  box-shadow: var(--shadow-card);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: var(--bs-card-spacer-y) var(--bs-card-spacer-x) 0;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--border-soft);
}
.card-header > :last-child { flex-shrink: 0; padding-bottom: 2px; }
.card-header + .card-body { padding-top: 20px; }
@media (max-width: 720px) {
  .card { --bs-card-spacer-x: 18px; --bs-card-spacer-y: 18px; }
  .card-header { flex-wrap: wrap; gap: 10px; }
}

/* Page grid: rows of cards rise in together (the KPI row animates card by card). Fill mode "backwards", not
   "both": the transform the animation left on each row made it a stacking context, so a dropdown opened in
   one row (e.g. a filter row's export or columns menu) went under the card of the next row. */
.content > .row:not(.kpi-row) { animation: rise-in 600ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards; animation-delay: 260ms; }

/* Button groups: one outlined block; the pressed button (.active) tinted */
.btn-group { border-radius: var(--radius); box-shadow: 0 0 0 1px var(--border); overflow: hidden; }
.btn-group > .btn { margin: 0; border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.btn-group > .btn:last-child { border-right: 0; }
.btn-group > .btn.active { background: var(--primary-soft); color: var(--primary); }

/* Badges: pills coloured with Bootstrap's utilities — soft .bg-{color}-subtle
   + .text-{color}, solid .text-bg-{color}; .badge-dot puts a status dot first. */
.badge {
  --bs-badge-padding-x: 8px;
  --bs-badge-padding-y: 3px;
  --bs-badge-font-size: 0.65625rem;
  --bs-badge-font-weight: 600;
  --bs-badge-border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.btn .badge { top: 0; }

/* The template's purple, as utilities (Bootstrap has no purple) */
.text-purple { color: var(--purple) !important; }
.bg-purple { background-color: var(--purple) !important; }
.bg-purple-subtle { background-color: var(--purple-soft) !important; }

/* The template's orange, as utilities (Bootstrap has no orange either): the
   "medium" level of impact and priority */
.text-orange { color: var(--orange) !important; }
.bg-orange { background-color: var(--orange) !important; }
.bg-orange-subtle { background-color: var(--orange-soft) !important; }

/* Progress: a pill track whose bar grows in. Colour the bar with .bg-{color};
   .progress-sm (4px) / .progress-lg (14px) on the track; .progress-bar-striped
   and .progress-bar-gradient (primary to purple) on the bar. */
.progress,
.progress-stacked {
  --bs-progress-height: 8px;
  --bs-progress-bg: var(--bg-muted);
  --bs-progress-border-radius: 999px;
  --bs-progress-bar-bg: var(--primary);
}
.progress-sm { --bs-progress-height: 4px; }
.progress-lg { --bs-progress-height: 14px; }
.progress-bar { border-radius: var(--bs-progress-border-radius); }
.progress-stacked .progress-bar { border-radius: 0; }
.progress-bar:not(.progress-bar-animated) { transform-origin: left; animation: bar-in 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.progress-bar-gradient { background-image: linear-gradient(90deg, var(--primary), var(--purple)); }

/* Alerts: a tinted box with a coloured edge on the left and body-coloured
   text. An .alert-icon first puts the text in a column beside it; dismiss
   with .btn-close[data-bs-dismiss="alert"] in an .alert-dismissible. */
.alert {
  --bs-alert-padding-x: 16px;
  --bs-alert-padding-y: 14px;
  --bs-alert-margin-bottom: 0;
  --bs-alert-color: var(--t-base);
  --bs-alert-border-radius: var(--radius-md);
  --alert-accent: var(--t-muted);
  border: 0;
  border-left: 3px solid var(--alert-accent);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.alert + .alert { margin-top: 10px; }
.alert-primary { --alert-accent: var(--primary); }
.alert-success { --alert-accent: var(--success); }
.alert-danger { --alert-accent: var(--danger); }
.alert-warning { --alert-accent: var(--warning); }
.alert-info { --alert-accent: var(--info); }
.alert-light { --alert-accent: var(--border); }
.alert-dark { --alert-accent: var(--t-base); }
.alert:has(> .alert-icon) { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; }
.alert-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-sm); background: color-mix(in oklab, var(--alert-accent) 14%, transparent); color: var(--alert-accent); }
.alert-icon svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2; fill: none; }
.alert-heading { margin-bottom: 2px; font-weight: 600; }
.alert-dismissible { padding-right: 50px; }
.alert-dismissible .btn-close { top: 14px; right: 16px; padding: 0; }

/* Close button (alerts, modals, offcanvas, toasts): the template's stroked X,
   masked in currentColor so it follows the theme. */
.btn-close {
  --bs-btn-close-bg: none;
  --bs-btn-close-opacity: 1;
  --bs-btn-close-hover-opacity: 1;
  --bs-btn-close-focus-opacity: 1;
  --bs-btn-close-focus-shadow: var(--focus-ring);
  --close-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E");
  position: relative;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: calc(var(--radius) * 0.625);
  color: var(--t-light);
  filter: none;
  transition: background-color 160ms, color 160ms;
}
.btn-close::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 12px;
  background-color: currentColor;
  -webkit-mask: var(--close-icon) center / contain no-repeat;
  mask: var(--close-icon) center / contain no-repeat;
}
.btn-close:hover { color: var(--t-base); background-color: var(--bg-hover); }
.btn-close-white { color: rgba(255, 255, 255, 0.75); }
.btn-close-white:hover { color: #fff; background-color: rgba(255, 255, 255, 0.12); }

/* Tables: rows straight on the card with a hairline between them, the header
   in small mono caps, cells centred vertically. The outer cells have no outer
   padding, so the text lines up with the card's (striped and bordered tables
   keep it). .table-hover, .table-striped, .table-active as in Bootstrap; wrap
   wide tables in .table-responsive. */
.table {
  --bs-table-color: var(--t-base);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--border-soft);
  --bs-table-striped-color: var(--t-base);
  --bs-table-striped-bg: var(--bg-hover);
  --bs-table-hover-color: var(--t-base);
  --bs-table-hover-bg: var(--bg-hover);
  --bs-table-active-color: var(--t-base);
  --bs-table-active-bg: var(--primary-soft);
  margin-bottom: 0;
  font-size: 0.8125rem;
  vertical-align: middle;
}
.table > :not(caption) > * > * { padding: 11px 12px; }
:where(.table:not(.table-striped, .table-bordered)) > :not(caption) > * > :first-child { padding-left: 0; }
:where(.table:not(.table-striped, .table-bordered)) > :not(caption) > * > :last-child { padding-right: 0; }
.table > thead > tr > * {
  padding-top: 10px;
  padding-bottom: 12px;
  border-bottom-color: var(--border);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-light);
}
.table > tbody > tr:last-child > * { border-bottom-width: 0; }
.table-hover > tbody > tr.table-active:hover > * { --bs-table-bg-state: var(--bs-table-active-bg); } /* a selected row stays tinted under the mouse */

/* Flagged rows (.linha-perigo red, .linha-laranja orange, .linha-aviso amber,
   .linha-info blue): a tint of the colour over the card, stronger in the dark
   theme and again under the mouse, and a 4px bar on the left, so the row stands
   out from the striping and the hover in both themes (and the colour is not the
   only cue). Used for the urgency of occurrences and maintenance, and for overdue
   payments; a .legenda-cores above the table says what each colour means, and
   its (i) button opens the details in a popover. */
.table > tbody > tr.linha-perigo, .legenda-cores .legenda-perigo { --linha-cor: var(--danger); }
.table > tbody > tr.linha-laranja, .legenda-cores .legenda-laranja { --linha-cor: var(--orange); }
.table > tbody > tr.linha-aviso, .legenda-cores .legenda-aviso { --linha-cor: var(--warning); }
.table > tbody > tr.linha-info, .legenda-cores .legenda-info { --linha-cor: var(--info); }
.table > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info), .legenda-cores .legenda-cor {
  --linha-fundo: color-mix(in srgb, var(--linha-cor) 16%, var(--bg-card));
  --linha-fundo-hover: color-mix(in srgb, var(--linha-cor) 24%, var(--bg-card));
}
:root[data-theme=dark] :is(.table > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info), .legenda-cores .legenda-cor) {
  --linha-fundo: color-mix(in srgb, var(--linha-cor) 24%, var(--bg-card));
  --linha-fundo-hover: color-mix(in srgb, var(--linha-cor) 32%, var(--bg-card));
}
.table > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info) > * { --bs-table-bg-state: var(--linha-fundo); }
.table-hover > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info):hover > * { --bs-table-bg-state: var(--linha-fundo-hover); }
/* DataTables' stylesheet paints the stripes and the hover with a box-shadow of its own that ignores
   --bs-table-bg-state, so on its striped tables the odd rows lost the tint: paint it here too. */
table.table.dataTable.table-striped > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info):not(.selected) > *,
table.table.dataTable.table-hover > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info):not(.selected):hover > * { box-shadow: inset 0 0 0 9999px var(--bs-table-bg-state); }
.table > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info) > :first-child { position: relative; }
.table > tbody > tr:is(.linha-perigo, .linha-laranja, .linha-aviso, .linha-info) > :first-child::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--linha-cor);
}
.legenda-cores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-bottom: 12px;
  font-size: 0.75rem;
  color: var(--t-muted);
}
.legenda-cores .legenda-titulo { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--t-base); }
.legenda-cores .legenda-ajuda {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--primary);
  font-size: 0.875rem;
  line-height: 1;
}
.legenda-cores .legenda-ajuda:hover { background: var(--primary-soft); }
.legenda-cores .legenda-ajuda:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.legenda-cores .legenda-item { display: inline-flex; align-items: center; gap: 6px; }
.legenda-cores .legenda-cor {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  background: var(--linha-fundo);
  box-shadow: inset 3px 0 0 var(--linha-cor), inset 0 0 0 1px var(--border-soft);
}
.legenda-cores .legenda-nota { color: var(--t-light); }
/* The details behind the (i): a wider popover with short paragraphs and lists */
.popover.popover-legenda { --bs-popover-max-width: 440px; }
.popover-legenda .popover-body p,
.popover-legenda .popover-body ul { margin-bottom: 8px; }
.popover-legenda .popover-body ul { padding-left: 18px; }
.popover-legenda .popover-body li + li { margin-top: 3px; }
.popover-legenda .popover-body strong { color: var(--t-base); }
.popover-legenda .popover-body > :last-child { margin-bottom: 0; }
.table-responsive::-webkit-scrollbar { height: 4px; }
.table-responsive::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-xs); }

/* .data-table: a .table for data screens — roomier cells that don't wrap and a
   header that stays put while the rows scroll. */
.data-table { border-collapse: separate; border-spacing: 0; }
.data-table > :not(caption) > * > * { padding: 12px 14px; white-space: nowrap; }
.data-table > thead > tr > * { position: sticky; top: 0; padding-top: 12px; padding-bottom: 12px; background-color: var(--bg-card); }

/* Navs: tabs underline the active link in the primary colour on one hairline
   (and scroll sideways when they don't fit); pills are a segmented switch on a
   muted track. Panes as in Bootstrap: .tab-content > .tab-pane. */
.nav {
  --bs-nav-link-padding-x: 14px;
  --bs-nav-link-padding-y: 10px;
  --bs-nav-link-font-size: 0.8125rem;
  --bs-nav-link-font-weight: 500;
  --bs-nav-link-color: var(--t-muted);
  --bs-nav-link-hover-color: var(--t-base);
  --bs-nav-link-disabled-color: var(--t-light);
  gap: 4px;
}
.nav-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nav-link:focus-visible { box-shadow: var(--focus-ring); }
.nav-link.active { font-weight: 600; }
.nav-tabs {
  --bs-nav-tabs-border-width: 0;
  --bs-nav-tabs-border-radius: 0;
  --bs-nav-tabs-link-hover-border-color: transparent;
  --bs-nav-tabs-link-active-color: var(--primary);
  --bs-nav-tabs-link-active-bg: transparent;
  --bs-nav-tabs-link-active-border-color: transparent transparent var(--primary);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: inset 0 -1px 0 var(--border); /* the hairline, under the links' own 2px line */
}
.nav-tabs::-webkit-scrollbar { display: none; }
.nav-tabs .nav-link { margin-bottom: 0; border-width: 0 0 2px; }
.nav-tabs + .tab-content { margin-top: 18px; }
.nav-pills {
  --bs-nav-pills-border-radius: calc(var(--radius) * 0.875);
  --bs-nav-pills-link-active-color: var(--t-base);
  --bs-nav-pills-link-active-bg: var(--bg-card);
  display: inline-flex;
  padding: 3px;
  border-radius: calc(var(--radius) * 1.125);
  background: var(--bg-muted);
}
.nav-pills .nav-link { --bs-nav-link-padding-x: 12px; --bs-nav-link-padding-y: 7px; --bs-nav-link-font-size: 0.78125rem; }
.nav-pills .nav-link.active { box-shadow: var(--shadow-sm); }

/* Accordion: separate bordered items, a chevron that turns when open, the
   answer in muted text. Add data-bs-parent to the collapses for one-at-a-time. */
.accordion {
  --bs-accordion-color: var(--t-muted);
  --bs-accordion-bg: var(--bg-card);
  --bs-accordion-border-color: var(--border);
  --bs-accordion-border-radius: var(--radius-md);
  --bs-accordion-inner-border-radius: calc(var(--radius-md) - 1px);
  --bs-accordion-btn-padding-x: 16px;
  --bs-accordion-btn-padding-y: 14px;
  --bs-accordion-btn-color: var(--t-base);
  --bs-accordion-btn-bg: transparent;
  --bs-accordion-btn-icon: none;
  --bs-accordion-btn-active-icon: none;
  --bs-accordion-btn-icon-width: 13px;
  --bs-accordion-body-padding-x: 16px;
  --bs-accordion-body-padding-y: 14px;
  --bs-accordion-active-color: var(--t-base);
  --bs-accordion-active-bg: transparent;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.accordion-item,
.accordion-item:not(:first-of-type) { border: 1px solid var(--bs-accordion-border-color); border-radius: var(--bs-accordion-border-radius); overflow: hidden; }
.accordion-button { font-size: 0.84375rem; font-weight: 600; line-height: 1.55; transition: background-color 160ms; }
.accordion-button:hover { background-color: var(--bg-hover); }
.accordion-button:not(.collapsed),
.accordion-button:focus { box-shadow: none; }
.accordion-button:focus-visible { box-shadow: inset 0 0 0 2px var(--primary-ring); }
.accordion-button::after {
  background-color: var(--t-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.accordion-body { padding-top: 0; font-size: 0.8125rem; line-height: 1.6; }

/* Modal: a card-like dialog — display-font title over a hairline, muted body
   text, actions on the right; the page dims and blurs behind it. */
.modal {
  --bs-modal-width: 480px;
  --bs-modal-padding: 20px;
  --bs-modal-color: var(--t-base);
  --bs-modal-bg: var(--bg-card);
  --bs-modal-border-color: var(--border);
  --bs-modal-border-radius: var(--radius-xl);
  --bs-modal-inner-border-radius: calc(var(--radius-xl) - 1px);
  --bs-modal-box-shadow: var(--shadow-lg);
  --bs-modal-header-padding-x: 20px;
  --bs-modal-header-padding-y: 16px;
  --bs-modal-header-padding: 16px 20px;
  --bs-modal-header-border-color: var(--border-soft);
  --bs-modal-footer-gap: 8px;
  --bs-modal-footer-border-color: var(--border-soft);
}
.modal-content { box-shadow: var(--bs-modal-box-shadow); }
.modal-title { font-family: var(--font-display); font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.012em; color: var(--t-base); }
.modal-header .btn-close { margin: 0 0 0 auto; padding: 0; }
.modal-body { padding-block: 18px; font-size: 0.84375rem; line-height: 1.6; color: var(--t-muted); }
.modal-footer { padding: 10px 16px; }
.modal-backdrop { --bs-backdrop-bg: rgb(15, 23, 42); --bs-backdrop-opacity: 0.55; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }

/* Tooltips: a small inverted bubble. Popovers: a little card. */
.tooltip {
  --bs-tooltip-bg: var(--t-base);
  --bs-tooltip-color: var(--bg-card);
  --bs-tooltip-font-size: 0.71875rem;
  --bs-tooltip-padding-x: 10px;
  --bs-tooltip-padding-y: 6px;
  --bs-tooltip-border-radius: var(--radius-sm);
  --bs-tooltip-opacity: 1;
  font-family: var(--font-sans);
  font-weight: 500;
}
.popover {
  --bs-popover-font-size: 0.8125rem;
  --bs-popover-bg: var(--bg-card);
  --bs-popover-border-color: var(--border);
  --bs-popover-border-radius: var(--radius-lg);
  --bs-popover-inner-border-radius: calc(var(--radius-lg) - 1px);
  --bs-popover-header-padding-x: 14px;
  --bs-popover-header-padding-y: 10px;
  --bs-popover-header-font-size: 0.8125rem;
  --bs-popover-header-color: var(--t-base);
  --bs-popover-header-bg: transparent;
  --bs-popover-body-padding-x: 14px;
  --bs-popover-body-padding-y: 10px;
  --bs-popover-body-color: var(--t-muted);
  font-family: var(--font-sans);
  box-shadow: var(--shadow-lg);
}
.popover-header { font-weight: 600; border-bottom-color: var(--border-soft); }

/* Dropdowns: a card that fades in under its button. .dropdown-item rows with
   an optional leading icon; .dropdown-menu-lg for the wide topbar lists
   (notifications, messages), which fill the screen width on phones. */
.dropdown-menu {
  --bs-dropdown-zindex: 100;
  --bs-dropdown-min-width: 10rem;
  --bs-dropdown-padding-x: 0;
  --bs-dropdown-padding-y: 0;
  --bs-dropdown-font-size: 0.8125rem;
  --bs-dropdown-color: var(--t-base);
  --bs-dropdown-bg: var(--bg-card);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-border-radius: var(--radius-lg);
  --bs-dropdown-inner-border-radius: calc(var(--radius-lg) - 1px);
  --bs-dropdown-box-shadow: var(--shadow-lg);
  --bs-dropdown-divider-bg: var(--border-soft);
  --bs-dropdown-divider-margin-y: 6px;
  --bs-dropdown-link-color: var(--t-base);
  --bs-dropdown-link-hover-color: var(--t-base);
  --bs-dropdown-link-hover-bg: var(--bg-hover);
  --bs-dropdown-link-active-color: var(--t-base);
  --bs-dropdown-link-active-bg: var(--bg-hover);
  --bs-dropdown-link-disabled-color: var(--t-light);
  --bs-dropdown-item-padding-x: 18px;
  --bs-dropdown-item-padding-y: 10px;
  --bs-dropdown-header-color: var(--t-light);
  overflow: hidden;
  box-shadow: var(--bs-dropdown-box-shadow);
}
.dropdown-menu.show { animation: dropdown-in 180ms ease both; }
@keyframes dropdown-in { from { opacity: 0; translate: 0 -4px; } } /* translate, not transform: Popper positions with transform */
.dropdown-menu-lg { --bs-dropdown-min-width: 340px; }
.dd-profile { --bs-dropdown-min-width: 220px; }
.dropdown-item { display: flex; align-items: center; gap: 12px; transition: background-color 150ms, color 150ms; }
.dropdown-item > svg { width: 15px; height: 15px; flex-shrink: 0; stroke: currentColor; stroke-width: 1.75; fill: none; color: var(--t-muted); }
.dropdown-item.text-danger > svg { color: inherit; }
.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus { background-color: var(--danger-soft); }
.dropdown-item.dd-item { display: grid; white-space: normal; }
.dropdown-item.dd-footer { display: block; }
@media (max-width: 720px) {
  .dropdown-menu-lg,
  .dd-profile { --bs-dropdown-min-width: 0; width: calc(100vw - 16px); max-width: 360px; }
  .dd-profile { max-width: 280px; }
}

/* --------------------------------------------------------------------------
 * Authentication and error pages — the same layouts as sign in and 404;
 * these are the extra pieces (forms.js runs the code boxes and the rules).
 * ------------------------------------------------------------------------ */
.auth-back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78125rem; color: var(--t-muted); }
.auth-back svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.auth-icon { width: 48px; height: 48px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.auth-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-icon.success { background: var(--success-soft); color: var(--success); }
.auth-card .sub strong { color: var(--t-base); font-weight: 600; }
.auth-user { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-user .avatar { width: 48px; height: 48px; margin: 0; font-size: 1rem; flex-shrink: 0; }
.auth-user-name { font-weight: 600; color: var(--t-base); }
.auth-user-mail { font-size: 0.78125rem; color: var(--t-muted); }
.auth-note { margin: 18px 0 0; font-size: 0.78125rem; color: var(--t-muted); text-align: center; }
.auth-note a { color: var(--primary); font-weight: 600; }

/* Verification code: one box per character ([data-otp]) */
.otp { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.otp .form-control { padding-inline: 0; text-align: center; font-family: var(--font-mono); font-weight: 600; }

/* Password rules that turn green as they're met ([data-password-rules]) */
.pw-rules { display: grid; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 0.75rem; color: var(--t-muted); }
.pw-rules li { display: flex; align-items: center; gap: 8px; transition: color 160ms; }
.pw-rules li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 1.5px solid var(--t-light);
  border-radius: 50%;
  transition: background-color 160ms, border-color 160ms;
}
.pw-rules li.is-met { color: var(--success); }
.pw-rules li.is-met::before {
  border-color: var(--success);
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}

/* An icon in place of the error code (offline page), in the code's gradient */
.error-code--icon { display: grid; place-items: center; margin-bottom: 14px; line-height: 1; }
.error-code--icon svg { width: 0.7em; height: 0.7em; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.error-code--icon .stop-a { stop-color: var(--primary); }
.error-code--icon .stop-b { stop-color: var(--purple); }

/* --------------------------------------------------------------------------
 * Profile page (profile.html): cover, profile column, tabs, preferences —
 * and the settings rows it shares with the app settings (settings.html)
 * ------------------------------------------------------------------------ */
.profile-cover {
  position: relative;
  height: 180px;
  margin-bottom: -64px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--bg-muted) url("../images/bg.jpg") center / cover no-repeat; /* default cover; a chosen picture replaces it inline */
}
.profile-cover-edit {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.profile-cover-edit:hover { background: rgba(255, 255, 255, 0.26); }
.profile-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr); gap: 22px; align-items: start; padding: 0 22px; }
.profile-side { display: grid; gap: 22px; }
.profile-card .card-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.profile-avatar { position: relative; margin-bottom: 14px; }
.profile-avatar .avatar { width: 96px; height: 96px; margin: 0; font-size: 1.75rem; border: 4px solid var(--bg-card); box-shadow: var(--shadow-sm); background-size: cover; background-position: center; }
.avatar.has-image { color: transparent; }
.profile-avatar-edit {
  position: absolute;
  right: 0;
  bottom: 4px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--t-base);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.profile-avatar-edit:hover { color: var(--primary); }
.profile-avatar-edit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.profile-name { margin: 0 0 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.015em; color: var(--t-base); }
.profile-role { font-size: 0.8125rem; color: var(--t-muted); }
.profile-progress { display: flex; align-items: center; gap: 12px; }
.profile-progress .progress { flex: 1; }
.profile-progress strong { font-size: 0.8125rem; color: var(--t-base); }
.profile-hint { margin: 12px 0 0; font-size: 0.75rem; color: var(--t-muted); line-height: 1.5; }
.portfolio-links { display: grid; gap: 12px; }

.settings-h { margin: 26px 0 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; letter-spacing: -0.012em; color: var(--t-base); }
.tab-pane > .settings-h:first-child { margin-top: 0; }
.settings-text { margin: 0 0 14px; font-size: 0.8125rem; color: var(--t-muted); line-height: 1.55; max-width: 70ch; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.settings-row:last-of-type { border-bottom: 0; }
.settings-row-title { font-size: 0.8125rem; font-weight: 600; color: var(--t-base); }
.settings-row p { margin: 3px 0 0; font-size: 0.78125rem; color: var(--t-muted); line-height: 1.5; max-width: 62ch; }
.settings-row > :last-child { flex-shrink: 0; }
.settings-delete { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-delete .input-wrap,
.settings-delete > .form-control { flex: 1 1 220px; max-width: 320px; }

.device-list { margin: 8px 0 0; padding: 0; list-style: none; }
.device { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); }
.device:last-child { border-bottom: 0; }
.device-icon { width: 38px; height: 38px; display: grid; place-items: center; flex-shrink: 0; border-radius: var(--radius); background: var(--bg-muted); color: var(--t-muted); }
.device-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.device-text { flex: 1; min-width: 0; }
.device-name { font-size: 0.8125rem; font-weight: 600; color: var(--t-base); }
.device-meta { font-size: 0.75rem; color: var(--t-muted); }
.device-action { font-size: 0.75rem; font-weight: 600; color: var(--primary); }

.experience-item { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px dashed var(--border); }
.experience-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
/* Preferences tab: a choice is a tile with a small drawing (radio + label) */
.pref-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* Menu layout and Sidebar side by side: their four tiles on the same grid as the theme's */
.pref-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.pref-pair .pref-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 720px) {
  .pref-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pref-pair { grid-template-columns: minmax(0, 1fr); }
}
.pref-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  margin: 0;
  padding: 8px 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 160ms, box-shadow 160ms;
}
.pref-option:hover { border-color: var(--t-light); }
.btn-check:checked + .pref-option { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.btn-check:focus-visible + .pref-option { box-shadow: inset 0 0 0 1px var(--primary), var(--focus-ring); }
.pref-option-label { margin-top: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--t-base); }
.pref-option-hint { font-size: 0.71875rem; color: var(--t-muted); }
/* the drawing: a sidebar and two lines of content, in the theme it stands for */
.pref-preview { display: flex; gap: 5px; height: 58px; padding: 6px; border-radius: var(--radius); background: var(--bg-body); }
.pref-preview i { display: block; border-radius: 3px; }
.pref-preview .pv-side { width: 28%; background: var(--bg-card); box-shadow: 0 0 0 1px var(--border); }
.pref-preview .pv-main { flex: 1; display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
.pref-preview .pv-main > i { height: 6px; width: 70%; background: var(--border); }
.pref-preview .pv-main > i + i { width: 45%; }
.pref-preview[data-scheme=light] { --pv-bg: #F0F4F8; --pv-side: #FFFFFF; --pv-line: #E4E8EF; }
.pref-preview[data-scheme=dark] { --pv-bg: #0B1120; --pv-side: #141B2D; --pv-line: #2A3550; }
.pref-preview[data-scheme] { background: var(--pv-bg); }
.pref-preview[data-scheme] .pv-side { background: var(--pv-side); box-shadow: none; }
.pref-preview[data-scheme] .pv-main > i { background: var(--pv-line); }
.pref-preview[data-scheme=auto] { background: linear-gradient(135deg, #F0F4F8 50%, #0B1120 50%); }
.pref-preview[data-scheme=auto] .pv-side { background: #FFFFFF; }
.pref-preview[data-scheme=auto] .pv-main > i { background: #94A3B8; }
.pref-preview.pv-horizontal { flex-direction: column; }
.pref-preview.pv-horizontal .pv-side { width: auto; height: 10px; flex: none; }
.pref-preview.pv-collapsed .pv-side { width: 10%; }
.pref-select { width: auto; min-width: 220px; }
/* segmented choices (Bootstrap radio buttons) inside a .btn-group */
.btn-group > .btn-check:checked + .btn { background: var(--primary-soft); color: var(--primary); }
.btn-group > .btn-check:focus-visible + .btn { box-shadow: inset 0 0 0 2px var(--primary-ring); }
.pref-sample { margin-top: 22px; padding: 16px 18px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.pref-sample-title { margin: 6px 0 4px; font-family: var(--font-display); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.012em; color: var(--t-base); }
.pref-sample p { margin: 0; color: var(--t-muted); }
.year-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; font-size: 0.8125rem; color: var(--t-muted); }

@media (max-width: 1100px) {
  .profile-grid { grid-template-columns: 1fr; padding: 0; }
  .profile-cover { margin-bottom: 22px; }
}
@media (max-width: 720px) {
  .profile-cover { height: 140px; }
  .settings-row { flex-direction: column; align-items: flex-start; }
}

/* --------------------------------------------------------------------------
 * Settings page (settings.html): a list of sections on the left (vertical
 * pills, Bootstrap tabs), the section's cards on the right. Rows use the
 * .settings-row pattern above.
 * ------------------------------------------------------------------------ */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 16px); }
:root[data-layout="horizontal"] .settings-nav { position: static; }
.settings-nav .card-body { padding: 10px; }
.settings-nav .nav-pills { display: flex; gap: 2px; padding: 0; border-radius: 0; background: none; }
.settings-nav .nav-link { justify-content: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--radius); font-size: 0.8125rem; text-align: left; }
.settings-nav .nav-link:hover { background: var(--bg-hover); }
.settings-nav .nav-link.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.settings-nav .nav-link svg { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-pane > .card + .card { margin-top: 24px; }
.settings-control { width: 220px; }
.settings-num { width: 110px; }
.settings-checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.settings-block { padding: 14px 0; }
.settings-row:has(+ .form-actions) { border-bottom: 0; } /* the actions bring their own line */
.settings-block + .form-actions,
.row + .form-actions { margin-top: 18px; }
.settings-logo { display: flex; align-items: center; gap: 18px; }
.settings-logo p { margin: 2px 0 10px; }
.settings-logo-preview {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-lg);
  background: var(--primary) center / cover no-repeat;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
}
.settings-logo-preview.has-image { color: transparent; background-color: var(--bg-muted); }
.settings-matrix td,
.settings-matrix th { white-space: nowrap; }
.settings-matrix .form-switch { display: inline-flex; }
.settings-danger { --bs-card-border-color: color-mix(in oklab, var(--danger) 35%, var(--border)); }
.settings-danger .card-title { color: var(--danger); }
@media (max-width: 1100px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; }
  .settings-nav .nav-pills { flex-direction: row !important; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .settings-nav .nav-link { width: auto; }
}
@media (max-width: 720px) {
  .settings-control { width: 100%; }
}

/* --------------------------------------------------------------------------
 * Icon pages (icons-*.html, assets/js/icons.js): how-to card and the grid
 * ------------------------------------------------------------------------ */
.icon-usage { margin-bottom: 24px; }
.icon-steps { margin: 0; padding-left: 1.2em; list-style: decimal; display: grid; gap: 12px; font-size: 0.8125rem; color: var(--t-base); }
.icon-steps code {
  display: block;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--bg-muted);
  color: var(--t-base);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.icon-license { margin: 14px 0 0; font-size: 0.75rem; color: var(--t-muted); }
.icon-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.icon-tools .input-icon { width: 240px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 18px 8px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--t-base);
  transition: border-color 150ms, color 150ms, background-color 150ms;
}
.icon-tile > i,
.icon-tile > svg { display: block; width: auto; height: 24px; font-size: 24px; line-height: 1; }
.icon-tile > svg { width: 24px; fill: none; }
.icon-tile > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.6875rem; color: var(--t-muted); }
.icon-tile:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.icon-tile:focus-visible { outline: 0; box-shadow: var(--focus-ring); }
.icon-tile.is-copied { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.icon-tile.is-copied > span { color: var(--success); font-weight: 600; }
.icon-empty { margin: 0; padding: 30px 0; text-align: center; color: var(--t-muted); font-size: 0.8125rem; }
@media (max-width: 720px) {
  .icon-tools, .icon-tools .input-icon { width: 100%; }
  .icon-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* --------------------------------------------------------------------------
 * Widgets page (widgets.html): solid, sparkline and goal tiles, team and
 * project cards, activity timeline, countries, legend, products, payment,
 * credit card and transactions. It also reuses .kpi-*, .upc-*, .todo-* and
 * .avatar-group; counters and the card preview live in components.js.
 * ------------------------------------------------------------------------ */
.wg-section + .wg-section { margin-top: 40px; }
.wg-section-head { margin-bottom: 18px; }
.wg-section-head .section-h { margin-bottom: 4px; }
.wg-section-head p { margin: 0; font-size: 0.8125rem; color: var(--t-muted); }
.wg-label { font-size: 0.75rem; font-weight: 500; color: var(--t-muted); }
.wg-value { margin: 2px 0 6px; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--t-base); }
.wg-sub { font-size: 0.75rem; color: var(--t-muted); }
.wg-value small { font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--t-muted); }
.wg-icon { display: inline-grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius); }
.wg-icon svg,
.wg-solid-icon svg,
.wg-thumb svg,
.wg-due svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wg-icon svg { width: 17px; height: 17px; }

/* tiles: solid colour (.c-primary by default, .c-success, .c-purple, .c-danger). A deeper
   shade of each colour, the same in both themes, so the white text keeps at least 4.5:1 */
.wg-solid { --wg-solid-bg: #2563EB; --bs-card-bg: var(--wg-solid-bg); --bs-card-color: #fff; --bs-card-border-color: transparent; color: #fff; }
.wg-solid.c-success { --wg-solid-bg: #047857; }
.wg-solid.c-purple { --wg-solid-bg: #7C3AED; }
.wg-solid.c-danger { --wg-solid-bg: #DC2626; }
.wg-solid .card-body { display: flex; flex-direction: column; gap: 2px; }
.wg-solid-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.18); }
.wg-solid-icon svg { width: 18px; height: 18px; }
.wg-solid-label { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.wg-solid-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.wg-solid-meta { font-size: 0.75rem; opacity: 0.8; }

/* tiles: with a sparkline; goals with a progress bar */
.wg-spark .card-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wg-spark-chart { position: relative; width: 120px; height: 52px; flex-shrink: 0; }
.wg-goal-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wg-goal-pct { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; color: var(--t-base); }
.wg-goal .wg-value { margin-bottom: 12px; }
.wg-goal-foot { margin-top: 10px; font-size: 0.75rem; color: var(--t-muted); }

/* team member */
.wg-member .card-body { display: flex; flex-direction: column; align-items: center; text-align: center; }
.wg-avatar { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 12px; border-radius: 50%; color: #fff; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; box-shadow: 0 0 0 4px var(--bg-card), 0 0 0 5px var(--border); }
.wg-member-name { margin: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--t-base); }
.wg-member-role { margin-top: 2px; font-size: 0.75rem; color: var(--t-muted); }
.wg-member-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin: 16px 0; padding: 12px 0; border-block: 1px solid var(--border-soft); }
.wg-member-stats > div + div { border-left: 1px solid var(--border-soft); }
.wg-member-stats dt { font-size: 0.6875rem; font-weight: 500; color: var(--t-muted); }
.wg-member-stats dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--t-base); }
.wg-member-actions { display: flex; gap: 8px; width: 100%; margin-top: auto; }
.wg-member-actions .btn { flex: 1; }

/* project */
.wg-project .card-body { display: flex; flex-direction: column; }
.wg-project-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.wg-project-title { margin: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--t-base); }
.wg-project-client { margin-top: 2px; font-size: 0.75rem; font-weight: 600; color: var(--primary); }
.wg-project-text { margin: 10px 0 16px; font-size: 0.8125rem; color: var(--t-muted); }
.wg-project-progress .progress { margin-top: 6px; }
.wg-project-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.wg-project-progress { margin-bottom: 18px; }
.wg-due { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--t-muted); white-space: nowrap; }
.wg-due svg { width: 14px; height: 14px; }

/* activity timeline */
.wg-timeline { margin: 0; padding: 0; list-style: none; }
.wg-timeline-item { position: relative; display: flex; gap: 12px; padding-bottom: 18px; }
.wg-timeline-item:last-child { padding-bottom: 0; }
.wg-timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 42px; bottom: 4px; left: 17.5px; width: 1px; background: var(--border); }
.wg-timeline-body { flex: 1; min-width: 0; }
.wg-timeline-text { font-size: 0.8125rem; color: var(--t-muted); }
.wg-timeline-text strong { font-weight: 600; color: var(--t-base); }
.wg-timeline-sub { margin-top: 2px; font-size: 0.75rem; color: var(--t-light); }
.wg-timeline-time { flex-shrink: 0; font-family: var(--font-mono); font-size: 0.65625rem; color: var(--t-light); white-space: nowrap; }

/* charts and map */
.wg-country-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.wg-country-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 0.8125rem; color: var(--t-base); }
.wg-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.wg-metrics > div { padding: 12px 14px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: var(--bg-hover); }
.wg-metrics .wg-value { font-size: 1.25rem; }
.wg-donut { position: relative; }
.wg-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.wg-donut-center .wg-value { margin: 0; font-size: 1.25rem; }
.wg-legend { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.wg-legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; font-size: 0.8125rem; }
.wg-dot { width: 10px; height: 10px; border-radius: 50%; }
.wg-legend-name { color: var(--t-base); }
.wg-legend-pct { min-width: 38px; text-align: right; font-weight: 600; color: var(--t-base); }
.wg-ref-share { width: 30%; min-width: 110px; }
.wg-hiring { display: grid; gap: 16px; }
.wg-hire { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-soft); }
.wg-hire:last-child { padding-bottom: 0; border-bottom: 0; }

/* products */
.wg-product-list,
.wg-tx-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.wg-product-row,
.wg-tx { display: flex; align-items: center; gap: 12px; }
.wg-thumb { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-lg); color: #fff; }
.wg-thumb svg { width: 20px; height: 20px; }
.wg-product-meta,
.wg-tx-meta { flex: 1; min-width: 0; }
.wg-product-name,
.wg-tx-name { overflow: hidden; font-size: 0.8125rem; font-weight: 600; color: var(--t-base); text-overflow: ellipsis; white-space: nowrap; }
.wg-product-price { font-size: 0.8125rem; font-weight: 700; color: var(--t-base); }
.wg-tx-amount { font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600; color: var(--t-base); white-space: nowrap; }

/* product card */
.wg-product { overflow: hidden; }
.wg-product-media { position: relative; display: grid; place-items: center; height: 170px; color: #fff; }
.wg-product-media > svg { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.wg-product-media .badge { position: absolute; top: 14px; left: 14px; }
.wg-product-like { position: absolute; top: 12px; right: 12px; }
.wg-product-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.wg-product-title { margin: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--t-base); }
.wg-rating { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 0.75rem; font-weight: 600; color: var(--t-base); }
.wg-rating svg { width: 13px; height: 13px; fill: var(--warning); stroke: var(--warning); stroke-width: 1.5; stroke-linejoin: round; }
.wg-rating span { font-weight: 400; color: var(--t-muted); }
.wg-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.wg-swatches { display: flex; gap: 10px; }
.wg-swatch { width: 26px; height: 26px; margin: 0; border-radius: 50%; background: var(--swatch); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); cursor: pointer; transition: box-shadow 150ms; }
.btn-check:checked + .wg-swatch { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary); }
.btn-check:focus-visible + .wg-swatch { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--primary), 0 0 0 7px var(--primary-soft); }

/* payment */
.wg-summary { margin: 0 0 18px; }
.wg-summary > div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.8125rem; color: var(--t-muted); }
.wg-summary dt { font-weight: 400; }
.wg-summary dd { margin: 0; font-weight: 600; color: var(--t-base); }
.wg-summary > .wg-summary-total { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--border); }
.wg-summary-total dt,
.wg-summary-total dd { font-size: 0.9375rem; font-weight: 700; color: var(--t-base); }
.wg-pay-methods { display: grid; gap: 8px; margin-bottom: 18px; }
.wg-pay-method { display: flex; align-items: center; gap: 12px; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); cursor: pointer; transition: border-color 150ms, box-shadow 150ms; }
.wg-pay-method:hover { border-color: var(--t-light); }
.wg-pay-method strong { display: block; font-size: 0.8125rem; color: var(--t-base); }
.wg-pay-method small { font-size: 0.71875rem; color: var(--t-muted); }
.wg-pay-brand { display: grid; place-items: center; width: 42px; height: 28px; flex-shrink: 0; border-radius: 6px; color: #fff; font-family: var(--font-display); font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.02em; }
.wg-pay-visa { background: #1A1F71; }
.wg-pay-mc { background: linear-gradient(90deg, #EB001B 50%, #F79E1B 50%); }
.wg-pay-pp { background: #003087; }
.wg-pay-check { width: 18px; height: 18px; margin-left: auto; flex-shrink: 0; border: 1.5px solid var(--t-light); border-radius: 50%; transition: border 150ms; }
.btn-check:checked + .wg-pay-method { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.btn-check:checked + .wg-pay-method .wg-pay-check { border: 5px solid var(--primary); }
.btn-check:focus-visible + .wg-pay-method { box-shadow: inset 0 0 0 1px var(--primary), var(--focus-ring); }

/* credit card: the front shows what's typed, the back the security code */
.wg-ccard { position: relative; max-width: 380px; margin-inline: auto; aspect-ratio: 1.586; perspective: 1000px; }
.wg-ccard-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  box-shadow: var(--shadow-lg);
  color: #fff;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transition: transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.wg-ccard-back { justify-content: flex-start; padding: 26px 0 0; transform: rotateY(180deg); }
.wg-ccard.is-flipped .wg-ccard-front { transform: rotateY(-180deg); }
.wg-ccard.is-flipped .wg-ccard-back { transform: rotateY(0deg); }
.wg-ccard-top { display: flex; align-items: center; justify-content: space-between; }
.wg-ccard-chip { width: 42px; height: 32px; border-radius: 6px; background: linear-gradient(135deg, #F5D58A, #C9A24B); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.wg-ccard-brand { font-family: var(--font-display); font-size: 1.125rem; font-style: italic; font-weight: 800; letter-spacing: 0.02em; }
.wg-ccard-number { font-family: var(--font-mono); font-size: 1.125rem; letter-spacing: 0.08em; white-space: nowrap; }
.wg-ccard-bottom { display: flex; justify-content: space-between; gap: 16px; }
.wg-ccard-bottom small,
.wg-ccard-cvc small { display: block; font-size: 0.625rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.7; }
.wg-ccard-bottom span { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.04em; }
.wg-ccard-stripe { height: 44px; background: rgba(0, 0, 0, 0.55); }
.wg-ccard-cvc { min-width: 92px; margin: 20px 22px 0 auto; padding: 6px 12px; border-radius: 6px; background: #fff; color: #1E293B; font-family: var(--font-mono); text-align: right; }

@media (max-width: 720px) {
  .wg-metrics { grid-template-columns: minmax(0, 1fr); }
  .wg-spark-chart { width: 96px; }
  .wg-ccard-number { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .wg-ccard-face { transition: none; }
}

/* --------------------------------------------------------------------------
 * Your customizations
 *
 * Put overrides in your project's own stylesheet, loaded after app.css (a
 * template update then never touches them), or below. Redefine the design
 * tokens from the top of this file instead of editing rules. The font, text
 * size, weight, line height and letter spacing can also be chosen by each user
 * in Profile › Preferences. For example:
 *
 *   :root {
 *     --font-sans: "Roboto", system-ui, sans-serif;  (body text)
 *     --font-display: var(--font-sans);              (headings and titles)
 *     --font-features: normal;                       (the default ones are Inter's)
 *     --font-scale: 1.125;                           (all text 12.5% larger)
 *     --radius: 4px;                                 (tighter corners everywhere; 0 = square)
 *     --sidebar-width: 264px;
 *     --control-padding-y: 11px;                     (taller fields and buttons)
 *   }
 *   :root[data-theme=light] {                        (brand color — light theme; the
 *     --primary: #7C3AED; --primary-rgb: 124, 58, 237;  -rgb triplet feeds Bootstrap's utilities)
 *     --primary-dark: #6D28D9;
 *     --primary-soft: #F5F3FF; --primary-ring: rgba(124, 58, 237, .18);
 *   }
 *   :root[data-theme=dark] {                         (… and dark theme)
 *     --primary: #A78BFA; --primary-rgb: 167, 139, 250; --primary-dark: #8B5CF6;
 *     --primary-soft: rgba(167, 139, 250, .14); --primary-ring: rgba(167, 139, 250, .25);
 *   }
 * ------------------------------------------------------------------------ */
