/* ============================================================
   Satisfying Logistics & Cargo — Design System
   Brand: logo red + blue, on a warm Claude-style canvas.
   ============================================================ */

:root {
    --brand-red: #C1272D;
    --brand-red-dark: #9E1B20;
    --brand-red-soft: #FBECEC;
    --brand-blue: #0E76BC;
    --brand-blue-light: #1CA3E0;
    --brand-blue-dark: #0A4C8B;
    --brand-blue-soft: #E9F3FB;

    --ink: #1E2124;
    --ink-soft: #3D434A;
    --muted: #6B7280;
    --muted-2: #9AA1AA;

    --bg: #FAF9F5;
    --bg-2: #F3F1EA;
    --card: #FFFFFF;
    --border: #E9E7DF;
    --border-strong: #DAD7CC;

    --ok: #1E7A46;
    --ok-soft: #E7F4EC;
    --warn: #B7791F;
    --warn-soft: #FBF3E2;
    --danger: #C1272D;
    --danger-soft: #FBECEC;

    --shadow-sm: 0 1px 2px rgba(24, 28, 34, .05);
    --shadow: 0 6px 24px rgba(24, 28, 34, .07);
    --shadow-lg: 0 18px 48px rgba(24, 28, 34, .12);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;

    --grad-brand: linear-gradient(120deg, var(--brand-blue-light), var(--brand-blue) 45%, var(--brand-red) 100%);
    --maxw: 1140px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; color: var(--ink-soft); }
a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--brand-blue-dark); }
small { font-size: .82rem; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 860px; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__mark { width: 40px; height: 40px; flex: 0 0 auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1; }
.brand__name { font-weight: 800; letter-spacing: -.02em; color: var(--brand-red); font-size: 1.05rem; }
.brand__sub { font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-blue-dark); margin-top: 3px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: .95rem;
    padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
    cursor: pointer; transition: .18s ease; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand-red); color: #fff; box-shadow: 0 6px 18px rgba(193,39,45,.28); }
