/* ═══════════════════════════════════════════════════════════
   OBHOLZ SOLUTIONS — Customer Dashboard
   OS Light Theme
   ═══════════════════════════════════════════════════════════ */

:root {
  --os-bg: #ffffff;
  --os-text: #0a0a0b;
  --os-muted: #6b6b70;
  --os-line: #e6e6e8;
  --os-accent: #e11f2e;
  --os-accent-hover: #c4192a;
  --os-success: #249e57;
  --os-warning: #d97706;
  --os-danger: #dc2626;
  --os-surface: #f8f9fa;
  --os-radius: 10px;
  --os-radius-sm: 6px;
  --os-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --os-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --os-sidebar-w: 260px;
  --os-transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--os-text);
  background: var(--os-surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--os-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Screen ─────────────────────────────────────── */

.login-overlay {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--os-surface);
  z-index: 900;
}

.login-card {
  width: 100%; max-width: 400px;
  background: var(--os-bg);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius);
  box-shadow: var(--os-shadow-md);
  padding: 48px 36px;
  text-align: center;
}

.login-card img { width: 56px; margin-bottom: 20px; }

.login-card h1 {
  font-size: 1.25rem; font-weight: 600;
  letter-spacing: .04em; margin: 0 0 8px;
}

.login-card .subtitle {
  font-size: .85rem; color: var(--os-muted);
  margin: 0 0 28px;
}

.login-card .success-msg {
  font-size: .875rem; color: var(--os-success);
  margin-top: 16px; display: none;
}

/* ── Layout ───────────────────────────────────────────── */

.app-container {
  display: flex; min-height: 100vh;
}

.sidebar {
  width: var(--os-sidebar-w); flex-shrink: 0;
  background: var(--os-bg);
  border-right: 1px solid var(--os-line);
  display: flex; flex-direction: column;
  padding: 28px 0;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 800;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--os-line);
  margin-bottom: 8px;
}

.sidebar-brand .brand-name {
  font-size: .8rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--os-text); margin: 0;
}

.sidebar-brand .brand-claim {
  font-size: .7rem; font-weight: 400;
  color: var(--os-muted); letter-spacing: .04em;
  margin: 4px 0 0;
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 24px;
  font-size: .875rem; font-weight: 500;
  color: var(--os-muted);
  transition: color var(--os-transition), background var(--os-transition);
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--os-text);
  background: var(--os-surface);
}

.sidebar-nav a.active {
  border-right: 3px solid var(--os-accent);
  font-weight: 600;
}

.sidebar-nav a svg {
  width: 18px; height: 18px; flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.sidebar-footer {
  padding: 16px 24px 0;
  border-top: 1px solid var(--os-line);
}

.sidebar-footer button {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .8rem; font-weight: 500;
  color: var(--os-muted); padding: 0;
  transition: color var(--os-transition);
}

.sidebar-footer button:hover { color: var(--os-accent); }

.main {
  flex: 1;
  margin-left: var(--os-sidebar-w);
  padding: 36px 40px 60px;
  max-width: 1100px;
}

.page-title {
  font-size: 1.4rem; font-weight: 700;
  margin: 0 0 6px;
}

.page-subtitle {
  font-size: .875rem; color: var(--os-muted);
  margin: 0 0 28px;
}

/* ── Hamburger ────────────────────────────────────────── */

.hamburger {
  display: none;
  position: fixed; top: 14px; left: 14px;
  z-index: 850;
  background: var(--os-bg); border: 1px solid var(--os-line);
  border-radius: var(--os-radius-sm);
  width: 40px; height: 40px;
  cursor: pointer; align-items: center; justify-content: center;
  box-shadow: var(--os-shadow);
}

.hamburger svg {
  width: 20px; height: 20px;
  stroke: var(--os-text); fill: none;
  stroke-width: 2; stroke-linecap: round;
}

/* ── Cards ────────────────────────────────────────────── */

.card {
  background: var(--os-bg);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius);
  box-shadow: var(--os-shadow);
  padding: 24px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card-clickable { cursor: pointer; transition: box-shadow var(--os-transition), border-color var(--os-transition); }
.card-clickable:hover { box-shadow: var(--os-shadow-md); border-color: #d0d0d4; }

/* ── KPI Cards ────────────────────────────────────────── */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-bottom: 32px;
}

.kpi-card {
  background: var(--os-bg);
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius);
  box-shadow: var(--os-shadow);
  padding: 20px 24px;
}

.kpi-card .kpi-value {
  font-size: 2rem; font-weight: 700;
  line-height: 1.1; margin: 0;
}

