/* ==========================================================================
   LogiMotor Portals : app.css
   Brand: navy #0a1628 · orange #fd7020
   Type: Outfit (display) + DM Sans (UI)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  --navy: #0a1628;
  --navy-2: #122036;
  --navy-3: #1a2d4a;
  --navy-ink: #06101c;

  --orange: #fd7020;
  --orange-deep: #e85f12;
  --orange-700: #c44a0c;
  --orange-soft: #fff3eb;
  --orange-100: #ffe0cc;
  --orange-glow: rgba(253, 112, 32, 0.28);

  --bg: #ffffff;
  --bg-soft: #f3f5f9;
  --bg-muted: #e8ecf3;
  --bg-warm: #faf6f2;
  --surface: #ffffff;
  --surface-2: #f8f9fc;

  --ink: #0f1a2a;
  --ink-2: #243044;
  --muted: #5a6578;
  --soft: #8b95a8;
  --line: #e4e9f1;
  --line-2: #eef1f6;

  --green: #0d7a4f;
  --green-bg: #e6f6ee;
  --amber: #b45309;
  --amber-bg: #fef3e2;
  --red: #c0392b;
  --red-bg: #fdecea;
  --blue: #1d5bbf;
  --blue-bg: #e8f0fc;
  --slate: #64748b;
  --slate-bg: #f1f5f9;

  /* Aliases used across portal markup */
  --accent: var(--orange);
  --accent-deep: var(--orange-deep);
  --accent-700: var(--orange-700);
  --accent-soft: var(--orange-soft);
  --accent-100: var(--orange-100);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-xs: 0 1px 2px rgba(10, 22, 40, 0.04);
  --shadow-sm: 0 1px 2px rgba(10, 22, 40, 0.05), 0 0 0 1px rgba(10, 22, 40, 0.04);
  --shadow: 0 2px 4px rgba(10, 22, 40, 0.04), 0 8px 24px -10px rgba(10, 22, 40, 0.12), 0 0 0 1px rgba(10, 22, 40, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 22, 40, 0.08), 0 16px 40px -16px rgba(10, 22, 40, 0.18);
  --shadow-lg: 0 8px 24px rgba(10, 22, 40, 0.1), 0 28px 56px -20px rgba(10, 22, 40, 0.28), 0 0 0 1px rgba(10, 22, 40, 0.05);
  --shadow-orange: 0 4px 16px var(--orange-glow);
  --shadow-lift: 0 12px 32px -8px rgba(10, 22, 40, 0.16), 0 0 0 1px rgba(10, 22, 40, 0.04);

  --font-display: "Manrope", system-ui, -apple-system, sans-serif;
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
  --font-mono: "Manrope", ui-monospace, monospace;
  --gothic: var(--font-display);
  --serif: var(--font-display);
  --tabular: var(--font-body);

  --sidebar-w: 260px;
  --sidebar-collapsed: 72px;
  --topbar-h: 60px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.22s;
  --dur-slow: 0.38s;

  --z-sidebar: 40;
  --z-topbar: 30;
  --z-drawer-backdrop: 45;
  --z-overlay: 60;
  --z-toast: 80;
  --z-dropdown: 70;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .brand-name, .crumb b, .kpi .val, .stat-val {
  font-family: var(--font-display);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: 13.5px;
}

svg { display: block; }
img { max-width: 100%; height: auto; }
a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-deep); }

.hidden { display: none !important; }

::selection {
  background: var(--orange-100);
  color: var(--navy);
}

/* --------------------------------------------------------------------------
   3. Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulseSoft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.fade-in-up,
.content > *,
#view > .card,
#view > .kpi-grid,
#view > .pipeline,
#view > .cal-strip {
  animation: fadeInUp var(--dur-slow) var(--ease-out) both;
}

.kpi-grid > *:nth-child(1) { animation: fadeInUp 0.45s var(--ease-out) 0.04s both; }
.kpi-grid > *:nth-child(2) { animation: fadeInUp 0.45s var(--ease-out) 0.1s both; }
.kpi-grid > *:nth-child(3) { animation: fadeInUp 0.45s var(--ease-out) 0.16s both; }
.kpi-grid > *:nth-child(4) { animation: fadeInUp 0.45s var(--ease-out) 0.22s both; }
.kpi-grid > *:nth-child(5) { animation: fadeInUp 0.45s var(--ease-out) 0.28s both; }
.kpi-grid > *:nth-child(6) { animation: fadeInUp 0.45s var(--ease-out) 0.34s both; }

.sidebar {
  animation: slideInLeft 0.4s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-in-up,
  .content > *,
  #view > .card,
  #view > .kpi-grid,
  .kpi-grid > *,
  .sidebar,
  .overlay,
  .modal,
  .toast {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   4. Auth screen
   -------------------------------------------------------------------------- */
