/* QuoteJobPro — aqua-marine dark theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f1923;
  --surface:   #1a2535;
  --surface2:  #0d1520;
  --border:    #2a3a4e;
  --text:      #e2e8f0;
  --muted:     #94a3b8;
  --primary:   #06b6d4;
  --primary-d: #0891b2;
  --green:     #22c55e;
  --red:       #ef4444;
  --blue:      #3b82f6;
  --radius:    8px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; min-height: 100vh; }

#app { min-height: 100vh; }
.hidden { display: none !important; }

/* ── Sidebar ── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 220px; background: var(--surface2); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
.sidebar.open { transform: none; }
@media (min-width: 768px) { .sidebar { transform: none; } .main-content { margin-left: 220px; } }
.sidebar-logo { padding: 24px 20px 20px; font-size: 22px; font-weight: 800; color: var(--text); border-bottom: 1px solid var(--border); letter-spacing: -.3px; }
.sidebar-logo span { color: var(--primary); }
.sidebar-nav { flex: 1; padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, color .15s; border: none; background: none; width: 100%; text-align: left; }
.nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link:hover, .nav-link.active { background: rgba(6,182,212,.12); color: var(--primary); }
.sidebar-user { padding: 16px; border-top: 1px solid var(--border); }
.user-row { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-email { font-size: 11px; color: var(--muted); }

.main-content { padding: 24px 20px; max-width: 900px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.menu-btn { display: flex; background: none; border: none; color: var(--muted); cursor: pointer; padding: 4px; }
@media (min-width: 768px) { .menu-btn { display: none; } }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; display: none; }
.overlay.show { display: block; }

/* ── Login ── */
#page-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 40px 32px; width: 100%; max-width: 400px; }
.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.login-logo h1 span { color: var(--primary); }
.login-logo .icon { font-size: 48px; margin-bottom: 8px; }
.login-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 32px; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
label, .form-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { resize: vertical; min-height: 100px; }
select option { background: var(--surface2); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: background .15s, opacity .15s; white-space: nowrap; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-d); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,.05); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn-danger { background: #7f1d1d; color: #fca5a5; border: 1px solid #991b1b; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 20px; font-size: 16px; width: 100%; justify-content: center; }
.btn-icon { padding: 8px; border-radius: var(--radius); background: none; border: 1px solid var(--border); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; }
.btn-icon:hover { color: var(--text); border-color: var(--text); }

/* ── Cards ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.card-body { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 16px; }

/* ── Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 28px; }
@media (min-width: 640px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; }

/* ── Quote rows ── */
.quote-row { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.quote-row:last-child { border-bottom: none; }
.quote-row:hover { background: rgba(6,182,212,.06); }
.quote-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quote-customer { font-weight: 600; font-size: 15px; }
.quote-amount { font-weight: 800; font-size: 16px; color: var(--primary); }
.quote-meta { font-size: 12px; color: var(--muted); }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.badge-draft    { background: rgba(148,163,184,.15); color: #94a3b8; }
.badge-sent     { background: rgba(59,130,246,.15);  color: #60a5fa; }
.badge-accepted { background: rgba(34,197,94,.15);   color: #4ade80; }
.badge-declined { background: rgba(239,68,68,.15);   color: #f87171; }
.badge-expired  { background: rgba(245,158,11,.15);  color: #fbbf24; }

/* ── Price summary ── */
.price-summary { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-top: 4px; }
.price-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 4px 0; }
.price-total { display: flex; justify-content: space-between; font-size: 22px; font-weight: 800; color: var(--primary); padding-top: 10px; margin-top: 6px; border-top: 2px solid var(--primary); }

/* ── Pricing grid ── */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 500px) { .pricing-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Timeline ── */
.timeline { position: relative; }
.tl-item { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-icon-wrap { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.tl-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.tl-line { width: 2px; flex: 1; background: var(--border); margin-top: 4px; min-height: 18px; }
.tl-content { flex: 1; min-width: 0; padding-top: 4px; }
.tl-label { font-size: 13px; font-weight: 600; }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-time { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* ── Scope toolbar ── */
.scope-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.scope-actions { display: flex; gap: 6px; }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Grid helpers ── */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .row2, .row3 { grid-template-columns: 1fr; } }

/* ── Toast ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 18px; font-size: 13px; font-weight: 600; max-width: 320px; box-shadow: var(--shadow); animation: slideIn .2s ease; }
.toast-ok  { border-left: 3px solid var(--green); }
.toast-err { border-left: 3px solid var(--red); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } }

/* ── Spinner ── */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(6,182,212,.3); border-top-color: var(--primary); border-radius: 50%; animation: spin .6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Record button ── */
.btn-record { background: none; border: 1px solid var(--border); border-radius: var(--radius); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; padding: 8px; transition: all .15s; }
.btn-record.recording { border-color: var(--red); color: var(--red); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.5} }

/* ── Misc ── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.detail-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--muted); }
.search-input { position: relative; }
.search-input input { padding-left: 36px; }
.search-input svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.back-btn { background: none; border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 20px; }
.back-btn:hover { color: var(--text); }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; width: 100%; max-width: 460px; padding: 28px; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.modal-actions { display: flex; flex-direction: column; gap: 10px; }
svg.icon { width: 16px; height: 16px; vertical-align: middle; }
