:root {
  --bg-primary: #ffffff;
  --bg-secondary: hsl(220, 25%, 98%);
  --bg-tertiary: #efedf5;

  --border-color: rgba(88, 56, 168, 0.12);
  --border-dark: hsl(265, 65%, 40%);

  --text-primary: #1a1525;
  --text-secondary: #5a5470;
  --text-muted: #8b849c;

  --accent: hsl(249, 100%, 67%);
  --accent-hover: hsl(249, 100%, 64%);
  --accent-light: hsl(265, 65%, 96%);
  --accent-rgb: 130, 77, 212;

  --success-bg: #f8fdf9;
  --success-border: rgba(43, 182, 115, 0.2);
  --success-text: #1b8a5a;

  --warning-bg: #fffdf5;
  --warning-border: rgba(245, 158, 11, 0.2);
  --warning-text: #b45309;

  --error-bg: #fffbfb;
  --error-border: rgba(239, 68, 68, 0.2);
  --error-text: #dc2626;

  --font-sans:
    "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius-sm: 4px;
  --radius: 4px;
  --radius-lg: 18px;

  --shadow-sm:
    0 2px 8px rgba(130, 77, 212, 0.06), 0 1px 2px rgba(0, 0, 0, 0.02);
  --shadow-md:
    0 12px 30px rgba(130, 77, 212, 0.08), 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-lg:
    0 32px 64px rgba(130, 77, 212, 0.1), 0 12px 24px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px rgba(130, 77, 212, 0.08);

  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

  --sb-bg: #000000;
  --sb-bg-elevated: #141414;
  --sb-border: rgba(255, 255, 255, 0.08);
  --sb-text: rgba(255, 255, 255, 0.94);
  --sb-muted: rgba(255, 255, 255, 0.62);
  --sb-hover: rgba(255, 255, 255, 0.06);
  --sb-active: rgba(255, 255, 255, 0.1);
  --sb-dot: #dcfb6e;
  --sb-brand: #dcfb6e;
  --sb-radius: 8px;
  --sb-bolt: #dcfb6e;

  --side-w: 260px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 {
  font-size: 1.75rem;
  font-weight: 800;
}

h2 {
  font-size: 1rem;
  font-weight: 700;
}

/* —— Brand —— */
.brand {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: lowercase;
  color: var(--sb-text);
  line-height: 1;
}

.brand em {
  font-style: normal;
  color: var(--sb-bolt);
}

.brand-bolt {
  width: 29px;
  height: 29px;
  color: var(--sb-bolt);
  transform: rotate(23deg);
  flex: 0 0 auto;
  display: block;
}

.brand-sm {
  font-size: 20px;
  color: var(--text-primary);
}

.brand-sm em {
  color: var(--sb-bolt);
}

.brand-lg {
  margin-bottom: 28px;
  color: #f4f1fa;
}

.brand-lg em {
  color: var(--sb-bolt);
}

.brand-lg .brand-bolt {
  color: var(--sb-bolt);
  filter: drop-shadow(0 0 12px rgba(220, 251, 110, 0.55));
}

.brand-auth {
  justify-content: center;
}

/* —— Auth —— */
.auth-body {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  overflow: hidden;
  background: #050507;
  color: #f4f1fa;
}

.auth-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.7;
  animation: auth-orb-drift 14s ease-in-out infinite alternate;
}

.auth-orb--violet {
  width: min(560px, 80vw);
  height: min(560px, 80vw);
  top: -12%;
  left: -8%;
  background: rgba(130, 77, 212, 0.55);
}

.auth-orb--lime {
  width: min(420px, 70vw);
  height: min(420px, 70vw);
  right: -10%;
  bottom: 8%;
  background: rgba(220, 251, 110, 0.28);
  animation-delay: -4s;
  animation-duration: 18s;
}

.auth-orb--soft {
  width: min(320px, 50vw);
  height: min(320px, 50vw);
  left: 42%;
  top: 48%;
  background: rgba(179, 154, 253, 0.22);
  animation-delay: -8s;
  animation-duration: 16s;
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(
    ellipse 70% 60% at 50% 40%,
    #000 20%,
    transparent 75%
  );
  opacity: 0.55;
}

