:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-accent: #7c3aed;
  --color-accent-light: #f5f3ff;
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-neutral-900: #0f172a;
  --color-neutral-800: #1e293b;
  --color-neutral-700: #334155;
  --color-neutral-500: #64748b;
  --color-neutral-300: #cbd5e1;
  --color-neutral-200: #e2e8f0;
  --color-neutral-100: #f1f5f9;
  --color-neutral-50: #f8fafc;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-neutral-800);
  background: var(--color-neutral-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--color-primary);
  color: #fff;
}

/* Slim, brand-tinted scrollbars (WebKit / Chromium) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-neutral-300);
  border-radius: 999px;
  border: 2px solid var(--color-neutral-50);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-500);
}

a {
  text-decoration: none;
  color: var(--color-primary);
}

h1, h2, h3 {
  color: var(--color-neutral-900);
  letter-spacing: -0.015em;
}

/* ---------- Unauthenticated / login shell ---------- */

.bare {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(37, 99, 235, 0.16), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(5, 150, 105, 0.14), transparent 45%),
    var(--color-neutral-900);
}

.auth-layout {
  display: flex;
  width: 100%;
  height: 100%;
}

.auth-hero {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 6vh, 4rem) clamp(2rem, 5vw, 4.5rem);
  color: #fff;
  min-height: 0;
}

.auth-hero .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(48px, 8vh, 68px);
  height: clamp(48px, 8vh, 68px);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-md), 0 0 0 6px rgba(255, 255, 255, 0.05);
  margin-bottom: clamp(0.75rem, 2.5vh, 1.75rem);
  padding: 8px;
  flex-shrink: 0;
}

.auth-hero .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-hero h1 {
  color: #fff;
  font-size: clamp(1.5rem, 1rem + 2vw, 2.375rem);
  line-height: 1.15;
  margin: 0 0 clamp(0.4rem, 1.5vh, 0.75rem);
  max-width: 460px;
  font-weight: 700;
}

.auth-hero p {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 420px;
  margin: 0 0 clamp(1rem, 3vh, 2rem);
}

.auth-hero .feature-list {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.2vh, 0.75rem);
  padding: 0;
  margin: 0;
}

.auth-hero .feature-list li {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #cbd5e1;
  font-size: 0.875rem;
  list-style: none;
}

.auth-hero .feature-list svg {
  flex-shrink: 0;
  color: var(--color-success);
  background: rgba(5, 150, 105, 0.18);
  border-radius: 50%;
  padding: 3px;
  width: 22px;
  height: 22px;
}

.auth-panel {
  flex: 1;
  min-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-neutral-50);
  padding: clamp(1rem, 4vh, 2rem);
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 860px) {
  .auth-layout {
    flex-direction: column;
    overflow-y: auto;
  }

  .bare {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  .auth-hero {
    padding: 2.5rem 1.75rem;
  }

  .auth-panel {
    min-width: 0;
    overflow-y: visible;
  }

  .auth-hero .stat-strip {
    display: none;
  }
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: clamp(0.625rem, 1.8vh, 1rem);
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  background: #fff;
  padding: clamp(1.5rem, 4vh, 2.25rem) clamp(1.5rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-neutral-200);
  box-shadow: var(--shadow-lg);
  animation: card-in 0.32s var(--ease);
  flex-shrink: 0;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-card .login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  padding: 8px;
  margin-bottom: 0.125rem;
  flex-shrink: 0;
}

.login-card .login-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-card h1 {
  margin: 0;
  font-size: 1.5rem;
}

.login-card .subtitle {
  margin: -0.5rem 0 0.25rem;
  color: var(--color-neutral-500);
  font-size: 0.875rem;
}

.login-card button {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.9375rem;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.login-card button:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.36);
  transform: translateY(-1px);
}

.login-card .hint {
  margin-top: 0.25rem;
  padding: 0.625rem 0.75rem;
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  line-height: 1.5;
}

.login-card .hint code {
  color: var(--color-neutral-800);
  font-weight: 600;
}

