/* timesheet-mvp — app.css · shares its design language (palette, card style,
   entrance animation) with aws-ops-dashboard, AlphaDevs' other internal tool —
   see frontend/src/styles.css there for the sibling copy of this system.
   Fonts stay system-only (no Google Fonts import): this app's CSP is
   deliberately `style-src 'self'` with no external hosts, and that's a stated
   security property (see README), not an oversight — 'Inter'/'JetBrains Mono'
   below are just preferences a browser uses only if already installed
   locally, so listing them costs nothing and never violates the CSP. */

:root {
  --bg: #0a0c0f; --bg-2: #0f1216; --bg-3: #14171b;
  --line: #232830;
  --accent: #e2a33d; --accent-dim: rgba(226, 163, 61, 0.5);
  --amber: #ffb300; --green: #3ddc84; --red: #f5566b;
  --text: #edeff2; --muted: #8b93a1;
  --mono: 'JetBrains Mono', ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 12px;
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, 0.45), 0 16px 40px rgba(0, 0, 0, 0.4);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* .top and .banner both set `display` unconditionally (flex), which — per
   the CSS cascade's origin order, not specificity — beats the browser's own
   `[hidden] { display: none }` UA-stylesheet rule even though the `hidden`
   attribute is genuinely set. Without this, the topbar/banner visibly leak
   through on the login screen (caught live in a browser, not by reading the
   markup). This one rule covers any future class that does the same. */
[hidden] { display: none !important; }

body {
  background: var(--bg); color: var(--text); font-family: var(--sans);
  line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
  background-image: radial-gradient(900px 420px at 85% -10%, rgba(226,163,61,0.05), transparent 60%);
}

a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); }
::selection { background: var(--accent); color: var(--bg); }

/* ── top bar ── */
.top {
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(14px, 3vw, 32px);
  border-bottom: 1px solid var(--line); background: rgba(6,10,18,0.8);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px);
}
.top__logo { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 16px; }
.top__prompt { color: var(--amber); }
.cursor { color: var(--accent); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.top__nav { display: flex; gap: clamp(8px, 2vw, 20px); margin-left: auto; font-family: var(--mono); font-size: 13px; flex-wrap: wrap; }
.top__nav a { color: var(--muted); padding: 3px 8px; border-radius: 7px; }
.top__nav a:hover { color: var(--accent); }
.top__nav a.on { color: var(--bg); background: var(--accent); font-weight: 700; }
.top__user { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 12.5px; }
.top__name { color: var(--muted); }
.linkbtn { background: none; border: none; color: var(--amber); font-family: var(--mono); font-size: 12.5px; }
.linkbtn:hover { text-decoration: underline; }

/* ── banner (reminders) ── */
.banner {
  margin: 14px clamp(14px, 3vw, 32px) 0;
  border: 1px solid rgba(255, 179, 0, 0.35); border-radius: var(--radius);
  background: rgba(255, 179, 0, 0.07); color: var(--text);
  padding: 11px 16px; font-size: 14px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.banner b { color: var(--amber); font-family: var(--mono); }
.banner a { font-family: var(--mono); font-size: 13px; }

/* ── layout ── */
.view { flex: 1; width: min(1080px, 100%); margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 40px; }
.foot {
  border-top: 1px solid var(--line); padding: 14px clamp(14px, 3vw, 32px);
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
h1 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.02em; margin-bottom: 4px; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.kicker { font-family: var(--mono); font-size: 12.5px; color: var(--amber); margin-bottom: 6px; }

/* ── controls ── */
.btn {
  font-family: var(--mono); font-weight: 700; font-size: 13.5px;
  padding: 9px 16px; border-radius: 9px; border: none;
  background: var(--accent); color: var(--bg); transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 0 18px rgba(226,163,61,0.4); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { background: var(--bg-3); color: var(--text); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--accent-dim); box-shadow: none; }
.btn--danger { background: transparent; color: var(--red); border: 1px solid rgba(255,95,107,0.4); }
.btn--sm { padding: 5px 10px; font-size: 12px; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], select {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 11px; outline: none; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent-dim); }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row + .row, .row + .tablewrap, .tablewrap + .row { margin-top: 14px; }

.chip {
  font-family: var(--mono); font-size: 11px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.chip--ok { color: var(--green); border-color: rgba(61,220,132,0.4); background: rgba(61,220,132,0.08); }
.chip--warn { color: var(--amber); border-color: rgba(255,179,0,0.4); background: rgba(255,179,0,0.08); }

/* ── login ── */
/* .login: plain narrow-column wrapper, still used by renderPassword (a
   regular in-app view, not the login screen) — kept separate from the
   login-screen/login-card pair below. */
.login { max-width: 380px; margin: 8vh auto 0; }
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(640px 420px at 50% 40%, rgba(226,163,61,0.09), transparent 65%);
}
.login-card {
  width: min(380px, 90vw);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-3), var(--bg-2));
  padding: 40px 32px 30px; box-shadow: var(--shadow-raised), 0 0 0 1px rgba(226,163,61,0.06);
  text-align: center; position: relative; overflow: hidden;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 26px; }
