/* Alwaseet Quotes — application stylesheet */
:root {
  --brand: #0e7490;          /* cyan-700 */
  --brand-dark: #155e75;
  --ink: #1f2937;            /* slate-800 */
  --muted: #6b7280;          /* gray-500 */
  --line: #e2e8f0;           /* slate-200 */
  --bg: #f1f5f9;             /* slate-100 */
  --card: #ffffff;
  --accent: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
}

* { box-sizing: border-box; }

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

/* ---------- top bar ---------- */
.topbar {
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.18); font-size: 14px; letter-spacing: .5px;
}
.brand-name { font-size: 17px; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  color: #e0f2fe; text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 7px 12px; border-radius: 7px;
}
.nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.who { opacity: .9; }
.logout-form { margin: 0; }
.btn-link {
  background: rgba(255,255,255,.16); color: #fff; border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 7px; font: inherit; font-size: 13px;
}
.btn-link:hover { background: rgba(255,255,255,.28); }

/* ---------- layout ---------- */
.container { max-width: 1080px; margin: 28px auto; padding: 0 20px; }
.footer {
  max-width: 1080px; margin: 40px auto 28px; padding: 0 20px;
  color: var(--muted); font-size: 13px; text-align: center;
}

h1 { font-size: 24px; margin: 0 0 18px; }
h2 { font-size: 17px; margin: 26px 0 12px; color: var(--ink); }
a { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------- cards ---------- */
section, .card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  margin-bottom: 18px;
}

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); margin: 6px 0 18px; }
thead th { background: #f8fafc; color: var(--muted); text-align: left;
  font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); }
td, tbody th { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
tfoot th { padding: 12px 14px; background: #f8fafc; text-align: left; }
tfoot th:last-child { text-align: right; color: var(--green); }

/* ---------- forms ---------- */
form p { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--ink); }
input, select, textarea {
  width: 100%; max-width: 420px; padding: 9px 11px; font: inherit;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: var(--ink);
}
input[type="checkbox"] { width: auto; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,116,144,.15);
}
.helptext { color: var(--muted); font-size: 12px; }
ul.errorlist { color: var(--red); font-size: 13px; margin: 4px 0; padding-left: 18px; }

/* ---------- buttons ---------- */
button[type="submit"], .button {
  background: var(--brand); color: #fff; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); text-decoration: none; display: inline-block;
}
button[type="submit"]:hover, .button:hover { background: var(--brand-dark); }

