/* ShiftClock — shared styles. Mobile-first, light/dark aware. */
:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --ink: #16202b;
  --muted: #62707e;
  --line: #e2e7ec;
  --brand: #0e7c86;
  --brand-ink: #ffffff;
  --brand-soft: #d6eef0;
  --good: #1a8a4a;
  --good-soft: #dcf3e6;
  --bad: #c23b34;
  --bad-soft: #fbe3e1;
  --warn: #b7791f;
  --warn-soft: #fbeecb;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 32, 43, .06), 0 6px 20px rgba(16, 32, 43, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1620; --card: #16222e; --ink: #e8eef3; --muted: #93a3b2;
    --line: #263442; --brand: #35b6c0; --brand-ink: #06222530; --brand-soft: #123b40;
    --good: #46c07d; --good-soft: #123626; --bad: #ef6b62; --bad-soft: #3a1c1a;
    --warn: #e0b25a; --warn-soft: #3a2f16;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
a { color: var(--brand); }
.hidden { display: none !important; }

/* Layout */
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.brand .dot { width: 22px; height: 22px; border-radius: 7px; background: var(--brand); display: inline-block; }
.brand small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-top: -2px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px;
}
.card h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack > * + * { margin-top: 10px; }
.center { text-align: center; }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 600; padding: 11px 16px; border-radius: 11px; cursor: pointer;
  transition: transform .04s ease, filter .15s ease; min-height: 44px;
}
.btn:active { transform: translateY(1px); }
.btn:hover { filter: brightness(.98); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.btn.good { background: var(--good); color: #fff; border-color: transparent; }
.btn.bad { background: var(--bad); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }

/* The big clock button */
.clockbtn {
  width: 100%; min-height: 132px; font-size: 26px; font-weight: 800; border-radius: 20px;
  border: none; color: #fff; cursor: pointer; letter-spacing: .3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.clockbtn small { font-weight: 600; font-size: 14px; opacity: .92; }
.clockbtn.in { background: linear-gradient(160deg, #16a34a, #0f7a39); }
.clockbtn.out { background: linear-gradient(160deg, #d9534f, #b53a35); }
.clockbtn:disabled { background: #9aa7b3; cursor: not-allowed; }

/* Forms */
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--ink); min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
textarea { min-height: 80px; resize: vertical; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .grid2 { grid-template-columns: 1fr; } }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.bad  { background: var(--bad-soft);  color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.neutral { background: var(--line); color: var(--muted); }
.badge .led { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* Lists / tables */
.list { list-style: none; margin: 0; padding: 0; }
.item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item:first-child { border-top: none; }
.item .who { font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.tablewrap { overflow-x: auto; }

/* Bottom nav (employee) + tab bar (admin) */
.bottomnav {
  position: sticky; bottom: 0; z-index: 20; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav button {
  flex: 1; border: none; background: none; color: var(--muted); font-weight: 600; font-size: 12px;
  padding: 10px 4px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottomnav button .ico { font-size: 20px; line-height: 1; }
.bottomnav button.active { color: var(--brand); }

.tabbar { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 12px; }
.tabbar button {
  white-space: nowrap; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-weight: 600; font-size: 13.5px; padding: 8px 13px; border-radius: 999px; cursor: pointer;
}
.tabbar button.active { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

/* Alerts */
.alert { padding: 11px 13px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.alert.info { background: var(--brand-soft); color: var(--brand); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.bad  { background: var(--bad-soft);  color: var(--bad); }
.alert.good { background: var(--good-soft); color: var(--good); }

/* Toasts */
#toasts { position: fixed; left: 0; right: 0; bottom: 78px; display: flex; flex-direction: column;
  align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 12px; }
.toast { background: #1f2b38; color: #fff; padding: 11px 16px; border-radius: 11px; font-size: 14px;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .28s ease; max-width: 480px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.bad { background: #b53a35; } .toast.good { background: #147a44; }

.big-time { font-size: 34px; font-weight: 800; letter-spacing: .5px; }
.pill-note { font-size: 12px; color: var(--muted); }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 8px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; font-size: 14px; }
hr.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