@keyframes auth-orb-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.auth-card {
  position: relative;
  background: rgba(18, 16, 24, 0.78);
  border: 1px solid rgba(179, 154, 253, 0.22);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 0 0 1px rgba(220, 251, 110, 0.06) inset,
    0 0 48px rgba(130, 77, 212, 0.22),
    0 24px 48px rgba(0, 0, 0, 0.45);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(220, 251, 110, 0.35),
    transparent 28%,
    transparent 72%,
    rgba(130, 77, 212, 0.45)
  );
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  padding: 1px;
  opacity: 0.85;
}

.auth-card__head {
  margin-bottom: 22px;
}

.auth-eyebrow {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #dcfb6e;
}

.auth-card h1 {
  margin-bottom: 8px;
  color: #f8f6ff;
}

.auth-body .lede {
  color: rgba(244, 241, 250, 0.68);
}

.auth-body label span {
  color: rgba(244, 241, 250, 0.7);
}

.auth-body input {
  background: rgba(8, 7, 12, 0.72);
  border-color: rgba(179, 154, 253, 0.22);
  color: #f4f1fa;
}

.auth-body input::placeholder {
  color: rgba(244, 241, 250, 0.35);
}

.auth-body input:focus {
  border-color: rgba(220, 251, 110, 0.55);
  box-shadow:
    0 0 0 3px rgba(220, 251, 110, 0.12),
    0 0 24px rgba(130, 77, 212, 0.25);
}

.btn-auth {
  width: 100%;
  margin-top: 6px;
  height: 42px;
  background: linear-gradient(135deg, #8b5cf6 0%, #7040e8 100%);
  box-shadow: 0 0 28px rgba(130, 77, 212, 0.45);
}

.btn-auth:hover {
  background: linear-gradient(135deg, #9b6dff 0%, #7c4aef 100%);
  box-shadow:
    0 0 36px rgba(130, 77, 212, 0.55),
    0 0 18px rgba(220, 251, 110, 0.12);
}

.lede,
.hint,
.auth-foot,
.auth-alt,
.empty-inline,
.kicker,
.side-user small,
.block-muted,
.metric-sub {
  color: var(--text-muted);
}

.lede {
  margin: 0 0 24px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.auth-card .lede {
  margin-bottom: 0;
}

.auth-foot {
  text-align: center;
  font-size: 0.85rem;
  margin: 24px 0 0;
  color: rgba(244, 241, 250, 0.45);
}

.auth-alt {
  text-align: center;
  margin: 18px 0 0;
  color: rgba(244, 241, 250, 0.55);
}

.auth-alt a,
.text-link,
.section-head a,
.panel-head a {
  color: var(--accent);
  font-weight: 600;
}

.auth-alt a {
  color: #dcfb6e;
}

.auth-alt a:hover,
.text-link:hover,
.section-head a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-alt a:hover {
  color: #e8ff9a;
}

.stack {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
}

label span {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  height: 38px;
  padding: 0 11px;
  font-size: 0.88rem;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

textarea {
  height: auto;
  min-height: 88px;
  padding: 9px 11px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}

input.is-readonly,
input[readonly] {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: default;
}

input.is-readonly:focus,
input[readonly]:focus {
  border-color: var(--border-color);
  box-shadow: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  height: 38px;
  padding: 0 14px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: none;
}

.btn-quiet {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-quiet:hover {
  background: var(--accent-light);
  border-color: rgba(var(--accent-rgb), 0.25);
  box-shadow: none;
}

.btn-full {
  width: 100%;
  margin-top: 8px;
}

.btn-side {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--sb-radius);
  background: #fff;
  color: #000;
  font-weight: 600;
  font-size: 0.82rem;
  transition: var(--transition);
}

.btn-side i {
  font-size: 1rem;
  line-height: 1;
}

.btn-side:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.btn-side.is-quiet {
  background: rgba(255, 255, 255, 0.04);
  color: var(--sb-text);
  border: 1px solid var(--sb-border);
  box-shadow: none;
}

.btn-side.is-quiet:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

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

.side-actions .btn-side {
  flex: 1;
}

.side-logout {
  flex: 1;
  margin: 0;
}

.side-logout .btn-side {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-family: inherit;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-logout {
  margin: 0;
}

.topbar-logout .ghost-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-family: inherit;
}

.ghost-btn {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.flash {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}

.flash-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error-text);
}

.flash-ok {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

/* —— App shell —— */
.app {
  min-height: 100dvh;
  display: block;
  width: 100%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--side-w);
  height: 100dvh;
  z-index: 100;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
}

.side-nav {
  display: grid;
  gap: 4px;
  flex: 1;
  align-content: start;
  overflow-y: auto;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 18px;
  border-radius: var(--sb-radius);
  color: var(--sb-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.nav-link svg,
.tab-link svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  opacity: 0.85;
}

.nav-link i {
  font-size: 17px;
  width: 17px;
  text-align: center;
  opacity: 0.85;
  flex: 0 0 auto;
}

.nav-link:hover {
  background: var(--sb-hover);
  color: var(--sb-text);
}

.nav-link.is-active {
  background: var(--sb-active);
  color: var(--sb-text);
  font-weight: 600;
}

.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sb-dot);
}

.nav-link.is-active svg,
.nav-link.is-active i {
  opacity: 1;
  color: var(--sb-dot);
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--sb-border);
}

.side-profile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(
    145deg,
    rgba(130, 77, 212, 0.18),
    rgba(255, 255, 255, 0.03) 42%,
    rgba(220, 251, 110, 0.06)
  );
  border: 1px solid rgba(179, 154, 253, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  transition: var(--transition);
}

.side-profile::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(220, 251, 110, 0.12);
  filter: blur(18px);
  pointer-events: none;
}

