/* ============================================================
   ALIS Valve Configurator — visual system
   Palette: graphite / steel-blue with a brass accent, echoing
   the metal the product itself is made from.
   ============================================================ */

:root {
  --graphite-950: #14181d;
  --graphite-900: #1b2129;
  --graphite-800: #262e38;
  --steel-700:    #3a4a58;
  --steel-500:    #5c7284;
  --steel-300:    #93a6b3;
  --steel-100:    #dbe3e8;
  --bg:           #f3f4f2;
  --panel:        #ffffff;
  --brass-600:    #a8752f;
  --brass-500:    #c08a3e;
  --brass-100:    #f3e6d0;
  --ok-600:       #2f7a4f;
  --warn-600:     #b5651d;
  --danger-600:   #ab3131;
  --text:         #1c2126;
  --text-muted:   #5b6670;
  --radius:       6px;
  --font-display: 'Barlow Semi Condensed', 'Oswald', 'Segoe UI', sans-serif;
  --font-body:    'Inter', 'Segoe UI', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;
}

/* Google Fonts are loaded via <link> tags in the page <head> (see
   includes/header.php and login.php), not via @import here — an
   @import inside this stylesheet breaks Paged.js's print pagination
   (it tries to fetch and parse the imported URL itself and fails on
   the cross-origin request). */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0.01em; margin: 0 0 0.4em; }

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--graphite-950);
  color: var(--steel-100);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.brand-mark {
  width: 34px; height: 34px;
  background: linear-gradient(155deg, var(--brass-500), var(--brass-600));
  color: var(--graphite-950);
  font-family: var(--font-display);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
  font-size: 1.1rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.08em; }
.brand-text small { color: var(--steel-300); font-size: 0.7rem; letter-spacing: 0.04em; }

.nav { display: flex; flex-direction: column; padding: 14px 10px; gap: 2px; flex: 1; }
.nav a {
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--steel-100);
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,0.06); }
.nav a.active {
  background: rgba(192,138,62,0.14);
  border-left-color: var(--brass-500);
  color: #fff;
}

.sidebar-foot {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.who { display: flex; flex-direction: column; line-height: 1.2; }
.who-name { font-size: 0.85rem; font-weight: 600; }
.who-role { font-size: 0.72rem; color: var(--steel-300); text-transform: uppercase; letter-spacing: 0.05em; }
.logout-link { font-size: 0.78rem; color: var(--brass-500); font-weight: 600; }
.logout-link:hover { text-decoration: underline; }

.content { flex: 1; padding: 32px 40px; max-width: 1200px; }

/* ---------- Page header ---------- */
.page-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 10px;
}
.page-head h1 { font-size: 1.6rem; color: var(--graphite-900); }
.page-head .sub { color: var(--text-muted); font-size: 0.9rem; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--steel-100);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.05rem; color: var(--graphite-900); }
.card h2 .eyebrow { display:block; font-size: 0.7rem; color: var(--brass-600); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-bottom: 2px; }