#auth,
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  position: relative;
  overflow: auto;
  background:
    radial-gradient(900px 480px at 72% -6%, #fff2e8 0%, transparent 55%),
    linear-gradient(165deg, #fffaf7 0%, #f4f6fa 55%, #eef1f8 100%);
}

#auth::before,
.auth-screen::before {
  display: none;
}

#auth::after,
.auth-screen::after {
  display: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.12),
    0 32px 64px -16px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: fadeInUp 0.5s var(--ease-out) both;
  backdrop-filter: blur(16px);
}

.auth-card .brand {
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #ff8a3d, var(--orange-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-orange);
  color: #fff;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--navy);
  line-height: 1.2;
}

.brand-name b,
.brand-name .accent {
  color: var(--orange);
  font-weight: 700;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--orange);
  font-weight: 650;
  cursor: pointer;
}

.auth-switch a:hover {
  color: var(--orange-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: border-color var(--dur), color var(--dur), background var(--dur), transform var(--dur);
}

.auth-back:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.auth-primary-stack .btn-primary {
  width: 100%;
  padding: 13px 18px;
}

/* --------------------------------------------------------------------------
   5. App shell
   -------------------------------------------------------------------------- */
#app,
.app-shell {
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(253, 112, 32, 0.04) 0%, transparent 50%),
    var(--bg-soft);
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: #c8d0dc;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: var(--z-sidebar);
  transition: width var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
  box-shadow: 4px 0 32px -8px rgba(6, 16, 28, 0.4);
}

.sidebar .brand {
  padding: 18px 18px 14px;
  margin: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar .brand img {
  height: 44px !important;
  width: auto;
  filter: brightness(1.05);
}

.sidebar .brand-name {
  color: #fff;
  font-size: 1.15rem;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar.collapsed .brand-name,
.sidebar.collapsed .module-switcher span,
.sidebar.collapsed .nav-group,
.sidebar.collapsed .nav-grp-btn span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .userbox .meta,
.sidebar.collapsed #navSearch,
.sidebar.collapsed .nav-search-wrap {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

.sidebar.collapsed .module-switcher {
  flex-direction: column;
  padding: 8px;
}

/* Mobile drawer backdrop */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 16, 28, 0.55);
  backdrop-filter: blur(3px);
  z-index: var(--z-drawer-backdrop);
  animation: fadeIn var(--dur) ease both;
}

.sidebar-backdrop.open {
  display: block;
}

/* Module switcher pills */
.module-switcher {
  display: flex;
  gap: 4px;
  padding: 12px 12px 8px;
  flex-shrink: 0;
}

.module-pill {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: rgba(200, 208, 220, 0.7);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  transition: background var(--dur), color var(--dur), border-color var(--dur), transform var(--dur);
  white-space: nowrap;
  min-width: 0;
}

.module-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.module-pill.active {
  color: #fff;
  background: linear-gradient(160deg, var(--orange) 0%, var(--orange-deep) 100%);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(253, 112, 32, 0.4);
}

.module-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Nav */
.nav {
  flex: 1;
  padding: 6px 10px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.nav-search-wrap {
  padding: 4px 4px 10px;
}

#navSearch {
  width: 100% !important;
  padding: 9px 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff !important;
  outline: none !important;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}

#navSearch::placeholder { color: rgba(200, 208, 220, 0.45); }

#navSearch:focus {
  border-color: var(--orange) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 0 0 3px rgba(253, 112, 32, 0.2) !important;
}

.nav-group {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(139, 149, 168, 0.85);
  padding: 16px 10px 6px;
}

.nav-grp-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(139, 149, 168, 0.85);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 10px 6px;
  transition: color var(--dur);
}

.nav-grp-btn:hover { color: #fff; }
.nav-grp-btn span { color: inherit; }

.nav-chev {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease);
  opacity: 0.55;
  color: inherit;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: rgba(200, 208, 220, 0.82);
  font-weight: 550;
  font-size: 13.5px;
  transition: background var(--dur), color var(--dur), transform var(--dur);
  width: 100%;
  text-align: left;
  margin: 2px 0;
  position: relative;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active {
  background: rgba(253, 112, 32, 0.14);
  color: #fff;
  font-weight: 650;
  border-left-color: var(--orange);
  padding-left: 7px;
}

.nav-item.active::before {
  content: none;
}

.nav-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(200, 208, 220, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--dur), color var(--dur);
}

.nav-item:hover .nav-ic {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-item.active .nav-ic {
  background: rgba(253, 112, 32, 0.22);
  color: var(--orange);
}

.nav-item svg,
.nav-ic svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
}

.nav-item--locked {
  opacity: 0.45;
}

.nav-item--locked::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a8' stroke-width='2'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.7;
}

