:root {
    --ink: #18221f;
    --muted: #6d7773;
    --line: #dfe6e2;
    --surface: #ffffff;
    --surface-soft: #f5f8f6;
    --canvas: #edf2ef;
    --brand: #136f63;
    --brand-dark: #0d554c;
    --brand-soft: #e2f0ec;
    --sand: #d8a54c;
    --sand-soft: #fff2d9;
    --danger: #b6473e;
    --danger-soft: #fbe8e5;
    --shadow: 0 12px 36px rgba(23, 47, 39, 0.08);
    --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; background: var(--canvas); }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0, rgba(19, 111, 99, 0.08), transparent 24rem),
        var(--canvas);
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 68px;
    padding: 0 max(24px, calc((100vw - 1180px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(247, 250, 248, 0.9);
    border-bottom: 1px solid rgba(201, 212, 206, 0.75);
    backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; }
.brand-mark, .auth-logo {
    display: grid;
    place-items: center;
    color: white;
    background: var(--brand);
    box-shadow: 0 7px 16px rgba(19, 111, 99, 0.25);
}
.brand-mark { width: 36px; height: 36px; border-radius: 12px; }
.sync-state { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #25a66f; box-shadow: 0 0 0 4px rgba(37, 166, 111, 0.12); }

.main-content { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 112px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 24px; }
.page-heading h1 { margin: 3px 0 5px; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.04em; }
.page-heading p { margin: 0; }
.compact-heading { align-items: center; }
.compact-heading h1 { margin-top: 9px; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.back-link { display: inline-flex; margin-bottom: 2px; font-size: 14px; }
.title-with-status { display: flex; align-items: center; gap: 12px; }
.button-row { display: flex; gap: 8px; flex-wrap: wrap; }
.heading-actions, .export-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.export-actions { padding: 4px; background: rgba(255,255,255,0.65); border: 1px solid var(--line); border-radius: 14px; }
.export-actions .btn { min-height: 36px; padding: 7px 11px; border: 0; background: transparent; font-size: 13px; }
.export-actions .btn:hover { background: white; }

.btn {
    border: 0;
    border-radius: 12px;
    min-height: 42px;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(19, 111, 99, 0.18); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-danger { color: white; background: var(--danger); box-shadow: 0 8px 18px rgba(182, 71, 62, 0.2); }
.btn-danger:hover { background: #963b34; }
.btn-warning { color: #5f410e; background: #f2c977; box-shadow: 0 8px 18px rgba(216, 165, 76, 0.2); }
.btn-warning:hover { background: #e8b958; }
.btn-starred { color: #80540d; background: var(--sand-soft); border: 1px solid #efd6a6; box-shadow: none; }
.btn-starred:hover { background: #ffe7b8; }
.btn-secondary { color: var(--ink); background: white; border: 1px solid var(--line); box-shadow: none; }
.btn-text { color: var(--brand); background: transparent; box-shadow: none; padding-inline: 8px; }
.btn-settle { color: var(--brand-dark); background: var(--brand-soft); }
.btn-small { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.danger-text { color: var(--danger) !important; }

.alert { margin: 0 0 14px; padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; }
.alert-success { color: #075d43; background: #dcf4e9; border: 1px solid #b7e5d2; }
.alert-error { color: #8f312a; background: var(--danger-soft); border: 1px solid #f2cbc6; }

.metric-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.metric-grid.four { grid-template-columns: repeat(3, 1fr); }
.metric-card { min-width: 0; min-height: 138px; padding: 23px; display: flex; flex-direction: column; justify-content: space-between; color: var(--ink); background: var(--surface); border: 1px solid rgba(210, 220, 214, 0.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.metric-card > span { color: var(--muted); font-size: 14px; }
.metric-card strong { font-size: clamp(22px, 3vw, 31px); letter-spacing: -0.04em; }
.metric-card small { color: var(--muted); }
.metric-main { color: white; background: linear-gradient(135deg, #136f63, #0a4f47); border-color: transparent; }
.metric-main > span, .metric-main small { color: rgba(255,255,255,0.72); }
.metric-warning { background: linear-gradient(135deg, var(--sand-soft), #fffaf0); border-color: #efd6a6; }

.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0 0 34px; }
.quick-actions a { padding: 16px 18px; display: flex; align-items: center; gap: 13px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 15px; }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions small { margin-top: 3px; color: var(--muted); }
.quick-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; font-size: 21px; font-weight: 700; }
.quick-icon.green { color: var(--brand); background: var(--brand-soft); }
.quick-icon.sand { color: #946415; background: var(--sand-soft); }

.section-block, .info-card, .form-card, .notice-card, .profile-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.section-block { padding: 23px; margin-top: 20px; }
.section-block.no-margin { margin-top: 0; }
.section-heading { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.section-heading h2 { margin: 0; font-size: 19px; }
.section-heading a { font-size: 14px; font-weight: 700; }

.record-list { display: grid; gap: 8px; }
.record-card { position: relative; padding: 14px 4px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 15px; border-bottom: 1px solid #edf0ee; }
.record-card:last-child { border-bottom: 0; }
.record-date { width: 48px; height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surface-soft); border-radius: 12px; }
.record-date strong { line-height: 1; font-size: 19px; }
.record-date span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.record-body { min-width: 0; }
.record-top { display: flex; align-items: center; gap: 8px; }
.record-body p { margin: 6px 0 3px; overflow: hidden; color: #46504c; text-overflow: ellipsis; white-space: nowrap; }
.record-body small { color: var(--muted); }
.record-amount { white-space: nowrap; font-size: 16px; }
.route-arrow { color: var(--brand); font-weight: 700; }

.status { width: fit-content; display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.status-pending { color: #966316; background: var(--sand-soft); }
.status-partial { color: #9a4f12; background: #ffead7; }
.status-settled { color: #0b6654; background: var(--brand-soft); }
.status-muted { color: #606864; background: #ebefed; }

.filter-bar, .filter-panel { margin-bottom: 18px; padding: 13px; display: flex; gap: 9px; align-items: end; background: rgba(255,255,255,0.7); border: 1px solid var(--line); border-radius: 15px; }
.filter-panel { flex-wrap: wrap; }
.filter-panel select { max-width: 180px; }
.shipment-search-panel { margin-bottom: 18px; padding: 11px; display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,0.78); border: 1px solid var(--line); border-radius: 15px; }
.shipment-search-panel .search-field { min-width: 0; }
.filter-trigger { position: relative; white-space: nowrap; }
.filter-trigger > span { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; color: white; background: var(--brand); border-radius: 999px; font-size: 10px; }
.search-field { min-width: 240px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 13px; background: white; border: 1px solid var(--line); border-radius: 11px; }
.search-field input { width: 100%; min-height: 42px; border: 0; outline: 0; background: transparent; }
.search-field.wide { flex: 2 1 300px; }
.filter-bar select, .filter-panel select, .date-field input { min-height: 44px; padding: 0 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 11px; }
.date-field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 11px; }

.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.client-card { padding: 19px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: 0.16s ease; }
.client-card:hover { transform: translateY(-2px); border-color: #b7cbc3; }
.client-card.is-starred { border-color: #e7c681; box-shadow: 0 10px 30px rgba(153, 104, 24, 0.1); }
.client-card.is-inactive { opacity: 0.7; box-shadow: none; }
.client-card-top { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.client-card-identity { min-width: 0; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; color: var(--ink); }
.client-card-controls { display: flex; align-items: center; gap: 7px; }
.client-card-controls form { display: inline-flex; }
.client-card h3 { margin: 0 0 4px; }
.client-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.star-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; color: #9aa29e; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 21px; transition: 0.15s ease; }
.star-button:hover { color: #a36a10; background: var(--sand-soft); border-color: #efd6a6; }
.star-button.active { color: #d4962f; background: var(--sand-soft); border-color: #efd6a6; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 13px; font-weight: 800; }
.client-stats { margin-top: 17px; padding-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #edf0ee; }
.client-stats { color: var(--ink); }
.client-stats span + span { padding-left: 14px; border-left: 1px solid #edf0ee; }
.client-stats small, .client-stats strong { display: block; }
.client-stats small { margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.client-stats strong { font-size: 14px; }

.form-card { overflow: hidden; }
.form-section { padding: 25px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section h2 { margin: 0 0 17px; font-size: 17px; }
.form-grid { display: grid; gap: 17px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; color: #3c4743; font-size: 13px; font-weight: 700; }
.field b { color: var(--danger); }
.field input, .field select, .field textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 13px;
    color: var(--ink);
    background: #fbfcfb;
    border: 1px solid #d8e0dc;
    border-radius: 11px;
    outline: none;
    font-weight: 500;
    transition: 0.15s ease;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { background: white; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.1); }
.form-actions { padding: 18px 25px; display: flex; justify-content: flex-end; gap: 9px; background: var(--surface-soft); }
.input-with-prefix { position: relative; }
.input-with-prefix > span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-with-prefix input { padding-left: 32px; }
.customer-mode-switch { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.customer-mode-option { cursor: pointer; }
.customer-mode-option input { position: absolute; opacity: 0; pointer-events: none; }
.customer-mode-option > span { min-height: 76px; padding: 15px 16px; display: flex; flex-direction: column; justify-content: center; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; transition: 0.15s ease; }
.customer-mode-option strong, .customer-mode-option small { display: block; }
.customer-mode-option small { margin-top: 4px; color: var(--muted); }
.customer-mode-option input:checked + span { color: var(--brand-dark); background: var(--brand-soft); border-color: #9fcbbd; box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.08); }
.customer-mode-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.customer-mode-option input:disabled + span { opacity: 0.5; cursor: not-allowed; }
.customer-panel { padding: 17px; background: #fbfcfb; border: 1px solid var(--line); border-radius: 14px; }
.temporary-customer-note { margin-bottom: 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.temporary-customer-note strong { padding: 4px 8px; color: #80540d; background: var(--sand-soft); border-radius: 999px; white-space: nowrap; font-size: 11px; }

.detail-grid { display: grid; grid-template-columns: minmax(270px, 0.8fr) minmax(0, 1.8fr); gap: 18px; }
.info-card { padding: 23px; }
.detail-list { margin: 0; }
.detail-list > div { padding: 11px 0; display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 12px; border-bottom: 1px solid #edf0ee; }
.detail-list dt { color: var(--muted); font-size: 13px; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }

.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { padding: 13px 12px; color: var(--muted); background: var(--surface-soft); text-align: left; white-space: nowrap; }
.data-table td { padding: 15px 12px; border-top: 1px solid #e8eeeb; vertical-align: middle; }
.data-table td > strong, .data-table td > span, .data-table td > small { display: block; }
.data-table td > small { margin-top: 5px; color: var(--muted); }
.check-cell { width: 40px; text-align: center !important; }
.check-cell input { width: 17px; height: 17px; accent-color: var(--brand); }
.route-text { max-width: 250px; color: #46504c; }
.route-text b { color: var(--brand); }
.amount-text { white-space: nowrap; font-size: 15px; }
.actions-cell { min-width: 155px; }
.actions-cell form { display: inline; }
.bulk-toolbar { position: sticky; top: 80px; z-index: 20; margin: 0 0 10px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--brand-dark); background: #dff2eb; border: 1px solid #b7ddcf; border-radius: 13px; box-shadow: var(--shadow); }
.bulk-toolbar > div { display: grid; gap: 3px; }
.bulk-toolbar small { color: #47736a; font-size: 11px; }
.bulk-toolbar small.invalid { color: var(--danger); font-weight: 700; }
.bulk-toolbar .bulk-actions { display: flex; grid-auto-flow: column; gap: 8px; }

.shipment-list-heading { margin: 0 2px 10px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 12px; }
.shipment-list-order { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.sort-switch { padding: 3px; display: inline-flex; gap: 2px; background: #e8eeeb; border-radius: 10px; }
.sort-switch a { padding: 6px 9px; color: #69736f; border-radius: 8px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.sort-switch a.active { color: var(--brand-dark); background: white; box-shadow: 0 2px 7px rgba(23, 47, 39, 0.08); }
.select-page { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.select-page input, .shipment-check { width: 18px; height: 18px; flex: 0 0 auto; accent-color: var(--brand); cursor: pointer; }
.shipment-list { display: grid; gap: 12px; }
.shipment-item { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 17px; box-shadow: 0 8px 24px rgba(23, 47, 39, 0.055); transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease; }
.shipment-item:hover { transform: translateY(-1px); border-color: #b8ccc4; box-shadow: var(--shadow); }
.shipment-item.is-settled { box-shadow: none; }
.shipment-item-head { padding: 14px 17px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; align-items: center; gap: 11px; background: linear-gradient(90deg, #f8faf9, white); border-bottom: 1px solid #edf1ef; }
.settled-check { width: 19px; height: 19px; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 50%; font-size: 11px; font-weight: 900; }
.shipment-client { min-width: 0; display: flex; align-items: baseline; gap: 11px; }
.shipment-client h3 { margin: 0; overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.shipment-client time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.client-type-badge { padding: 3px 7px; color: #80540d; background: var(--sand-soft); border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.shipment-item-body { padding: 16px 17px; display: grid; grid-template-columns: minmax(280px, 1.4fr) minmax(190px, 1fr) 160px; align-items: center; gap: 20px; }
.shipment-route-card { position: relative; display: grid; gap: 10px; }
.route-stop { position: relative; z-index: 1; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 10px; }
.route-stop div { min-width: 0; }
.route-stop small, .route-stop strong { display: block; }
.route-stop small { margin-bottom: 2px; color: var(--muted); font-size: 10px; }
.route-stop strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.route-badge { width: 28px; height: 28px; display: grid; place-items: center; color: var(--brand-dark); background: var(--brand-soft); border-radius: 9px; font-size: 11px; font-weight: 900; }
.route-badge.end { color: #8b5a0f; background: var(--sand-soft); }
.route-track { position: absolute; top: 26px; bottom: 26px; left: 13px; width: 2px; background: repeating-linear-gradient(to bottom, #aac8bd 0 4px, transparent 4px 8px); }
.shipment-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shipment-meta span { min-width: 0; }
.shipment-meta small, .shipment-meta strong { display: block; }
.shipment-meta small { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.shipment-meta strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.shipment-amount-box { padding-left: 18px; display: flex; flex-direction: column; align-items: flex-end; border-left: 1px solid var(--line); }
.shipment-amount-box small { color: var(--muted); font-size: 10px; }
.shipment-amount-box strong { margin: 2px 0 3px; color: var(--ink); font-size: 21px; letter-spacing: -0.03em; white-space: nowrap; }
.shipment-amount-box span { color: var(--muted); font-size: 10px; text-align: right; }
.shipment-amount-box .receipt-progress { margin-top: 4px; color: #9a4f12; font-size: 11px; font-weight: 800; }
.shipment-amount-box .receipt-complete { margin-top: 4px; color: var(--brand-dark); font-size: 11px; font-weight: 700; }
.shipment-actions { min-height: 48px; padding: 8px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; background: #fbfcfb; border-top: 1px solid #edf1ef; }
.shipment-actions form { display: inline-flex; }

.pagination { margin-top: 18px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.page-numbers { display: flex; justify-content: center; gap: 6px; }
.page-link { min-width: 38px; min-height: 38px; padding: 8px 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 700; }
.page-link.active { color: white; background: var(--brand); border-color: var(--brand); }
.page-link.disabled { color: #aeb6b2; background: #f3f5f4; cursor: not-allowed; }
.page-direction:first-child { justify-self: start; }
.page-direction:last-child { justify-self: end; }

.app-dialog { width: min(460px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px); margin: auto; padding: 0; overflow: auto; color: var(--ink); background: white; border: 0; border-radius: 22px; box-shadow: 0 28px 80px rgba(18, 36, 31, 0.28); }
.app-dialog[open] { animation: dialog-enter 0.18s ease-out; }
.app-dialog::backdrop { background: rgba(15, 28, 24, 0.58); backdrop-filter: blur(4px); animation: backdrop-enter 0.18s ease-out; }
.dialog-open { overflow: hidden; }
.dialog-panel { position: relative; padding: 28px; }
.dialog-heading { display: flex; align-items: flex-start; gap: 14px; padding-right: 30px; }
.dialog-heading .dialog-icon { float: none; flex: 0 0 auto; }
.dialog-heading h2 { margin: 4px 0 0; font-size: 24px; line-height: 1.25; }
.dialog-heading .eyebrow { margin: 1px 0 0; }
.dialog-close { position: absolute; top: 17px; right: 17px; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); background: var(--surface-soft); border: 0; border-radius: 10px; cursor: pointer; font-size: 22px; line-height: 1; transition: 0.15s ease; }
.dialog-close:hover { color: var(--ink); background: #e9eeeb; }
.confirm-dialog { width: min(430px, calc(100% - 28px)); }
.confirm-dialog-message { min-height: 48px; margin: 22px 0 0; padding: 15px 16px; color: #45504c; background: var(--surface-soft); border: 1px solid #e8eeeb; border-radius: 13px; line-height: 1.65; }
.confirm-dialog.tone-danger .confirm-dialog-icon { color: var(--danger); background: var(--danger-soft); }
.confirm-dialog.tone-warning .confirm-dialog-icon { color: #946415; background: var(--sand-soft); }
.settle-dialog form { position: relative; padding: 28px; }
.filter-dialog { width: min(560px, calc(100% - 28px)); }
.filter-dialog form { position: relative; padding: 28px; }
.vehicle-dialog form { position: relative; padding: 28px; }
.vehicle-dialog-description { margin: 16px 0 20px; line-height: 1.6; }
.filter-dialog-description { margin: 16px 0 20px; }
.filter-dialog-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.filter-dialog-actions { grid-template-columns: 0.8fr 1.2fr; }
.settle-dialog .dialog-heading h2 { margin: 4px 0 0; font-size: 25px; }
.settle-dialog p { margin-top: 0; }
.settle-dialog .settle-description { margin: 16px 0 0; line-height: 1.6; }
.dialog-icon { width: 46px; height: 46px; display: grid; place-items: center; float: right; color: var(--brand); background: var(--brand-soft); border-radius: 14px; font-size: 22px; font-weight: 800; }
.expected-amount { margin: 20px 0; padding: 16px; display: flex; justify-content: space-between; align-items: center; background: var(--surface-soft); border-radius: 13px; }
.expected-amount span { color: var(--muted); }
.expected-amount strong { font-size: 24px; }
.amount-input > div { position: relative; }
.amount-input > div span { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 20px; }
.amount-input > div input { height: 54px; padding-left: 42px; font-size: 20px; font-weight: 800; }
.amount-input small { color: var(--danger); }
.amount-input small.valid { color: var(--brand); }
.field .input-valid { border-color: var(--brand); background: #f2fbf7; }
.field .input-invalid { border-color: var(--danger); }
.dialog-actions { margin-top: 23px; display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 9px; }

.bill-page-heading { align-items: flex-end; }
.bill-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.bill-preview { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.bill-preview-head { padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: white; background: linear-gradient(135deg, #136f63, #0a5148); }
.bill-preview-head > div { display: flex; align-items: center; gap: 14px; }
.bill-preview-head small, .bill-preview-head h2 { display: block; }
.bill-preview-head small { color: rgba(255,255,255,0.65); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; }
.bill-preview-head h2 { margin: 4px 0 0; font-size: 24px; }
.bill-mark { width: 48px; height: 48px; display: grid; place-items: center; color: var(--brand); background: white; border-radius: 14px; font-size: 20px; font-weight: 900; }
.bill-count { padding: 7px 11px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; font-size: 12px; font-weight: 700; }
.bill-client-info { padding: 20px 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; border-bottom: 1px solid var(--line); }
.bill-client-info small, .bill-client-info strong { display: block; }
.bill-client-info small { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.bill-client-info strong { overflow-wrap: anywhere; }
.bill-summary { padding: 18px 28px; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.bill-summary > div { padding: 5px 18px; text-align: center; border-left: 1px solid var(--line); }
.bill-summary > div:first-child { border-left: 0; }
.bill-summary small, .bill-summary strong { display: block; }
.bill-summary small { margin-bottom: 6px; color: var(--muted); }
.bill-summary strong { font-size: 22px; }
.bill-summary .remaining strong { color: #a35c17; }
.bill-records { padding: 10px 28px; }
.bill-record { padding: 16px 0; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid #ebefed; }
.bill-record:last-child { border-bottom: 0; }
.bill-record-index { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-size: 11px; font-weight: 900; }
.bill-record-main { min-width: 0; }
.bill-record-main > div { display: flex; align-items: center; gap: 8px; }
.bill-record-main time { color: var(--muted); font-size: 11px; }
.bill-record-main > strong { margin-top: 7px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-record-main > small { margin-top: 4px; display: block; color: var(--muted); }
.bill-record-amount { min-width: 155px; text-align: right; }
.bill-record-amount small, .bill-record-amount strong, .bill-record-amount span { display: block; }
.bill-record-amount small, .bill-record-amount span { color: var(--muted); font-size: 10px; }
.bill-record-amount strong { margin: 3px 0; font-size: 17px; }
.bill-preview-foot { padding: 16px 28px; display: flex; justify-content: space-between; color: var(--muted); background: #fbfcfb; border-top: 1px solid var(--line); font-size: 11px; }
.bill-preview-foot strong { color: var(--brand); }
.bill-download-state { margin: 12px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
.wechat-image-dialog { width: min(620px, calc(100% - 20px)); }
.wechat-image-stage { min-height: 210px; max-height: 52vh; margin-top: 20px; overflow: auto; display: grid; place-items: center; background: #edf2ef; border: 1px solid var(--line); border-radius: 16px; }
.wechat-image-stage img { width: 100%; height: auto; display: block; -webkit-touch-callout: default; user-select: auto; touch-action: pinch-zoom; }
.wechat-image-stage img[hidden] { display: none; }
.wechat-image-loading { padding: 50px 20px; color: var(--muted); text-align: center; font-size: 13px; }
.wechat-preview-status { margin: 14px 0 0; color: var(--brand-dark); font-size: 13px; font-weight: 700; line-height: 1.6; }
.wechat-preview-status.error { color: var(--danger); }
.wechat-save-guide { margin-top: 14px; padding: 14px 16px; background: var(--surface-soft); border-radius: 13px; }
.wechat-save-guide strong { display: block; font-size: 13px; }
.wechat-save-guide ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.wechat-fallback-actions { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wechat-fallback-actions .btn { width: 100%; }
.wechat-fallback-actions .btn-text { grid-column: 1 / -1; }
.wechat-expiry-note { margin-top: 12px; display: block; color: var(--muted); text-align: center; line-height: 1.6; }

/* 朋友圈素材 */
.social-category-tabs { margin: -6px 0 22px; padding: 6px; display: flex; gap: 6px; overflow-x: auto; background: rgba(255,255,255,0.76); border: 1px solid var(--line); border-radius: 15px; scrollbar-width: none; }
.social-category-tabs::-webkit-scrollbar { display: none; }
.social-category-tabs a, .social-category-tabs button { min-height: 38px; padding: 8px 14px; display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; color: var(--muted); background: transparent; border: 0; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 800; }
.social-category-tabs a.active, .social-category-tabs button.active { color: white; background: var(--brand); box-shadow: 0 6px 14px rgba(19,111,99,0.18); }
.social-category-tabs a span { width: 22px; height: 22px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 7px; font-size: 10px; }
.social-category-tabs a.active span { color: var(--brand); background: white; }
.social-category-tabs.compact { margin: 17px 0 13px; background: var(--surface-soft); }
.social-category-tabs.compact button { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.social-template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.social-template-card { min-width: 0; padding: 20px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.social-template-card.is-inactive { opacity: 0.64; }
.social-template-card > header { display: flex; align-items: flex-start; gap: 12px; }
.social-template-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: var(--brand); background: var(--brand-soft); border-radius: 13px; font-weight: 900; }
.social-template-card h2 { margin: 7px 0 0; font-size: 18px; }
.social-template-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.social-template-badges span { padding: 3px 7px; color: #69746f; background: #eef2f0; border-radius: 999px; font-size: 9px; font-weight: 800; }
.social-template-badges .system { color: #265e7b; background: #e4f0f6; }
.social-template-badges .custom { color: #7d5718; background: var(--sand-soft); }
.social-template-badges .inactive { color: var(--danger); background: var(--danger-soft); }
.social-template-preview { min-height: 160px; max-height: 230px; margin: 18px 0; padding: 16px; overflow: hidden; color: #46534e; background: var(--surface-soft); border-radius: 13px; font-size: 13px; line-height: 1.75; white-space: normal; }
.social-template-card > footer { margin-top: auto; padding-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); }
.social-theme-name { color: var(--muted); font-size: 10px; white-space: nowrap; }
.social-template-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.social-template-actions form { margin: 0; }
.social-template-actions .btn { padding-inline: 7px; }
.social-template-form { overflow: hidden; }
.social-variable-heading { margin-bottom: 13px; }
.social-variable-heading h2 { margin-bottom: 4px; }
.social-variable-heading p { margin: 0; font-size: 12px; }
.social-variable-groups { margin-bottom: 18px; display: grid; gap: 11px; }
.social-variable-groups > div { padding: 12px 14px; background: var(--surface-soft); border-radius: 12px; }
.social-variable-groups strong { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.social-variable-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.social-variable-chips button { padding: 6px 9px; color: var(--brand-dark); background: white; border: 1px solid #cfe0da; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; }
.social-variable-chips button:hover { border-color: var(--brand); }
.social-copy-field textarea { width: 100%; padding: 14px; resize: vertical; line-height: 1.7; }
.social-generator-heading .muted { max-width: 800px; }
.social-wizard-progress { margin: -6px 0 18px; padding: 14px 20px; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 10px; background: rgba(255,255,255,0.88); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.social-wizard-progress button { padding: 0; display: flex; align-items: center; gap: 8px; color: #8a9590; background: transparent; border: 0; cursor: pointer; font-size: 12px; }
.social-wizard-progress button:disabled { cursor: default; }
.social-wizard-progress button > span { width: 29px; height: 29px; display: grid; place-items: center; color: #7d8984; background: #eef2f0; border-radius: 9px; font-size: 11px; font-weight: 900; }
.social-wizard-progress button.active { color: var(--brand-dark); }
.social-wizard-progress button.active > span { color: white; background: var(--brand); box-shadow: 0 5px 12px rgba(19,111,99,0.2); }
.social-wizard-progress button.complete { color: var(--brand); }
.social-wizard-progress button.complete > span { color: var(--brand); background: var(--brand-soft); }
.social-wizard-progress > i { height: 2px; background: #e2e8e5; border-radius: 999px; }
.social-generator-layout { display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; align-items: start; gap: 18px; }
.social-generator-layout.is-poster-step { grid-template-columns: minmax(0, 1.3fr) minmax(350px, 0.8fr); justify-content: stretch; }
.social-generator-controls { display: grid; gap: 14px; }
.social-step-card { min-height: 390px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); animation: social-step-in 0.2s ease; }
.social-step-heading { display: flex; align-items: flex-start; gap: 12px; }
.social-step-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--brand); border-radius: 11px; font-size: 13px; font-weight: 900; }
.social-step-heading h2 { margin: 0 0 4px; font-size: 18px; }
.social-step-heading p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.social-template-picker { max-height: 310px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; overflow-y: auto; }
.social-template-picker label { min-width: 0; cursor: pointer; }
.social-template-picker input { position: absolute; opacity: 0; pointer-events: none; }
.social-template-picker label > span { min-height: 66px; padding: 12px; display: flex; flex-direction: column; justify-content: center; background: white; border: 1px solid var(--line); border-radius: 12px; }
.social-template-picker input:checked + span { background: var(--brand-soft); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.social-template-picker strong, .social-template-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-template-picker strong { font-size: 13px; }
.social-template-picker small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.social-manual-fields { margin-top: 17px; }
.social-copy-actions { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.social-copy-actions span { color: var(--brand-dark); font-size: 12px; }
.social-theme-picker { margin-top: 17px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.social-theme-picker label { min-width: 0; cursor: pointer; }
.social-theme-picker input { position: absolute; opacity: 0; pointer-events: none; }
.social-theme-picker label > span { min-height: 82px; padding: 11px; display: grid; grid-template-columns: 42px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 10px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.social-theme-picker input:checked + span { border-color: var(--brand); box-shadow: inset 0 0 0 2px var(--brand); }
.social-theme-picker i { width: 42px; height: 54px; grid-row: 1 / 3; background: linear-gradient(145deg, #e8f3ef, #126f62); border-radius: 9px; }
.social-theme-picker strong { align-self: end; font-size: 12px; }
.social-theme-picker small { align-self: start; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.theme-road_black_gold i { background: linear-gradient(145deg, #171a1a, #d5a744); }
.theme-industrial_yellow i { background: linear-gradient(145deg, #b88f35 50%, #252722 50%); }
.theme-business_blue i { background: linear-gradient(145deg, #e9eff5, #275d88); }
.theme-china_red i { background: linear-gradient(145deg, #793035, #c79b55); }
.theme-sunset_road i { background: linear-gradient(145deg, #c47858, #57485d); }
.theme-night_blue i { background: linear-gradient(145deg, #071b35, #51c9dc); }
.theme-receipt_white i { background: linear-gradient(145deg, #ffffff 60%, #253e35 60%); border: 1px solid var(--line); }
.social-privacy-options { margin-top: 16px; padding: 13px; display: flex; flex-wrap: wrap; gap: 12px 18px; background: var(--surface-soft); border-radius: 12px; }
.social-privacy-options label { display: flex; align-items: center; gap: 7px; color: #4d5955; cursor: pointer; font-size: 11px; font-weight: 700; }
.social-privacy-options input { accent-color: var(--brand); }
.social-poster-sticky { position: sticky; top: 88px; padding: 18px; background: #17211e; border-radius: 21px; box-shadow: 0 18px 42px rgba(18,33,28,0.2); }
.social-poster-toolbar { margin-bottom: 13px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: white; }
.social-poster-toolbar strong, .social-poster-toolbar small { display: block; }
.social-poster-toolbar small { margin-top: 3px; color: #aeb9b5; font-size: 10px; }
.social-poster-toolbar > span { padding: 5px 8px; color: #d7e4df; background: #2b3834; border-radius: 999px; font-size: 10px; }
.social-poster-preview { aspect-ratio: 4 / 5; margin-bottom: 13px; overflow: hidden; background: #dfe7e3; border-radius: 13px; }
.social-poster-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.social-download-state { margin: 11px 5px 0; color: #9daba6; font-size: 10px; line-height: 1.55; text-align: center; }
.social-download-state.error { color: #ffb3ab; }
.social-wizard-navigation { position: sticky; z-index: 25; bottom: 14px; width: min(820px, calc(100% - 16px)); min-height: 70px; margin: 18px auto 0; padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; background: rgba(24,34,31,0.95); border: 1px solid rgba(255,255,255,0.1); border-radius: 18px; box-shadow: 0 16px 34px rgba(13,28,23,0.24); backdrop-filter: blur(14px); }
.social-wizard-navigation > div { min-width: 0; text-align: center; }
.social-wizard-navigation span, .social-wizard-navigation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-wizard-navigation span { color: white; font-size: 12px; }
.social-wizard-navigation small { margin-top: 3px; color: #aeb9b5; font-size: 10px; }
.social-wizard-navigation .btn { white-space: nowrap; }

@keyframes social-step-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}


@keyframes dialog-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes backdrop-enter {
    from { background: rgba(15, 28, 24, 0); }
    to { background: rgba(15, 28, 24, 0.58); }
}

.empty-state { min-height: 280px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); background: rgba(255,255,255,0.7); border: 1px dashed #c9d4cf; border-radius: var(--radius); }
.empty-state h1, .empty-state h3 { margin: 10px 0 4px; color: var(--ink); }
.empty-state p { margin: 4px 0 19px; }
.empty-state.small { min-height: 130px; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 15px; font-size: 21px; font-weight: 800; }
.standalone-empty { min-height: 60vh; }
.notice-card { padding: 30px; text-align: center; }
.notice-card h2 { margin-top: 0; }

.profile-card { padding: 24px; display: flex; align-items: center; gap: 17px; }
.profile-card h2 { margin: 4px 0; }
.profile-card p { margin: 0; color: var(--muted); font-size: 13px; }
.profile-avatar { width: 58px; height: 58px; display: grid; place-items: center; color: white; background: var(--brand); border-radius: 18px; font-size: 22px; font-weight: 800; }
.profile-metrics { margin-top: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.profile-menu { margin-top: 18px; overflow: hidden; background: rgba(255,255,255,0.92); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.profile-menu > * + * { border-top: 1px solid var(--line); }
.profile-menu-row { width: 100%; min-height: 76px; padding: 13px 18px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto 18px; align-items: center; gap: 13px; color: var(--ink); background: transparent; border: 0; text-align: left; }
.profile-menu-button { font: inherit; cursor: pointer; }
.profile-menu-button:hover { background: var(--surface-soft); }
.profile-menu-button:focus-visible { outline: 3px solid rgba(19,111,99,0.16); outline-offset: -3px; }
.profile-menu-icon { width: 40px; height: 40px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 12px; font-size: 14px; font-weight: 900; }
.profile-menu-copy { min-width: 0; grid-column: 2; }
.profile-menu-copy strong, .profile-menu-copy small { display: block; }
.profile-menu-copy strong { font-size: 15px; }
.profile-menu-copy small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-menu-value { grid-column: 3; color: #4d5955; font-size: 13px; font-weight: 700; white-space: nowrap; }
.profile-menu-arrow { grid-column: 4; color: #9aa49f; font-size: 25px; line-height: 1; text-align: right; }
.profile-menu-form { margin: 0; }
.profile-menu-danger .profile-menu-icon, .profile-menu-danger .profile-menu-copy strong { color: var(--danger); }
.profile-menu-danger .profile-menu-icon { background: var(--danger-soft); }

.auth-shell { display: grid; min-height: 100vh; place-items: center; background: linear-gradient(145deg, #e4efeb 0%, #f5f2e9 100%); }
.auth-content { width: min(430px, calc(100% - 30px)); padding: 35px 0; }
.auth-card { position: relative; overflow: hidden; padding: 36px; background: rgba(255,255,255,0.91); border: 1px solid rgba(255,255,255,0.9); border-radius: 25px; box-shadow: 0 25px 70px rgba(26, 56, 46, 0.13); }
.auth-card::before { content: ""; position: absolute; width: 170px; height: 170px; top: -90px; right: -70px; background: var(--brand-soft); border-radius: 50%; }
.auth-logo { position: relative; width: 52px; height: 52px; border-radius: 16px; font-size: 20px; font-weight: 800; }
.auth-card h1 { margin: 5px 0 7px; font-size: 30px; letter-spacing: -0.04em; }
.auth-card > .muted { margin: 0 0 26px; }
.stack-form { display: grid; gap: 15px; }
.stack-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
.stack-form input { width: 100%; height: 47px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; }
.stack-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(19,111,99,0.1); }
.stack-form .btn { margin-top: 7px; min-height: 48px; }
.auth-switch { margin: 22px 0 0; color: var(--muted); text-align: center; font-size: 14px; }
.auth-switch a { font-weight: 800; }

.installer-shell { min-height: 100vh; background: linear-gradient(145deg, #e5f0ec 0%, #f5f1e7 100%); }
.installer-page { width: min(920px, calc(100% - 30px)); margin: 0 auto; padding: 48px 0 70px; }
.installer-header { margin-bottom: 24px; display: flex; align-items: center; gap: 17px; }
.installer-header .auth-logo { flex: 0 0 auto; }
.installer-header h1 { margin: 2px 0 5px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.04em; }
.installer-header p { margin: 0; }
.installer-card { margin-bottom: 16px; padding: 25px; background: rgba(255,255,255,0.92); border: 1px solid rgba(212,223,217,0.95); border-radius: 21px; box-shadow: var(--shadow); }
.installer-section-heading { margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.installer-section-heading > div { display: flex; align-items: center; gap: 12px; }
.installer-section-heading h2 { margin: 0 0 3px; font-size: 19px; }
.installer-section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.step-number { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; color: white; background: var(--brand); border-radius: 11px; font-size: 14px; font-weight: 800; }
.check-summary { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.check-summary.success { color: #086248; background: #dff4e9; }
.check-summary.error { color: #9b352d; background: var(--danger-soft); }
.check-summary.waiting { color: #6d7773; background: #edf1ef; }
.install-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.install-check { min-width: 0; padding: 12px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 12px; }
.install-check > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font-size: 12px; font-weight: 900; }
.install-check.pass > span { color: var(--brand-dark); background: var(--brand-soft); }
.install-check.fail { background: #fff6f4; border-color: #f0cbc6; }
.install-check.fail > span { color: var(--danger); background: var(--danger-soft); }
.install-check strong, .install-check small { display: block; }
.install-check strong { font-size: 13px; }
.install-check small { margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.database-result { margin: -5px 0 18px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; border-radius: 11px; font-size: 13px; }
.database-result.success { color: #086248; background: #e5f6ee; border: 1px solid #bee5d4; }
.database-result.error { color: #94342d; background: #fff0ed; border: 1px solid #f2cbc6; }
.database-result span { overflow-wrap: anywhere; text-align: right; }
.install-form .field > small { color: var(--muted); font-weight: 500; }
.secure-option { padding: 13px; display: flex; align-items: flex-start; gap: 10px; background: var(--surface-soft); border-radius: 12px; cursor: pointer; }
.secure-option input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--brand); }
.secure-option strong, .secure-option small { display: block; }
.secure-option strong { font-size: 13px; }
.secure-option small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.install-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 9px; }
.install-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; text-align: right; }
.install-success-card { min-height: 360px; padding: 45px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: white; border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.install-success-icon { width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 18px; color: white; background: var(--brand); border-radius: 20px; font-size: 28px; font-weight: 900; box-shadow: 0 12px 25px rgba(19,111,99,0.25); }
.install-success-card h2 { margin: 5px 0 8px; font-size: 28px; }
.install-success-card p { max-width: 580px; margin: 0 0 22px; color: var(--muted); }
.install-success-card code { padding: 2px 5px; color: var(--ink); background: var(--surface-soft); border-radius: 5px; }

.bottom-nav { position: fixed; z-index: 40; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); height: 68px; padding: 6px 14px; display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center; background: rgba(25, 35, 32, 0.94); border: 1px solid rgba(255,255,255,0.09); border-radius: 22px; box-shadow: 0 18px 45px rgba(8, 20, 16, 0.28); backdrop-filter: blur(16px); }
.bottom-nav > a { height: 55px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #aeb8b4; font-size: 10px; }
.bottom-nav > a.active { color: white; }
.nav-icon { font-size: 20px; line-height: 1; }
.bottom-nav .nav-create { width: 54px; height: 54px; margin: -25px auto 0; color: white; background: var(--brand); border: 4px solid var(--canvas); border-radius: 18px; box-shadow: 0 9px 20px rgba(19,111,99,0.35); font-size: 28px; }

@media (min-width: 760px) {
    .bottom-nav { display: none; }
    .main-content { padding-bottom: 60px; }
}

@media (max-width: 820px) {
    .topbar { height: 60px; padding: 0 18px; }
    .brand > span:last-child { display: none; }
    .main-content { width: min(100% - 24px, 680px); padding-top: 23px; }
    .page-heading { align-items: center; }
    .page-heading h1 { font-size: 29px; }
    .dashboard-heading { align-items: end; }
    .metric-grid, .metric-grid.four { grid-template-columns: repeat(2, 1fr); }
    .metric-main { grid-column: 1 / -1; }
    .metric-card { min-height: 122px; padding: 18px; }
    .detail-grid { grid-template-columns: 1fr; }
    .client-grid { grid-template-columns: 1fr; }
    .filter-bar { flex-wrap: wrap; }
    .search-field { flex-basis: 100%; }
    .filter-bar select { flex: 1; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { position: relative; padding: 16px 15px; border-top: 1px solid var(--line); }
    .data-table tr:first-child { border-top: 0; }
    .data-table td { min-height: 26px; padding: 4px 0 4px 98px; border: 0; }
    .data-table td::before { content: attr(data-label); position: absolute; left: 0; width: 88px; color: var(--muted); font-size: 11px; }
    .data-table .check-cell { position: absolute; top: 12px; right: 12px; width: 24px; padding: 0; z-index: 2; }
    .data-table .check-cell::before { display: none; }
    .data-table .actions-cell { min-width: 0; padding-top: 10px; }
    .data-table .actions-cell::before { top: auto; }
    .bulk-toolbar { top: 68px; }
    .shipment-item-body { grid-template-columns: minmax(0, 1.4fr) minmax(150px, 0.8fr); }
    .shipment-amount-box { grid-column: 1 / -1; padding: 12px 0 0; display: grid; grid-template-columns: 1fr auto; align-items: center; border-top: 1px solid var(--line); border-left: 0; }
    .shipment-amount-box strong { grid-column: 2; grid-row: 1 / span 2; }
    .shipment-amount-box span { text-align: left; }
    .bill-client-info { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .social-template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .social-generator-layout, .social-generator-layout.is-poster-step { grid-template-columns: 1fr; }
    .social-poster-sticky { position: static; }
    .social-poster-panel { width: min(460px, 100%); margin: 0 auto; }
}

@media (max-width: 560px) {
    .sync-state { font-size: 11px; }
    .main-content { width: calc(100% - 20px); }
    .page-heading { align-items: flex-start; }
    .page-heading .btn-primary { padding-inline: 12px; white-space: nowrap; }
    .page-heading .muted { font-size: 13px; }
    .metric-grid, .metric-grid.four { gap: 9px; }
    .metric-card { min-height: 112px; padding: 15px; }
    .metric-card strong { font-size: 21px; }
    .quick-actions { gap: 9px; margin-bottom: 23px; }
    .quick-actions a { padding: 13px; }
    .quick-actions small { display: none; }
    .section-block { padding: 16px; }
    .record-card { grid-template-columns: 43px minmax(0, 1fr); gap: 10px; }
    .record-date { width: 43px; height: 45px; }
    .record-amount { grid-column: 2; }
    .form-grid.two-columns { grid-template-columns: 1fr; }
    .customer-mode-switch { grid-template-columns: 1fr; }
    .customer-mode-option > span { min-height: 66px; }
    .customer-panel { padding: 14px; }
    .temporary-customer-note { align-items: flex-start; flex-direction: column; gap: 6px; }
    .full-width { grid-column: auto; }
    .form-section { padding: 20px 16px; }
    .form-actions { padding: 14px; flex-wrap: wrap; }
    .form-actions .btn { flex: 1 1 auto; }
    .filter-panel > * { flex: 1 1 45%; }
    .filter-panel .search-field { flex-basis: 100%; }
    .filter-panel select { max-width: none; }
    .shipment-search-panel { flex-wrap: wrap; }
    .shipment-search-panel .search-field { flex-basis: 100%; }
    .shipment-search-panel .btn { flex: 1; }
    .date-field input { width: 100%; }
    .client-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .client-stats strong { font-size: 12px; }
    .client-stats span + span { padding-left: 8px; }
    .button-row { justify-content: flex-end; }
    .account-actions { align-items: flex-start; flex-direction: column; }
    .shipment-page-heading { display: block; }
    .heading-actions { margin-top: 15px; display: grid; grid-template-columns: 1fr auto; }
    .export-actions { min-width: 0; display: grid; grid-template-columns: 1fr; }
    .export-actions .btn { white-space: nowrap; }
    .shipment-list-heading { align-items: flex-start; }
    .shipment-list-order { align-items: flex-end; flex-direction: column; gap: 5px; }
    .shipment-item-head { padding: 13px 14px; }
    .shipment-client { align-items: flex-start; flex-direction: column; gap: 2px; }
    .shipment-item-body { padding: 15px 14px; grid-template-columns: 1fr; gap: 15px; }
    .shipment-meta { padding-top: 13px; border-top: 1px solid var(--line); }
    .shipment-amount-box { grid-column: auto; }
    .shipment-actions { padding: 9px 10px; justify-content: flex-start; overflow-x: auto; }
    .shipment-actions .btn { white-space: nowrap; }
    .pagination { grid-template-columns: 1fr 1fr; }
    .page-numbers { grid-column: 1 / -1; grid-row: 1; }
    .page-direction { grid-row: 2; }
    .auth-card { padding: 28px 22px; }
    .settle-dialog form, .filter-dialog form, .vehicle-dialog form, .dialog-panel { padding: 23px 19px; }
    .dialog-heading { padding-right: 28px; }
    .dialog-heading h2 { font-size: 22px; }
    .confirm-dialog-message { margin-top: 18px; }
    .dialog-actions { grid-template-columns: 1fr; }
    .filter-dialog-grid { grid-template-columns: 1fr; }
    .bulk-toolbar { align-items: stretch; flex-direction: column; }
    .bulk-toolbar .bulk-actions { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bulk-toolbar .bulk-actions .btn { width: 100%; }
    .profile-menu-row { padding-inline: 14px; grid-template-columns: 40px minmax(0, 1fr) auto 14px; gap: 10px; }
    .profile-menu-copy small { max-width: 175px; }
    .bill-page-heading { align-items: flex-start; }
    .bill-heading-actions { width: 100%; justify-content: stretch; }
    .bill-heading-actions .btn { flex: 1 1 145px; }
    .bill-client-info { grid-template-columns: 1fr; gap: 12px; }
    .bill-summary { padding-inline: 12px; }
    .bill-summary > div { padding-inline: 8px; }
    .bill-summary strong { font-size: 16px; }
    .bill-records { padding-inline: 14px; }
    .bill-record { grid-template-columns: 32px minmax(0, 1fr); }
    .bill-record-amount { grid-column: 2; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; text-align: left; }
    .bill-record-amount span { display: inline; }
    .wechat-image-dialog .dialog-panel { padding-inline: 14px; }
    .wechat-image-stage { max-height: 50vh; }
    .wechat-fallback-actions { grid-template-columns: 1fr; }
    .wechat-fallback-actions .btn-text { grid-column: auto; }
    .social-library-heading, .social-generator-heading { display: block; }
    .social-library-heading .heading-actions, .social-generator-heading > .btn { margin-top: 14px; }
    .social-library-heading .heading-actions { grid-template-columns: 1fr 1fr; }
    .social-template-grid { grid-template-columns: 1fr; }
    .social-template-preview { min-height: 120px; }
    .social-template-picker, .social-theme-picker { grid-template-columns: 1fr; }
    .social-step-card { padding: 18px 14px; }
    .social-wizard-progress { padding: 11px 9px; gap: 5px; }
    .social-wizard-progress button { display: block; text-align: center; }
    .social-wizard-progress button > span { margin: 0 auto; }
    .social-wizard-progress button strong { display: none; }
    .social-step-card { min-height: 360px; }
    .social-wizard-navigation { bottom: 84px; width: 100%; grid-template-columns: auto 1fr auto; gap: 7px; }
    .social-wizard-navigation > div small { display: none; }
    .social-wizard-navigation .btn { min-height: 38px; padding: 8px 10px; font-size: 11px; }
    .social-copy-actions { align-items: stretch; flex-direction: column; }
    .social-copy-actions .btn { width: 100%; }
    .social-manual-fields { grid-template-columns: 1fr; }
    .social-poster-panel { width: 100%; }
    .installer-page { width: calc(100% - 20px); padding-top: 26px; }
    .installer-header { align-items: flex-start; }
    .installer-card { padding: 18px 15px; }
    .install-check-grid { grid-template-columns: 1fr; }
    .installer-section-heading { align-items: flex-start; }
    .database-result { flex-direction: column; }
    .database-result span { text-align: left; }
    .install-actions { display: grid; grid-template-columns: 1fr; }
    .install-note { text-align: left; }
}
