:root {
  --bg: #f4efe6;
  --panel: rgba(255, 251, 245, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --text: #172325;
  --muted: #6b6861;
  --border: rgba(94, 79, 58, 0.14);
  --border-strong: rgba(166, 132, 86, 0.24);
  --brand: #123c3a;
  --brand-deep: #0a2322;
  --brand-soft: #204f4c;
  --accent: #b68a52;
  --accent-soft: #e8d4b4;
  --success: #206851;
  --warning: #a66b2d;
  --danger: #9a4037;
  --shadow: 0 28px 70px rgba(30, 25, 17, 0.12);
  --shadow-soft: 0 14px 34px rgba(30, 25, 17, 0.08);
  --radius: 28px;
  --radius-sm: 18px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --font-body: "Avenir Next", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(182, 138, 82, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(18, 60, 58, 0.16), transparent 24%),
    linear-gradient(180deg, #fbf7f0 0%, #f2ece1 52%, #efe7db 100%);
  color: var(--text);
  font-family: var(--font-body);
  letter-spacing: 0.01em;
}

body {
  min-height: 100vh;
}

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

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

#app {
  min-height: 100vh;
}

.shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 28px;
  background:
    radial-gradient(circle at top, rgba(182, 138, 82, 0.18), transparent 26%),
    linear-gradient(180deg, #112d2d 0%, #0b1c1f 100%);
  color: #f4efe7;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid rgba(232, 212, 180, 0.12);
}

.brand-card, .profile-card, .panel, .result-card, .stat-card, .login-card, .hero-panel {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
  overflow: hidden;
}

.brand-card {
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(232, 212, 180, 0.14);
  box-shadow: none;
}

.brand-card h1, .hero-panel h1, .login-card h2, .page-header h2, .panel h3 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #f0dfc4, #b68a52);
  color: #0c2424;
  display: grid;
  place-items: center;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}

.profile-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border-color: rgba(232, 212, 180, 0.14);
  display: grid;
  gap: 8px;
  justify-items: start;
  box-shadow: none;
}

.avatar {
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(197, 140, 59, 0.24));
  color: var(--brand-deep);
  font-weight: 800;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 44px;
  height: 44px;
}

.avatar-md {
  width: 60px;
  height: 60px;
}

.avatar-lg {
  width: 88px;
  height: 88px;
}

.eyebrow {
  margin: 0 0 8px;
  color: inherit;
  opacity: 0.72;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
}

.sidebar-nav, .sidebar-actions, .stack, .list-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link, .ghost-button, .secondary-button, .primary-button, .credential-chip {
  border-radius: 18px;
  padding: 14px 16px;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.nav-link {
  color: #f6f0e8;
  border: 1px solid rgba(232, 212, 180, 0.08);
  background: rgba(255, 255, 255, 0.03);
  text-transform: capitalize;
}

.nav-link.active, .nav-link:hover, .ghost-button:hover, .secondary-button:hover, .primary-button:hover, .credential-chip:hover {
  transform: translateY(-1px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(182, 138, 82, 0.2), rgba(255, 255, 255, 0.08));
  border-color: rgba(232, 212, 180, 0.2);
}

.main-content {
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.topbar, .page-header, .panel-heading, .list-row, .inline-actions, .list-end {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sync-pill, .pill, .badge {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.sync-pill {
  background: linear-gradient(135deg, rgba(18, 60, 58, 0.12), rgba(182, 138, 82, 0.12));
  color: var(--brand-deep);
  border: 1px solid rgba(182, 138, 82, 0.18);
}

.sync-pill.offline {
  background: rgba(197, 140, 59, 0.16);
  color: #8c5a17;
}

.content-grid, .login-page, .eligibility-grid {
  display: grid;
  gap: 22px;
}

.content-grid {
  grid-template-columns: 1.2fr 1fr;
}

.stat-grid, .result-grid, .credential-grid, .form-grid {
  display: grid;
  gap: 16px;
}

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

.stat-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel, .result-card, .stat-card {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(253,248,240,0.9));
}

.panel::before,
.result-card::before,
.stat-card::before,
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.22), transparent 40%);
  pointer-events: none;
}

.stat-card {
  box-shadow: var(--shadow-soft);
}

.stat-card.green { border-left: 8px solid var(--success); }
.stat-card.yellow { border-left: 8px solid var(--warning); }
.stat-card.red { border-left: 8px solid var(--danger); }

.stat-card span, .muted, .list-row p, .detail-list span, .result-card p {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: 2rem;
  font-family: var(--font-display);
  letter-spacing: -0.03em;
}

.primary-button, .secondary-button, .ghost-button, .credential-chip {
  border: 1px solid transparent;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--brand-soft), var(--brand-deep));
  color: white;
  box-shadow: 0 12px 22px rgba(18, 60, 58, 0.22);
}

.secondary-button {
  background: linear-gradient(180deg, rgba(182, 138, 82, 0.14), rgba(182, 138, 82, 0.08));
  color: var(--brand-deep);
  border-color: rgba(182, 138, 82, 0.18);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-strong);
  color: inherit;
}