/* Sidebar footer / user */
.sidebar-foot {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.userbox .meta {
  flex: 1;
  min-width: 0;
}

.userbox .meta b {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userbox .meta span {
  font-size: 12px;
  color: rgba(200, 208, 220, 0.55);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(150deg, #ff8a3d, #ef5f10);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(184, 72, 12, 0.35);
}

.sidebar .icon-btn {
  color: rgba(200, 208, 220, 0.55);
}

.sidebar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Main column */
.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--dur-slow) var(--ease);
}

.app-shell.sidebar-collapsed .main,
#app.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed);
}

.app-shell.sidebar-collapsed .sidebar,
#app.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed);
}

/* Topbar */
.topbar {
  height: var(--topbar-h);
  border-bottom: 1px solid rgba(228, 233, 241, 0.85);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.sidebar-toggle,
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  align-items: center;
  justify-content: center;
  color: var(--ink-2);
  flex-shrink: 0;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.sidebar-toggle:hover,
.hamburger:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.sidebar-toggle svg,
.hamburger svg {
  width: 20px;
  height: 20px;
}

.crumb,
.breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb b,
.breadcrumbs b,
.breadcrumbs .current {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

#topActions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-notif {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.topbar-notif:hover {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.topbar-notif .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid #fff;
}

.content {
  padding: 24px 28px 48px;
  width: 100%;
  max-width: none;
  flex: 1;
}

/* --------------------------------------------------------------------------
   6. Forms & buttons
   -------------------------------------------------------------------------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field input,
.field select,
.field textarea,
.select,
.input {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  font-size: 13.5px;
  transition: border-color var(--dur), box-shadow var(--dur), background var(--dur);
}

.field textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #d0d7e2;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(253, 112, 32, 0.14);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--soft);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b95a8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid2 .full {
  grid-column: 1 / -1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  transition:
    background var(--dur),
    border-color var(--dur),
    color var(--dur),
    box-shadow var(--dur),
    transform var(--dur);
  white-space: nowrap;
  line-height: 1.25;
  border: 1.5px solid transparent;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(175deg, #ff8a3d 0%, var(--orange) 45%, var(--orange-deep) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 10px var(--orange-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(175deg, #ff944d 0%, var(--orange-deep) 100%);
  box-shadow: 0 4px 16px rgba(253, 112, 32, 0.38);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-ghost,
.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover,
.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: #d0d7e2;
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: transparent;
}

.btn-danger:hover {
  background: #fad5d1;
}

.modal-foot .btn-danger {
  background: var(--red);
  color: #fff;
}

.modal-foot .btn-danger:hover {
  background: #a32f24;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}

.btn-lg {
  padding: 12px 22px;
  font-size: 15px;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.icon-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
  font-size: 12px;
  font-weight: 600;
  transition: background var(--dur), color var(--dur);
}

.icon-btn:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.btn-ghost.is-danger,
.icon-btn.is-danger {
  color: var(--red);
  border-color: transparent;
}

.btn-ghost.is-danger:hover {
  background: var(--red-bg);
  color: var(--red);
}

/* --------------------------------------------------------------------------
   7. Alerts & messages
   -------------------------------------------------------------------------- */
.msg {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 15px;
  line-height: 1.45;
}

.msg-ok {
  background: var(--green-bg);
  color: var(--green);
  border-left: 3px solid var(--green);
}

.msg-err {
  background: var(--red-bg);
  color: var(--red);
  border-left: 3px solid var(--red);
}

.msg-warn {
  background: var(--amber-bg);
  color: var(--amber);
  border-left: 3px solid var(--amber);
}

.alert-banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.alert-banner.warn {
  background: var(--amber-bg);
  border-left: 3px solid var(--amber);
}

.alert-banner.ok {
  background: var(--green-bg);
  border-left: 3px solid var(--green);
}

.info-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}

.info-box.ok {
  background: var(--green-bg);
  border: 1px solid rgba(13, 122, 79, 0.2);
}

.info-box.warn {
  background: var(--amber-bg);
  border: 1px solid rgba(180, 83, 9, 0.2);
}

.summary-bar {
  padding: 10px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   8. KPI cards
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi,
.stat-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur);
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur);
}

.kpi:hover,
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(253, 112, 32, 0.2);
}

.kpi:hover::after {
  opacity: 1;
}

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.kpi-lbl,
.stat-lbl {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.kpi-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange);
  flex-shrink: 0;
}

.kpi-ic svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.kpi .val,
.stat-val {
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.kpi .sub,
.stat-sub {
  font-size: 12px;
  color: var(--soft);
  margin-top: 8px;
}

.stat-val.accent { color: var(--orange); }
.stat-val.danger { color: var(--red); }
.text-danger { color: var(--red); }
.text-success { color: var(--green); }
.text-muted { color: var(--soft); }

.kpi-grid .card.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 110px;
}

