:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #e2e6ec;
  --text-primary: #1a1d29;
  --text-secondary: #6b7280;
  --accent: #2f6fed;
  --accent-hover: #2559c7;
  --danger: #d64545;
  --success: #1f9d55;
  --warning: #d99a1b;
  --sidebar-bg: #14182b;
  --sidebar-text: #aab0c6;
  --sidebar-text-active: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 24, 43, 0.06), 0 1px 3px rgba(20, 24, 43, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
}

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

/* ---------- Login page ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}

.auth-card h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
}

.auth-card p.sub {
  color: var(--text-secondary);
  margin: 0 0 28px;
  font-size: 13px;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: #fafbfc;
  transition: border-color 0.15s ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-block { width: 100%; }

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}
.alert-error { background: #fdecec; color: var(--danger); border: 1px solid #f6c9c9; }
.alert-success { background: #e9f8ee; color: var(--success); border: 1px solid #bfe8cd; }

/* ---------- Dashboard shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}

.sidebar .brand {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  padding: 8px 10px 20px;
}

.sidebar nav { flex: 1; }

.sidebar .nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5c6280;
  padding: 16px 10px 6px;
}

.sidebar a.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  margin-bottom: 2px;
}

.sidebar a.nav-link:hover { background: rgba(255,255,255,0.06); text-decoration: none; }
.sidebar a.nav-link.active { background: var(--accent); color: #fff; }

.sidebar .nav-link .count {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
}
.sidebar a.nav-link.active .count { background: rgba(255,255,255,0.25); }

.sidebar .sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 12px;
  margin-top: 12px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar h2 { font-size: 16px; font-weight: 600; margin: 0; }

.content { padding: 24px; flex: 1; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.empty-state {
  text-align: center;
  color: var(--text-secondary);
  padding: 60px 20px;
}

/* ---------- Phase 3: tables, badges, quote views ---------- */
table th { font-weight: 600; color: var(--text-secondary); }
table tbody tr:hover { background: #fafbfc; }
.btn-block { width: 100%; }