.kpi-card .kpi-label {
  font-size: .75rem; font-weight: 500;
  color: var(--os-muted);
  letter-spacing: .05em; text-transform: uppercase;
  margin: 6px 0 0;
}

/* ── Status Badges ────────────────────────────────────── */

.badge {
  display: inline-block;
  font-size: .7rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

.badge-success { background: #e6f7ee; color: var(--os-success); }
.badge-danger  { background: #fde8e8; color: var(--os-danger); }
.badge-warning { background: #fef3c7; color: var(--os-warning); }
.badge-neutral { background: var(--os-surface); color: var(--os-muted); }

/* ── Phase Stepper ────────────────────────────────────── */

.stepper { display: flex; align-items: center; gap: 0; margin: 12px 0; }

.stepper-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--os-line); flex-shrink: 0;
  position: relative;
}

.stepper-dot.done { background: var(--os-success); }
.stepper-dot.current { background: var(--os-accent); box-shadow: 0 0 0 4px rgba(225,31,46,.15); }

.stepper-line {
  flex: 1; height: 2px;
  background: var(--os-line); min-width: 12px;
}

.stepper-line.done { background: var(--os-success); }

.stepper-labels {
  display: flex; justify-content: space-between;
  margin-top: 6px;
}

.stepper-label {
  font-size: .65rem; font-weight: 500;
  color: var(--os-muted); text-align: center;
  flex: 1;
}

.stepper-label.done { color: var(--os-success); }
.stepper-label.current { color: var(--os-accent); font-weight: 700; }

/* ── Tables ───────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }

table {
  width: 100%; border-collapse: collapse;
  font-size: .875rem;
}

th {
  text-align: left; font-weight: 600;
  font-size: .7rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--os-muted);
  padding: 10px 16px;
  border-bottom: 2px solid var(--os-line);
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--os-line);
}

tr:hover td { background: var(--os-surface); }

/* ── Tabs ─────────────────────────────────────────────── */

.tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--os-line);
  margin-bottom: 24px;
}

.tab-btn {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .85rem; font-weight: 500;
  color: var(--os-muted); padding: 10px 20px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--os-transition), border-color var(--os-transition);
}

.tab-btn:hover { color: var(--os-text); }
.tab-btn.active { color: var(--os-accent); border-bottom-color: var(--os-accent); font-weight: 600; }

/* ── Forms ────────────────────────────────────────────── */

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--os-muted); letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 6px;
}

.form-input {
  width: 100%; padding: 10px 14px;
  font-family: inherit; font-size: .9rem;
  border: 1px solid var(--os-line);
  border-radius: var(--os-radius-sm);
  background: var(--os-bg); color: var(--os-text);
  transition: border-color var(--os-transition), box-shadow var(--os-transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--os-accent);
  box-shadow: 0 0 0 3px rgba(225,31,46,.1);
}

.form-input:disabled {
  background: var(--os-surface); color: var(--os-muted);
  cursor: not-allowed;
}

textarea.form-input { resize: vertical; min-height: 100px; }

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; font-size: .85rem; font-weight: 600;
  padding: 10px 22px; border-radius: var(--os-radius-sm);
  cursor: pointer; transition: all var(--os-transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--os-accent); color: #fff;
  border-color: var(--os-accent);
}

.btn-primary:hover { background: var(--os-accent-hover); }

.btn-secondary {
  background: transparent; color: var(--os-text);
  border-color: var(--os-line);
}

.btn-secondary:hover { border-color: var(--os-text); }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Toast ────────────────────────────────────────────── */

.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 950; display: flex; flex-direction: column-reverse;
  gap: 10px;
}

.toast {
  background: var(--os-text); color: #fff;
  font-size: .85rem; font-weight: 500;
  padding: 12px 20px; border-radius: var(--os-radius-sm);
  box-shadow: var(--os-shadow-md);
  animation: toast-in 300ms ease forwards;
  max-width: 360px;
}

.toast.toast-error { background: var(--os-danger); }
.toast.toast-success { background: var(--os-success); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Spinner ──────────────────────────────────────────── */

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--os-line);
  border-top-color: var(--os-accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty-state {
  text-align: center; padding: 48px 20px;
  color: var(--os-muted); font-size: .9rem;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 768px) {
  .hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 250ms ease;
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; padding: 68px 20px 40px; }

  .kpi-row { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr; }

  .stepper-labels { display: none; }
}

@media (max-width: 480px) {
  .kpi-row { grid-template-columns: 1fr; }
  .login-card { margin: 16px; padding: 32px 24px; }
  .tabs { overflow-x: auto; }
  .tab-btn { white-space: nowrap; padding: 10px 14px; font-size: .8rem; }
}