/* --------------------------------------------------------------------------
   9. Content cards & tables
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-2);
  background: var(--surface);
  gap: 12px;
  flex-wrap: wrap;
}

.card-head h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.card-head .tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card-body {
  padding: 20px;
}

table,
.data-table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13.5px;
  color: var(--ink);
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background var(--dur);
}

tbody tr:hover {
  background: rgba(253, 112, 32, 0.03);
}

.row-click {
  cursor: pointer;
}

.row-click:hover {
  background: var(--orange-soft) !important;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

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

.cell-soft {
  color: var(--soft);
  font-size: 12.5px;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}

.search input {
  padding: 8px 12px 8px 34px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  width: 240px;
  font-size: 13px;
  transition: border-color var(--dur), box-shadow var(--dur);
}

.search input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(253, 112, 32, 0.12);
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--soft);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   10. Badges
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: 0.01em;
}

.b-draft,
.badge-draft { background: var(--slate-bg); color: var(--slate); }
.b-ok,
.badge-ok,
.badge-success { background: var(--green-bg); color: var(--green); }
.b-warn,
.badge-warn,
.badge-warning { background: var(--amber-bg); color: var(--amber); }
.b-info,
.badge-info { background: var(--blue-bg); color: var(--blue); }
.b-red,
.badge-danger,
.badge-error { background: var(--red-bg); color: var(--red); }
.badge-accent { background: var(--orange-soft); color: var(--orange-700); }
.badge-navy { background: rgba(10, 22, 40, 0.08); color: var(--navy); }

.pp-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  background: color-mix(in srgb, currentColor 12%, transparent);
}

/* --------------------------------------------------------------------------
   11. Empty states
   -------------------------------------------------------------------------- */
.empty,
.empty-state {
  padding: 56px 28px;
  text-align: center;
  color: var(--soft);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state .empty-icon,
.empty .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg-soft);
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
  margin-bottom: 4px;
}

.empty-state .empty-icon svg,
.empty .empty-icon svg {
  width: 26px;
  height: 26px;
}

.empty-state h3,
.empty h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0;
}

.empty-state p,
.empty p {
  max-width: 320px;
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   12. Modals
   -------------------------------------------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 16, 28, 0.58);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  z-index: var(--z-overlay);
  overflow-y: auto;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn var(--dur) ease both;
}

.modal {
  width: 100%;
  max-width: 820px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  animation: slideUp var(--dur-slow) var(--ease-out) both;
  margin: auto 0;
}

.modal-sm { max-width: 440px; }
.modal-md { max-width: 640px; }
.modal-lg { max-width: 960px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.modal-x {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--soft);
  font-size: 20px;
  line-height: 1;
  transition: background var(--dur), color var(--dur);
}

.modal-x:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.modal-body {
  padding: 24px;
  max-height: 66vh;
  overflow-y: auto;
}

.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-foot .btn {
  flex: 0 0 auto;
  min-width: 100px;
}

/* --------------------------------------------------------------------------
   13. Toasts
   -------------------------------------------------------------------------- */
.toast,
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-toast);
}

.toast {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 13px 18px;
  font-size: 13.5px;
  font-weight: 550;
  animation: toastIn 0.32s var(--ease-out) both;
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  line-height: 1.45;
  border-left: 3px solid var(--orange);
}

