/* DiDi theme: the DiDi navy/orange brand on the MLT family look. */
:root {
  --navy: #13294B;
  --orange: #F58A3C;
  --orange-soft: #FDE9D9;
  --mlt-blue: #1F4E79;
  --mlt-mid: #2E75B6;
  --mlt-light: #D6E4F0;
  --mlt-accent: #00B4D8;
  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --dark: #0D1B2A;
  --surface: #F4F8FB;
  --border: #CCD9E3;
  --text: #1A2B3C;
  --muted: #6B8399;
  --radius: 10px;
  --shadow: 0 1px 6px rgba(19, 41, 75, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--surface); font-size: 15px; line-height: 1.45;
  display: flex; flex-direction: column; min-height: 100vh; }
a { color: var(--mlt-mid); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 .5rem; letter-spacing: -0.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
.inline { display: inline; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.tick { color: var(--success); font-weight: 700; }

/* Top bar */
.topbar { display: flex; align-items: center; gap: 1.2rem; padding: .55rem 1.4rem; background: #fff;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-logo { height: 52px; width: auto; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-tag { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.crumbs { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--mlt-blue); }
.crumbs .current { color: var(--navy); font-weight: 600; }
.crumbs .sep { color: var(--border); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .9rem; font-size: .9rem; }
.userbox .who { font-weight: 600; color: var(--navy); }
.link-soft { color: var(--muted); }

/* Picker */
.picker-bar { background: linear-gradient(90deg, var(--navy), var(--mlt-blue)); padding: .55rem 1.4rem; }
.picker { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; }
.picker-field { display: flex; flex-direction: column; gap: .15rem; color: rgba(255,255,255,.75);
  font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.picker-field select { min-width: 150px; font-size: .9rem; padding: .35rem .5rem; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.35); background: #fff; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.picker-field select:disabled { opacity: .5; }

/* Banners and messages */
.banner { padding: .6rem 1.4rem; font-size: .9rem; }
.banner-example { background: var(--orange-soft); color: #7A3E0A; border-bottom: 1px solid #F3C9A4; }
.messages { padding: .6rem 1.4rem 0; }
.msg { padding: .6rem .9rem; border-radius: 8px; margin-bottom: .5rem; background: #E8F0F8; color: var(--navy); border: 1px solid var(--mlt-light); }
.msg-success { background: #E8F8F0; color: #1A7A45; border-color: #BFEBD3; }
.msg-error, .msg-danger { background: #FDE8E8; color: #7A1A1A; border-color: #F5BDBD; }
.msg-warning { background: #FEF3CD; color: #7A5A00; border-color: #F7E0A0; }

/* Page */
.page { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.3rem 1.4rem 2rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.page-head .titles { flex: 1; min-width: 240px; }
.page-head .subtitle { color: var(--muted); font-size: .9rem; }
.page-head .product { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--mlt-mid); padding: 2px 9px; border-radius: 20px; vertical-align: middle; margin-left: .5rem; }
.product-paxshield { background: var(--orange) !important; }
.product-bagshield { background: var(--mlt-mid) !important; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: #E9EEF3; border-radius: 8px; padding: 4px; margin-bottom: 1rem; width: fit-content; }
.tabs a { padding: 6px 16px; border-radius: 6px; font-size: .86rem; font-weight: 500; color: var(--muted); }
.tabs a:hover { text-decoration: none; color: var(--navy); }
.tabs a.active { background: #fff; color: var(--navy); box-shadow: 0 1px 4px rgba(19,41,75,.12); font-weight: 600; }

/* Filter bar */
.filters { display: flex; flex-wrap: wrap; gap: .8rem; align-items: flex-end; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.filters label { display: flex; flex-direction: column; gap: .15rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); font-weight: 600; }
.filters select, .filters input { font-size: .9rem; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); min-width: 120px; }
.filters .range-custom { display: flex; gap: .5rem; }
.filters .summary { margin-left: auto; align-self: center; color: var(--muted); font-size: .85rem; }

/* Buttons */
.btn { display: inline-block; font: inherit; font-size: .9rem; font-weight: 600; padding: .45rem .95rem; border-radius: 7px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff; cursor: pointer; }
.btn:hover { background: var(--mlt-blue); text-decoration: none; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: #DD7527; }
.btn-ghost { background: transparent; color: var(--muted); border-color: transparent; padding: .3rem .6rem; }
.btn-ghost:hover { background: var(--surface); color: var(--navy); }
.btn-outline { background: #fff; color: var(--navy); }
.btn-small { font-size: .8rem; padding: .3rem .7rem; }
.btn-danger { background: var(--danger); border-color: var(--danger); }

/* Cards and grids */
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.section-header { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .1em;
  margin: 1.4rem 0 .7rem; padding-bottom: .4rem; border-bottom: 1.5px solid var(--border); }
.section-header:first-child { margin-top: 0; }

/* KPI cards */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; margin-bottom: 1.2rem; }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.kpi-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--navy), var(--orange)); }
.kpi-card.kpi-success::before { background: var(--success); }
.kpi-card.kpi-warning::before { background: var(--warning); }
.kpi-card.kpi-danger::before { background: var(--danger); }
.kpi-label { font-size: .68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem; }
.kpi-value { font-size: 1.7rem; font-weight: 700; color: var(--navy); line-height: 1; font-family: var(--mono); }
.kpi-delta { font-size: .74rem; margin-top: .3rem; color: var(--muted); }

/* Charts */
.chart { width: 100%; }
.chart-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .6rem .8rem .2rem; box-shadow: var(--shadow); }
.chart-note { font-size: .8rem; color: var(--muted); padding: .2rem .4rem .6rem; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  background: var(--surface); padding: .55rem .7rem; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; }
table.data td { padding: .45rem .7rem; border-bottom: 1px solid #EDF1F5; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #F8FAFC; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-foot { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between; padding: .6rem .8rem; font-size: .85rem; color: var(--muted); }
.pager a, .pager span { display: inline-block; padding: .2rem .55rem; border-radius: 5px; border: 1px solid var(--border); margin-left: .25rem; font-size: .82rem; }
.pager span.current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .72rem; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.badge-success { background: #E8F8F0; color: #1A7A45; }
.badge-info { background: #E8F0F8; color: #1A4E7A; }
.badge-danger { background: #FDE8E8; color: #7A1A1A; }
.badge-neutral { background: #EEF1F4; color: #555; }
.badge-warning { background: #FEF3CD; color: #7A5A00; }
.badge-orange { background: var(--orange-soft); color: #7A3E0A; }

/* Forms */
.form { display: flex; flex-direction: column; gap: .8rem; }
.form label, .field label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; display: block; margin-bottom: .2rem; }
.form input, .form select, .form textarea, .field input, .field select, .field textarea { width: 100%; font: inherit; padding: .5rem .65rem; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text); }
.form textarea { min-height: 120px; font-family: var(--mono); font-size: .85rem; }
.form .help, .field .help { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.form .errors, .errorlist { color: var(--danger); font-size: .85rem; margin: .2rem 0 0; padding-left: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; }
.form-actions { display: flex; gap: .6rem; align-items: center; margin-top: .4rem; }
.checkbox { display: flex; align-items: center; gap: .45rem; text-transform: none !important; letter-spacing: 0 !important; font-weight: 500 !important; color: var(--text) !important; }
.checkbox input { width: auto; }

/* Auth pages */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 2rem 2rem 1.6rem; box-shadow: 0 8px 30px rgba(19,41,75,.12); }
.auth-card .brand { justify-content: center; margin-bottom: 1rem; }
.auth-card .brand-logo { height: 150px; width: auto; }
.auth-card h1 { text-align: center; font-size: 1.25rem; }
.auth-card .lead { text-align: center; color: var(--muted); font-size: .9rem; margin-bottom: 1.2rem; }
.auth-card .btn { width: 100%; padding: .6rem; }
.auth-foot { text-align: center; margin-top: 1rem; font-size: .82rem; color: var(--muted); }
.qr { display: block; margin: .5rem auto; width: 220px; height: 220px; }

/* Hierarchy tree */
.tree { list-style: none; margin: 0; padding: 0; }
.tree > li { margin-bottom: 1rem; }
.tree .node { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.tree .node .name { font-weight: 600; color: var(--navy); }
.tree ul { list-style: none; margin: .4rem 0 0 1.2rem; padding-left: 1rem; border-left: 2px solid var(--mlt-light); }
.tree li { margin: .35rem 0; }
.unit-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .45rem .7rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.unit-row .meta { color: var(--muted); font-size: .8rem; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.thumb { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e9eef3; }
.thumb .cap { padding: .45rem .6rem; font-size: .78rem; color: var(--muted); }
.thumb .cap strong { color: var(--navy); display: block; font-size: .82rem; }
#lightbox { position: fixed; inset: 0; background: rgba(13,27,42,.88); display: flex; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; }
#lightbox[hidden] { display: none; }
#lightbox figure { margin: 0; max-width: 92vw; max-height: 92vh; text-align: center; }
#lightbox img { max-width: 92vw; max-height: 84vh; border-radius: 6px; }
#lightbox figcaption { color: #fff; font-size: .85rem; margin-top: .5rem; }

/* Footer */
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .8rem 1.4rem; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border); background: #fff; }

/* Definition lists */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.2rem; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .crumbs { order: 3; width: 100%; }
  .page { padding: 1rem; }
  .filters .summary { margin-left: 0; }
}
