:root {
  --bg: #eef3fb;
  --bg-2: #f8fbff;
  --card: #ffffff;
  --primary: #d91c23;
  --primary-dark: #b0151a;
  --secondary: #2c2076;
  --secondary-dark: #23195f;
  --text: #132238;
  --muted: #66758a;
  --border: #dce5f1;
  --success: #17623c;
  --success-bg: #e6f8ee;
  --danger: #a61c2b;
  --danger-bg: #fdecef;
  --warning: #9a5f00;
  --warning-bg: #fff5dd;
  --soft: #f5f8fc;
  --shadow: 0 18px 50px rgba(19, 34, 56, .09);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(217, 28, 35, .08), transparent 30%),
    radial-gradient(circle at top right, rgba(44, 32, 118, .10), transparent 28%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
}
a { color: var(--secondary); }
img { max-width: 100%; display: block; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 0;
}

.auth-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(220,229,241,.85);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(19, 34, 56, .14);
}

.hero {
  position: relative;
  padding: 48px;
  color: white;
  background:
    linear-gradient(145deg, rgba(44, 32, 118, .96), rgba(20, 24, 78, .98)),
    linear-gradient(180deg, #1f2b85, #11183f);
}
.hero:before,
.hero:after {
  content: '';
  position: absolute;
  border-radius: 999px;
  opacity: .18;
  pointer-events: none;
}
.hero:before {
  width: 240px;
  height: 240px;
  background: #fff;
  right: -60px;
  top: -80px;
}
.hero:after {
  width: 200px;
  height: 200px;
  background: #d91c23;
  left: -50px;
  bottom: -70px;
}
.hero-content { position: relative; z-index: 1; }
.hero-logo {
  width: 220px;
  background: rgba(255,255,255,.98);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 28px;
  box-shadow: 0 16px 30px rgba(0,0,0,.18);
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 16px;
  font-size: 38px;
  line-height: 1.1;
}
.hero p {
  margin: 0 0 20px;
  color: rgba(255,255,255,.88);
  line-height: 1.75;
  font-size: 16px;
}
.hero-list {
  display: grid;
  gap: 12px;
  margin: 28px 0 0;
}
.hero-list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
}
.hero-list-item strong { display: block; margin-bottom: 4px; }
.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff8f94;
  margin-top: 6px;
  flex: 0 0 auto;
}

.panel {
  padding: 34px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,1));
}
.panel-header {
  text-align: center;
  margin-bottom: 18px;
}
.panel-logo-mobile {
  display: none;
  width: 190px;
  margin: 0 auto 14px;
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  box-shadow: 0 10px 24px rgba(19,34,56,.08);
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.card-body { padding: 28px; }
.card-title { margin: 0 0 8px; font-size: 30px; }
.card-subtitle,
.footer-note,
.helper-text {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

label {
  display: block;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 8px;
}
input[type="text"],
input[type="password"],
input[type="email"] {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid #c8d6e6;
  border-radius: 14px;
  outline: none;
  transition: .2s;
  font-size: 15px;
  color: var(--text);
  background: #fbfdff;
}
input::placeholder { color: #93a0b3; }
input:focus {
  border-color: rgba(44, 32, 118, .45);
  box-shadow: 0 0 0 4px rgba(44, 32, 118, .09);
  background: #fff;
}
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 12px 24px rgba(217, 28, 35, .20);
}
.btn-primary:hover { box-shadow: 0 16px 26px rgba(217, 28, 35, .25); }
.btn-light {
  background: #eef2ff;
  color: var(--secondary);
}
.btn-outline {
  background: white;
  color: var(--secondary);
  border: 1px solid #cad7ef;
}
.btn-soft {
  background: #f6f8fc;
  color: var(--text);
  border: 1px solid #d8e1ed;
}
.btn-inline { width: auto; }

.small-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.small-links a {
  color: var(--secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: bold;
}
.small-links a:hover { text-decoration: underline; }

.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: #b9e9cb;
}
.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f7c3cf;
}
.alert-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: #f2de9a;
}