.toast-ok { border-left-color: #34d399; }
.toast-err { border-left-color: #f87171; background: #1a1214; }
.toast-warn { border-left-color: #fbbf24; }

.toast-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-stack .toast {
  position: static;
  pointer-events: auto;
}

/* --------------------------------------------------------------------------
   14. Pipeline / Kanban
   -------------------------------------------------------------------------- */
.pipeline,
.kanban {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 4px 24px;
  margin: 0 0 20px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.pipeline-col,
.kanban-col {
  flex: 0 0 280px;
  min-width: 260px;
  max-width: 320px;
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
  scroll-snap-align: start;
  overflow: visible;
}

.pipeline-col-head,
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
  flex-shrink: 0;
}

.pipeline-col-title,
.kanban-col-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-col-title::before,
.kanban-col-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

.pipeline-col[data-stage="lead"] .pipeline-col-title::before,
.kanban-col[data-stage="lead"] .kanban-col-title::before { background: var(--blue); }
.pipeline-col[data-stage="qualified"] .pipeline-col-title::before { background: var(--amber); }
.pipeline-col[data-stage="offer"] .pipeline-col-title::before { background: var(--orange); }
.pipeline-col[data-stage="won"] .pipeline-col-title::before { background: var(--green); }
.pipeline-col[data-stage="lost"] .pipeline-col-title::before { background: var(--red); }

.pipeline-count,
.kanban-count {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

.pipeline-col-body,
.kanban-col-body {
  flex: 1;
  overflow-x: visible;
  overflow-y: auto;
  padding: 4px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 140px;
}

.pipeline-card,
.kanban-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-xs);
  cursor: grab;
  overflow: visible;
  position: relative;
  z-index: 0;
  transition: box-shadow var(--dur), border-color var(--dur);
}
.pipeline-card:has(.lm-select.open),
.kanban-card:has(.lm-select.open) {
  z-index: 5;
}

.pipeline-card:hover,
.kanban-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(253, 112, 32, 0.25);
}

.pipeline-card:active,
.kanban-card:active {
  cursor: grabbing;
}

.pipeline-card-title,
.kanban-card-title {
  font-weight: 650;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.35;
}

.pipeline-card-meta,
.kanban-card-meta {
  font-size: 12px;
  color: var(--soft);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.pipeline-card-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   15. Calendar day strip (planning)
   -------------------------------------------------------------------------- */
.cal-strip,
.day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 16px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.cal-day,
.day-chip {
  flex: 0 0 auto;
  min-width: 72px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: transform var(--dur), border-color var(--dur), background var(--dur), box-shadow var(--dur), color var(--dur);
  scroll-snap-align: start;
  box-shadow: var(--shadow-xs);
}

.cal-day:hover,
.day-chip:hover {
  border-color: rgba(253, 112, 32, 0.35);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cal-day.active,
.day-chip.active,
.cal-day.is-selected {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  box-shadow: 0 6px 20px rgba(10, 22, 40, 0.28);
}

.cal-day.today:not(.active),
.day-chip.today:not(.active) {
  border-color: var(--orange);
  background: var(--orange-soft);
}

.cal-day-dow,
.day-chip .dow {
  display: block;
  font-size: 10.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--soft);
  margin-bottom: 4px;
}

.cal-day.active .cal-day-dow,
.day-chip.active .dow {
  color: rgba(255, 255, 255, 0.55);
}

.cal-day-num,
.day-chip .num {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--navy);
  text-align: center;
}

.cal-day.active .cal-day-num,
.day-chip.active .num {
  color: #fff;
}

.cal-day-count,
.day-chip .count {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--orange);
}

.cal-day.active .cal-day-count,
.day-chip.active .count {
  color: #ffb07a;
}

.cal-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-event {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  border-left: 3px solid var(--orange);
  transition: box-shadow var(--dur), transform var(--dur);
}

.cal-event:hover {
  box-shadow: var(--shadow);
  transform: translateX(2px);
}

.cal-event-time {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--navy);
  min-width: 52px;
  font-variant-numeric: tabular-nums;
}

.cal-event-body {
  flex: 1;
  min-width: 0;
}

.cal-event-title {
  font-weight: 650;
  font-size: 14px;
  color: var(--ink);
}

.cal-event-meta {
  font-size: 12.5px;
  color: var(--soft);
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   16. Tabs, notifications, misc portal UI
   -------------------------------------------------------------------------- */
.page-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-tab {
  padding: 10px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 550;
  font-size: 13.5px;
  cursor: pointer;
  transition: color var(--dur), border-color var(--dur);
  margin-bottom: -1px;
}

.page-tab:hover { color: var(--ink); }

.page-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
  font-weight: 650;
}

.acc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.acc-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}

.acc-tab:hover {
  border-color: #d0d7e2;
  color: var(--ink);
}

.acc-tab.active {
  background: var(--orange-soft);
  border-color: var(--orange);
  color: var(--orange-700);
}

.notif-panel {
  position: fixed;
  top: calc(var(--topbar-h) + 8px);
  right: 20px;
  width: min(360px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-dropdown);
  display: none;
  overflow: hidden;
  animation: fadeInUp 0.25s var(--ease-out) both;
}

.notif-panel.open { display: block; }

.notif-panel-hd {
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--line-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
  position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item small {
  display: block;
  color: var(--soft);
  margin-top: 4px;
  font-size: 11px;
}

.notif-item.notif-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--soft);
}

.notif-clear-all {
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
}

.notif-x {
  position: absolute;
  top: 8px;
  right: 10px;
  color: var(--soft);
  font-size: 16px;
  line-height: 1;
  padding: 2px 6px;
}

.notif-x:hover { color: var(--ink); }

.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--soft);
  font-size: 14px;
}

.spin {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 10px;
  flex-shrink: 0;
}

.wizard-dots {
  display: flex;
  gap: 6px;
  margin: 12px 0 4px;
}

.wizard-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  transition: background var(--dur);
}

.wizard-dot.done { background: var(--orange); }

