:root {
  --bg: #0b1020;
  --bg-2: #0e1530;
  --surface: #141c38;
  --surface-2: #1a2342;
  --card: #121a34;
  --border: #25305a;
  --foreground: #e8ecf8;
  --muted: #93a0c4;
  --primary: #4f7cff;
  --primary-2: #7a5cff;
  --primary-fg: #ffffff;
  --success: #22c55e;
  --warning: #f59e0b;
  --destructive: #ef4444;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.bg-hero {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(79,124,255,0.18), transparent 70%),
    radial-gradient(40% 40% at 85% 20%, rgba(122,92,255,0.16), transparent 70%);
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }
.narrow { max-width: 640px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  padding: 10px 16px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: filter .15s, background .15s, transform .05s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: none; color: var(--primary-fg);
  box-shadow: 0 8px 24px rgba(79,124,255,0.35);
}
.btn-success { background: var(--success); border: none; color: #06240f; }
.btn-danger { background: var(--destructive); border: none; color: #fff; }
.btn-outline { background: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; }

/* Cards */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}
.card-plain { background: var(--card); }
.p-5 { padding: 20px; } .p-6 { padding: 24px; }

/* Forms */
label { display: block; font-size: 16px; font-weight: 600; margin-bottom: 6px; color: var(--foreground); }
.input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-2); color: var(--foreground);
  font-size: 14px; font-family: inherit;
}
.input:focus, select:focus, textarea:focus { outline: 2px solid rgba(79,124,255,0.5); border-color: transparent; }
.field { margin-bottom: 16px; }
.hint { font-size: 16px; color: var(--muted); margin-top: 5px; }
.row { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* Typography */
h1,h2,h3 { margin: 0; letter-spacing: -0.02em; }
.h-title { font-size: 24px; font-weight: 800; }
.muted { color: var(--muted); }
.text-sm { font-size: 14px; } .text-xs { font-size: 12px; }
.text-primary { color: var(--primary); }
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.text-center { text-align: center; }

/* Badges */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-pending { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-approved, .badge-occupied { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-rejected { background: rgba(239,68,68,0.15); color: var(--destructive); }
.badge-vacant { background: rgba(147,160,196,0.15); color: var(--muted); }

/* Grid helpers */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .wrap { flex-wrap: wrap; }
.mt-1{margin-top:4px}.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}.mt-6{margin-top:24px}
.mb-4{margin-bottom:16px}.mb-6{margin-bottom:24px}
.space-y > * + * { margin-top: 16px; }
.divide > * + * { border-top: 1px solid var(--border); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 900;
}

/* Header (public) */
.site-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }

/* Stat cards */
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 800; margin-top: 10px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 40px 0; position: relative; z-index: 1; }
.footer-grid { display: grid; gap: 32px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 12px; }
.footer-grid a { display: block; color: var(--muted); padding: 4px 0; font-size: 14px; }
.footer-grid a:hover { color: var(--foreground); }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* Lang toggle */
.lang-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.lang-toggle a { padding: 7px 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.lang-toggle a.active { background: var(--primary); color: #fff; }

/* Dashboard layout */
.dash { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; border-right: 1px solid var(--border);
  background: #0c1330; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-head { display: flex; align-items: center; gap: 8px; height: 64px; padding: 0 20px; border-bottom: 1px solid var(--border); }
.nav { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.nav a:hover { background: var(--surface); color: var(--foreground); }
.nav a.active { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: 0 6px 18px rgba(79,124,255,0.35); }
.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 20px; border-bottom: 1px solid var(--border); background: rgba(11,16,32,0.85); backdrop-filter: blur(8px); }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.topbar-title { font-size: 17px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dash-content { padding: 24px 20px; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 24px 0 60px rgba(0,0,0,0.5); }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(4,8,20,0.6); }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 6px; }
  .topbar-title { font-size: 15px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .btn-sm { padding: 6px 9px; font-size: 12px; }
  .lang-toggle a { padding: 6px 9px; font-size: 12px; }
  .dash-content { padding: 16px 14px; }
}

/* Alerts / flash */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; border: 1px solid var(--border); }
.alert-success { background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.4); color: #86efac; }
.alert-error { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.4); color: #fca5a5; }

/* Tabs */
.tabs { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; overflow-x: auto; max-width: 100%; }
.tabs a { padding: 8px 14px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tabs a.active { background: var(--primary); color: #fff; }

/* Modal via :target */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(4,8,20,0.7); }
.modal:target { display: flex; }
.modal-box { width: 100%; max-width: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; max-height: 90vh; overflow-y: auto; }
.modal-close { float: right; color: var(--muted); font-size: 22px; line-height: 1; }

/* List rows */
.list-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }

.proof-img { max-height: 70vh; border-radius: 12px; border: 1px solid var(--border); margin: 0 auto; }
.icon { width: 18px; height: 18px; display: inline-block; vertical-align: middle; }


/* Mobile fine-tuning */
@media (max-width: 560px) {
  .site-header { padding: 16px 0; gap: 10px; }
  .site-header .brand { font-size: 16px; }
  .brand-mark { width: 32px; height: 32px; }
  .h-title { font-size: 20px; }
  .stat-value { font-size: 22px; }
  .p-6 { padding: 18px; }
  .p-5 { padding: 16px; }
  .list-row { padding: 14px 16px; }
  .section-head { padding: 14px 16px; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-box { 
    padding: 18px; 
    padding-bottom: calc(18px + env(safe-area-inset-bottom)); /* Accommodate iOS home bar */
    border-radius: 18px 18px 0 0; 
  }
  .modal-bx { padding: 18px; border-radius: 18px 18px 0 0; max-height: 85vh; }
  .btn { padding: 10px 14px; }
  .btn-lg { padding: 12px 18px; font-size: 15px; }
}
@media (max-width: 400px) {
  .topbar-signout { padding: 6px 8px; }
  .lang-toggle a { padding: 6px 8px; }
}