.side-profile:hover {
  border-color: rgba(220, 251, 110, 0.28);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 14px 28px rgba(0, 0, 0, 0.34),
    0 0 24px rgba(130, 77, 212, 0.18);
}

.side-avatar {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #8b5cf6, #5b2fd6);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 8px 16px rgba(91, 47, 214, 0.35);
}

.side-profile__meta {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.side-profile__meta strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-profile__meta small {
  display: block;
  font-size: 0.74rem;
  color: var(--sb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-profile__meta em {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #dcfb6e;
  background: rgba(220, 251, 110, 0.1);
  border: 1px solid rgba(220, 251, 110, 0.18);
}

.side-profile__go {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.35);
  font-size: 1rem;
  transition:
    transform 0.18s ease,
    color 0.18s ease;
}

.side-profile:hover .side-profile__go {
  color: #dcfb6e;
  transform: translateX(2px);
}

.side-user strong,
.side-user small {
  display: block;
}

.side-user strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sb-text);
}

.side-user small {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--sb-muted);
}

.main {
  display: block;
  box-sizing: border-box;
  margin-left: var(--side-w);
  width: calc(100% - var(--side-w));
  max-width: calc(100% - var(--side-w));
  padding: 28px 32px 48px;
  min-height: 100dvh;
}

.topbar {
  display: none;
}

.page {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.kicker {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* —— Surfaces —— */
.card,
.panel,
.board-main,
.board-side,
.recent-block,
.welcome,
.metrics,
.table-wrap,
.empty,
.drop,
.facts,
.detail figure,
.form-card,
.filters {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow 0.18s ease,
    transform 0.18s ease;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.card:hover,
.panel:hover,
.board-main:hover,
.board-side:hover,
.recent-block:hover,
.table-wrap:hover {
  box-shadow: var(--shadow-md);
}

.panel,
.board-main,
.board-side,
.recent-block,
.form-card {
  padding: 20px 22px 22px;
}

.section-head,
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border-color);
}

.section-head h2,
.panel-head h2 {
  line-height: 1.35;
}

.board-side > .empty-inline,
.recent-block > .empty-inline {
  margin-top: 4px;
}

/* —— Welcome —— */
.welcome {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  width: 100%;
  overflow: hidden;
  min-height: 320px;
}

.welcome-copy {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border-right: 1px solid var(--border-color);
}

.welcome-copy h2 {
  font-size: 1.6rem;
  font-weight: 800;
}

.welcome-copy p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 48ch;
  line-height: 1.6;
  font-size: 0.95rem;
}

.welcome-copy .btn {
  align-self: flex-start;
  margin-top: 6px;
}