/* Signup wizard (LogiDrink-style 4 steps) */
.auth-card.wiz-card { max-width: 520px; }
.wiz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.wiz-head strong { font-size: 15px; color: var(--ink); }
.wiz-close {
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--soft);
  cursor: pointer;
  padding: 0 4px;
}
.wiz-step-lbl {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 16px;
}
.wiz-lead {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.wiz-mod {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
}
.wiz-mod input { width: auto; flex-shrink: 0; }
.wiz-mod span { flex: 1; font-size: 13px; color: var(--ink); }
.wiz-mod em { color: var(--soft); font-style: normal; font-size: 12px; }
.wiz-hint { font-size: 12px; color: var(--soft); margin: 0 0 12px; }
.wiz-link { margin-top: 12px; font-size: 12px; }
.wiz-link a { color: var(--orange); font-weight: 600; }
.wiz-price-box {
  padding: 14px 16px;
  background: var(--orange-soft);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
  margin-top: 4px;
}
.wiz-price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
}
.wiz-price-row strong { color: var(--ink); }
.wiz-price-row strong.accent { color: var(--orange); }
.wiz-price-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--soft);
}
.wiz-recap {
  padding: 12px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.wiz-cgv {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  margin-top: 8px;
}
.wiz-cgv input { margin-top: 3px; width: auto; flex-shrink: 0; }
.wiz-cgv a { color: var(--blue, #1d4ed8); }
.wiz-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.users-slider-wrap { width: 100%; margin-top: 8px; }
.users-slider {
  width: 100%;
  height: 8px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.users-slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #e8e8ea;
}
.users-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  margin-top: -6px;
}
.users-slider::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #e8e8ea;
  border: none;
}
.users-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--orange);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.users-slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 6px;
}
.accent { color: var(--orange); }

.lines th,
.lines td {
  padding: 10px 12px;
  font-size: 12px;
  background: transparent;
}

.lines th {
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}

.lines input,
.lines select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  font-size: 13px;
  min-width: 60px;
}

.lines input:focus,
.lines select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(253, 112, 32, 0.12);
}

.lines .num input {
  text-align: right;
}

.line-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  margin-top: 16px;
  font-size: 13px;
}

.totals .ttc {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 750;
  margin-top: 5px;
  color: var(--orange-700);
}

.toplist { padding: 8px 12px 14px; }

.toprow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-2);
}

.toprow:last-child { border-bottom: none; }

.toprow .rank {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--line-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.toprow:first-child .rank {
  background: var(--orange-soft);
  color: var(--orange-700);
}

.toprow .topmain { flex: 1; min-width: 0; }

.toprow .topname {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 7px;
  color: var(--ink);
}

.toprow .bar {
  height: 6px;
  border-radius: 4px;
  background: var(--line-2);
  overflow: hidden;
}

.toprow .bar-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--orange), #ff944d);
}

.toprow .topval {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  color: var(--ink);
}

.dash-tops {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 18px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.settings-grid {
  display: grid;
  gap: 16px;
}

.settings-save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  padding: 12px 0;
  margin-top: 8px;
  background: linear-gradient(180deg, transparent, var(--bg-soft) 35%);
  padding-top: 20px;
}

.settings-save-bar .btn-primary {
  min-width: 220px;
  box-shadow: var(--shadow-orange);
}

/* Chart sizing handled in planiq.css (.chart-box / card-body canvas) : do not clamp whole card-body */
.card canvas {
  max-width: 100% !important;
}

/* Tom Select */
.ts-control {
  background: var(--bg) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
  min-height: auto !important;
}

.ts-control:focus-within {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(253, 112, 32, 0.12) !important;
}

.ts-dropdown {
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-lg) !important;
  font-size: 13px !important;
  z-index: 99999 !important;
  margin-top: 4px !important;
}

.ts-dropdown .active {
  background: var(--orange) !important;
  color: #fff !important;
}

.ts-dropdown .ts-dropdown-content {
  max-height: 260px;
}

.modal .field {
  position: relative;
}

/* Ticket / support extras */
.tkt-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 650;
  background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent);
  color: var(--c, var(--muted));
}

.upgrade-accent {
  color: var(--orange);
}

/* --------------------------------------------------------------------------
   17. Responsive : 980px
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .sidebar {
    width: min(280px, 86vw);
    transform: translateX(-105%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(6, 16, 28, 0.35);
  }

  .sidebar.collapsed {
    width: min(280px, 86vw);
  }

  .sidebar.collapsed .brand-name,
  .sidebar.collapsed .module-switcher span,
  .sidebar.collapsed .nav-group,
  .sidebar.collapsed .nav-grp-btn span,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .userbox .meta,
  .sidebar.collapsed #navSearch,
  .sidebar.collapsed .nav-search-wrap {
    display: initial;
  }

  .sidebar.collapsed .nav-item {
    justify-content: flex-start;
    padding: 8px 10px;
  }

  .sidebar.collapsed .module-switcher {
    flex-direction: row;
    padding: 12px 12px 8px;
  }

  .main,
  .app-shell.sidebar-collapsed .main,
  #app.sidebar-collapsed .main {
    margin-left: 0;
  }

  .sidebar-toggle,
  .hamburger {
    display: inline-flex;
  }

  .kpi-grid,
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .content {
    padding: 18px 16px 36px;
  }

  .topbar {
    padding: 0 14px;
  }

  .search input {
    width: 160px;
  }

  .pipeline-col,
  .kanban-col {
    flex: 0 0 240px;
    min-width: 230px;
  }

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

  .acc-tab span:last-child {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   18. Responsive : 560px
   -------------------------------------------------------------------------- */
