/* ── Reset & Base ─────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0f0f0f; color: #ccc; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; min-height: 100vh; }
a { color: inherit; text-decoration: none; }

/* ── Forms ────────────────────────────────────────────────────── */
input, select, textarea { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 6px; color: #eee; font-size: 14px; padding: 10px 12px; width: 100%; outline: none; transition: border-color .15s; font-family: inherit; }
input:focus, select:focus, textarea:focus { border-color: #555; }
textarea { resize: vertical; min-height: 100px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 6px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; transition: opacity .15s; font-family: inherit; }
.btn:hover { opacity: .85; }
.btn-primary { background: #fff; color: #000; }
.btn-ghost { background: transparent; border: 1px solid #2a2a2a; color: #aaa; }
.btn-danger { background: #3a1010; border: 1px solid #5a2020; color: #e05050; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Cards ────────────────────────────────────────────────────── */
.card { background: #141414; border: 1px solid #1e1e1e; border-radius: 10px; padding: 24px; }
.card + .card { margin-top: 16px; }

/* ── Labels & Fields ──────────────────────────────────────────── */
.label { font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #555; margin-bottom: 6px; }
.field { margin-bottom: 16px; }

/* ── Messages ─────────────────────────────────────────────────── */
.msg { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.msg-ok  { background: #0d2a1a; border: 1px solid #1a5a30; color: #5adb8a; }
.msg-err { background: #2a0d0d; border: 1px solid #5a2020; color: #e05050; }

/* ── Navigation ───────────────────────────────────────────────── */
nav { background: #0a0a0a; border-bottom: 1px solid #1a1a1a; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; height: 52px; }
nav .logo { font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -.02em; }
nav .nav-links { display: flex; align-items: center; gap: 24px; }
nav .nav-links a { font-size: 13px; color: #666; transition: color .15s; }
nav .nav-links a:hover { color: #ccc; }
nav .nav-links a.active { color: #fff; }

/* ── Layout ───────────────────────────────────────────────────── */
.page { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
.page-narrow { max-width: 440px; margin: 0 auto; padding: 80px 24px; }
.page-mid { max-width: 640px; margin: 0 auto; padding: 48px 24px; }

/* ── Typography ───────────────────────────────────────────────── */
h1 { font-size: 22px; font-weight: 600; color: #fff; margin-bottom: 6px; }
h2 { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 16px; }
h3 { font-size: 14px; font-weight: 600; color: #eee; margin-bottom: 8px; }
.sub { font-size: 13px; color: #555; margin-bottom: 32px; }

/* ── Tables ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th { font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #444; text-align: left; padding: 10px 12px; border-bottom: 1px solid #1a1a1a; }
td { padding: 12px; border-bottom: 1px solid #141414; font-size: 13px; color: #aaa; vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.badge-admin  { background: #1a1a2a; color: #7070e0; border: 1px solid #2a2a4a; }
.badge-owner  { background: #2a2a1a; color: #c0a040; border: 1px solid #4a4a2a; }
.badge-member { background: #1a1a1a; color: #555; border: 1px solid #2a2a2a; }

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar { border-radius: 50%; background: #1a1a2a; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #7070e0; flex-shrink: 0; border: 1px solid #2a2a4a; }
.avatar-img { border-radius: 50%; object-fit: cover; }
.profile-avatar { border-radius: 50%; background: #1a1a2a; display: flex; align-items: center; justify-content: center; font-weight: 600; color: #7070e0; flex-shrink: 0; border: 2px solid #2a2a4a; }

/* ── Markdown Content ─────────────────────────────────────────── */
.md-content { font-size: 14px; color: #ccc; line-height: 1.7; }
.md-content p { margin-bottom: 12px; }
.md-content p:last-child { margin-bottom: 0; }
.md-content strong { color: #eee; }
.md-content a { color: #7070e0; }
.md-content a:hover { color: #9090ff; }
.md-content ul, .md-content ol { margin: 8px 0 12px 20px; }
.md-content li { margin-bottom: 4px; }
.md-content code { background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px; padding: 1px 6px; font-size: 13px; color: #e0a040; }
.md-content pre { background: #0a0a0a; border: 1px solid #1e1e1e; border-radius: 4px; padding: 14px; margin: 12px 0; overflow-x: auto; }
.md-content pre code { background: none; border: none; padding: 0; color: #ccc; }
.md-content blockquote { border-left: 3px solid #2a2a4a; margin: 12px 0; padding: 8px 16px; color: #999; }
.md-content img { max-width: 100%; border-radius: 4px; margin: 8px 0; }
.md-content h1, .md-content h2, .md-content h3 { color: #fff; margin: 16px 0 8px; }
.md-content h1 { font-size: 20px; }
.md-content h2 { font-size: 17px; }
.md-content h3 { font-size: 15px; }
.md-content hr { border: none; border-top: 1px solid #1e1e1e; margin: 16px 0; }
.md-content table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.md-content th, .md-content td { border: 1px solid #1e1e1e; padding: 8px 12px; text-align: left; }
.md-content th { background: #111; color: #eee; }

/* ── Item Cards (for CRUD lists) ─────────────────────────────── */
.card-list { display: flex; flex-direction: column; gap: 8px; }
.item-card { display: block; background: #141414; border: 1px solid #1e1e1e; border-radius: 10px; padding: 18px 20px; transition: border-color .15s; text-decoration: none; color: inherit; }
.item-card:hover { border-color: #333; }
.item-card-title { font-size: 15px; font-weight: 600; color: #eee; margin-bottom: 4px; }
.item-card-meta { font-size: 12px; color: #555; margin-bottom: 4px; }
.item-card-preview { font-size: 13px; color: #777; line-height: 1.4; }

/* ── Empty State ──────────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 24px; color: #444; font-size: 13px; }
.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 48px; color: #1e1e1e; margin-bottom: 16px; }
.empty-state h2 { color: #fff; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: #555; }

/* ── Landing Page ─────────────────────────────────────────────── */
.landing-hero { text-align: center; padding: 100px 24px 60px; max-width: 640px; margin: 0 auto; }
.landing-title { font-size: 40px; font-weight: 700; color: #fff; margin-bottom: 16px; letter-spacing: -.02em; }
.landing-sub { font-size: 16px; color: #777; line-height: 1.6; margin-bottom: 32px; }
.landing-actions { display: flex; gap: 12px; justify-content: center; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 60px; }
.feature-card { background: #141414; border: 1px solid #1e1e1e; border-radius: 10px; padding: 24px; text-align: center; }
.feature-icon { font-size: 24px; margin-bottom: 12px; }
.feature-card h3 { color: #fff; margin-bottom: 8px; }
.feature-card p { font-size: 13px; color: #777; line-height: 1.5; }

/* ── Admin Bar ────────────────────────────────────────────────── */
.admin-bar { background: linear-gradient(90deg, #1a1000 0%, #201800 100%); border-bottom: 1px solid #3a3000; padding: 0 24px; height: 36px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.ab-left { display: flex; align-items: center; gap: 16px; }
.ab-pulse { width: 6px; height: 6px; background: #c0a040; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.ab-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #c0a040; }
.ab-link { color: #888; transition: color .15s; display: flex; align-items: center; gap: 4px; }
.ab-link:hover { color: #c0a040; }
.ab-icon { font-size: 13px; }
.ab-text { }

/* ── Impersonate Banner ──────────────────────────────────────── */
.impersonate-banner { background: #2a0d0d; border-bottom: 1px solid #5a2020; padding: 8px 24px; font-size: 13px; color: #e05050; text-align: center; }

/* ── Verify Banner ───────────────────────────────────────────── */
.verify-banner { background: #1a1400; border: 1px solid #3a3000; border-radius: 6px; padding: 12px 16px; font-size: 13px; color: #c0a040; }

/* ── Admin Dashboard ─────────────────────────────────────────── */
.adm-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.adm-title { font-size: 26px; font-weight: 700; color: #fff; letter-spacing: -.02em; margin-bottom: 2px; }
.adm-subtitle { font-size: 13px; color: #555; }
.adm-pulse { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #5adb8a; font-weight: 500; }
.adm-pulse-dot { width: 8px; height: 8px; background: #5adb8a; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }

.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.adm-stat { background: #111; border: 1px solid #1e1e1e; border-radius: 4px; padding: 16px; display: flex; align-items: center; gap: 12px; position: relative; overflow: hidden; }
.adm-stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.adm-stat-blue { background: #0a1a2a; color: #4090e0; border: 1px solid #1a2a4a; }
.adm-stat-value { font-size: 24px; font-weight: 700; color: #fff; }
.adm-stat-label { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: .5px; }
.adm-stat-delta { position: absolute; top: 8px; right: 10px; font-size: 10px; font-weight: 500; }
.adm-delta-up { color: #5adb8a; }

.adm-tabs { display: flex; gap: 4px; margin-bottom: 20px; }
.adm-tab { display: flex; align-items: center; gap: 6px; padding: 10px 18px; font-size: 13px; color: #555; background: #111; border: 1px solid #1e1e1e; border-radius: 4px 4px 0 0; transition: all .12s; }
.adm-tab:hover { color: #ccc; border-color: #2a2a2a; }
.adm-tab.active { color: #fff; background: #141414; border-color: #2a2a2a; border-bottom-color: #141414; }
.adm-tab-icon { font-size: 14px; }

.adm-panel { background: #141414; border: 1px solid #2a2a2a; border-radius: 0 4px 4px 4px; overflow: hidden; }
.adm-panel-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #1e1e1e; }
.adm-panel-header h2 { margin: 0; font-size: 15px; }
.adm-count { font-size: 12px; color: #555; background: #1a1a1a; padding: 2px 10px; border-radius: 10px; }
.adm-empty { padding: 48px 20px; text-align: center; color: #444; font-size: 13px; }

.adm-activity-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #1a1a1a; transition: background .1s; }
.adm-activity-row:last-child { border-bottom: none; }
.adm-activity-row:hover { background: #181818; }
.adm-activity-icon { width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.adm-ai-signup { background: #0d2a1a; color: #5adb8a; border: 1px solid #1a5a30; }
.adm-activity-body { flex: 1; font-size: 13px; color: #ccc; min-width: 0; }
.adm-activity-body strong { color: #fff; }
.adm-activity-time { font-size: 11px; color: #444; flex-shrink: 0; white-space: nowrap; }

.adm-user-list { }
.adm-user-row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #1a1a1a; transition: background .1s; }
.adm-user-row:last-child { border-bottom: none; }
.adm-user-row:hover { background: #181818; }
.adm-user-avatar { width: 32px; height: 32px; border-radius: 6px; background: #1a1a2a; border: 1px solid #2a2a4a; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #7070e0; flex-shrink: 0; }
.adm-user-info { flex: 1; min-width: 0; }
.adm-user-name { font-size: 13px; font-weight: 600; color: #eee; }
.adm-user-email { font-size: 11px; color: #555; }
.adm-user-meta { flex-shrink: 0; }
.adm-user-date { font-size: 11px; color: #444; flex-shrink: 0; }
.adm-user-actions { display: flex; gap: 4px; flex-shrink: 0; }

.adm-action-btn { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 4px; color: #666; font-size: 13px; cursor: pointer; transition: all .12s; font-family: inherit; text-decoration: none; }
.adm-action-btn:hover { background: #222; border-color: #333; color: #ccc; }
.adm-action-view:hover { background: #1a1a2a; border-color: #2a2a4a; color: #7070e0; }
.adm-action-danger:hover { background: #2a0d0d; border-color: #5a2020; color: #e05050; }

/* ── Stats Grid ──────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat-card { background: #141414; border: 1px solid #1e1e1e; border-radius: 10px; padding: 20px; text-align: center; }
.stat-value { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #555; }

/* ── Footer ──────────────────────────────────────────────────── */
.platform-footer { text-align: center; padding: 32px 24px; font-size: 12px; color: #333; border-top: 1px solid #1a1a1a; }
.platform-footer a { color: #444; }
.platform-footer a:hover { color: #888; }
.footer-sep { margin: 0 8px; }

/* ── Cookie Banner ───────────────────────────────────────────── */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #1a1a1a; border-top: 1px solid #2a2a2a; padding: 14px 24px; display: flex; align-items: center; justify-content: center; gap: 16px; font-size: 13px; color: #888; z-index: 1000; }

/* ── Toast Notifications ─────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 12px; transform: translateX(120%); transition: transform .3s ease; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.toast-show { transform: translateX(0); }
.toast-success { background: #0d2a1a; border: 1px solid #1a5a30; color: #5adb8a; }
.toast-error { background: #2a0d0d; border: 1px solid #5a2020; color: #e05050; }
.toast-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 16px; padding: 0; opacity: 0.5; }
.toast-close:hover { opacity: 1; }

/* ── Back to Top ─────────────────────────────────────────────── */
.back-to-top { position: fixed; bottom: 24px; right: 24px; width: 36px; height: 36px; border-radius: 50%; background: #1a1a1a; border: 1px solid #2a2a2a; color: #666; font-size: 14px; cursor: pointer; opacity: 0; transition: opacity .2s; z-index: 100; display: flex; align-items: center; justify-content: center; }
.btt-show { opacity: 1; }
.back-to-top:hover { background: #222; color: #fff; }

/* ── Utilities ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }

/* ── Rose: status, progress, board ───────────────────────────── */
.status { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; vertical-align: middle; white-space: nowrap; border: 1px solid; }
.status-booked    { background: #1a1a1a; color: #aaa; border-color: #333; }
.status-assigned  { background: #0a1a2a; color: #4090e0; border-color: #1a2a4a; }
.status-collected { background: #1a1430; color: #9a80f0; border-color: #2e2650; }
.status-en_route  { background: #2a1a05; color: #e0a040; border-color: #4a3010; }
.status-delivered { background: #0d2a1a; color: #5adb8a; border-color: #1a5a30; }
.status-cancelled { background: #2a0d0d; color: #e05050; border-color: #5a2020; }
h1 .status { font-size: 12px; margin-left: 6px; }

.progress { display: flex; list-style: none; margin: 8px 0 20px; gap: 4px; }
.progress li { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 11px; color: #444; }
.progress-dot { height: 4px; border-radius: 2px; background: #1e1e1e; }
.progress li.done .progress-dot { background: #5adb8a; }
.progress li.done { color: #777; }
.progress li.current .progress-dot { background: #fff; }
.progress li.current { color: #fff; font-weight: 600; }
.progress-cancelled { display: block; color: #e05050; font-size: 13px; }

.eta { background: #141414; border: 1px solid #2a2a2a; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; color: #ccc; }
.item-card .eta { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; }
.eta-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: #e0a040; margin-right: 6px; }
.eta strong { color: #fff; }
.eta-meta { display: block; font-size: 11px; color: #555; margin-top: 2px; }

.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.board-col { background: #111; border: 1px solid #1e1e1e; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.board-col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.board-empty { font-size: 12px; color: #333; padding: 8px 4px; }
.job-card { display: block; background: #161616; border: 1px solid #222; border-radius: 8px; padding: 12px; transition: border-color .15s; }
.job-card:hover { border-color: #3a3a3a; }
.job-card-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: #eee; margin-bottom: 4px; }
.job-card-top span { color: #777; font-size: 12px; text-align: right; }
.job-card-route { font-size: 13px; color: #bbb; margin: 4px 0; }
.job-card-meta { font-size: 11px; color: #555; line-height: 1.5; }
.stat-card { display: block; }
.warn { color: #e0a040; }

/* ── Rose: layout bits ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.job-layout > div > .card:first-child { margin-top: 0; }
.addr { white-space: pre-line; color: #ccc; line-height: 1.5; }
.addr strong { color: #fff; }
.muted { color: #666; font-size: 12px; }
.link { color: #9a9af0; }
.link:hover { color: #c0c0ff; }
.divider { border-top: 1px solid #1e1e1e; margin: 20px 0; }
.mt-8 { margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aaa; margin-bottom: 8px; cursor: pointer; }
.check input { width: auto; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar select { width: auto; min-width: 140px; }
.filter-bar input { flex: 1; min-width: 200px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid #1e1e1e; }
.inline-form input, .inline-form select { flex: 1; min-width: 140px; width: auto; }
.table-card { padding: 0; overflow-x: auto; }
.table-card table { min-width: 560px; }
.row-link { cursor: pointer; }
.row-link:hover td { background: #181818; }
.contact-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid #1a1a1a; }
.contact-row:last-of-type { border-bottom: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-size: 12px; color: #555; }

.timeline { list-style: none; }
.timeline li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid #1a1a1a; font-size: 13px; }
.timeline li:last-child { border-bottom: none; }
.timeline-when { width: 130px; flex-shrink: 0; color: #555; font-size: 12px; }
.timeline-note { color: #ccc; }

.map-wrap { position: relative; }
.map { height: 320px; border-radius: 8px; background: #1a1a1a; }
.map-meta { font-size: 12px; color: #666; margin-top: 8px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .page, .page-narrow, .page-mid { padding-left: 16px; padding-right: 16px; }
  .landing-features { grid-template-columns: 1fr; }
  .landing-title { font-size: 28px; }
  .landing-hero { padding: 60px 16px 40px; }
  .adm-stats { grid-template-columns: 1fr; }
  .adm-tabs { flex-wrap: wrap; }
  .adm-user-row { flex-wrap: wrap; gap: 8px; }
  .adm-user-date { display: none; }
  .admin-bar .ab-text { display: none; }
  nav { height: auto; min-height: 52px; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  nav .nav-links { gap: 14px; flex-wrap: wrap; }
  .board, .grid-2, .job-layout { grid-template-columns: 1fr; }
  .progress-label { display: none; }
  .progress li.current .progress-label { display: inline; }
  .timeline-when { width: 90px; }
}

/* ── Finance ──────────────────────────────────────────────────── */
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 24px; border-bottom: 1px solid #1e1e1e; }
.subnav a { padding: 8px 12px; font-size: 13px; color: #777; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: #ccc; }
.subnav a.active { color: #fff; border-bottom-color: #fff; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; }
.status-draft     { background: #1a1a1a; color: #aaa; border-color: #333; }
.status-issued, .status-due { background: #0a1a2a; color: #4090e0; border-color: #1a2a4a; }
.status-sent, .status-paid, .status-approved, .status-funded, .status-accepted, .status-acknowledged { background: #0d2a1a; color: #5adb8a; border-color: #1a5a30; }
.status-overdue, .status-rejected, .status-disapproved, .status-recoursed { background: #2a0d0d; color: #e05050; border-color: #5a2020; }
.status-proposed, .status-scheduled, .status-submitted, .status-uploaded, .status-disputed, .status-generated { background: #2a1a05; color: #e0a040; border-color: #4a3010; }
.status-credit, .status-credited { background: #1a1430; color: #9a80f0; border-color: #2e2650; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; list-style: none; }
.steps li { flex: 1; min-width: 120px; padding: 10px 12px; border: 1px solid #1e1e1e; border-radius: 8px; font-size: 12px; color: #555; background: #111; }
.steps li strong { display: block; color: #777; font-size: 13px; margin-bottom: 2px; }
.steps li.done { border-color: #1a5a30; color: #5adb8a; }
.steps li.done strong { color: #5adb8a; }
.steps li.current { border-color: #555; color: #ccc; background: #161616; }
.steps li.current strong { color: #fff; }
.check-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #1e1e1e; align-items: flex-start; }
.check-row:last-child { border-bottom: none; }
.tick { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.tick-ok { background: #0d2a1a; color: #5adb8a; border: 1px solid #1a5a30; }
.tick-bad { background: #2a0d0d; color: #e05050; border: 1px solid #5a2020; }
.hold-reason { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #2a1a05; color: #e0a040; margin: 2px 4px 2px 0; }
.kpi { background: #141414; border: 1px solid #1e1e1e; border-radius: 10px; padding: 16px 18px; display: block; }
.kpi:hover { border-color: #333; }
.kpi-value { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #555; margin-top: 2px; }
.kpi-note { font-size: 12px; color: #777; margin-top: 6px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.doc-frame { width: 100%; height: 900px; border: 1px solid #1e1e1e; border-radius: 8px; background: #fff; }
.bar { height: 6px; border-radius: 3px; background: #222; overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: #5adb8a; }
.bar.bar-warn > span { background: #e0a040; }
.bar.bar-bad > span { background: #e05050; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: #555; padding: 6px 8px; border-bottom: 1px solid #1e1e1e; }
.mini-table td { padding: 8px; border-bottom: 1px solid #1a1a1a; vertical-align: top; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table tfoot td { border-top: 1px solid #2a2a2a; color: #fff; font-weight: 600; }
.neg { color: #e05050; }
.pos { color: #5adb8a; }
.code-input { max-width: 140px; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
.qr svg { background: #fff; padding: 8px; border-radius: 8px; }
.note-box { background: #111; border: 1px dashed #2a2a2a; border-radius: 8px; padding: 12px 14px; font-size: 12px; color: #888; }
@media (max-width: 700px) { .doc-frame { height: 600px; } .steps li { min-width: 45%; } }
/* Grid tracks must be allowed to shrink, so wide tables scroll inside their card
   instead of stretching the page on a phone. */
.grid-2 > *, .job-layout > * { min-width: 0; }
.contact-row > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .card { overflow-x: auto; }
  .contact-row { flex-wrap: wrap; }
  .flex-between { flex-wrap: wrap; gap: 12px; }
}
