:root {
  --bg: #080808;
  --surface: #1a2026;
  --surface-alt: #12171c;
  --input-bg: #12171c;
  --border: #383838;
  --border-soft: #24292f;
  --sidebar-bg: #1a2026;
  --sidebar-active: #242b33;
  --row-hover: #202830;
  --text: #ffffff;
  --text-muted: #8a929b;
  --accent: #de2c5f;
  --success: #f0d481;
  --money: #f0d481;
  --positive-text: #48b578;
  --neutral-text: #8a929b;
  --urgent-text: #de2c5f;
  --danger-bg: rgba(222, 44, 95, 0.11);
  --notice-bg: rgba(240, 212, 129, 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-hero: 0 18px 44px rgba(0, 0, 0, 0.34);
}

[data-theme="light"] {
  --bg: #e8edf2;
  --surface: #f5f7fa;
  --surface-alt: #e2e8ef;
  --input-bg: #eef3f8;
  --border: #c7d0da;
  --border-soft: #d5dde6;
  --sidebar-bg: #eff3f7;
  --sidebar-active: #e1e8f0;
  --row-hover: #dce5ee;
  --text: #10161d;
  --text-muted: #5d6875;
  --danger-bg: rgba(222, 44, 95, 0.09);
  --notice-bg: rgba(240, 212, 129, 0.14);
  --shadow-card: 0 10px 26px rgba(16, 33, 45, 0.08);
  --shadow-hero: 0 18px 40px rgba(16, 33, 45, 0.08);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  font: inherit;
}

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

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.2;
}

.app-body,
.app-shell,
.landing-body {
  min-height: 100vh;
}

.guest-shell {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(222, 44, 95, 0.12), transparent 34%),
    radial-gradient(ellipse at bottom right, rgba(240, 212, 129, 0.09), transparent 28%);
}

.guest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 1.4rem 0 1rem;
  border-bottom: 1px solid var(--border-soft);
}

.guest-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 2.4rem;
}

.guest-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  align-items: start;
}

.login-card {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

.login-card h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.login-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.panel-copy {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.auth-provider-stack {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.login-note {
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0 1.1rem;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button--full {
  width: 100%;
}

.button--google {
  background: #ffffff;
  color: #10161d;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.button--microsoft {
  background: #2f6fed;
  color: #ffffff;
  box-shadow: 0 10px 26px rgba(47, 111, 237, 0.22);
}

.button--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.button--ghost:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-alt);
}

.provider-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.provider-mark--google {
  background: linear-gradient(135deg, #4285f4, #ea4335);
}

.provider-mark--microsoft {
  background: linear-gradient(135deg, #f25022 0 25%, #7fba00 25% 50%, #00a4ef 50% 75%, #ffb900 75% 100%);
}

.app-shell {
  display: grid;
  grid-template-columns: 252px 1fr;
}

.app-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border-soft);
}

.app-sidebar__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.05rem 1rem 0.95rem;
  border-bottom: 1px solid var(--border-soft);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  color: var(--text);
}

.brand-mark strong,
.brand-mark small {
  display: block;
  line-height: 1.3;
}

.brand-mark strong {
  font-size: 0.96rem;
  font-weight: 700;
}

.brand-mark small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.brand-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 800;
}

.app-sidebar__nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem 0.75rem;
}

.nav-workspace-label,
.eyebrow,
.sidebar-card__eyebrow {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.eyebrow {
  display: block;
  margin-bottom: 0.35rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--sidebar-active);
  color: var(--text);
}

.nav-link__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(222, 44, 95, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.sidebar-card,
.panel,
.stat-card,
.hero-panel {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-card);
}

.sidebar-card {
  margin: 0 0.75rem 0.75rem;
  padding: 1rem;
  border-radius: var(--radius-md);
}

.sidebar-card h2 {
  font-size: 1.1rem;
}

.sidebar-card p {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.role-badge,
.badge,
.topbar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.role-badge {
  min-height: 26px;
  padding: 0 0.7rem;
  background: rgba(240, 212, 129, 0.12);
  border: 1px solid rgba(240, 212, 129, 0.24);
  color: var(--success);
  font-size: 0.74rem;
  font-weight: 700;
}

.badge {
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(222, 44, 95, 0.15);
  color: var(--accent);
  border: 1px solid rgba(222, 44, 95, 0.25);
}

.badge--soft {
  background: rgba(240, 212, 129, 0.12);
  color: var(--success);
  border-color: rgba(240, 212, 129, 0.22);
}

.topbar-badge {
  padding: 0.4rem 0.8rem;
  background: rgba(240, 212, 129, 0.12);
  color: var(--success);
  border: 1px solid rgba(240, 212, 129, 0.22);
  font-size: 0.82rem;
  font-weight: 600;
}

.app-sidebar__footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-soft);
}