@media (max-width: 560px) {
  .kpi-grid,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 22px;
    border-radius: var(--radius-lg);
  }

  .content {
    padding: 14px 12px 32px;
  }

  .topbar {
    height: 54px;
    padding: 0 10px;
  }

  .crumb b,
  .breadcrumbs b {
    font-size: 14px;
  }

  #topActions {
    gap: 6px;
  }

  #topActions .btn {
    padding: 7px 12px;
    font-size: 12px;
  }

  .search input {
    width: 100%;
    max-width: 140px;
  }

  .modal {
    border-radius: var(--radius-lg);
  }

  .modal-body {
    padding: 18px 16px;
    max-height: 70vh;
  }

  .modal-head,
  .modal-foot {
    padding: 14px 16px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 16px;
    max-width: none;
  }

  .cal-day,
  .day-chip {
    min-width: 64px;
    padding: 10px 10px;
  }

  .pipeline-col,
  .kanban-col {
    flex: 0 0 85vw;
    max-width: 85vw;
  }

  .module-pill {
    font-size: 10.5px;
    padding: 7px 4px;
  }

  .card-head {
    padding: 14px 14px;
  }

  th, td {
    padding: 10px 12px;
  }
}

/* :  Portal switcher & extras (LogiMotor modules) :  */
.portal-switch, .portal-switcher {
  display: flex; gap: 6px; padding: 12px 14px 8px; flex-wrap: wrap;
}
.portal-pill, .module-pill {
  flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-pill); padding: 8px 10px; font-size: 12px; font-weight: 700;
  color: var(--muted); cursor: pointer; transition: .2s var(--ease); font-family: var(--font-display);
}
.portal-pill:hover { color: var(--ink); border-color: #d0d7e2; }
.portal-pill.active {
  background: color-mix(in srgb, var(--pc, var(--orange)) 14%, #fff);
  border-color: var(--pc, var(--orange)); color: var(--navy);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc, var(--orange)) 18%, transparent);
}
.btn-block { width: 100%; }
.auth-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 750; margin: 0 0 6px; }
.auth-sub { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.search-input, .ld-select, .toolbar select {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  background: #fff; font: inherit; min-width: 180px;
}
.search-input { flex: 1; min-width: 200px; }
.row-act { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: .15s;
}
.icon-btn:hover { color: var(--orange); border-color: var(--orange); }
.icon-btn svg { width: 15px; height: 15px; }
.mono { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 13px; }
.muted { color: var(--muted); font-size: 12.5px; }
.muted.sm { font-size: 12px; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-neutral { background: var(--slate-bg); color: var(--slate); }
.loading-block { display: grid; place-items: center; gap: 12px; padding: 64px 20px; color: var(--muted); }
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--orange);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fade-in { animation: fadeInUp .45s var(--ease) both; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.tl-time { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.lines-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 10px; }
.line-row {
  display: grid; grid-template-columns: 90px 1fr 70px 90px 36px; gap: 8px; margin-bottom: 8px; align-items: center;
}
.line-row input, .line-row select {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; background: #fff;
}
@media (max-width: 720px) {
  .line-row { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 1fr; }
}
.totals-bar {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  margin-top: 14px; padding: 12px 14px; background: var(--bg-soft); border-radius: var(--radius);
}
.totals-bar span { color: var(--muted); font-size: 13px; }
.totals-bar b { margin-right: 8px; }
.modal-wide { max-width: 820px; }
.planning-strip {
  display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 10px; margin-bottom: 18px;
  overflow-x: auto;
}
.plan-day {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); min-height: 180px;
  box-shadow: var(--shadow-sm);
}
.plan-day-hd {
  display: flex; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.plan-day-hd span {
  background: var(--orange-soft); color: var(--orange-700); border-radius: 999px; padding: 1px 8px; font-weight: 700; font-size: 11px;
}
.plan-day-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.plan-chip {
  border-left: 3px solid var(--c, var(--orange)); background: var(--bg-soft); border-radius: 10px; padding: 8px 10px;
}
.plan-chip b { display: block; font-size: 13px; }
.plan-chip small { color: var(--muted); font-size: 11.5px; }
.tech-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.tech-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.tech-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tech-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle;
}
.status-bars { display: flex; flex-direction: column; gap: 12px; }
.sbar-lbl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.sbar-track { height: 8px; background: var(--bg-muted); border-radius: 999px; overflow: hidden; }
.sbar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), #ff9a4d); border-radius: 999px; }
.vehicle-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.vehicle-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s;
}
.vehicle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.vc-top { display: flex; gap: 6px; margin-bottom: 10px; }
.vehicle-card h3 { font-family: var(--font-display); font-size: 1.05rem; margin: 0 0 4px; }
.vc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; color: var(--muted); font-size: 12.5px; }
.vc-price { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; color: var(--navy); margin: 8px 0 12px; }
.vc-actions { display: flex; gap: 8px; }
.btn.danger, .btn-ghost.danger { color: var(--red); }
.mini-pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mp-col {
  background: var(--bg-soft); border-radius: var(--radius); padding: 14px; text-align: center;
}
.mp-col span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.mp-col b { font-family: var(--font-display); font-size: 1.4rem; }
.kanban-hd {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 14px 12px;
  border-bottom: 1px solid var(--line-2); font-weight: 700; font-size: 13px;
  flex-shrink: 0; line-height: 1.3;
}
.kanban-body {
  padding: 10px; display: flex; flex-direction: column; gap: 8px;
  min-height: 140px; overflow: visible;
}
.kanban-card .kc-foot { margin-top: 8px; font-weight: 700; color: var(--orange-700); font-size: 13px; }
.kanban-card .lm-select { width: 100%; min-width: 0; margin-top: 8px; }
.stage-select {
  width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; background: #fff;
}
.module-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.module-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px;
}
.module-chip.on { border-color: var(--orange); background: var(--orange-soft); color: var(--orange-700); }
.module-chip input { width: auto; }
.settings-save-bar { display: flex; justify-content: flex-end; margin-top: 14px; }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 200; background: var(--navy); color: #fff;
  padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: .25s var(--ease); font-weight: 600; font-size: 13.5px; max-width: min(360px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: none; }
