:root {
  --bg: #081225;
  --panel: rgba(10, 19, 37, 0.9);
  --ink: #edf4ff;
  --muted: #9fb3d9;
  --accent: #2563eb;
  --accent-soft: #1d4ed8;
  --eds-blue: #0b3ea9;
  --eds-steel: #d8e2f2;
  --emhs-magenta: #cf1dbb;
  --emhs-violet: #6d28d9;
  --emhs-orange: #ffb400;
  --border: rgba(148, 163, 184, 0.18);
  --shadow: 0 24px 70px rgba(2, 8, 23, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.16), transparent 28%),
    linear-gradient(180deg, #050b16 0%, var(--bg) 100%);
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-brand-block {
  display: grid;
  gap: 18px;
}

.brand-ribbon {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.brand-card {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(9, 16, 32, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-card strong,
.brand-card span {
  display: block;
}

.brand-card strong {
  font-size: 1rem;
}

.brand-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-mark,
.brand-logo-wrap {
  display: grid;
  place-items: center;
  height: 68px;
  border-radius: 18px;
}

.brand-mark {
  font-weight: 800;
  letter-spacing: 0.08em;
  font-size: 1.1rem;
  color: #fff;
}

.brand-mark-eds {
  background: linear-gradient(135deg, #082e84, var(--eds-blue) 55%, #7fa7ff);
}

.brand-mark-emhs {
  background: linear-gradient(135deg, var(--emhs-orange), #ff6a00 22%, var(--emhs-magenta) 48%, var(--emhs-violet) 76%, #3b82f6);
}

.brand-logo-wrap {
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  overflow: hidden;
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-logo-eds {
  transform: scale(1.22);
}

.brand-logo-emhs {
  transform: scale(1.1);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.75);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero-tag-eds {
  background: rgba(11, 62, 169, 0.18);
  color: #cfe0ff;
}

.hero-tag-emhs {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.18), rgba(207, 29, 187, 0.18), rgba(109, 40, 217, 0.18));
  color: #ffd66b;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.95;
  margin-bottom: 14px;
}

.eyebrow,
.panel-kicker,
.hero-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: #60a5fa;
  font-weight: 700;
}

.hero-copy,
.hero-note,
.feedback,
.muted {
  color: var(--muted);
}

.hero-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(255, 180, 0, 0.12), transparent 28%),
    radial-gradient(circle at bottom left, rgba(207, 29, 187, 0.14), transparent 32%),
    rgba(10, 19, 37, 0.92);
}

.hero-time {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  margin: 10px 0 6px;
}

.hero-divider {
  height: 1px;
  margin: 14px 0;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.08), rgba(255, 180, 0, 0.42), rgba(207, 29, 187, 0.35), rgba(148, 163, 184, 0.08));
}

.mode-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.mode-tab {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.84);
  color: var(--ink);
  border-radius: 999px;
  padding: 12px 18px;
  cursor: pointer;
  font: inherit;
}

.mode-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #fff;
}

.view-stack {
  display: grid;
  gap: 20px;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.panel {
  padding: 22px;
}

.panel-accent {
  background:
    radial-gradient(circle at top right, rgba(255, 180, 0, 0.08), transparent 26%),
    linear-gradient(135deg, rgba(11, 62, 169, 0.26), rgba(10, 19, 37, 0.95) 46%, rgba(109, 40, 217, 0.14));
}

.panel-wide {
  grid-column: 1 / -1;
}

.kiosk-panel {
  max-width: 760px;
}

.narrow-panel {
  max-width: 520px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.stack-form,
.employee-form {
  display: grid;
  gap: 12px;
}

.employee-form {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.95rem;
}

select,
input,
.readonly-field {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--ink);
}

.readonly-field {
  background: rgba(30, 41, 59, 0.8);
  font-weight: 600;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(135deg, var(--eds-blue), var(--accent-soft) 55%, #3b82f6);
  color: #fff;
}

.secondary-btn {
  background: linear-gradient(135deg, rgba(255, 180, 0, 0.16), rgba(207, 29, 187, 0.16));
  color: #fde68a;
}

.ghost-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: var(--ink);
}

.feedback {
  min-height: 24px;
  font-weight: 600;
}

.feedback.success {
  color: #60a5fa;
}

.feedback.error {
  color: #fca5a5;
}

.identity-preview {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.82);
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
}

.identity-preview img,
.employee-thumb {
  width: 92px;
  height: 92px;
  border-radius: 18px;
  object-fit: cover;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.identity-preview h3 {
  margin: 0 0 6px;
}

.identity-secret {
  margin: 8px 0 0;
  font-weight: 700;
  color: #dbeafe;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stats-grid article,
.info-box {
  border-radius: 18px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.stats-grid span {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.stats-grid strong {
  font-size: 1.6rem;
}

.table-wrap {
  overflow: auto;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1050px;
  background: rgba(15, 23, 42, 0.75);
}

th,
td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.94rem;
}

th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bfdbfe;
  background: rgba(15, 23, 42, 0.96);
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.pill.ok {
  background: rgba(37, 99, 235, 0.16);
  color: #93c5fd;
}

.pill.late {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.qr-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

@media print {
  .hero,
  .mode-switch,
  #employeeView,
  #rhAuthPanel,
  .grid,
  .table-wrap,
  #employeeForm,
  #logoutRhBtn,
  #exportBtn,
  #refreshBtn,
  #settingsForm,
  .info-box {
    display: none !important;
  }

  #rhView,
  #rhDashboard,
  .panel,
  .panel-wide {
    display: block !important;
  }

  body {
    background: #fff;
    color: #111827;
  }

  .panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 920px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

  .brand-ribbon {
    grid-template-columns: 1fr;
  }

  .employee-form {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    flex-wrap: wrap;
  }
}