.btn-primary:hover { background: var(--brand-red-dark); color: #fff; transform: translateY(-1px); }
.btn-blue { background: var(--brand-blue); color: #fff; box-shadow: 0 6px 18px rgba(14,118,188,.28); }
.btn-blue:hover { background: var(--brand-blue-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue-dark); }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }

/* ---------- Cards ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(20px, 3vw, 34px); }
.card-hover { transition: .2s ease; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700;
    letter-spacing: .02em; text-transform: uppercase;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-blue { background: var(--brand-blue-soft); color: var(--brand-blue-dark); }
.badge-muted { background: var(--bg-2); color: var(--muted); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 5px; }
.req { color: var(--brand-red); }
.input, .select, textarea.input {
    width: 100%; font: inherit; font-size: .95rem; color: var(--ink);
    padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: #fff; transition: .15s ease; appearance: none;
}
.input:focus, .select:focus, textarea.input:focus {
    outline: none; border-color: var(--brand-blue); box-shadow: 0 0 0 4px var(--brand-blue-soft);
}
.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236B7280' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.input.err, .select.err { border-color: var(--brand-red); box-shadow: 0 0 0 4px var(--danger-soft); }
.err-text { color: var(--brand-red); font-size: .8rem; margin-top: 5px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 18px; }

/* segmented control (mode / currency) */
.segmented { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 999px;
    font-weight: 600; font-size: .9rem; color: var(--muted); transition: .15s;
}
.segmented input:checked + span { background: #fff; color: var(--brand-blue-dark); box-shadow: var(--shadow-sm); }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand-blue); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { padding: 13px 16px; text-align: left; font-size: .9rem; }
table.data thead th { background: var(--bg-2); color: var(--muted); font-weight: 700; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
table.data tbody tr { border-top: 1px solid var(--border); }
table.data tbody tr:hover { background: #FCFBF8; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Alerts ---------- */
.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 18px; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #C7E6D2; }
.alert-danger { background: var(--danger-soft); color: var(--brand-red-dark); border-color: #F0CACB; }
.alert-info { background: var(--brand-blue-soft); color: var(--brand-blue-dark); border-color: #CDE4F5; }

/* ---------- Steps ---------- */
.steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 26px; }
.steps .step { display: inline-flex; align-items: center; gap: 9px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.steps .step i { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--bg-2); color: var(--muted); font-style: normal; font-size: .8rem; border: 1px solid var(--border); }
.steps .step.active i { background: var(--brand-blue); color: #fff; border-color: var(--brand-blue); }
.steps .step.done i { background: var(--ok); color: #fff; border-color: var(--ok); }
.steps .sep { flex: 1 1 18px; height: 1px; background: var(--border-strong); min-width: 14px; }

/* ---------- Public shell ---------- */
.pub-header { position: sticky; top: 0; z-index: 40; background: rgba(250,249,245,.85); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); }
.pub-header .bar { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.pub-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 34px 0; color: var(--muted); font-size: .86rem; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.hero:before { content: ""; position: absolute; inset: 0; background:
    radial-gradient(1000px 460px at 82% -8%, rgba(28,163,224,.16), transparent 60%),
    radial-gradient(760px 420px at 8% 108%, rgba(193,39,45,.12), transparent 55%); pointer-events: none; }
.hero h1 span { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-soft); max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { padding: 26px; }
.feature .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue-dark); margin-bottom: 14px; }
.feature:nth-child(2) .ic { background: var(--brand-red-soft); color: var(--brand-red); }

/* summary / totals */
.summary-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: .92rem; }
.summary-row.total { border-bottom: none; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 14px; font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.summary-row .lbl { color: var(--ink-soft); }
.summary-row .lbl small { display: block; color: var(--muted); font-weight: 400; }
.summary-row .val { font-variant-numeric: tabular-nums; font-weight: 600; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Admin shell ---------- */
.admin { display: grid; grid-template-columns: 258px 1fr; min-height: 100vh; }
.side { background: #14171A; color: #C9CFD6; padding: 20px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand__name { color: #fff; }
.side .brand__sub { color: var(--brand-blue-light); }
.side nav { margin-top: 26px; display: flex; flex-direction: column; gap: 3px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 10px; color: #AEB6BF; font-weight: 500; font-size: .92rem; transition: .15s; }
.side nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side nav a.active { background: var(--brand-blue); color: #fff; }
.side nav a svg { flex: 0 0 auto; opacity: .9; }
.side .side-foot { margin-top: auto; padding-top: 18px; }
.main { background: var(--bg); min-width: 0; }
.topbar { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px,3vw,32px); background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.content { padding: clamp(18px, 3vw, 32px); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat { padding: 20px; }
.stat .lab { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat .big { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.stat .ic { float: right; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-blue-soft); color: var(--brand-blue-dark); }

.rev-card .amount { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.chart-bars .bar { flex: 1; background: var(--grad-brand); border-radius: 6px 6px 0 0; min-height: 4px; position: relative; }
.chart-bars .bar span { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.chart-bars .bar b { position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--ink); font-weight: 700; }

.hamburger { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 9px; width: 40px; height: 40px; cursor: pointer; align-items: center; justify-content: center; }

/* ---------- Card brands ---------- */
.card-networks { display: inline-flex; gap: 6px; align-items: center; }
.card-networks img, .net-chip { height: 22px; }
.net-chip { display: inline-flex; align-items: center; padding: 3px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: .68rem; font-weight: 700; color: var(--muted); background: #fff; letter-spacing: .03em; }

.secure-note { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.pay-input-row { display: grid; grid-template-columns: 1fr 90px 90px; gap: 12px; }

/* utilities */
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:32px}
.mb-0{margin-bottom:0}.mb-2{margin-bottom:16px}.mb-3{margin-bottom:24px}
.flex{display:flex}.between{justify-content:space-between}.items-center{align-items:center}.gap{gap:12px}.gap-sm{gap:8px}.wrap{flex-wrap:wrap}
.grow{flex:1}.hide{display:none}
.pill-tab{display:inline-flex;gap:6px;background:var(--bg-2);border:1px solid var(--border);border-radius:999px;padding:4px}
.pill-tab a{padding:7px 14px;border-radius:999px;font-size:.85rem;font-weight:600;color:var(--muted)}
.pill-tab a.active{background:#fff;color:var(--brand-blue-dark);box-shadow:var(--shadow-sm)}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .hero-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .admin { grid-template-columns: 1fr; }
    .side {
        position: fixed; left: 0; top: 0; bottom: 0; width: 258px; height: 100vh; z-index: 60;
        transform: translateX(-100%); transition: transform .25s ease;
    }
    .side.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .hamburger { display: inline-flex; }
    .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; display: none; }
    .backdrop.show { display: block; }
}
@media (max-width: 620px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .pay-input-row { grid-template-columns: 1fr 1fr; }
    .hero-actions .btn { width: 100%; }
    .dashboard-2col { grid-template-columns: 1fr !important; }
}