.toast-err { background: var(--red); }
.toast-ok { background: var(--navy); }
.empty-state {
  text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty-ico { width: 48px; height: 48px; margin: 0 auto 12px; color: var(--soft); }
.empty-ico svg { width: 48px; height: 48px; }
.empty-state h3 { font-family: var(--font-display); margin: 0 0 6px; }
.empty-state p { color: var(--muted); margin: 0 0 16px; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted); background: var(--surface-2); padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 0; }
.card-head h3 { font-family: var(--font-display); font-size: 1rem; margin: 0; }
.card-body { padding: 14px 18px 18px; }
.card-actions { display: flex; gap: 8px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 980px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .kpi-grid { grid-template-columns: 1fr; } }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px;
  box-shadow: var(--shadow-sm); transition: transform .2s var(--ease);
}
.kpi:hover { transform: translateY(-2px); }
.kpi-ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c, var(--orange)) 14%, #fff); color: var(--c, var(--orange)); margin-bottom: 10px;
}
.kpi-ico svg { width: 18px; height: 18px; }
.kpi-lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi-val { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; margin-top: 2px; }
.kpi-hint { font-size: 12px; color: var(--soft); margin-top: 4px; }
.overlay {
  position: fixed; inset: 0; background: rgba(10, 22, 40, .48); z-index: 120;
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  opacity: 0; transition: .2s; backdrop-filter: blur(4px);
}
.overlay.open { opacity: 1; }
@media (min-width: 720px) {
  .overlay { align-items: center; }
}
.modal {
  width: min(640px, 100%); background: #fff; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  transform: translateY(16px); transition: .25s var(--ease); max-height: min(90vh, 900px); overflow: auto;
}
.overlay.open .modal { transform: none; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; padding: 16px 18px;
  border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 1;
}
.modal-head h2 { font-family: var(--font-display); font-size: 1.1rem; margin: 0; }
.modal-body { padding: 16px 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px;
  border-top: 1px solid var(--line-2); position: sticky; bottom: 0; background: #fff;
}
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px;
  font: inherit; background: #fff; color: var(--ink); outline: none; transition: .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-glow);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-pill); font-weight: 700; font-size: 13.5px;
  border: none; cursor: pointer; font-family: inherit; transition: .15s;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, #ff8038, #f2640f); color: #fff; box-shadow: var(--shadow-orange);
}
.btn-primary:hover { filter: brightness(1.03); }
.btn-ghost {
  background: #fff; border: 1.5px solid var(--line); color: var(--ink);
}
.btn-ghost:hover { border-color: #cfd6e2; background: var(--bg-soft); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.msg { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 12px; }
.msg-ok { background: var(--green-bg); color: var(--green); }
.msg-err { background: var(--red-bg); color: var(--red); }
.crumb-sep { color: var(--soft); font-weight: 400; margin: 0 4px; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(10,22,40,.4); z-index: 40;
}
.sidebar-backdrop.open { display: block; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
