@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&display=swap");

:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --bg: #f3f5f8;
  --bg-elevated: #ffffff;
  --bg-muted: #eef1f6;
  --bg-sidebar: #0b1220;
  --bg-sidebar-2: #111827;
  --text: #0f172a;
  --text-2: #334155;
  --text-3: #64748b;
  --text-inv: #e8edf5;
  --text-inv-2: #93a0b5;
  --border: #e6ebf2;
  --border-2: #d5dde8;
  --accent: #1d4ed8;
  --accent-2: #2563eb;
  --accent-soft: #edf3ff;
  --gold: #b0893e;
  --gold-soft: #f6eedc;
  --success: #0f766e;
  --success-soft: #e7f6f3;
  --warning: #b45309;
  --warning-soft: #fef3e6;
  --danger: #be123c;
  --danger-soft: #fde8ee;
  --info: #0369a1;
  --info-soft: #e8f4fb;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
  --sidebar: 272px;
  --sidebar-min: 84px;
  --topbar: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #080c14;
  --bg-elevated: #111827;
  --bg-muted: #1a2333;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --border: #243044;
  --border-2: #334155;
  --accent-soft: #172554;
  --gold-soft: #2a2316;
  --success-soft: #102422;
  --warning-soft: #2a1c10;
  --danger-soft: #2a1218;
  --info-soft: #102433;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.28);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.app {
  display: flex;
  min-height: 100%;
}

.sidebar {
  width: var(--sidebar);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  color: var(--text-inv);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: width 0.28s var(--ease);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

body.sidebar-collapsed .sidebar { width: var(--sidebar-min); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-section-title,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .nav-caret,
body.sidebar-collapsed .nav-sub,
body.sidebar-collapsed .nav-tag,
body.sidebar-collapsed .sidebar-foot-label { display: none; }
body.sidebar-collapsed .brand { justify-content: center; padding-inline: 0; }
body.sidebar-collapsed .nav-link { justify-content: center; padding-inline: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar);
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(160deg, #1e3a5f, #0b1220);
  border: 1px solid rgba(196, 163, 90, 0.35);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.brand-mark svg { width: 18px; height: 18px; }

.brand-text { line-height: 1.15; min-width: 0; }
.brand-text strong { display: block; font-size: 15px; font-weight: 750; letter-spacing: -0.02em; }
.brand-text span { font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

.nav {
  padding: 16px 12px;
  overflow: auto;
  flex: 1;
}

.nav::-webkit-scrollbar { width: 0; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b778c;
  padding: 14px 12px 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-inv-2);
  font-size: 13.5px;
  font-weight: 550;
  margin-bottom: 2px;
  position: relative;
  transition: 0.18s ease;
}

.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }

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

.nav-link.is-active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.06));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.25);
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #60a5fa;
}

