/* WOMS · Shared styles — simple, functional, readable */
* { box-sizing: border-box; }
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --muted: #6b7280;
  --primary: #0f766e;
  --primary-hover: #0d5e58;
  --danger: #dc2626;
  --warning: #d97706;
  --success: #16a34a;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d12;
    --surface: #151921;
    --border: #2a2f3a;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --primary: #14b8a6;
    --primary-hover: #0d9488;
  }
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* Layout */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topbar h1 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: 0.9rem; }

.container { max-width: 1200px; margin: 2rem auto; padding: 0 1rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 { margin-top: 0; font-size: 1.1rem; }

/* Login centered */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}
.login-card p.sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Forms */
label { display: block; margin-bottom: 0.25rem; font-size: 0.85rem; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
button {
  padding: 0.6rem 1.2rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  cursor: pointer;
  font-weight: 500;
}
button:hover { background: var(--primary-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary { background: transparent; color: var(--primary); border: 1px solid var(--border); }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
th { font-weight: 600; color: var(--muted); background: color-mix(in srgb, var(--bg) 50%, transparent); }
tr:hover td { background: color-mix(in srgb, var(--primary) 5%, transparent); }

/* Status badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge.unassigned { background: #fef3c7; color: #92400e; }
.badge.assigned { background: #dbeafe; color: #1e40af; }
.badge.in_progress { background: #e0e7ff; color: #3730a3; }
.badge.reported { background: #d1fae5; color: #065f46; }
.badge.cancelled { background: #fee2e2; color: #991b1b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.unassigned { background: #78350f; color: #fde68a; }
  :root:not([data-theme="light"]) .badge.assigned { background: #1e3a8a; color: #bfdbfe; }
  :root:not([data-theme="light"]) .badge.in_progress { background: #312e81; color: #c7d2fe; }
  :root:not([data-theme="light"]) .badge.reported { background: #064e3b; color: #a7f3d0; }
  :root:not([data-theme="light"]) .badge.cancelled { background: #7f1d1d; color: #fecaca; }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tabs a {
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.kpi .label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; }
.kpi .value { font-size: 1.6rem; font-weight: 600; margin-top: 0.25rem; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.right { text-align: right; }

@media (max-width: 640px) {
  .container { margin: 1rem auto; }
  .card { padding: 1rem; }
  th, td { padding: 0.4rem; font-size: 0.8rem; }
}