.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--steel-100); border-left: 4px solid var(--brass-500); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-family: var(--font-display); font-size: 1.9rem; color: var(--graphite-900); line-height: 1; }
.stat .label { color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--steel-700); margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--steel-100);
  border-radius: var(--radius);
  background: #fbfcfb;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(192,138,62,0.15);
}
.field { margin-bottom: 16px; }
.spec-chk { width: 15px; height: 15px; margin: 0; flex-shrink: 0; accent-color: var(--brass-600); cursor: pointer; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.88rem; cursor: pointer;
  font-family: var(--font-body);
}
.btn-primary { background: var(--graphite-950); color: #fff; }
.btn-primary:hover { background: var(--graphite-800); }
.btn-accent { background: var(--brass-500); color: #201406; }
.btn-accent:hover { background: var(--brass-600); }
.btn-ghost { background: transparent; border-color: var(--steel-100); color: var(--steel-700); }
.btn-ghost:hover { border-color: var(--steel-300); }
.btn-danger { background: #fff; border-color: var(--danger-600); color: var(--danger-600); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--steel-100); }
th { color: var(--text-muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
tr:hover td { background: #fafbfa; }
.text-right { text-align: right; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-draft    { background: #e9edf0; color: var(--steel-700); }
.badge-sent     { background: #fde9d0; color: var(--warn-600); }
.badge-approved { background: #dcf0e3; color: var(--ok-600); }
.badge-rejected { background: #f6dede; color: var(--danger-600); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 0.88rem; margin-bottom: 18px; }
.alert-error { background: #f6dede; color: var(--danger-600); border: 1px solid #edb9b9; }
.alert-ok { background: #dcf0e3; color: var(--ok-600); border: 1px solid #b6ddc3; }
.alert-info { background: #fdf3e4; color: var(--brass-600); border: 1px solid #efd6a8; }

/* ---------- Login page ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 20% 20%, #232b33, var(--graphite-950) 60%);
}
.login-card {
  width: 380px; background: var(--panel); border-radius: 10px;
  padding: 40px 34px; box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.login-mark {
  width: 46px; height: 46px; border-radius: 8px; margin-bottom: 18px;
  background: linear-gradient(155deg, var(--brass-500), var(--brass-600));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; color: var(--graphite-950); font-size: 1.3rem;
}
.login-card h1 { font-size: 1.3rem; margin-bottom: 2px; }
.login-card p.sub { color: var(--text-muted); font-size: 0.86rem; margin-bottom: 22px; }

/* ---------- Other-toggle inputs ---------- */
.other-inp { display: none; margin-top: 6px; }
.other-inp.show { display: block; }

/* ---------- Wizard ---------- */
.wizard-steps { display: flex; align-items: center; margin-bottom: 24px; }
.wizard-step { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.wizard-circle { width: 30px; height: 30px; border-radius: 50%; background: var(--steel-100); color: var(--steel-700); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; font-family: var(--font-display); flex-shrink: 0; }
.wizard-step.done .wizard-circle { background: var(--ok-600); color: #fff; }
.wizard-step.current .wizard-circle { background: var(--brass-500); color: #201406; }
.wizard-label { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.wizard-step.current .wizard-label { color: var(--graphite-900); }
.wizard-conn { flex: 1; height: 2px; background: var(--steel-100); margin: 0 14px; }
.sec-title { font-size: 0.8rem; font-weight: 700; color: var(--brass-600); text-transform: uppercase; letter-spacing: 0.04em; margin: 22px 0 12px; padding-top: 14px; border-top: 1px solid var(--steel-100); }
.chooser-card { transition: border-color 0.15s, box-shadow 0.15s; }
.chooser-card:hover { border-color: var(--brass-500) !important; box-shadow: 0 4px 14px rgba(192,138,62,0.15); }
.sec-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.price-row { display: flex; justify-content: space-between; padding: 7px 0; font-size: 0.88rem; border-bottom: 1px dashed var(--steel-100); }
.price-row .lbl { color: var(--text-muted); }
.price-row .val { font-weight: 600; }
.pill-warn { display:inline-block; background:#fde9d0; color:var(--warn-600); font-size:0.75rem; font-weight:700; padding:3px 9px; border-radius:999px; }
.pill-ok { display:inline-block; background:#dcf0e3; color:var(--ok-600); font-size:0.75rem; font-weight:700; padding:3px 9px; border-radius:999px; }

/* ---------- Configurator ---------- */
.line-items-table input[type=number] { width: 80px; }
.spec-chip { display: inline-block; background: var(--brass-100); color: var(--brass-600); font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; margin-right: 4px; }
.summary-box { background: var(--graphite-950); color: #fff; border-radius: var(--radius); padding: 20px 22px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.9rem; color: var(--steel-100); }
.summary-row.total { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 8px; padding-top: 12px; font-family: var(--font-display); font-size: 1.25rem; color: #fff; }

/* ---------- Quotation content tables (used in both the on-screen view
   and the dedicated print view — see quotation_print.php) ---------- */
.quotation-content table {
  border: 1px solid var(--graphite-900);
  margin-bottom: 4px;
  border-collapse: collapse;
}
.quotation-content th, .quotation-content td {
  border: 1px solid var(--graphite-900);
  padding: 7px 10px;
  vertical-align: top;
}
.quotation-content th {
  background: #eef1ee;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
  font-size: 0.78rem;
}

@media print {
  .no-print { display: none !important; }
  .sidebar { display: none !important; }
  .content { padding: 0; max-width: 100%; }
  body { background: #fff; }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { position: relative; height: auto; width: 100%; }
  .content { padding: 20px; }
}