.header { padding: 22px 0 0; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(220,229,241,.95);
  padding: 18px 22px;
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(19,34,56,.07);
}
.brand {
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-logo {
  width: 145px;
  background: #fff;
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(19,34,56,.06);
  border: 1px solid #edf2f8;
}
.brand-text h2 { margin: 0 0 4px; font-size: 25px; }
.brand-text span { color: var(--muted); font-size: 14px; line-height: 1.5; }
.user-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.layout { display: grid; grid-template-columns: 1fr; gap: 18px; margin: 20px 0 30px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  padding: 22px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(19,34,56,.05);
}
.stat-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.stat strong { display: block; font-size: 30px; margin-top: 8px; }
.stat-highlight {
  background: linear-gradient(145deg, rgba(44,32,118,.97), rgba(31,43,133,.98));
  color: white;
  border-color: rgba(44,32,118,.3);
}
.stat-highlight .stat-label,
.stat-highlight .footer-note { color: rgba(255,255,255,.78); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.section-header h3 { margin: 0 0 6px; font-size: 24px; }
.section-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
}
table { width: 100%; border-collapse: collapse; min-width: 920px; background: #fff; }
th, td { padding: 15px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th {
  background: #f7faff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--muted);
}
tbody tr:hover { background: #fbfdff; }
.value {
  font-weight: bold;
  white-space: nowrap;
}
.badge {
  display: inline-block;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid transparent;
}
.badge-open {
  background: #e5f2ff;
  color: #1952a6;
  border-color: #bfd7f8;
}
.badge-late {
  background: #feecef;
  color: #af1e31;
  border-color: #f8bfca;
}
.empty {
  text-align: center;
  padding: 44px 24px;
  color: var(--muted);
  background: linear-gradient(180deg, #fbfdff, #f6f9fc);
  border-radius: 18px;
  border: 1px dashed #cfdceb;
}
.password-box { max-width: 680px; margin: 34px auto; }
.auth-box { max-width: 680px; margin: 42px auto; }
.auth-top-logo {
  width: 190px;
  margin: 0 auto 18px;
  background: #fff;
  border-radius: 18px;
  padding: 12px 16px;
  box-shadow: 0 10px 24px rgba(19,34,56,.08);
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title {
  margin: 0 0 6px;
  font-size: 30px;
}

.footer-bar {
  padding: 0 0 30px;
  color: var(--muted);
  font-size: 13px;
}
.footer-bar .card {
  background: rgba(255,255,255,.8);
}

@media (max-width: 980px) {
  .auth-grid { grid-template-columns: 1fr; }
  .hero { display: none; }
  .panel { padding: 22px; }
  .panel-logo-mobile { display: block; }
  .stats { grid-template-columns: 1fr 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .brand { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
  .container { width: min(100% - 20px, 1180px); }
  .stats { grid-template-columns: 1fr; }
  .card-body { padding: 22px; }
  .form-row { grid-template-columns: 1fr; }
  .form-actions,
  .user-actions,
  .section-actions { flex-direction: column; }
  .btn-inline,
  .section-actions .btn,
  .user-actions .btn,
  .form-actions .btn { width: 100% !important; }
  .brand-logo { width: 130px; }
  .brand-text h2 { font-size: 22px; }
  .page-title,
  .card-title { font-size: 26px; }
}


.app-shell { padding: 26px 0 40px; }
.header-pro { margin-bottom: 18px; }
.section-header-stack { margin-bottom: 18px; }
.tabs-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 18px;
}
.tab-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  text-decoration: none;
  background: #f2f6fd;
  color: var(--text);
  border: 1px solid #d8e4f3;
  font-weight: bold;
}
.tab-chip span {
  display: inline-flex;
  min-width: 26px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(44, 32, 118, .08);
  color: var(--secondary);
  font-size: 12px;
}
.tab-chip.active {
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  color: #fff;
  border-color: transparent;
}
.tab-chip.active span { background: rgba(255,255,255,.18); color: #fff; }
.filter-bar {
  display: flex;
  gap: 14px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-field { flex: 1 1 320px; margin-bottom: 0; }
.filter-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.action-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-sm {
  padding: 10px 12px;
  font-size: 13px;
}
.badge-paid {
  background: var(--success-bg);
  color: var(--success);
}
.footer-flex {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}
.form-actions-stack {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
@media (max-width: 860px) {
  .footer-flex { flex-direction: column; align-items: flex-start; }
  .filter-actions { width: 100%; }
}