/* ---------- toolbar (search / actions row) ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar form { display: flex; gap: 8px; margin: 0; }
.toolbar input[type="search"] { min-width: 260px; }

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; }
.pill-draft { background: #e2e8f0; color: #475569; }
.pill-sent  { background: #dbeafe; color: #1d4ed8; }
.pill-won   { background: #dcfce7; color: #15803d; }
.pill-lost  { background: #fee2e2; color: #b91c1c; }
.pill-archived { background: #fef3c7; color: #92400e; }
.status-form { margin: 0 0 1rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* ---------- dashboard expiry buckets ---------- */
tr.red    td:first-child { box-shadow: inset 4px 0 0 var(--red); }
tr.amber  td:first-child { box-shadow: inset 4px 0 0 var(--amber); }
tr.green  td:first-child { box-shadow: inset 4px 0 0 var(--green); }
.bucket { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.bucket.red   { background: #fee2e2; color: #b91c1c; }
.bucket.amber { background: #fef3c7; color: #b45309; }
.bucket.green { background: #dcfce7; color: #15803d; }

/* ---------- summary stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 24px; font-weight: 700; margin-top: 4px; }

/* ---------- totals box (quote builder + detail) ---------- */
.totals { background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; display: inline-block; min-width: 280px; }
.totals .grand { font-size: 18px; font-weight: 700; color: var(--brand-dark); }

/* ---------- internal (operator-only) panel ---------- */
.internal-panel { border: 1px solid #fecaca; background: #fff7f7; }
.internal-panel h2 { color: var(--red); margin-top: 0; }
.internal-panel table { box-shadow: none; }

/* ---------- login ---------- */
.login-wrap { max-width: 380px; margin: 8vh auto 0; }
.login-wrap .card { padding: 28px; }
.login-wrap h1 { text-align: center; }

/* ---------- quote builder line-item table ---------- */
#lines input, #lines select { max-width: 100%; min-width: 60px; padding: 7px 9px; }
#lines td { padding: 8px; }
#lines .sell, #lines .ltot { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
#add-line {
  background: #fff; color: var(--brand-dark); border: 2px dashed var(--brand);
  border-radius: 8px; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
#add-line:hover { background: #ecfeff; border-style: solid; }

/* ---------- misc ---------- */
.muted { color: var(--muted); }
.actions { margin: 16px 0; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- ops workspace ---------- */
/* Everything below is scoped to body.ops-body — the /ops/ surface used by the
   operator. Same brand palette as the rest of the site; only sizes, spacing and
   touch targets grow. Owner pages ('/') are unaffected. */
.ops-body { font-size: 17px; }
.ops-body h1 { font-size: 28px; margin-bottom: 22px; }
.ops-body h2, .ops-body h3 { font-size: 20px; }
.ops-body .container { max-width: 920px; }
.ops-body p { font-size: 17px; }

/* top bar — same brand look, larger touch targets (min 44px) */
.ops-body .topbar-inner { min-height: 66px; padding: 8px 20px; }
.ops-body .brand-name { font-size: 19px; }
.ops-body .nav a {
  font-size: 17px; font-weight: 600; min-height: 44px;
  display: inline-flex; align-items: center;
  padding: 8px 20px; border-radius: 9px; background: rgba(255,255,255,.12);
}
.ops-body .nav a:hover { background: rgba(255,255,255,.24); }
.ops-body .nav-user { font-size: 16px; gap: 14px; }
.ops-body .btn-link {
  min-height: 44px; padding: 8px 20px; font-size: 16px; font-weight: 600;
  border-radius: 9px; display: inline-flex; align-items: center;
}

/* forms — bigger type, ~40px-tall inputs */
.ops-body label { font-size: 15px; }
.ops-body input, .ops-body select, .ops-body textarea {
  font-size: 16px; padding: 9px 12px; min-height: 40px; border-radius: 9px;
}
.ops-body textarea { min-height: 72px; }

/* tables — roomier cells, larger text */
.ops-body thead th { font-size: 13px; padding: 12px 14px; }
.ops-body td { padding: 12px 14px; font-size: 16px; }

/* line-item entry table — inputs fill their cells at full touch size */
.ops-body #line-rows td { padding: 8px; }
.ops-body #line-rows input, .ops-body #line-rows select {
  max-width: 100%; min-width: 64px; padding: 9px 10px; min-height: 40px; font-size: 16px;
}
.ops-body #line-rows input[type="checkbox"] { min-width: 22px; min-height: 22px; width: 22px; height: 22px; }

/* buttons — real buttons, min ~46px tall */
.ops-body button[type="submit"], .ops-body .button {
  min-height: 46px; font-size: 17px; padding: 11px 24px; border-radius: 9px;
}
.ops-body .ops-add-line {
  background: #fff; color: var(--brand-dark); border: 2px dashed var(--brand);
  box-shadow: none; cursor: pointer; font: inherit; font-weight: 600;
  min-height: 46px; font-size: 17px; padding: 10px 22px; border-radius: 9px;
}
.ops-body .ops-add-line:hover { background: #ecfeff; border-style: solid; }
.ops-body .ops-btn-block {
  display: flex; width: 100%; justify-content: center; align-items: center;
  min-height: 58px; font-size: 19px; margin: 0 0 22px;
}

/* home screen card list */
.ops-cards { display: flex; flex-direction: column; gap: 14px; }
.ops-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; color: var(--ink);
}
a.ops-card:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(14,116,144,.20); }
.ops-card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ops-card-number { font-size: 19px; font-weight: 700; color: var(--brand-dark); }
.ops-card-customer { font-size: 17px; color: var(--ink); }
.ops-card.ops-empty { justify-content: center; color: var(--muted); font-size: 17px; padding: 36px 20px; }

/* status pills sized up for readability */
.ops-body .pill { font-size: 14px; padding: 6px 14px; }
