:root {
  --ink: #1a1520;
  --muted: #6d6574;
  --line: #e4ddd2;
  --paper: #f4efe6;
  --card: #fffdf9;
  --sidebar: #110e16;
  --side-text: #f6f1ea;
  --side-dim: #b7adbe;
  --accent: #ff6a2c;
  --accent-2: #7c4dff;
  --good: #1c7a4a;
  --good-bg: #e7f6ee;
  --warn: #9a5b10;
  --warn-bg: #fff1dc;
  --bad: #b3262e;
  --bad-bg: #fde8e8;
  --info: #2c4f8f;
  --info-bg: #e8eefb;
  --shadow: 0 16px 40px rgba(40, 24, 16, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Outfit", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 15.5px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--info); }
h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 560; letter-spacing: -0.03em; margin: 0; }
h1 { font-size: 2rem; line-height: 1.1; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}
.login-brand {
  background: var(--sidebar);
  color: var(--side-text);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-brand::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(255,106,44,.45), rgba(124,77,255,.05) 70%);
  pointer-events: none;
}
.brand-mark { display: flex; gap: 14px; align-items: center; }
.brand-mark img { width: 64px; height: 64px; border-radius: 16px; }
.eyebrow { color: var(--accent); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; }
.login-brand h1 { font-size: 3.2rem; max-width: 12ch; margin: 18px 0 12px; }
.login-brand p { max-width: 38ch; color: var(--side-dim); font-size: 1.05rem; }
.login-panel { display: grid; place-items: center; padding: 32px 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.login-card { width: min(420px, 100%); padding: 32px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 0.92rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #c9b8a4; box-shadow: 0 0 0 4px rgba(255,106,44,.12); }
.btn {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: #efeae2;
  color: var(--ink);
  font-weight: 600;
}
.btn.primary {
  background: linear-gradient(120deg, var(--accent), #ff4d6d 55%, var(--accent-2));
  color: white;
}
.btn.good { background: var(--good); color: white; }
.btn.bad { background: transparent; color: var(--bad); border: 1px solid #f0c4c6; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn:disabled { opacity: 0.55; cursor: wait; }
.err { color: var(--bad); margin: 0; }
.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; color: var(--muted); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); width: 100%; }
.sidebar {
  background: var(--sidebar);
  color: var(--side-text);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side-brand { display: flex; gap: 10px; align-items: center; padding: 0 8px; }
.side-brand img { width: 44px; height: 44px; border-radius: 12px; }
.side-brand strong { display: block; font-size: 0.95rem; }
.side-brand span { color: var(--side-dim); font-size: 0.78rem; }
.nav { display: grid; gap: 4px; overflow: auto; }
.nav button {
  text-align: left;
  background: transparent;
  color: var(--side-dim);
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav button.active, .nav button:hover { background: rgba(255,255,255,.06); color: white; }
.badge {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  min-width: 1.3rem;
  text-align: center;
  font-size: 0.75rem;
  padding: 1px 6px;
}
.main { min-width: 0; max-width: 100%; }
.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  padding: 20px 28px 0;
}
.top-actions { display: flex; gap: 8px; align-items: center; }
.who { text-align: right; }
.who strong { display: block; }
.menu-btn { display: none; }
.view { padding: 18px 28px 48px; display: grid; gap: 16px; min-width: 0; }
.banner {
  background: #fff6ea;
  border: 1px solid #f0d7b4;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.banner > span { flex: 1 1 220px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 0.82rem; display: block; }
.stat strong { font-family: "Fraunces", Georgia, serif; font-size: 1.7rem; display: block; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; }
.hero-punch { display: flex; justify-content: space-between; gap: 18px; align-items: center; }
.punch-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; background: #faf7f2; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 0.78rem; font-weight: 600; background: #f1ece4; }
.pill.approved, .pill.good { background: var(--good-bg); color: var(--good); }
.pill.pending, .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.rejected, .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; min-width: 0; max-width: 100%; }
.filters label { min-width: 160px; flex: 1; }
.filters > input { flex: 1; min-width: 180px; max-width: 360px; width: auto; }
.split { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 14, 24, .46);
  display: grid; place-items: center; padding: 18px; z-index: 30;
}
.modal { width: min(760px, 100%); max-height: min(88vh, 900px); overflow: auto; background: var(--card); border-radius: 20px; padding: 18px 18px 22px; }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.icon-x { border: 0; background: transparent; font-size: 1.4rem; line-height: 1; }
.toast {
  position: fixed; bottom: 18px; right: 18px; background: var(--ink); color: white;
  padding: 12px 14px; border-radius: 12px; z-index: 40; max-width: 320px;
}
.list { display: grid; gap: 10px; }
.note { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; padding-bottom: 0; }
.kicker { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.empty { color: var(--muted); padding: 16px; }
.map { font-size: 0.82rem; }

@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 280px; padding: 28px; }
  .login-brand h1 { font-size: 2.4rem; }
  .stats, .grid-2, .split { grid-template-columns: 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 25; transform: translateX(-105%);
    width: min(280px, 86vw); transition: transform .2s ease;
  }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .view, .topbar { padding-left: 16px; padding-right: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .hero-punch { flex-direction: column; align-items: stretch; }
}