.nav-toggle {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.nav-toggle.is-parent { color: #fff; }
.nav-caret {
  margin-left: auto;
  display: grid;
  place-items: center;
  opacity: 0.6;
  transition: transform 0.18s var(--ease);
}
.nav-caret svg { width: 14px; height: 14px; }
.nav-group.is-open > .nav-toggle .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 6px 12px; }
.nav-group.is-open > .nav-sub { display: block; }
.nav-child { font-size: 13px; padding: 8px 12px; }
.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5b6b82;
  flex-shrink: 0;
  margin: 0 6px;
}
.nav-child.is-active .nav-dot { background: #60a5fa; }
.nav-tag {
  margin-left: auto;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1408;
  background: linear-gradient(180deg, #d4b56a, #b0893e);
  border-radius: 999px;
  padding: 2px 6px;
}

.nav-badge {
  margin-left: auto;
  background: #be123c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 5px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(160deg, #2563eb, #1e3a8a);
  flex-shrink: 0;
}

.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.gold { background: linear-gradient(160deg, #c4a35a, #8a6a2a); }
.avatar.teal { background: linear-gradient(160deg, #14b8a6, #0f766e); }
.avatar.rose { background: linear-gradient(160deg, #fb7185, #be123c); }
.avatar.slate { background: linear-gradient(160deg, #64748b, #334155); }

.app-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 12px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  position: relative;
  transition: 0.18s ease;
}

.icon-btn:hover { border-color: var(--border-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #e11d48;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-elevated);
}

.search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 12px;
  padding: 0 14px 0 38px;
  outline: none;
  transition: 0.18s ease;
}

.search input:focus {
  background: var(--bg-elevated);
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  cursor: pointer;
}

.user-chip span { font-size: 13px; font-weight: 650; }
.user-chip small { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; }

.app-footer {
  padding: 12px 28px 22px;
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

.page {
  padding: 26px 28px 24px;
  flex: 1;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.breadcrumb a:hover { color: var(--accent); }

.page-head h1 {
  font-size: 26px;
  letter-spacing: -0.035em;
  font-weight: 750;
}

.page-head p { color: var(--text-3); font-size: 13.5px; margin-top: 4px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.18s ease;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--border-2); }
.btn-primary {
  background: linear-gradient(180deg, #2b6ef2, #1d4ed8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.25);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-gold {
  background: linear-gradient(180deg, #d4b56a, #b0893e);
  color: #1a1408;
  border-color: transparent;
}
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.btn-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-1-2 { grid-template-columns: 1.4fr 1fr; }
.grid-2-1 { grid-template-columns: 1.6fr 1fr; }
.span-2 { grid-column: span 2; }

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-pad { padding: 18px 18px 16px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.muted { font-size: 13px; color: var(--text-3); }
.card-head .muted { font-size: 12px; }

.kpi {
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
}

.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon.blue { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.teal { background: var(--success-soft); color: var(--success); }
.kpi-icon.gold { background: var(--gold-soft); color: var(--gold); }
.kpi-icon.rose { background: var(--danger-soft); color: var(--danger); }

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 10px 0 8px;
}

.delta {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
}

.delta.up { background: var(--success-soft); color: var(--success); }
.delta.down { background: var(--danger-soft); color: var(--danger); }
.delta.warn { background: var(--warning-soft); color: var(--warning); }
.delta + .hint { font-size: 12px; color: var(--text-3); margin-left: 8px; }

.spark { height: 42px; margin-top: 10px; }

.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.data {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 700;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg-muted); }

.person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person strong { display: block; font-size: 13px; }
.person span { font-size: 12px; color: var(--text-3); }

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.neutral { background: var(--bg-muted); color: var(--text-2); }
.badge.gold { background: var(--gold-soft); color: #8a6a2a; }

.progress {
  height: 7px;
  background: var(--bg-muted);
  border-radius: 99px;
  overflow: hidden;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #22c55e);
  border-radius: inherit;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row strong { display: block; font-size: 13px; }
.list-row span { font-size: 12px; color: var(--text-3); }

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex-shrink: 0;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
  overflow: hidden;
  z-index: 50;
}

.dropdown.open { display: block; }
.dropdown-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}

.dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-2);
}

.dropdown-item:hover { background: var(--bg-muted); }
.dropdown-item p { color: var(--text-3); font-size: 11px; margin-top: 1px; line-height: 1.3; }
.dropdown-item strong { font-size: 12.5px; font-weight: 650; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.45);
  z-index: 35;
}

.overlay.show { display: block; }

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.field, .select {
  height: 40px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 11px;
  padding: 0 12px;
  outline: none;
}

.field:focus, .select:focus, textarea.field:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea.field {
  height: auto;
  padding: 12px;
  width: 100%;
  resize: vertical;
  min-height: 110px;
}

.label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-2);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.tabs {
  display: flex;
  gap: 6px;
  background: var(--bg-muted);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

.tab {
  border: 0;
  background: transparent;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-3);
  cursor: pointer;
}

.tab.is-active { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow); }

.tab-pane { display: none; }
.tab-pane.is-on { display: block; }

.profile-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-hero .who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-hero h1 { font-size: 22px; letter-spacing: -0.03em; }
.profile-hero .muted { margin-top: 2px; }

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 18%, var(--border));
  border-radius: 12px;
}
.status-bar p { font-size: 13px; font-weight: 650; }

table.info { width: 100%; border-collapse: collapse; font-size: 13px; }
table.info th {
  text-align: left;
  color: var(--text-3);
  font-weight: 650;
  width: 42%;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
table.info td { padding: 10px 0; border-bottom: 1px solid var(--border); }
table.info tr:last-child th, table.info tr:last-child td { border-bottom: 0; }

.view-only { display: flex; }
.edit-only { display: none; }
.app-view { display: block; }
.app-edit { display: none; }
body.app-editing .view-only { display: none !important; }
body.app-editing .edit-only { display: flex; }
body.app-editing .app-view { display: none; }
body.app-editing .app-edit { display: block; }
body.app-editing .edit-only.actions { display: flex; }

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal .dow {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  padding: 6px 0;
}

.cal .day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  padding: 6px;
  font-size: 12px;
  min-height: 72px;
}

.cal .day.mute { color: var(--text-3); background: var(--bg-muted); }
.cal .day.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal .ev {
  margin-top: auto;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.msg:hover, .msg.is-active { background: var(--bg-muted); }
.msg.unread strong { font-weight: 800; }
.msg time { font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; }

.login-wrap {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.login-wrap.login-only {
  grid-template-columns: 1fr;
}

.login-wrap.login-only .login-panel {
  min-height: 100%;
}

.login-brand {
  height: auto;
  padding: 0 0 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.login-brand .brand-text strong { color: var(--text); }
.login-card h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.login-lead {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 22px;
}
.login-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 18px;
  color: var(--text-3);
}
.login-foot {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 16px;
  text-align: center;
}

.login-hero {
  background:
    radial-gradient(1200px 500px at 10% 10%, rgba(37, 99, 235, 0.28), transparent 50%),
    radial-gradient(800px 400px at 90% 90%, rgba(196, 163, 90, 0.18), transparent 50%),
    var(--bg-sidebar);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-hero h1 {
  font-size: 42px;
  letter-spacing: -0.045em;
  line-height: 1.1;
  max-width: 520px;
}

.login-hero p { color: #93a0b5; max-width: 420px; margin-top: 14px; }

.login-panel {
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

.stat-pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 120px;
}
.pill b { display: block; font-size: 18px; }
.pill span { font-size: 11px; color: #93a0b5; }

.mobile-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: 45;
  grid-template-columns: repeat(5, 1fr);
}

.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  padding: 8px 0;
  border-radius: 12px;
}

.mobile-nav a svg { width: 18px; height: 18px; }
.mobile-nav a.is-active { color: var(--accent); background: var(--accent-soft); }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: #0b1220;
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 0.28s var(--ease);
  z-index: 80;
}

.toast.show { transform: none; opacity: 1; }

.menu-btn { display: none; }
.search-btn { display: none; }

.kbd {
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text-3);
}

.welcome {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 16px;
  background:
    linear-gradient(120deg, rgba(29, 78, 216, 0.12), rgba(176, 137, 62, 0.1)),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.welcome h2 { font-size: 18px; letter-spacing: -0.03em; }
.welcome p { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.welcome-time { text-align: right; }
.welcome-time b { display: block; font-size: 22px; letter-spacing: -0.04em; }
.welcome-time span { font-size: 12px; color: var(--text-3); }

.switch {
  width: 42px;
  height: 24px;
  border: 0;
  border-radius: 99px;
  background: var(--border-2);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch.on { background: var(--accent); }
.switch.on::after { left: 21px; }

.cmdk {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: start center;
  padding-top: 12vh;
  background: rgba(8, 12, 20, 0.5);
  backdrop-filter: blur(6px);
}
.cmdk.open { display: grid; }
.cmdk-box {
  width: min(560px, 92vw);
  background: var(--bg-elevated);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.cmdk-box input {
  width: 100%;
  height: 54px;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
}
.cmdk-list { max-height: 320px; overflow: auto; padding: 8px; }
.cmdk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.cmdk-item svg { width: 16px; height: 16px; color: var(--text-3); }
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); color: var(--accent); }
.cmdk-foot {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 11px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: none;
  place-items: center;
  background: rgba(8, 12, 20, 0.5);
  padding: 16px;
}
.modal-root.open { display: grid; }
.modal {
  width: min(480px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 4px; }
.modal .muted { margin-bottom: 16px; display: block; }

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kanban-col {
  background: var(--bg-muted);
  border-radius: 16px;
  padding: 12px;
  min-height: 440px;
  border: 1px dashed transparent;
}
.kanban-col.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.kanban-col h4 {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}
.kanban-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: var(--shadow);
}
.kanban-card:active { cursor: grabbing; }
.kanban-card strong { display: block; font-size: 13px; margin-bottom: 6px; }
.kanban-card p { font-size: 12px; color: var(--text-3); }

.file-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
}
.file-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.file-ico.pdf { background: var(--danger-soft); color: var(--danger); }
.file-ico.xls { background: var(--success-soft); color: var(--success); }
.file-ico.doc { background: var(--info-soft); color: var(--info); }

.alert {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 12px;
  display: none;
}
.alert.show { display: block; }
.alert.danger { background: var(--danger-soft); color: var(--danger); }

table.data tbody tr[hidden] { display: none; }

table.data.striped tbody tr:nth-child(even) { background: var(--bg-muted); }
table.data.compact th, table.data.compact td { padding: 7px 12px; font-size: 12px; }
table.data.sticky thead th {
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}
table.data.money td.num, table.data td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
table.data th[data-sort] { cursor: pointer; user-select: none; }
table.data th[data-sort]::after { content: " ↕"; color: var(--text-3); font-size: 10px; }
table.data th.sort-asc::after { content: " ↑"; color: var(--accent); }
table.data th.sort-desc::after { content: " ↓"; color: var(--accent); }
table.data tbody tr.selected { background: var(--accent-soft); }
table.data tbody tr.low { background: var(--danger-soft); }
table.data.log { font-variant-numeric: tabular-nums; }
table.data.log td { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.bulk-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--border);
}
.bulk-bar.show { display: flex; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.chip.is-active { background: var(--accent); color: #fff; border-color: transparent; }

.expand-toggle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  cursor: pointer;
}
.expand-child td {
  background: var(--bg-muted);
  padding-top: 8px;
  padding-bottom: 8px;
}

.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.dot-ok { color: var(--success); font-weight: 800; }
.dot-no { color: var(--border-2); }

.view-grid { display: none; }
body.view-cards .view-table { display: none; }
body.view-cards .view-grid { display: grid; }

.filter-side {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
.filter-card { padding: 16px; height: fit-content; position: sticky; top: 84px; }
.filter-card .label { margin-top: 12px; }

.pager-pages { display: flex; gap: 6px; }
.pager-pages .btn { min-width: 36px; padding: 0 8px; justify-content: center; }
.pager-pages .btn.is-active { background: var(--accent); color: #fff; border-color: transparent; }

.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.row-actions .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
.row-actions .icon-btn.danger { color: var(--danger); }
.row-actions .icon-btn.danger:hover { background: var(--danger-soft); border-color: transparent; }

.icon-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 10px;
}
.icon-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 12px;
  cursor: pointer;
  min-width: 0;
  color: var(--text-2);
}
.icon-tile:hover, .icon-tile:focus {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.icon-tile svg { width: 22px; height: 22px; flex-shrink: 0; }
.icon-tile span {
  font-size: 11px;
  font-weight: 650;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-tile[hidden] { display: none; }

.create-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.create-steps span {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-3);
}
.create-steps span.is-on { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 980px) {
  .filter-side { grid-template-columns: 1fr; }
  .filter-card { position: static; }
}

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-1-2, .grid-2-1, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar {
    position: fixed;
    transform: translateX(-105%);
    width: min(86vw, 300px);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-collapsed .sidebar { width: min(86vw, 300px); }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed .nav-section-title,
  body.sidebar-collapsed .nav-badge,
  body.sidebar-collapsed .nav-caret,
  body.sidebar-collapsed .nav-tag { display: block; }
  body.sidebar-collapsed .nav-sub { display: none; }
  body.sidebar-open .nav-group.is-open .nav-sub { display: block; }
  body.sidebar-collapsed .nav-link { justify-content: flex-start; padding-inline: 12px; }
  body.sidebar-collapsed .brand { justify-content: flex-start; padding-inline: 20px; }
  .menu-btn { display: grid; }
  #collapseBtn { display: none; }
  .user-chip span, .search { display: none; }
  .page { padding: 18px 14px 16px; }
  .app-footer { padding: 8px 14px 88px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { min-height: 220px; padding: 28px 22px; }
  .login-hero h1 { font-size: 28px; }
  .mobile-nav { display: grid; }
  .form-grid { grid-template-columns: 1fr; }
  .cal-wrap { overflow-x: auto; }
  .cal { min-width: 560px; }
  .search-btn { display: grid; }
  .welcome { flex-direction: column; align-items: flex-start; }
  .welcome-time { text-align: left; }
  .toast { bottom: 88px; left: 16px; right: 16px; }
  .kanban { grid-template-columns: repeat(4, minmax(240px, 1fr)); }
}

.alert-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.alert-box.ok { background: var(--success-soft); color: var(--success); }
.alert-box.warn { background: var(--warning-soft); color: var(--warning); }
.alert-box.danger { background: var(--danger-soft); color: var(--danger); }
.alert-box.info { background: var(--info-soft); color: var(--info); }
.alert-box.gold { background: var(--gold-soft); color: #8a6a2a; }
.alert-box span { font-weight: 500; color: inherit; opacity: 0.85; }

.ui-swatch {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.ribbon {
  position: relative;
  overflow: hidden;
}
.ribbon::after {
  content: attr(data-ribbon);
  position: absolute;
  top: 12px;
  right: -28px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 36px;
  transform: rotate(35deg);
}

.price-card {
  padding: 28px 22px;
  text-align: center;
  position: relative;
}
.price-card.is-featured {
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(29, 78, 216, 0.16);
}
.price-card .kpi-value { margin: 8px 0 4px; }
.price-list { text-align: left; margin: 18px 0; display: grid; gap: 8px; }
.price-list li { font-size: 13px; color: var(--text-2); }

.acc-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
  overflow: hidden;
}
.acc-item + .acc-item { margin-top: 8px; }
.acc-item button {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
}
.acc-item .acc-body {
  display: none;
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--text-3);
}
.acc-item.is-open .acc-body { display: block; }

.otp-row { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.otp-row input {
  width: 48px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-muted);
}
.otp-row input:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: var(--bg-elevated);
}

.error-page {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  text-align: center;
  background: var(--bg);
}
.error-page .error-code {
  font-size: 88px;
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  background: linear-gradient(180deg, var(--accent), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page h1 { margin: 12px 0 8px; font-size: 28px; letter-spacing: -0.03em; }
.error-page p { color: var(--text-3); max-width: 420px; margin: 0 auto 22px; }

.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - var(--topbar) - 120px);
  overflow: hidden;
}
.chat-list { border-right: 1px solid var(--border); overflow: auto; }
.chat-thread { display: flex; flex-direction: column; min-width: 0; }
.chat-thread .chat-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-msgs {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: var(--bg-muted);
}
.bubble {
  max-width: 72%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.bubble.me {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}
.chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.integ-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.invoice-sheet {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px;
}
.invoice-sheet table { width: 100%; border-collapse: collapse; }
.invoice-sheet th, .invoice-sheet td { padding: 10px 0; border-bottom: 1px solid var(--border); text-align: left; font-size: 13px; }
.invoice-sheet td.num, .invoice-sheet th.num { text-align: right; }
.map-panel {
  height: 280px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 40% 45%, rgba(37,99,235,.22), transparent 42%),
    radial-gradient(circle at 62% 58%, rgba(176,137,62,.2), transparent 36%),
    linear-gradient(160deg, #0b1220, #1e3a5f);
  position: relative;
  overflow: hidden;
}
.map-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 0 8px rgba(96,165,250,.2);
}
.demo-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
}

@media (max-width: 980px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { display: none; }
}

@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 22px; }
  .cal .day { min-height: 54px; }
  .otp-row input { width: 40px; height: 44px; }
}