.login-page {
  min-height: 100vh;
  grid-template-columns: 1.15fr 0.85fr;
  padding: 28px;
  align-items: stretch;
}

.hero-panel {
  padding: 38px;
  background:
    radial-gradient(circle at top right, rgba(232, 212, 180, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(10, 35, 34, 0.98), rgba(18, 60, 58, 0.92));
  color: #fbf7ef;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-color: rgba(232, 212, 180, 0.18);
}

.hero-copy {
  max-width: 36rem;
  font-size: 1.08rem;
  color: rgba(251, 247, 239, 0.8);
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-points span, .pill, .badge {
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
}

.login-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(251,246,238,0.92));
}

.credential-grid, .result-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.credential-chip {
  background: linear-gradient(180deg, rgba(18, 60, 58, 0.06), rgba(182, 138, 82, 0.09));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  border: 1px solid rgba(182, 138, 82, 0.14);
}

.search-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

input, select, textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(120, 95, 65, 0.18);
  padding: 14px 16px;
  background: rgba(255,255,255,0.92);
  color: var(--text);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.6);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(182, 138, 82, 0.5);
  box-shadow: 0 0 0 4px rgba(182, 138, 82, 0.14);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-list {
  display: grid;
  gap: 14px;
}

.user-admin-card {
  padding: 18px 0;
  border-bottom: 1px solid rgba(120, 95, 65, 0.12);
}

.user-admin-card:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

select[multiple] {
  min-height: 160px;
  background: rgba(255,255,255,0.96);
}

.owner-profile-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 18px;
}

.file-label {
  width: 100%;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(120, 95, 65, 0.12);
}

.eligibility-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.eligibility-card {
  border-radius: 22px;
  padding: 20px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.eligibility-card.green {
  background: linear-gradient(180deg, rgba(32, 104, 81, 0.14), rgba(255,255,255,0.8));
}

.eligibility-card.yellow {
  background: linear-gradient(180deg, rgba(182, 138, 82, 0.18), rgba(255,255,255,0.82));
}

.eligibility-card.red {
  background: linear-gradient(180deg, rgba(154, 64, 55, 0.16), rgba(255,255,255,0.82));
}

.reason-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.badge-active, .badge-approved, .badge-green {
  background: rgba(32, 104, 81, 0.12);
  color: var(--success);
  border: 1px solid rgba(32, 104, 81, 0.16);
}

.badge-pending, .badge-yellow, .warning {
  background: rgba(182, 138, 82, 0.16);
  color: #8c6638;
  border: 1px solid rgba(182, 138, 82, 0.16);
}

.badge-restricted, .badge-suspended, .badge-delinquent, .badge-denied, .badge-inactive, .badge-expired, .badge-red {
  background: rgba(154, 64, 55, 0.12);
  color: var(--danger);
  border: 1px solid rgba(154, 64, 55, 0.14);
}

.notice {
  padding: 16px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.mini-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}

.mini-dot.green { background: var(--success); }
.mini-dot.yellow { background: var(--warning); }
.mini-dot.red { background: var(--danger); }

.qr-card {
  margin-top: 20px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18,60,58,0.08), rgba(255,255,255,0.7));
  border: 1px solid rgba(182, 138, 82, 0.14);
}

.fake-qr {
  width: 124px;
  height: 124px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(90deg, #173132 10%, transparent 10%) 0 0/16px 16px,
    linear-gradient(#173132 10%, transparent 10%) 0 0/16px 16px,
    #f8faf9;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.text-link {
  color: var(--brand-deep);
  font-weight: 600;
}

.page-header {
  padding: 8px 2px 2px;
}

.page-header h2 {
  font-size: clamp(1.8rem, 2vw, 2.4rem);
}

.panel-heading {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(120, 95, 65, 0.12);
}

.result-card,
.panel,
.stat-card,
.eligibility-card,
.credential-chip {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.result-card:hover,
.panel:hover,
.stat-card:hover,
.eligibility-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(30, 25, 17, 0.11);
}

.list-row {
  padding: 14px 0;
  border-bottom: 1px solid rgba(120, 95, 65, 0.1);
}

.list-stack > .list-row:last-child,
.list-stack > .panel:last-child .list-row:last-child {
  border-bottom: 0;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full-width {
  grid-column: 1 / -1;
}

.solo-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.compact-top {
  margin-top: 18px;
}

.wrap {
  flex-wrap: wrap;
}

.form-message {
  color: var(--danger);
  margin: 0;
}

@media (max-width: 1080px) {
  .shell,
  .login-page,
  .content-grid,
  .stat-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 18px;
  }
}

@media (max-width: 720px) {
  .main-content, .login-page, .sidebar {
    padding: 18px;
  }

  .topbar, .page-header, .panel-heading, .list-row, .search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .detail-list div {
    flex-direction: column;
  }
}