.welcome-steps {
  list-style: none;
  margin: 0;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  background: var(--bg-tertiary);
}

.welcome-steps li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.welcome-steps span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* —— KPI metrics —— */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin-bottom: 20px;
  overflow: hidden;
  padding: 0;
}

.metrics-4 {
  grid-template-columns: repeat(4, 1fr);
}

.metrics-3 {
  grid-template-columns: repeat(3, 1fr);
}

.metric {
  padding: 24px 28px;
  border-right: 1px solid var(--border-color);
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.metric strong {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.metric strong small {
  font-size: 0.55em;
  font-weight: 600;
  color: var(--text-muted);
}

.metric-sub {
  display: block;
  margin-top: 8px;
  font-size: 0.8rem;
}

/* —— Board / charts —— */
.board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
  margin-bottom: 20px;
}

.board-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 100%;
  margin-bottom: 24px;
}

.bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  height: 200px;
  align-items: end;
}

.bar {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.bar-track {
  flex: 1;
  width: 100%;
  max-width: 36px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.bar-fill {
  width: 100%;
  min-height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
}

.bar span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.cat-row {
  margin-bottom: 16px;
}

.cat-row:last-child {
  margin-bottom: 2px;
}

.cat-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.cat-meta span {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cat-track {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 99px;
  overflow: hidden;
}

.cat-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mini-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.18s ease;
}

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

.mini-list li:first-child a {
  padding-top: 4px;
}

.mini-list li:last-child a {
  border-bottom: 0;
  padding-bottom: 2px;
}

.mini-list small {
  display: block;
  color: var(--text-muted);
  margin-top: 3px;
  font-size: 0.78rem;
}

.mini-list strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.btn-danger {
  background: var(--error-text);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: 0 6px 18px rgba(220, 38, 38, 0.2);
}

/* —— Confirm modal —— */
body.is-modal-open {
  overflow: hidden;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.confirm-modal[hidden] {
  display: none !important;
}

.confirm-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.confirm-modal.is-open[hidden] {
  display: grid !important;
}

.confirm-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 16, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-modal__dialog {
  position: relative;
  width: min(400px, 100%);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px 22px;
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(220, 38, 38, 0.08);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
}

.confirm-modal.is-open .confirm-modal__dialog {
  transform: none;
}

.confirm-modal__icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(220, 38, 38, 0.1);
  color: var(--error-text);
  font-size: 1.35rem;
}

.confirm-modal__dialog h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.confirm-modal__dialog p {
  margin: 0 0 22px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.confirm-modal__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-modal__actions .btn {
  min-width: 110px;
}

@media (prefers-reduced-motion: reduce) {
  .auth-orb,
  .confirm-modal,
  .confirm-modal__dialog {
    animation: none !important;
    transition: none !important;
  }
}

/* —— DataTable kabuğu —— */
.dt-card {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.dt-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.dt-toolbar-simple {
  align-items: center;
}

.dt-toolbar-simple h2 {
  margin: 0;
}

.dt-toolbar-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.dt-toolbar-fields label {
  min-width: 160px;
  flex: 1 1 160px;
}

.dt-scroll {
  overflow: auto;
}

.dt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dt-table th,
.dt-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.dt-table th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  background: #faf9fc;
  position: sticky;
  top: 0;
  z-index: 1;
}

.dt-table tbody tr {
  transition: background 0.18s ease;
}

.dt-table tbody tr:hover {
  background: var(--accent-light);
}

.dt-table tbody tr:last-child td {
  border-bottom: 0;
}

.dt-link {
  color: var(--text-primary);
  font-weight: 600;
}

.dt-link:hover {
  color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--border-dark);
  border: 1px solid var(--border-color);
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.dt-col-actions {
  width: 1%;
  text-align: right !important;
}

.dt-actions {
  text-align: right;
  white-space: nowrap;
}

.dt-action-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 1;
}

.dt-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease;
  text-decoration: none;
  padding: 0;
}

.dt-icon-btn i {
  font-size: 16px;
  line-height: 1;
}

.dt-icon-btn:hover {
  background: #fff;
  border-color: var(--border-color);
  color: var(--accent);
}

.dt-icon-btn.is-danger:hover {
  color: var(--error-text);
  border-color: var(--error-border);
  background: var(--error-bg);
}

.dt-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.dt-foot strong {
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.dt-empty {
  padding: 48px 24px;
  text-align: center;
}

.dt-empty p {
  margin: 0 0 14px;
  color: var(--text-secondary);
}

.dt-actions form {
  display: inline;
  margin: 0;
}

/* —— Filters / tables (legacy) —— */
.filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 16px 18px;
}

.filters label {
  min-width: 200px;
  flex: 1 1 200px;
}

.table-wrap {
  display: block;
  overflow: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 700;
  background: var(--bg-secondary);
}

.table tbody tr {
  transition: background 0.18s ease;
}

.table tbody tr:hover {
  background: var(--accent-light);
}

.table tfoot td {
  font-weight: 700;
  border-bottom: 0;
}

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

.pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--border-dark);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 600;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
}