/* ---------- Authenticated shell ---------- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 244px;
  flex-shrink: 0;
  background: linear-gradient(165deg, var(--color-neutral-900), #0b1220 60%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.125rem;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.75rem;
  padding: 0 0.25rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #fff;
  flex-shrink: 0;
  padding: 4px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06);
}

.sidebar .brand .mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar .brand .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.sidebar .brand .brand-text strong {
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sidebar .brand .brand-text span {
  font-size: 0.6875rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 0.125rem;
}

.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: none;
}

.sidebar nav .nav-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #475569;
  padding: 0.875rem 0.625rem 0.375rem;
  font-weight: 700;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  color: #94a3b8;
  padding: 0.5625rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
  position: relative;
}

.sidebar nav a svg {
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s ease;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  transform: translateX(1px);
}

.sidebar nav a:hover svg {
  opacity: 1;
}

.sidebar nav a.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.sidebar nav a.active svg {
  opacity: 1;
}

.user-panel {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1rem;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.user-panel .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  color: #fff;
}

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

.user-panel .user-name {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-panel .user-role {
  color: #64748b;
  font-size: 0.75rem;
}

.user-panel form button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #94a3b8;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}

.user-panel form button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transform: none;
}

.content {
  flex: 1;
  padding: 2rem 2.5rem;
  overflow-x: auto;
  max-width: 100%;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 99, 235, 0.045), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(124, 58, 237, 0.03), transparent 45%);
  animation: page-in 0.28s var(--ease);
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Alerts ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  animation: alert-in 0.18s ease;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert .alert-icon {
  flex-shrink: 0;
  margin-top: 0.0625rem;
}

.alert .alert-body {
  flex: 1;
  line-height: 1.45;
}

.alert .alert-body ul {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}

.alert .alert-close {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 0;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  color: inherit;
  box-shadow: none;
}

.alert .alert-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

.alert-success {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
  color: #065f46;
}

.alert-danger {
  background: var(--color-danger-bg);
  border-color: var(--color-danger-border);
  color: #991b1b;
}

.alert-warning {
  background: var(--color-warning-bg);
  border-color: var(--color-warning-border);
  color: #92400e;
}

.alert-success .alert-icon { color: var(--color-success); }
.alert-danger .alert-icon { color: var(--color-danger); }
.alert-warning .alert-icon { color: var(--color-warning); }

/* ---------- Page header ---------- */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-neutral-200);
  gap: 1rem;
}

.page-header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.625rem;
  font-weight: 700;
}

.page-header .subtitle {
  margin: 0;
  color: var(--color-neutral-500);
  font-size: 0.875rem;
}

/* ---------- Buttons ---------- */

.btn, button, input[type="submit"] {
  padding: 0.5625rem 1.0625rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: box-shadow 0.15s ease, transform 0.1s ease, filter 0.15s ease;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn:hover, button:hover, input[type="submit"]:hover {
  filter: brightness(1.06);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  transform: translateY(-1px);
}

.btn:active, button:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.btn.secondary, .btn-secondary {
  background: #fff;
  color: var(--color-neutral-700);
  border-color: var(--color-neutral-200);
  box-shadow: var(--shadow-xs);
}

.btn.secondary:hover, .btn-secondary:hover {
  background: var(--color-neutral-50);
  border-color: var(--color-neutral-300);
  box-shadow: var(--shadow-sm);
  filter: none;
}

.btn.danger, .btn-danger, button.danger {
  background: #fff;
  color: var(--color-danger);
  border-color: var(--color-danger-border);
  box-shadow: var(--shadow-xs);
}

.btn.danger:hover, .btn-danger:hover, button.danger:hover {
  background: var(--color-danger-bg);
  box-shadow: var(--shadow-sm);
  filter: none;
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success { background: var(--color-success-bg); color: var(--color-success); border-color: var(--color-success-border); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger); border-color: var(--color-danger-border); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: var(--color-warning-border); }
.badge-neutral { background: var(--color-neutral-100); color: var(--color-neutral-500); border-color: var(--color-neutral-200); }
.badge-primary { background: var(--color-primary-light); color: var(--color-primary-dark); border-color: #bfdbfe; }

/* ---------- Table ---------- */

.table-wrap {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-neutral-200);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 0.8125rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--color-neutral-100);
}