.login-badge {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(155deg, var(--accent), #b9781f);
  color: var(--bg); font-size: 15px; flex-shrink: 0;
}
.login-mark { font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
.login-card .kicker { text-align: left; }
.login-card h1 { text-align: left; }
.login-card .sub { text-align: left; }
.login-card .btn { padding: 12px 16px; font-size: 14px; }
.login-foot { margin: 18px 0 0; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); opacity: 0.75; }
.err { color: var(--red); font-size: 13px; min-height: 1.2em; margin-bottom: 10px; font-family: var(--mono); text-align: left; }

/* .card: the other, plainer card style — still used by the change-password
   form (renderPassword), which isn't part of the login screen. */
.card {
  max-width: 380px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg-3), var(--bg-2)); padding: 26px;
}
.card .field { margin-bottom: 14px; display: grid; gap: 5px; }
.card label { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.card input { width: 100%; }

/* ── week grid ── */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 8px 10px; border-bottom: 1px solid rgba(226,163,61,0.08); text-align: left; white-space: nowrap; }
thead th { font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-weight: 400; background: var(--bg-3); }
tbody tr:hover { background: rgba(226,163,61,0.05); }
.grid td.num, .grid th.num { text-align: center; }
.grid .taskcell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.grid .taskcell small { color: var(--muted); font-family: var(--mono); font-size: 11px; display: block; }
.grid input.hrs {
  width: 62px; text-align: center; padding: 6px 4px; font-family: var(--mono); font-size: 13px;
  background: var(--bg); border-radius: 7px;
}
.grid input.hrs.has-note { border-color: rgba(255,179,0,0.5); }
.grid input.hrs:disabled { opacity: 0.55; }
.grid .day--today { color: var(--accent); }
.grid .day--hol { color: var(--amber); }
.grid .hol-tag { font-size: 10px; display: block; }
.grid tfoot td { font-family: var(--mono); color: var(--muted); border-top: 1px solid var(--line); }
.grid tfoot .tot { color: var(--text); font-weight: 700; }
.rowdel { background: none; border: none; color: var(--muted); font-size: 14px; padding: 2px 6px; }
.rowdel:hover { color: var(--red); }

.progress { height: 6px; background: var(--bg-3); border-radius: 999px; overflow: hidden; flex: 1; min-width: 140px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 999px; transition: width 0.4s; }
.progress.over i { background: linear-gradient(90deg, var(--accent), var(--amber)); }

/* ── temp password reveal ── */
.secret {
  border: 1px solid rgba(255,179,0,0.4); background: rgba(255,179,0,0.07);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px;
  font-family: var(--mono); font-size: 13px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}
.secret code { color: var(--amber); font-size: 15px; font-weight: 700; }

/* ── toast ── */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--bg-3); border: 1px solid var(--accent-dim); color: var(--text);
  border-radius: 10px; padding: 10px 18px; font-family: var(--mono); font-size: 13px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5); z-index: 50; max-width: 90vw;
}
.toast--err { border-color: rgba(255,95,107,0.6); color: var(--red); }

/* ── utilities (CSP forbids inline styles — use these) ── */
.spacer { flex: 1; }
.dim { opacity: 0.55; }
.mut { color: var(--muted); }
.mono { font-family: var(--mono); }
.w100 { width: 100%; }
.gap6 { gap: 6px; }
.empty { color: var(--muted); padding: 18px; }
.lbl { font-family: var(--mono); font-size: 12px; color: var(--muted); }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .top__nav { order: 3; width: 100%; }
}

/* ── entrance animation ── same fade-up used on aws-ops-dashboard: applied
   once per render() (see armEnterOnce in app.js), not on every re-render, so
   it reads as a page settling in rather than flashing on every tab switch. */
.enter { animation: fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .enter, .cursor { animation: none; }
}