.empty p {
  color: var(--text-secondary);
  margin: 0 0 16px;
  font-size: 0.95rem;
  max-width: none;
}

/* —— Forms / drop —— */
.drop {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 20px;
  width: 100%;
  border-style: dashed;
  border-width: 1.5px;
}

.drop-file {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0);
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.drop-target {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  cursor: default;
  color: inherit;
  padding: 20px;
}

.drop-copy {
  text-align: center;
  pointer-events: none;
  padding: 0 12px;
}

.drop-copy i {
  display: block;
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 12px;
}

.drop-copy span {
  display: block;
  color: var(--text-muted);
  margin-top: 6px;
}

.drop-hint-mobile,
.label-gallery-mobile {
  display: none;
}

.drop-hint-desktop,
.label-gallery-desktop {
  display: block;
}

.label-gallery-desktop {
  display: inline;
}

.drop-actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.drop-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.drop-action:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.drop-action.is-quiet {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.drop-action.is-quiet:hover {
  background: var(--accent-light);
  border-color: rgba(var(--accent-rgb), 0.25);
  transform: none;
}

/* PC'de capture galeriye düşer → Çek gizle */
.drop-action[data-action="camera"] {
  display: none;
}

@media (pointer: coarse), (max-width: 900px) {
  .drop-hint-desktop,
  .label-gallery-desktop {
    display: none;
  }

  .drop-hint-mobile {
    display: block;
  }

  .label-gallery-mobile {
    display: inline;
  }

  .drop-action[data-action="camera"] {
    display: inline-flex;
  }
}

.drop.has-preview .drop-copy,
.drop.has-preview .drop-actions {
  display: none;
}

.drop.is-on {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: var(--shadow-glow);
}

.drop.is-busy .drop-action {
  cursor: wait;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ocr-line {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  pointer-events: none;
  min-height: 44px;
  background: #000;
  color: #111;
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.ocr-line[hidden] {
  display: none !important;
}

.ocr-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  height: 100%;
  background: #dcfb6e;
  transition: width 0.22s ease;
  font-style: normal;
  z-index: 0;
}

.ocr-line.is-done .ocr-bar-fill {
  background: #dcfb6e;
}

#ocr-status {
  position: relative;
  z-index: 1;
  color: #f4f1fa;
  letter-spacing: 0.01em;
  transition: color 0.18s ease;
}

.ocr-line.has-fill #ocr-status,
.ocr-line.is-done #ocr-status {
  color: #111;
}

.drop-change {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.drop-change[hidden] {
  display: none !important;
}

.drop-change:hover {
  background: #000;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.grid-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
  width: 100%;
}

.grid-form .span-2 {
  grid-column: 1 / -1;
}

.field-opt {
  font-style: normal;
  font-weight: 500;
  color: var(--text-muted);
}

.note-mark {
  margin-left: 6px;
  color: var(--accent);
  font-size: 0.95rem;
  vertical-align: middle;
}

.fact-note {
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
}

.fact-note dd {
  text-align: left !important;
  white-space: pre-wrap;
  line-height: 1.55;
  color: var(--text-primary);
}

.receipt-form {
  width: 100%;
}

.receipt-page {
  width: min(720px, 100%);
  margin: 0 auto;
}

.hint {
  font-size: 0.85rem;
  text-align: center;
  margin-top: 14px;
}

.detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  width: 100%;
}