th {
  background: var(--color-neutral-50);
  color: var(--color-neutral-700);
  font-weight: 700;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--color-neutral-200);
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 252, 0.6);
}

tbody tr:hover {
  background: var(--color-primary-light);
}

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

tr.inactive td {
  color: var(--color-neutral-500);
}

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

td.actions {
  display: flex;
  gap: 0.5rem;
}

td.actions form {
  display: inline-flex;
}

.empty-state {
  padding: 3.5rem 1rem;
  text-align: center;
  color: var(--color-neutral-500);
  font-size: 0.875rem;
}

.empty-state::before {
  content: '';
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 0.75rem;
  background: var(--color-neutral-300);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2'/%3E%3Cpath d='M8 8h8M8 12h8M8 16h5'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Forms ---------- */

.card-form {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-neutral-200);
  max-width: 760px;
  position: relative;
}

.card-form.narrow {
  max-width: 400px;
  flex-direction: column;
}

.card-form.stacked {
  max-width: 560px;
  flex-direction: column;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3125rem;
  font-size: 0.8125rem;
  color: var(--color-neutral-700);
  flex: 1 1 200px;
}

.form-group label {
  font-weight: 600;
  color: var(--color-neutral-800);
}

.form-group.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.375rem;
  flex: 0 0 auto;
}

.form-group.checkbox input {
  width: auto;
}

.form-group.full-width {
  flex-basis: 100%;
}

input, select, textarea {
  padding: 0.5625rem 0.75rem;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: #fff;
  color: var(--color-neutral-800);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:hover, select:hover, textarea:hover {
  border-color: var(--color-neutral-300);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

input:disabled {
  background: var(--color-neutral-50);
  color: var(--color-neutral-500);
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  flex-basis: 100%;
  padding-top: 0.25rem;
}

.field-validation-error {
  color: var(--color-danger);
  font-size: 0.8125rem;
}

/* ASP.NET's validation-summary tag helper always renders a <ul><li> — even a
   placeholder <li style="display:none"> when the form is valid — so it is
   never actually :empty. Hide/show off the "-valid" / "-errors" class the
   tag helper itself toggles instead. */
.validation-summary-valid {
  display: none;
}

.validation-summary-errors ul {
  margin: 0;
  padding-left: 1.1rem;
}

.validation-summary-errors {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  background: var(--color-danger-bg);
  border: 1px solid var(--color-danger-border);
  color: #991b1b;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  animation: alert-in 0.18s ease;
}

.validation-summary-errors::before {
  content: '';
  flex-shrink: 0;
  margin-top: 0.1875rem;
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='12' y1='8' x2='12' y2='12'/%3E%3Cline x1='12' y1='16' x2='12.01' y2='16'/%3E%3C/svg%3E") no-repeat center / contain;
}

.filters {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  align-items: flex-end;
  background: #fff;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-neutral-200);
  box-shadow: var(--shadow-xs);
  max-width: fit-content;
}

.filters .form-group {
  flex: 0 0 auto;
}

/* ---------- Stat cards ---------- */

.stat-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1 1 200px;
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.25rem 1.125rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-primary);
}

.stat-card:nth-child(4n+2)::before { background: var(--color-success); }
.stat-card:nth-child(4n+3)::before { background: var(--color-warning); }
.stat-card:nth-child(4n+4)::before { background: var(--color-accent); }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.highlight {
  background: linear-gradient(135deg, var(--color-primary), #1e40af);
  border-color: transparent;
  color: #fff;
}

.stat-card.highlight::before {
  display: none;
}

.stat-card.highlight .stat-label,
.stat-card.highlight .stat-hint {
  color: rgba(255, 255, 255, 0.75);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-neutral-500);
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: inherit;
  letter-spacing: -0.02em;
}

.stat-hint {
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  margin-top: 0.25rem;
}

/* ---------- Misc utilities ---------- */

.cell-sub {
  font-size: 0.75rem;
  color: var(--color-neutral-500);
  margin-top: 0.125rem;
}

.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }

