:root {
  color-scheme: light;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --primary-soft: #ccfbf1;
  --accent: #2563eb;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #059669;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(15, 23, 42, .09);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, rgba(15, 118, 110, .13), transparent 34rem), var(--bg);
  color: var(--text);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
}
.auth-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px clamp(24px, 7vw, 96px);
  background: linear-gradient(135deg, rgba(15, 118, 110, .96), rgba(37, 99, 235, .88));
  color: white;
  position: relative;
  overflow: hidden;
}
.auth-hero::after {
  content: "";
  position: absolute;
  width: 460px;
  height: 460px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  right: -120px;
  bottom: -160px;
}
.brand { display: flex; align-items: center; gap: 14px; font-weight: 800; letter-spacing: -.03em; }
.logo { width: 54px; height: 54px; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.18); background: white; }
.auth-hero h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .96; margin: 54px 0 20px; letter-spacing: -.07em; }
.auth-hero p { font-size: 1.1rem; max-width: 680px; line-height: 1.7; opacity: .93; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 36px; max-width: 720px; }
.hero-card { padding: 18px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; backdrop-filter: blur(16px); }
.hero-card b { display:block; margin-bottom: 4px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px; }
.panel-card { width: min(100%, 460px); background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: 30px; box-shadow: var(--shadow); padding: 30px; backdrop-filter: blur(14px); }
.panel-card h2 { margin: 0 0 8px; font-size: 1.7rem; letter-spacing: -.04em; }
.panel-card p { margin-top: 0; color: var(--muted); line-height: 1.5; }
.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field label { font-size: .85rem; color: #334155; font-weight: 700; }
.input, input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(15, 118, 110, .12); }
.btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  color: white;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(15, 118, 110, .22);
}
.btn:hover { background: var(--primary-dark); }
.btn.secondary { color: var(--text); background: var(--surface-2); box-shadow: none; border: 1px solid var(--border); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); box-shadow: none; }
.btn.danger { background: var(--danger); }
.error { padding: 12px 14px; background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; border-radius: 14px; margin-bottom: 14px; }
.success { padding: 12px 14px; background: #ecfdf5; color: #065f46; border: 1px solid #bbf7d0; border-radius: 14px; margin-bottom: 14px; }
.app-layout { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255,255,255,.9);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sidebar .brand { padding: 0 8px 14px; border-bottom: 1px solid var(--border); }
.sidebar-nav { display: grid; gap: 6px; overflow: auto; padding-right: 4px; }
.nav-link {
  border: 0;
  border-radius: 14px;
  padding: 12px 13px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  text-decoration: none;
  font-weight: 750;
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-link:hover, .nav-link.active { background: var(--primary); color: white; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.main { padding: 28px; min-width: 0; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:18px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -.06em; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.card { background: rgba(255,255,255,.93); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 35px rgba(15,23,42,.06); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 20px; border-radius: 22px; background: linear-gradient(180deg, white, #f8fafc); border: 1px solid var(--border); }
.stat span { color: var(--muted); font-size: .86rem; font-weight: 750; }
.stat strong { display:block; margin-top: 7px; font-size: 2rem; letter-spacing: -.05em; }
.toolbar { display:flex; gap: 10px; flex-wrap: wrap; align-items:center; justify-content:space-between; margin-bottom: 16px; }
.toolbar-left, .toolbar-right { display:flex; gap: 10px; flex-wrap: wrap; align-items:center; }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 18px; background: white; }
table { width:100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { font-size: .76rem; text-transform: uppercase; color: #475569; background: #f8fafc; letter-spacing: .04em; }
td { font-size: .92rem; }
.badge { display:inline-flex; align-items:center; border-radius:999px; padding: 5px 9px; font-size:.78rem; font-weight:800; background:#e0f2fe; color:#075985; }
.badge.success { background:#dcfce7; color:#166534; border:0; margin:0; }
.badge.warn { background:#fef3c7; color:#92400e; }
.badge.danger { background:#fee2e2; color:#991b1b; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.58); display: none; align-items: center; justify-content:center; padding: 20px; z-index: 20; }
.modal-backdrop.open { display:flex; }
.modal { width: min(720px, 100%); max-height: 88vh; overflow:auto; background:white; border-radius:28px; border:1px solid var(--border); box-shadow: var(--shadow); padding: 24px; }
.form-grid { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.empty { padding: 32px; text-align:center; color:var(--muted); border:1px dashed var(--border); border-radius: 18px; background:#fff; }
.mobile-menu { display:none; }
.portal-shell { min-height: 100vh; padding: 28px; }
.portal-header { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:22px; }
.kiosk { min-height: 100vh; display:grid; place-items:center; padding:24px; }
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: 42vh; }
  .hero-grid, .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; transform: translateX(-105%); z-index: 10; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display:inline-flex; }
  .main { padding: 18px; }
  .topbar { align-items:flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