.detail figure {
  margin: 0;
  overflow: hidden;
}

.detail img {
  width: 100%;
}

.facts {
  margin: 0;
  padding: 8px 24px;
}

.facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
}

.facts > div:last-child {
  border-bottom: 0;
}

.facts dt {
  color: var(--text-muted);
  font-weight: 500;
}

.facts dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tabbar {
  display: none;
}

.block-muted {
  display: block;
  font-weight: 400;
  margin-top: 3px;
}

.empty-inline {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.lede-tight {
  margin-bottom: 16px;
}

.empty-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 16px;
  padding: 18px 20px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.empty-banner strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.empty-banner p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.team-grid {
  margin-bottom: 20px;
}

.team-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.team-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.team-list li:first-child {
  padding-top: 0;
}

.team-list small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.password-card {
  max-width: 520px;
}

.account-page {
  width: min(640px, 100%);
  margin: 0 auto;
}

.account-head {
  justify-content: center;
  text-align: center;
}

.account-shell {
  display: grid;
  gap: 14px;
}

.ui-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.ui-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.ui-tab i {
  font-size: 1.05rem;
}

.ui-tab:hover {
  color: var(--text-primary);
  background: var(--accent-light);
}

.ui-tab.is-active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.28);
}

.account-panel {
  padding: 28px 26px 26px;
}

.account-panel__head {
  margin-bottom: 18px;
}

.account-panel__head h2 {
  margin-bottom: 6px;
}

.account-panel__head .lede {
  margin-bottom: 0;
}

.account-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
}

.account-meta > div {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px 14px;
}

.account-meta dt {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.account-meta dd {
  margin: 0;
  font-weight: 600;
  color: var(--text-primary);
}

.pw-block {
  display: grid;
  gap: 8px;
}

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

.pw-field input {
  padding-right: 42px;
}

.pw-tool {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.pw-tool:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.btn-pw-gen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius);
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.1),
    rgba(var(--accent-rgb), 0.04)
  );
  color: var(--accent);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  cursor: pointer;
  transition: var(--transition);
}

.btn-pw-gen:hover {
  transform: translateY(-1px);
  border-color: rgba(var(--accent-rgb), 0.45);
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.16),
    rgba(var(--accent-rgb), 0.06)
  );
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.12);
}

.btn-pw-gen.is-done {
  border-color: rgba(43, 182, 115, 0.35);
  color: var(--success-text);
  background: var(--success-bg);
}

.auth-body .pw-tool {
  color: rgba(244, 241, 250, 0.55);
}

.auth-body .pw-tool:hover {
  color: #dcfb6e;
  background: rgba(220, 251, 110, 0.08);
}

.auth-body .btn-pw-gen {
  border-color: rgba(220, 251, 110, 0.28);
  color: #dcfb6e;
  background: rgba(220, 251, 110, 0.08);
}

.auth-body .btn-pw-gen:hover {
  background: rgba(220, 251, 110, 0.14);
  box-shadow: 0 0 24px rgba(220, 251, 110, 0.12);
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.fancy-check {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  grid-template-columns: none !important;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.fancy-check:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--accent-light);
}

.fancy-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.fancy-check__box {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.35);
  background: var(--bg-primary);
  color: transparent;
  transition: var(--transition);
}

.fancy-check__box i {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.fancy-check input:checked + .fancy-check__box {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.14);
}

.fancy-check input:focus-visible + .fancy-check__box {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}

.fancy-check__copy {
  display: grid;
  gap: 2px;
}

.fancy-check__copy strong {
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--text-primary);
}

.fancy-check__copy small {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.check-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  grid-template-columns: none !important;
}

.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
}

.check-row span {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
}

.team-cards {
  display: grid;
  gap: 10px;
}

.team-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  overflow: hidden;
}

.team-card summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.team-card summary::-webkit-details-marker {
  display: none;
}

.team-card__who b {
  display: block;
}

.team-card__who small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.team-card__nums {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.team-card__nums em {
  font-style: normal;
  font-weight: 700;
  color: var(--text-primary);
}

.team-card__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-color);
}

.team-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.team-stat-row span {
  color: var(--text-muted);
}

.team-stat-row small {
  color: var(--text-muted);
  font-weight: 500;
}