.bank-details-heading {
  font-weight: 600;
  color: var(--color-neutral-800);
  font-size: 0.8125rem;
  border-top: 1px solid var(--color-neutral-100);
  padding-top: 0.875rem;
  margin-top: 0.25rem;
}

/* ---------- Auth hero decoration ---------- */

.auth-hero {
  position: relative;
  overflow: hidden;
}

.auth-hero::before,
.auth-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}

.auth-hero::before {
  width: 340px;
  height: 340px;
  background: var(--color-primary);
  top: -120px;
  right: -100px;
}

.auth-hero::after {
  width: 280px;
  height: 280px;
  background: var(--color-success);
  bottom: -100px;
  left: -80px;
  opacity: 0.25;
}

.auth-hero > * {
  position: relative;
  z-index: 1;
}

.auth-hero .stat-strip {
  display: flex;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-hero .stat-strip div {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.auth-hero .stat-strip strong {
  font-size: 1.375rem;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.auth-hero .stat-strip span {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Input with icon ---------- */

.input-icon-group {
  position: relative;
}

.input-icon-group svg {
  position: absolute;
  left: 0.6875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-neutral-500);
  pointer-events: none;
}

.input-icon-group input,
.input-icon-group select {
  padding-left: 2.25rem;
  width: 100%;
}

.input-icon-group:focus-within svg {
  color: var(--color-primary);
}

/* ---------- Auth card polish ---------- */

.login-card h1 {
  background: linear-gradient(135deg, var(--color-neutral-900), var(--color-primary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card label {
  font-size: 0.8125rem;
}

/* ---------- Role picker ---------- */

.role-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.role-option {
  position: relative;
  cursor: pointer;
}

.role-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}

.role-option .role-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 0.875rem;
  border: 1.5px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease;
  height: 100%;
}

.role-option:hover .role-card {
  border-color: var(--color-neutral-300);
  transform: translateY(-1px);
}

.role-option .role-card svg {
  color: var(--color-neutral-500);
}

.role-option .role-card strong {
  font-size: 0.8125rem;
  color: var(--color-neutral-800);
}

.role-option .role-card span {
  font-size: 0.6875rem;
  color: var(--color-neutral-500);
  line-height: 1.35;
}

.role-option input:checked + .role-card {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.role-option input:checked + .role-card svg {
  color: var(--color-primary-dark);
}

.role-option input:focus-visible + .role-card {
  box-shadow: 0 0 0 3px var(--color-primary-light);
}

/* ---------- Chart of Accounts tree ---------- */

.coa-parent-row td {
  background: var(--color-neutral-50);
}

.coa-child-row td {
  border-bottom-color: var(--color-neutral-50);
}

.coa-child-row:hover td {
  background: var(--color-primary-light);
}

.coa-child-code {
  display: inline-block;
  padding-left: 1.25rem;
  position: relative;
  color: var(--color-neutral-700);
}

.coa-child-code::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.75rem;
  height: 1px;
  background: var(--color-neutral-300);
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.pagination-info {
  font-size: 0.8125rem;
  color: var(--color-neutral-500);
}

.pagination-links {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.pagination-current {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-neutral-700);
  white-space: nowrap;
}

.pagination .btn.disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

@media print {
  .pagination {
    display: none !important;
  }
}

/* ---------- Statement layout ---------- */

.statement-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.statement-columns h2 {
  font-size: 1rem;
  margin: 0 0 0.625rem;
}

.statement-columns tfoot td {
  border-bottom: none;
  border-top: 2px solid var(--color-neutral-200);
  background: var(--color-neutral-50);
}

@media (max-width: 900px) {
  .statement-columns {
    grid-template-columns: 1fr;
  }
}

@media print {
  .sidebar, .page-header .btn, .filters {
    display: none !important;
  }
  .content {
    padding: 0;
    animation: none;
    background: none;
  }
}

/* ---------- Auth page card header ---------- */

.form-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.form-card-header .icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary-light), #dbeafe);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.form-card-header h1 {
  margin: 0;
  font-size: 1.25rem;
}

.form-card-header p {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  color: var(--color-neutral-500);
}
