:root {
  --ink: #10251e;
  --muted: #65746f;
  --paper: #f3f0e7;
  --card: #fffdf7;
  --line: #ddd8cb;
  --green: #0c8f62;
  --green-dark: #076545;
  --orange: #f1a33b;
  --shadow: 0 18px 45px rgba(20, 45, 36, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(12, 143, 98, 0.13), transparent 30%),
    radial-gradient(circle at 95% 15%, rgba(241, 163, 59, 0.16), transparent 25%),
    var(--paper);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell {
  width: min(680px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 54px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 28px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 40px;
  border-radius: 16px;
  color: white;
  background: var(--ink);
  font-weight: 800;
  letter-spacing: -.05em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(42px, 7vw, 72px); letter-spacing: -.07em; line-height: .95; }
h2 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.04em; }
.lede { max-width: 520px; color: var(--muted); font-size: 20px; line-height: 1.55; }

.login-form { margin-top: 38px; }
label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.input-row { display: flex; gap: 10px; }
input, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: white;
  padding: 0 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(12, 143, 98, .12); }

.input-row button, .primary-button {
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--green);
  padding: 0 22px;
  font-weight: 800;
  transition: .2s ease;
}
.input-row button:hover, .primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.form-error { min-height: 20px; margin-top: 10px; color: #b24636; font-size: 13px; }

.dashboard { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 36px 0 64px; }
header, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
header h1 { font-size: 42px; margin: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.mode-badge { padding: 8px 12px; border-radius: 999px; background: #e0eee7; color: var(--green-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.quiet-button { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: rgba(255,255,255,.5); padding: 0 14px; font-weight: 750; }
.quiet-button:hover { background: white; }

.summary {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin: 46px 0 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.summary-number { display: block; font-size: 72px; font-weight: 800; line-height: .8; letter-spacing: -.08em; }
.summary-label { display: block; margin-top: 12px; color: var(--muted); font-weight: 700; }
.summary p { max-width: 420px; margin: 0; color: var(--muted); line-height: 1.6; }

.locker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.locker-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(221,216,203,.9);
  border-radius: 20px;
  background: rgba(255,253,247,.82);
  padding: 22px;
  box-shadow: 0 8px 24px rgba(20,45,36,.05);
}
.locker-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  right: -56px;
  bottom: -65px;
  border-radius: 50%;
  background: rgba(12,143,98,.08);
}
.locker-top { display: flex; justify-content: space-between; align-items: start; }
.locker-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: white; background: var(--ink); font-weight: 850; }
.status { display: flex; gap: 6px; align-items: center; color: var(--green-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.occupied .status { color: #a05b08; }
.occupied .status::before { background: var(--orange); }
.locker-card h2 { margin-top: 28px; }
.assignment { min-height: 44px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card-actions { position: absolute; z-index: 1; left: 22px; right: 22px; bottom: 22px; display: flex; gap: 8px; }
.card-actions button { flex: 1; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: white; font-weight: 800; }
.card-actions .assign-button { border-color: var(--green); color: white; background: var(--green); }

.activity-section { margin-top: 60px; }
.activity-list { margin-top: 18px; border-top: 1px solid var(--line); }
.activity-item { display: grid; grid-template-columns: 160px 1fr auto; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity-item time, .activity-detail { color: var(--muted); }
.empty-state { padding: 36px 0; color: var(--muted); }

dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  padding: 0;
  box-shadow: 0 28px 80px rgba(10,30,22,.28);
}
dialog::backdrop { background: rgba(10,25,20,.45); backdrop-filter: blur(4px); }
dialog form { position: relative; padding: 32px; }
.dialog-close { position: absolute; top: 18px; right: 18px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eeeae0; font-size: 22px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 18px 0; }
.check-row input { width: 18px; min-height: 18px; }
.primary-button { width: 100%; min-height: 50px; }
.primary-button + .primary-button { margin-top: 10px; }
.primary-button:disabled { opacity: .55; transform: none; cursor: wait; }
.code-dialog { text-align: center; }
.code-display { margin: 24px 0 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(46px, 12vw, 70px); font-weight: 900; letter-spacing: .12em; color: var(--green-dark); }
.link-display { font-family: inherit; font-size: 32px; letter-spacing: 0; }
.code-dialog p:not(.eyebrow) { color: var(--muted); line-height: 1.55; }
.full { width: 100%; margin-top: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 10; transform: translate(-50%, 20px); opacity: 0; border-radius: 12px; color: white; background: var(--ink); padding: 12px 18px; font-size: 14px; font-weight: 750; transition: .25s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 850px) {
  .locker-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-item { grid-template-columns: 110px 1fr; }
  .activity-detail { display: none; }
}

@media (max-width: 580px) {
  .login-shell { margin: 5vh auto; padding: 32px 24px; }
  .input-row, .summary { align-items: stretch; flex-direction: column; }
  .input-row button { min-height: 48px; }
  .locker-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  header { align-items: start; }
  .mode-badge { display: none; }
}