.team-months {
  padding-top: 12px;
}

.team-months h3 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.team-months ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.team-months li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.team-months li:last-child a {
  border-bottom: 0;
}

.team-months li a:hover {
  color: var(--accent);
}

.mini-static {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.mini-list li:last-child .mini-static {
  border-bottom: 0;
}

.insight-block {
  padding: 8px 0 4px;
}

.insight-block strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.insight-block p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.bars-year {
  grid-template-columns: repeat(6, 1fr);
}

.bars-year .bar span {
  font-size: 0.72rem;
}

.expenses-layout {
  align-items: start;
}

.expenses-detail {
  display: grid;
  gap: 16px;
}

.expenses-years .section-head-tight {
  margin-top: 18px;
}

.year-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.year-chip {
  display: grid;
  gap: 2px;
  min-width: 88px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  transition: var(--transition);
}

.year-chip strong {
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.year-chip small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.year-chip:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  background: var(--accent-light);
}

.year-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.25);
}

.year-chip.is-active small {
  color: rgba(255, 255, 255, 0.78);
}

.month-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.month-row {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition:
    background 0.18s ease,
    border-color 0.18s ease;
}

.month-row:hover {
  background: var(--accent-light);
}

.month-row.is-active {
  background: var(--accent-light);
  border-color: var(--border-color);
}

.month-row-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.month-row-top strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.month-row small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.expense-receipts {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 18px 18px 16px;
}

.expense-receipt-list {
  display: grid;
  gap: 10px;
}

.expense-receipt {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: stretch;
  padding: 14px 14px 14px 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.92),
    rgba(248, 246, 252, 0.96)
  );
  transition: var(--transition);
}

.expense-receipt:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.expense-receipt__main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.expense-receipt__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.expense-receipt__top time {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.expense-receipt__top strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.expense-receipt__body {
  display: grid;
  gap: 4px;
}

.expense-receipt__body b {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.expense-receipt__sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expense-receipt__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.expense-receipt__note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-weight: 600;
}

.expense-receipt__actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px solid var(--border-color);
}

.section-head-pad,
.empty-pad {
  padding: 18px 18px 0;
}

.empty-pad {
  padding-bottom: 18px;
}

/* legacy aliases */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
}

.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.stat-card span {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.stat-card strong {
  display: block;
  font-size: 1.7rem;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.03em;
}

.stat-hero {
  background: var(--text-primary);
  color: #fff;
  border-color: transparent;
}

.stat-hero span,
.stat-hero em,
.stat-hero small {
  color: rgba(255, 255, 255, 0.6);
}

.stat-hero em {
  display: block;
  margin-top: 8px;
  font-style: normal;
  font-size: 0.8rem;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

@media (max-width: 1100px) {
  .board-split {
    grid-template-columns: 1fr;
  }

  .metrics-4 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .dt-action-group {
    opacity: 1;
  }

  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    padding: calc(16px + var(--safe-top)) calc(16px + var(--safe-right))
      calc(100px + var(--safe-bottom)) calc(16px + var(--safe-left));
  }

  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: calc(-1 * (16px + var(--safe-top)))
      calc(-1 * (16px + var(--safe-right))) 18px
      calc(-1 * (16px + var(--safe-left)));
    padding: calc(12px + var(--safe-top)) calc(16px + var(--safe-right)) 12px
      calc(16px + var(--safe-left));
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg-secondary);
  }

  .welcome,
  .metrics,
  .metrics-4,
  .board-split,
  .stat-grid,
  .split,
  .grid-form,
  .detail {
    grid-template-columns: 1fr;
  }

  .welcome-copy {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
    padding: 32px 24px;
  }

  .welcome-steps {
    padding: 24px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px 20px;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--border-color);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .bars {
    height: 140px;
    gap: 6px;
  }

  .tabbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    position: fixed;
    left: calc(12px + var(--safe-left));
    right: calc(12px + var(--safe-right));
    bottom: calc(12px + var(--safe-bottom));
    background: var(--sb-bg);
    color: var(--sb-muted);
    border-radius: 14px;
    padding: 8px;
    z-index: 20;
    border: 1px solid var(--sb-border);
  }

  .tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    padding: 8px 4px;
    border-radius: var(--sb-radius);
    font-weight: 500;
  }

  .tab-link svg {
    width: 18px;
    height: 18px;
  }

  .tab-plus,
  .tab-plus.is-active {
    color: var(--sb-bolt);
  }

  .tab-link.is-active {
    background: var(--sb-active);
    color: var(--sb-text);
  }
}

