:root {
  --primary: #1e5eb5;
  --primary-dark: #164a8c;
  --secondary: #f4f6f9;
  --accent: #22c55e;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --danger: #dc2626;
  --white: #ffffff;
}

* { box-sizing: border-box; }
body {
  font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  color: var(--text);
  background: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  border-bottom: 3px solid var(--primary);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  font-size: 1.25rem;
  text-decoration: none;
}
.logo-img { max-height: 40px; max-width: 160px; }
.logo-icon { width: 38px; height: 38px; }

.nav-pills {
  display: flex;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.nav-pills a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted);
  text-decoration: none;
  line-height: 1;
}
.nav-pills a:hover, .nav-pills a.active {
  background: var(--primary);
  color: #fff;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
  width: 100%;
  flex: 1;
}

h1 { font-size: 1.75rem; margin: 0 0 0.25rem; color: var(--primary-dark); }
h2 { font-size: 1.25rem; margin: 0 0 0.75rem; color: var(--primary); }
h3 { font-size: 1rem; margin: 1rem 0 0.5rem; color: var(--primary-dark); text-transform: uppercase; letter-spacing: 0.5px; }

p { margin: 0 0 1rem; line-height: 1.5; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.small { font-size: 0.85rem; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.input {
  width: 100%;
  height: 2.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  color: var(--text);
  font-family: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 94, 181, 0.1);
}
.input[readonly] { background: #f3f4f6; }
.textarea { height: auto; min-height: 6rem; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--text); border: 1px solid var(--border); }
.btn-success { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }

.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-row .field { flex: 1; margin-bottom: 0; }
.form-row.three .field { flex: 1; }

.actions-right { display: flex; gap: 0.75rem; }
.wizard-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}
.stepper .step {
  text-align: center;
  flex: 1;
  position: relative;
}
.stepper .step::after {
  content: '';
  position: absolute;
  top: 11px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}
.stepper .step:last-child::after { display: none; }
.stepper .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  position: relative;
  z-index: 1;
}
.stepper .step.active .dot { background: var(--primary); }
.stepper .step.done .dot { background: var(--accent); }
.stepper .label { display: block; margin-top: 4px; color: var(--muted); }
.stepper .step.active .label { color: var(--primary); font-weight: 700; }
.stepper .step.done .label { color: var(--accent); }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 600;
}
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-submitted { background: #dbeafe; color: #1e40af; }
.badge-approved { background: #d1fae5; color: #065f46; }

.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th, .table td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); }
.table th { background: var(--secondary); font-weight: 600; color: var(--muted); }
.table td input { width: 100%; }
.table-responsive { overflow-x: auto; }

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.two-col { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: 1.5rem; }
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-title { font-weight: 600; font-size: 1rem; }
.list-meta { font-size: 0.85rem; color: var(--muted); }
.list-actions { display: flex; gap: 0.5rem; align-items: center; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
}
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--muted); }

.note-box {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 0.75rem;
  font-size: 0.9rem;
  color: var(--primary-dark);
  border-radius: 0 5px 5px 0;
}

.approval-grid {
  display: grid;
  gap: 1rem;
}
.approval-card .approval-role {
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.quote-card { margin-bottom: 1rem; }
.quote-file-control { display: flex; align-items: center; gap: 0.5rem; }
.quote-file-name { font-size: 0.85rem; color: var(--muted); }

.settings-row { display: flex; gap: 1rem; margin-bottom: 1rem; align-items: center; }
.color-swatch { width: 40px; height: 40px; border-radius: 5px; border: 1px solid var(--border); }
.settings-label { font-weight: 600; font-size: 0.95rem; }
.logo-preview { min-height: 120px; display: flex; align-items: center; justify-content: center; background: var(--secondary); border: 1px dashed var(--border); border-radius: 5px; padding: 1rem; }
.placeholder-img { min-height: 120px; background: var(--secondary); border: 1px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 5px; }

.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}
.login-card { width: 100%; max-width: 420px; }

.flash-messages { margin-bottom: 1rem; }
.alert { padding: 0.75rem 1rem; border-radius: 5px; margin-bottom: 0.5rem; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }

.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

.error-page { text-align: center; padding: 3rem 1rem; }
.error-page h1 { font-size: 4rem; margin-bottom: 1rem; }

.footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #fff;
}