.sidebar-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #9a50ab);
  color: #fff;
  object-fit: cover;
  font-size: 0.78rem;
  font-weight: 800;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
  line-height: 1.3;
}

.sidebar-user strong {
  font-size: 0.85rem;
}

.sidebar-user small {
  font-size: 0.74rem;
  color: var(--text-muted);
}

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

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.5rem 0.95rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.app-topbar__primary,
.app-topbar__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-topbar .eyebrow {
  color: var(--accent);
  margin-bottom: 0.15rem;
}

.app-topbar h1 {
  font-size: 1.45rem;
}

.theme-toggle,
.nav-toggle,
.sidebar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 36px;
  padding: 0 0.95rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.theme-toggle:hover,
.nav-toggle:hover,
.sidebar-close:hover {
  color: var(--text);
  background: var(--sidebar-active);
}

.nav-toggle,
.sidebar-close {
  display: none;
}

.app-main {
  flex: 1;
  padding: 1.35rem 1.5rem 2rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 1rem;
  padding: 1.4rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface), var(--surface-alt));
  box-shadow: var(--shadow-hero);
}

.hero-panel__content h2 {
  max-width: 36ch;
  font-size: 1.3rem;
  line-height: 1.3;
}

.hero-panel__content p {
  margin-top: 0.55rem;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.hero-panel__aside {
  display: grid;
  gap: 0.75rem;
}

.hero-panel__metric {
  padding: 0.95rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
}

.hero-panel__metric span,
.hero-panel__metric strong {
  display: block;
}

.hero-panel__metric span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hero-panel__metric strong {
  margin-top: 0.25rem;
  font-size: 1.9rem;
  color: var(--money);
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1.05rem;
  border-radius: var(--radius-md);
}

.stat-card p,
.stat-card strong,
.stat-card span {
  display: block;
}

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

.stat-card strong {
  margin-top: 0.28rem;
  font-size: 1.7rem;
  line-height: 1.05;
}

.stat-card span {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.stat-card--positive span {
  color: var(--positive-text);
}

.stat-card--neutral span {
  color: var(--neutral-text);
}

.content-grid {
  display: grid;
  gap: 1rem;
}

.content-grid--dashboard {
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
}

.panel {
  padding: 1.25rem;
  border-radius: var(--radius-md);
}

.login-aside {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 320px;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
}

.login-aside h2 {
  max-width: 24ch;
  font-size: 1.45rem;
}

.empty-surface {
  display: flex;
  min-height: calc(100vh - 132px);
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.empty-surface h2 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.panel__header h2 {
  font-size: 1rem;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

.data-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table thead th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.data-table tbody td {
  font-size: 0.88rem;
}

.data-table tbody tr:hover td {
  background: var(--row-hover);
}

.table-primary strong,
.table-primary small {
  display: block;
}

.table-primary small {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.stack-list {
  display: grid;
  gap: 0.8rem;
}

.notice {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
}

.notice strong,
.notice p {
  display: block;
}

.notice strong {
  font-size: 0.88rem;
}

.notice p {
  margin-top: 0.22rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.notice--urgent {
  background: rgba(222, 44, 95, 0.08);
  border-color: var(--accent);
}

.notice--positive {
  background: rgba(72, 181, 120, 0.08);
  border-color: var(--positive-text);
}

.notice--neutral {
  background: rgba(138, 146, 155, 0.08);
  border-color: var(--neutral-text);
}

.app-overlay {
  display: none;
}

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

@media (max-width: 1080px) {
  .hero-panel,
  .content-grid--dashboard,
  .guest-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 20;
    width: min(272px, calc(100% - 28px));
    transform: translateX(-110%);
    transition: transform 0.22s ease;
  }

  .app-shell.is-nav-open .app-sidebar {
    transform: translateX(0);
  }

  .app-overlay {
    position: fixed;
    inset: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.62);
    border: 0;
  }

  .app-shell.is-nav-open .app-overlay {
    display: block;
  }

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

  .app-topbar,
  .app-topbar__primary,
  .app-topbar__meta {
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .guest-header {
    width: min(1180px, calc(100% - 28px));
    flex-direction: column;
    align-items: stretch;
  }

  .guest-main {
    width: min(1180px, calc(100% - 28px));
  }

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

  .app-topbar,
  .app-main {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .app-topbar__meta,
  .theme-toggle {
    width: 100%;
  }

  .theme-toggle {
    justify-content: center;
  }
}