@media (max-width: 620px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .filters label {
    min-width: 100%;
  }

  .bars {
    height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* —— Custom selects (rules.md) —— */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.oto-select,
.cat-parent-select,
.gpc-select {
  position: relative;
  width: 100%;
}

.oto-select-trigger,
.cat-parent-select-trigger,
.gpc-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  height: 38px;
  padding: 0 11px;
  background: #fff;
  border: 1.5px solid rgba(var(--accent-rgb), 0.45);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.oto-select-trigger .oto-label.is-placeholder,
.gpc-select-trigger .gpc-label.is-placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.oto-select-trigger:hover,
.cat-parent-select-trigger:hover,
.gpc-select-trigger:hover {
  border-color: hsl(265, 65%, 62%);
}

.oto-select.is-open .oto-select-trigger,
.cat-parent-select.is-open .cat-parent-select-trigger,
.gpc-select.is-open .gpc-select-trigger,
.oto-select-trigger:focus-visible,
.cat-parent-select-trigger:focus-visible,
.gpc-select-trigger:focus-visible {
  border-color: hsl(265, 65%, 62%);
  box-shadow: 0 0 0 3px hsla(265, 65%, 55%, 0.12);
  outline: none;
}

.oto-caret,
.gpc-caret {
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.18s ease;
  flex: 0 0 auto;
}

.oto-select.is-open .oto-caret,
.gpc-select.is-open .gpc-caret,
.cat-parent-select.is-open .oto-caret {
  transform: rotate(180deg);
}

.oto-select-panel,
.cat-parent-select-panel,
.gpc-select-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  display: none;
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  box-shadow:
    0 12px 28px rgba(16, 24, 40, 0.12),
    0 2px 6px rgba(16, 24, 40, 0.04);
  padding: 6px;
  max-height: 280px;
  overflow: auto;
}

.oto-select.is-open .oto-select-panel,
.cat-parent-select.is-open .cat-parent-select-panel,
.gpc-select.is-open .gpc-select-panel {
  display: block;
}

.oto-option,
.cat-option,
.gpc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.oto-option:hover,
.cat-option:hover,
.gpc-option:hover {
  background: rgba(var(--accent-rgb), 0.08);
}

.oto-option.is-selected,
.cat-option.is-selected,
.gpc-option.is-selected {
  background: var(--accent-light);
  color: var(--border-dark);
}

.oto-option .ti-check,
.cat-option .ti-check,
.gpc-option .ti-check {
  opacity: 0;
  font-size: 16px;
  color: var(--accent);
}

.oto-option.is-selected .ti-check,
.cat-option.is-selected .ti-check,
.gpc-option.is-selected .ti-check {
  opacity: 1;
}

.cat-option {
  padding-left: calc(12px + var(--cat-pad, 0px));
}

.cat-option-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cat-expand {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex: 0 0 auto;
}

.cat-expand:hover {
  background: #f3f4f6;
}

.cat-leaf-spacer {
  width: 22px;
  flex: 0 0 auto;
}

.gpc-select-panel {
  max-height: none;
  padding: 8px;
}

.gpc-search {
  position: relative;
  margin-bottom: 8px;
}

.gpc-search .ti-search {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.gpc-search input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 34px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.gpc-list {
  max-height: 340px;
  overflow: auto;
}

.gpc-empty,
.gpc-loading {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.gpc-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.gpc-clear {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gpc-clear:hover {
  background: #f3f4f6;
}

/* Native toolbar filter select */
.filters select,
select.filter-select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  min-height: 38px;
  padding: 0 34px 0 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b849c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  font-size: 0.88rem;
  font-weight: 500;
}

.filters select:focus,
select.filter-select:focus {
  border-color: hsl(265, 65%, 62%);
  box-shadow: 0 0 0 3px hsla(265, 65%, 55%, 0.12);
}

.filters input[type="month"] {
  height: 38px;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
