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

:root {
  --bg: #eff4f6;
  --bg-soft: #e6eff2;
  --bg-panel: rgba(255, 255, 255, 0.72);
  --bg-panel-strong: rgba(255, 255, 255, 0.88);
  --ink: #162033;
  --ink-soft: #516074;
  --line: rgba(140, 157, 179, 0.22);
  --line-strong: rgba(120, 137, 159, 0.32);
  --primary: #1667c8;
  --primary-strong: #0f4fa3;
  --accent: #0f9f87;
  --success: #17885e;
  --warning: #d38b16;
  --danger: #cf4040;
  --shadow-lg: 0 22px 54px rgba(15, 23, 42, 0.09);
  --shadow-md: 0 14px 32px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, 0.05);
  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

html,
body {
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 159, 135, 0.12), transparent 34%),
    radial-gradient(circle at bottom right, rgba(22, 103, 200, 0.12), transparent 38%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

body {
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  pointer-events: none;
  z-index: -1;
}

body::before {
  inset: 40px auto auto 48px;
  width: 280px;
  height: 280px;
  background: rgba(15, 159, 135, 0.08);
}

body::after {
  inset: auto 36px 24px auto;
  width: 320px;
  height: 320px;
  background: rgba(22, 103, 200, 0.08);
}

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

.app-shell,
.guest-shell {
  position: relative;
}

.app-main {
  max-width: 1440px;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-subtitle {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
}

.section-subtitle {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.glass-card,
.card,
.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.card-header {
  background:
    linear-gradient(90deg, rgba(22, 103, 200, 0.08), rgba(15, 159, 135, 0.08));
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
  padding: 1rem 1.2rem;
}

.card-body {
  padding: 1.2rem;
}

.app-flash {
  background: rgba(23, 136, 94, 0.14);
  border: 1px solid rgba(23, 136, 94, 0.18);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.navbar.app-navbar {
  max-width: calc(100% - 28px);
  margin: 14px auto 0;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(18, 25, 40, 0.8) !important;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.24);
  backdrop-filter: blur(16px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 20px rgba(15, 79, 163, 0.26);
}

.brand-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-stack strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.brand-stack small {
  color: rgba(255, 255, 255, 0.64);
  font-size: 0.74rem;
  margin-top: 0.18rem;
}

.navbar .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  border-radius: 10px;
  padding: 0.55rem 0.85rem !important;
  font-weight: 600;
  font-size: 0.92rem;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff !important;
}

.nav-quick-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.84rem;
}

.user-chip strong {
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 1rem 1.05rem;
  min-height: 142px;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -10px -28px auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.metric-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-value {
  margin: 0.9rem 0 0;
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.metric-note {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.metric-primary {
  background: linear-gradient(160deg, rgba(22, 103, 200, 0.16), rgba(255, 255, 255, 0.78));
}

.metric-accent {
  background: linear-gradient(160deg, rgba(15, 159, 135, 0.16), rgba(255, 255, 255, 0.78));
}

.metric-warm {
  background: linear-gradient(160deg, rgba(211, 139, 22, 0.16), rgba(255, 255, 255, 0.78));
}

.metric-danger {
  background: linear-gradient(160deg, rgba(207, 64, 64, 0.14), rgba(255, 255, 255, 0.78));
}

.surface-panel {
  padding: 1.2rem;
}

.surface-panel-muted {
  background: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid rgba(140, 157, 179, 0.18);
}

.table-card .table {
  margin-bottom: 0;
}

.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--ink);
  --bs-table-border-color: rgba(140, 157, 179, 0.18);
}

.table thead th {
  border-bottom-width: 1px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table tbody tr {
  transition: background-color 0.16s ease;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.34);
}

.table > :not(caption) > * > * {
  padding: 0.9rem 0.8rem;
}

.table-title-link {
  font-weight: 700;
  color: var(--ink);
}

.table-title-link:hover {
  color: var(--primary-strong);
}

.muted-copy {
  color: var(--ink-soft);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.status-active,
.status-open,
.status-confirmed,
.status-paid,
.status-income {
  background: rgba(23, 136, 94, 0.14);
  color: #146749;
}

.status-draft,
.status-pending,
.status-reserved,
.status-partial {
  background: rgba(211, 139, 22, 0.14);
  color: #9b660f;
}

.status-closed,
.status-cancelled,
.status-inactive,
.status-expense {
  background: rgba(207, 64, 64, 0.13);
  color: #a03232;
}

.btn {
  border-radius: 12px;
  font-weight: 700;
  padding: 0.62rem 1rem;
}

.btn-sm {
  border-radius: 10px;
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
}

.btn-primary {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--primary-strong));
  box-shadow: 0 10px 22px rgba(22, 103, 200, 0.24);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.03);
}

.btn-success {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #1ba66e, #17885e);
  box-shadow: 0 10px 22px rgba(23, 136, 94, 0.2);
}

.btn-warning {
  border: 0;
  color: #fff;
  background: linear-gradient(90deg, #d38b16, #b8740d);
}

.btn-outline-secondary,
.btn-outline-light,
.btn-outline-danger {
  background: rgba(255, 255, 255, 0.52);
}

.btn-outline-secondary {
  border-color: rgba(120, 137, 159, 0.38);
  color: var(--ink-soft);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.btn-outline-danger {
  border-color: rgba(207, 64, 64, 0.36);
  color: #b13e3e;
}

.form-control,
.form-select {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(140, 157, 179, 0.36);
  background: var(--bg-panel-strong);
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(22, 103, 200, 0.42);
  box-shadow: 0 0 0 0.2rem rgba(22, 103, 200, 0.12);
  background: #fff;
}

.form-label {
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
}

.alert {
  border: 1px solid rgba(140, 157, 179, 0.22);
  border-radius: var(--radius-md);
}

.alert-warning {
  background: rgba(211, 139, 22, 0.12);
  color: #87560d;
}

.alert-success {
  background: rgba(23, 136, 94, 0.14);
  color: #146749;
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(22, 103, 200, 0.08);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.76rem;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--ink-soft);
}

.empty-state strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  gap: 1.2rem;
  align-items: stretch;
}

.auth-hero {
  padding: 1.6rem;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(18, 25, 40, 0.9), rgba(22, 103, 200, 0.76)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 28%);
  box-shadow: var(--shadow-lg);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-hero-title {
  margin: 1rem 0 0.5rem;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.auth-hero-copy {
  max-width: 34ch;
  color: rgba(248, 250, 252, 0.8);
  font-size: 0.98rem;
}

.auth-feature-list {
  display: grid;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.auth-feature-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-feature-dot {
  width: 11px;
  height: 11px;
  margin-top: 0.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #8fe8d6, #d7fbff);
  flex-shrink: 0;
}

.auth-feature-item strong {
  display: block;
  font-size: 0.94rem;
}

.auth-feature-item span {
  display: block;
  color: rgba(248, 250, 252, 0.72);
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.auth-wrap {
  display: flex;
}

.auth-card {
  width: 100%;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.auth-brand {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.auth-subtitle {
  color: var(--ink-soft);
  font-size: 0.96rem;
}

.auth-divider {
  border-top: 1px solid rgba(140, 157, 179, 0.22);
  margin: 1rem 0 1.25rem;
}

.auth-link,
.link-subtle {
  color: var(--primary-strong);
  font-weight: 700;
}

.auth-link:hover,
.link-subtle:hover {
  color: var(--primary);
}

.pagination {
  --bs-pagination-bg: rgba(255, 255, 255, 0.76);
  --bs-pagination-border-color: rgba(140, 157, 179, 0.26);
  --bs-pagination-color: var(--primary-strong);
  --bs-pagination-active-bg: var(--primary);
  --bs-pagination-active-border-color: var(--primary);
  --bs-pagination-hover-bg: rgba(22, 103, 200, 0.08);
}

.profile-section {
  margin-bottom: 1rem;
}

@media (max-width: 992px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    min-height: auto;
  }

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

@media (max-width: 768px) {
  .navbar.app-navbar {
    max-width: calc(100% - 12px);
    margin-top: 8px;
  }

  .app-main {
    padding-inline: 0.45rem;
  }

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

  .page-toolbar {
    align-items: flex-start;
  }

  .nav-quick-actions {
    width: 100%;
    margin-top: 0.75rem;
    justify-content: space-between;
  }
}
