@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* Dark theme (default) */
  --bg: #0e0d0f;
  --surface: #19181b;
  --surface-raised: #221f22;
  --border: #2e2a2c;
  --rim: #7a1f1f;
  --rim-bright: #a5312f;
  --text: #f2efe9;
  --text-muted: #9a948d;
  --good: #4c8a5e;
  --good-bg: rgba(76, 138, 94, 0.14);
  --warn: #c9a227;
  --warn-bg: rgba(201, 162, 39, 0.14);
  --danger: #b8433f;
  --danger-bg: rgba(184, 67, 63, 0.14);

  --font-display: 'Big Shoulders Display', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-raised: #f0ebe1;
  --border: #e2dcd0;
  --rim: #7a1f1f;
  --rim-bright: #9c2b2b;
  --text: #1c1a18;
  --text-muted: #6b655e;
  --good: #2f6b3f;
  --good-bg: rgba(47, 107, 63, 0.10);
  --warn: #8a6d1c;
  --warn-bg: rgba(138, 109, 28, 0.12);
  --danger: #9c2b28;
  --danger-bg: rgba(156, 43, 40, 0.10);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}

a { color: inherit; }

button {
  font-family: var(--font-body);
  cursor: pointer;
}

/* ============ LAYOUT ============ */

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sidebar-header img { width: 26px; height: 26px; }

.sidebar-header .wordmark {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--surface-raised); color: var(--text); }
.nav-item.active { background: var(--surface-raised); color: var(--text); border-left: 3px solid var(--rim); padding-left: 9px; }

.nav-item .pip { color: var(--rim); flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  width: 100%;
}

.main {
  padding: 32px 40px;
  max-width: 1200px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.topbar .company-name {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.page-title {
  font-size: 26px;
  margin-bottom: 4px;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}

/* ============ COMPONENTS ============ */

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  width: 260px;
}

.search-box svg { color: var(--text-muted); flex-shrink: 0; }

.search-box input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13.5px;
  width: 100%;
}

.search-box input::placeholder { color: var(--text-muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 16px;
}

.card-hover:hover {
  border-color: var(--rim);
  cursor: pointer;
}

.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}

.site-row:last-child { border-bottom: none; }

.status-pip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-pip.green { color: var(--good); background: var(--good-bg); }
.status-pip.yellow { color: var(--warn); background: var(--warn-bg); }
.status-pip.red { color: var(--danger); background: var(--danger-bg); }

.status-pip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.btn:hover { border-color: var(--rim); }

.btn-primary {
  background: var(--rim);
  border-color: var(--rim);
  color: #f7ede9;
}

.btn-primary:hover { background: var(--rim-bright); border-color: var(--rim-bright); }

.btn-sm { padding: 6px 12px; font-size: 12px; }

input, select {
  font-family: var(--font-body);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

input:focus, select:focus { border-color: var(--rim); }

label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.field { margin-bottom: 14px; }

.error-banner {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ============ ROSTER GRID ============ */

.roster-grid-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table.roster-grid {
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12.5px;
  width: 100%;
}

.roster-grid th, .roster-grid td {
  padding: 8px 10px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.roster-grid th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 11px;
  background: var(--surface);
}

.roster-grid td.worker-name {
  font-family: var(--font-body);
  text-align: left;
  font-weight: 600;
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
}

.shift-D { color: var(--warn); font-weight: 600; }
.shift-N { color: var(--text-muted); font-weight: 600; }
.shift-A { color: var(--rim-bright); font-weight: 600; }
.shift-X { color: var(--border); }

/* ============ LOGIN ============ */

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.login-watermark {
  position: absolute;
  width: 900px;
  height: 900px;
  opacity: 0.09;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 340px;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.login-card .sidebar-header { border: none; margin-bottom: 24px; padding: 0; }

.login-title { font-size: 22px; margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 24px; }

.full-width { width: 100%; }

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px; }
}
