:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-2: #fafbfc;
    --ink: #101828;
    --ink-2: #344054;
    --muted: #667085;
    --muted-2: #98a2b3;
    --line: #e4e7ec;
    --line-soft: #eef1f4;
    --brand: #0e7c66;
    --brand-700: #0a5f4f;
    --brand-600: #0c6f5c;
    --brand-400: #34b39a;
    --brand-50: #ecfdf5;
    --brand-100: #d1fae5;
    --amber: #b54708;
    --amber-50: #fffaeb;
    --red: #b42318;
    --red-50: #fef3f2;
    --green: #027a48;
    --green-50: #ecfdf3;
    --blue: #175cd3;
    --blue-50: #eff8ff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
    --shadow-lg: 0 12px 32px rgba(16, 24, 40, .10);
    --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4, h5 { letter-spacing: -.025em; color: var(--ink); }

.mono { font-family: var(--mono); }
.text-muted-2 { color: var(--muted); }
.text-tiny { font-size: .75rem; }
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }
.stack-16 > * + * { margin-top: 16px; }
.stack-24 > * + * { margin-top: 24px; }

/* ---------- shell ---------- */
.app-shell { min-height: 100vh; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0a1d19 0%, #0c2a23 58%, #0b211d 100%);
    color: #d5e6e0;
    z-index: 40;
    overflow: hidden;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(460px 320px at -20% -5%, rgba(52, 211, 153, .20), transparent 65%),
                radial-gradient(380px 260px at 120% 100%, rgba(16, 185, 129, .10), transparent 60%);
    pointer-events: none;
}

.sidebar > * { position: relative; z-index: 1; }

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 20px;
    color: #fff;
}
.brand:hover { color: #fff; }

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, #34d399, #0e7c66);
    color: #062a22;
    font-size: 1.25rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, .28);
    flex: 0 0 auto;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.08rem; letter-spacing: -.02em; }
.brand-text small { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; color: #8fc0b1; }

.side-nav { display: flex; flex-direction: column; gap: 3px; }

.side-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #a9c6bc;
    font-weight: 550;
    font-size: .92rem;
    transition: background .15s ease, color .15s ease;
}
.side-nav .nav-link i { font-size: 1.06rem; width: 20px; text-align: center; }
.side-nav .nav-link:hover { background: rgba(255, 255, 255, .06); color: #ecfdf5; }
.side-nav .nav-link.active {
    background: rgba(52, 211, 153, .14);
    color: #ecfdf5;
    box-shadow: inset 3px 0 0 #34d399;
}
.side-nav .nav-receive {
    margin: 10px 0 8px;
    background: linear-gradient(135deg, #12a385, #0e7c66);
    color: #fff;
    box-shadow: 0 8px 18px rgba(14, 124, 102, .30);
}
.side-nav .nav-receive:hover { background: linear-gradient(135deg, #14b092, #0c6f5c); color: #fff; }

.sidebar-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-chip { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.user-meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.user-meta strong { font-size: .84rem; color: #ecfdf5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta small { font-size: .7rem; color: #83a99d; }

.avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(52, 211, 153, .18);
    color: #a7f3d0;
    font-weight: 700;
    font-size: .8rem;
    letter-spacing: .02em;
}
.avatar-sm { width: 34px; height: 34px; background: var(--brand-50); color: var(--brand-700); }

.logout-btn {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
    color: #a9c6bc;
    display: grid;
    place-items: center;
}
.logout-btn:hover { background: rgba(248, 113, 113, .16); color: #fecaca; }

.main { margin-left: 264px; min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 32px;
    background: rgba(244, 246, 248, .86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(228, 231, 236, .7);
}
.topbar-title { font-weight: 650; font-size: .95rem; color: var(--ink-2); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    color: var(--ink-2);
    font-size: 1.15rem;
}

.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 26px 32px 72px; flex: 1; }

/* ---------- page ---------- */
.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-head h1 { font-size: clamp(1.45rem, 2.4vw, 1.95rem); font-weight: 720; margin: 2px 0 4px; }
.page-head p { margin: 0; color: var(--muted); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .68rem;
    font-weight: 750;
    color: var(--brand-600);
}

/* ---------- buttons ---------- */
.btn {
    --bs-btn-border-radius: 10px;
    font-weight: 600;
    font-size: .875rem;
    padding: .58rem .95rem;
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border-width: 1px;
}
.btn i { font-size: 1rem; }
.btn-primary {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-700);
    --bs-btn-hover-border-color: var(--brand-700);
    --bs-btn-active-bg: var(--brand-700);
    --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: #9cc9be;
    --bs-btn-disabled-border-color: #9cc9be;
}
.btn-soft { background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); }
.btn-soft:hover { background: #d9fbe9; color: var(--brand-700); }
.btn-outline { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.btn-outline:hover { background: var(--surface-2); border-color: #cfd6df; color: var(--ink); }
.btn-danger-soft { background: var(--red-50); border: 1px solid #fecdca; color: var(--red); }
.btn-danger-soft:hover { background: #fee4e2; color: var(--red); }
.btn-sm { font-size: .8rem; padding: .4rem .7rem; }
.btn-lg { font-size: .95rem; padding: .8rem 1.15rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; justify-content: center; }

/* ---------- cards ---------- */
.card-app {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.card-head h2, .card-head h3 { font-size: .98rem; font-weight: 680; margin: 0; }
.card-body { padding: 20px; }
.card-body-tight { padding: 12px 20px; }
.link-more { font-size: .8rem; font-weight: 650; color: var(--brand-600); white-space: nowrap; flex-shrink: 0; }

/* ---------- stats ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--stat-tint, var(--brand-50));
    opacity: .7;
}
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--stat-tint, var(--brand-50));
    color: var(--stat-color, var(--brand-700));
    font-size: 1.05rem;
}
.stat-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.stat-value { font-size: 1.9rem; font-weight: 750; letter-spacing: -.03em; line-height: 1.15; margin-top: 6px; }
.stat-note { font-size: .74rem; color: var(--muted-2); margin-top: 2px; }

/* ---------- layout grids ---------- */
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .85fr); gap: 18px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: 18px; align-items: start; }
.content-grid > *, .detail-grid > * { min-width: 0; }

/* ---------- lists ---------- */
.pending-list { display: flex; flex-direction: column; }
.pending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink);
}
.pending-item:last-child { border-bottom: 0; }
.pending-item:hover { background: var(--surface-2); color: var(--ink); }
.item-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--brand-50);
    color: var(--brand-700);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
}
.item-main { min-width: 0; flex: 1; }
.item-title { font-weight: 640; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-meta { font-size: .76rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.item-side { text-align: right; flex: 0 0 auto; }
.item-side .mono { font-size: .78rem; color: var(--muted); }

.quick-links { display: flex; flex-direction: column; gap: 8px; }
.quick-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--ink-2);
    font-weight: 600;
    font-size: .85rem;
    background: var(--surface);
}
.quick-link:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand-700); }
.quick-link i { color: var(--brand-600); font-size: 1.05rem; }

/* ---------- badges ---------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: .71rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid transparent;
}
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.is-waiting { background: var(--amber-50); color: var(--amber); border-color: #fedf89; }
.is-picked { background: var(--green-50); color: var(--green); border-color: #abefc6; }
.is-sent { background: var(--green-50); color: var(--green); border-color: #abefc6; }
.is-pending { background: var(--blue-50); color: var(--blue); border-color: #b2ddff; }
.is-simulated { background: #f4f3ff; color: #5925dc; border-color: #d9d6fe; }
.is-failed { background: var(--red-50); color: var(--red); border-color: #fecdca; }
.is-neutral { background: #f2f4f7; color: var(--ink-2); border-color: var(--line); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #f2f4f7;
    color: var(--ink-2);
    font-size: .72rem;
    font-weight: 650;
}
.chip-ok { background: var(--green-50); color: var(--green); }
.chip-warn { background: var(--amber-50); color: var(--amber); }
.chip-off { background: #f2f4f7; color: var(--muted); }

/* ---------- forms ---------- */
.form-label { font-size: .8rem; font-weight: 650; color: var(--ink-2); margin-bottom: .35rem; }
.form-label .req { color: var(--red); }
.form-control, .form-select {
    border-color: #d0d5dd;
    border-radius: var(--radius-sm);
    padding: .62rem .8rem;
    min-height: 44px;
    font-size: .9rem;
    color: var(--ink);
    background-color: #fff;
}
.form-control::placeholder { color: #a6b0bf; }
.form-control:focus, .form-select:focus {
    border-color: var(--brand-400);
    box-shadow: 0 0 0 4px rgba(14, 124, 102, .12);
}
.form-control-lg { min-height: 52px; font-size: 1rem; }
textarea.form-control { min-height: 110px; }
.form-hint { font-size: .75rem; color: var(--muted); margin-top: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { border-color: var(--brand-400); box-shadow: 0 0 0 4px rgba(14, 124, 102, .12); }
.field-error { color: var(--red); font-size: .75rem; margin-top: .25rem; }
.input-icon { position: relative; }
.input-icon > i {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted-2);
    font-size: 1rem;
    pointer-events: none;
}
.input-icon > .form-control { padding-left: 38px; }

.form-section { padding: 20px; border-bottom: 1px solid var(--line-soft); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { font-size: .9rem; font-weight: 700; margin-bottom: 2px; }
.form-section-sub { font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }

.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}
.filter-bar .search-field { flex: 1 1 260px; }
.filter-bar .form-control, .filter-bar .form-select { min-height: 42px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.app-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.app-table th {
    text-align: left;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--muted);
    font-weight: 750;
    padding: 11px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.app-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line-soft);
    vertical-align: middle;
    font-size: .86rem;
}
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table tbody tr:hover { background: #fbfcfd; }
.app-table .cell-title { font-weight: 650; color: var(--ink); }
.app-table .cell-sub { font-size: .75rem; color: var(--muted); }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; }

.mobile-list { display: none; }
.package-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    color: var(--ink);
    box-shadow: var(--shadow);
}
.package-card:hover { color: var(--ink); border-color: var(--brand-100); }
.package-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.package-card h3 { font-size: .95rem; font-weight: 700; margin: 0; }
.package-card .meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.package-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.package-card-bottom .mono { font-size: .76rem; color: var(--muted); }

/* ---------- empty ---------- */
.empty-state { text-align: center; padding: 40px 22px; color: var(--muted); }
.empty-state i { font-size: 2rem; color: var(--muted-2); display: block; margin-bottom: 8px; }
.empty-state strong { display: block; color: var(--ink-2); font-size: .92rem; }
.empty-state p { margin: 4px 0 14px; font-size: .82rem; }

/* ---------- alerts/toasts ---------- */
.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    margin-bottom: 14px;
    font-size: .86rem;
    font-weight: 550;
    box-shadow: var(--shadow);
    animation: toast-in .22s ease-out;
}
.toast > i { font-size: 1.05rem; margin-top: 1px; }
.toast > span { flex: 1; }
.toast-close { border: 0; background: transparent; color: inherit; opacity: .55; padding: 0 2px; }
.toast-close:hover { opacity: 1; }
.toast-ok { background: var(--green-50); color: #05603a; border-color: #abefc6; }
.toast-warn { background: var(--amber-50); color: #93370d; border-color: #fedf89; }
.toast-error { background: var(--red-50); color: #912018; border-color: #fecdca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.alert-soft {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: .83rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
}
.alert-soft.is-warn { background: var(--amber-50); border-color: #fedf89; color: #93370d; }
.alert-soft.is-info { background: var(--blue-50); border-color: #b2ddff; color: #175cd3; }

/* ---------- wizard ---------- */
.wizard-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.wizard-step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.step-index {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #eef1f4;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
    border: 1px solid var(--line);
}
.wizard-step.active { color: var(--brand-700); }
.wizard-step.active .step-index { background: var(--brand); color: #fff; border-color: var(--brand); }
.wizard-step.done .step-index { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.step-line { flex: 1; height: 1px; background: var(--line); min-width: 12px; }

.js .wizard-panel { display: none; }
.js .wizard-panel.active { display: block; }
.wizard-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

.photo-drop {
    border: 1.5px dashed #c9d2dc;
    border-radius: 14px;
    background: var(--surface-2);
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 24px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.photo-drop:hover, .photo-drop.dragover { border-color: var(--brand-400); background: var(--brand-50); }
.photo-drop i { font-size: 2.1rem; color: var(--brand-600); }
.photo-drop #photoEmpty { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.photo-drop strong { font-size: .92rem; }
.photo-drop small { color: var(--muted); font-size: .76rem; }
.photo-drop.has-image { padding: 8px; border-style: solid; background: #0b1f1a; }
.photo-preview { width: 100%; max-height: 340px; object-fit: contain; border-radius: 9px; display: block; }

.ocr-bar { margin-top: 12px; }
.progress { height: 8px; border-radius: 99px; background: #eef1f4; }
.progress-bar { background: var(--brand); border-radius: 99px; transition: width .2s ease; }
.ocr-status { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); margin-top: 6px; }
.spinner-border-sm { width: .9rem; height: .9rem; border-width: .14em; }

.match-list { display: flex; flex-direction: column; gap: 8px; }
.match-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    width: 100%;
}
.match-card:hover { border-color: var(--brand-400); background: var(--brand-50); }
.match-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 124, 102, .12); }
.match-score {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 750;
    font-size: .85rem;
}
.match-main { min-width: 0; flex: 1; }
.match-main strong { display: block; font-size: .88rem; }
.match-main small { color: var(--muted); font-size: .75rem; }
.match-reasons { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.match-reason { font-size: .66rem; background: #f2f4f7; color: var(--ink-2); padding: 1px 6px; border-radius: 99px; }

/* ---------- code box ---------- */
.code-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0b1f1a, #0e3a30);
    color: #d1fae5;
}
.code-box .code-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: #7fb6a7; font-weight: 700; }
.code-value { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; letter-spacing: .18em; color: #fff; }
.copy-btn {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: #d1fae5;
    border-radius: 9px;
    padding: 7px 10px;
    font-size: .76rem;
    font-weight: 650;
    white-space: nowrap;
}
.copy-btn:hover { background: rgba(255, 255, 255, .14); }

/* ---------- detail ---------- */
.detail-photo {
    background: #0b1f1a;
    border-radius: 14px;
    min-height: 260px;
    display: grid;
    place-items: center;
    overflow: hidden;
}
.detail-photo img { width: 100%; max-height: 420px; object-fit: contain; display: block; }
.photo-placeholder { color: #6f9a8d; text-align: center; padding: 36px 18px; }
.photo-placeholder i { font-size: 2.4rem; display: block; margin-bottom: 8px; }
.photo-placeholder small { font-size: .76rem; }

.info-list { display: flex; flex-direction: column; }
.info-row {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
    font-size: .85rem;
}
.info-row:last-child { border-bottom: 0; }
.info-label { color: var(--muted); font-size: .78rem; }
.info-value { color: var(--ink); font-weight: 550; overflow-wrap: anywhere; }

.notification-list { display: flex; flex-direction: column; }
.notification-item {
    display: flex;
    gap: 12px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--line-soft);
}
.notification-item:last-child { border-bottom: 0; }
.notification-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex: 0 0 auto;
    background: var(--muted-2);
}
.notification-dot.is-sent { background: #12b76a; }
.notification-dot.is-simulated { background: #7a5af8; }
.notification-dot.is-failed { background: #f04438; }
.notification-dot.is-pending { background: #2e90fa; }
.notification-body { flex: 1; min-width: 0; }
.notification-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notification-phone { font-weight: 650; font-size: .85rem; }
.notification-meta { font-size: .72rem; color: var(--muted); }
.notification-error { font-size: .72rem; color: var(--red); margin-top: 3px; overflow-wrap: anywhere; }

/* ---------- login ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: var(--bg); }
.login-aside {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #eafff7;
    background: linear-gradient(150deg, #071a16 0%, #0c332a 55%, #0e5244 100%);
    overflow: hidden;
}
.login-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(520px 420px at 15% 10%, rgba(52, 211, 153, .22), transparent 60%),
                radial-gradient(420px 360px at 95% 90%, rgba(16, 185, 129, .16), transparent 60%);
}
.login-aside > * { position: relative; z-index: 1; }
.login-aside h1 { color: #fff; font-size: clamp(1.9rem, 3.2vw, 2.7rem); font-weight: 720; line-height: 1.12; max-width: 520px; }
.login-aside p { color: #a9cfc4; max-width: 430px; font-size: .95rem; }
.login-points { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.login-point { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; color: #c8e5dc; }
.login-point i { color: #34d399; font-size: 1rem; margin-top: 1px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 46px; height: 46px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 32px 22px; }
.login-card { width: 100%; max-width: 400px; }
.login-card h2 { font-size: 1.45rem; font-weight: 720; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: .86rem; margin-bottom: 22px; }
.demo-card { margin-top: 18px; padding: 11px 13px; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: .76rem; color: var(--brand-700); }
.demo-card code { color: var(--brand-700); font-weight: 700; }

/* ---------- bottom nav ---------- */
.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: none;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
}
.bottom-nav a, .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .62rem;
    font-weight: 650;
    padding: 4px 2px;
}
.bottom-nav a i, .bottom-nav button i { font-size: 1.2rem; }
.bottom-nav a.active { color: var(--brand-700); }
.bottom-fab {
    width: 52px;
    height: 52px;
    margin: -20px auto 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #12a385, #0e7c66) !important;
    color: #fff !important;
    display: grid !important;
    place-items: center;
    box-shadow: 0 8px 20px rgba(14, 124, 102, .35);
    font-size: 1.35rem !important;
}
.bottom-fab i { font-size: 1.35rem !important; }

/* ---------- offcanvas / misc ---------- */
.offcanvas { max-width: 320px; }
.side-nav-light .nav-link { color: var(--ink-2); }
.side-nav-light .nav-link:hover { background: var(--surface-2); color: var(--ink); }
.side-nav-light .nav-link i { color: var(--brand-600); }
.nav-link-danger { color: var(--red) !important; width: 100%; border: 0; background: transparent; text-align: left; }
.nav-link-danger i { color: var(--red) !important; }

.divider { height: 1px; background: var(--line); margin: 16px 0; }
.section-title { font-size: .95rem; font-weight: 700; margin: 0 0 4px; }
.section-sub { font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
.phone-row { display: grid; grid-template-columns: 1fr 140px auto auto; gap: 8px; align-items: center; }
.phone-row .form-control { min-height: 42px; }
.phone-row .remove-phone { color: var(--muted); border: 1px solid var(--line); background: #fff; border-radius: 9px; width: 38px; height: 38px; }
.phone-row .remove-phone:hover { color: var(--red); border-color: #fecdca; background: var(--red-50); }
.audit-list { max-height: 420px; overflow: auto; }
.audit-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .78rem; }
.audit-item:last-child { border-bottom: 0; }
.audit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-400); margin-top: 6px; flex: 0 0 auto; }
.audit-meta { color: var(--muted); font-size: .7rem; }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991.98px) {
    .sidebar { display: none; }
    .main { margin-left: 0; }
    .topbar { height: 60px; padding: 0 16px; }
    .content { padding: 18px 16px 104px; }
    .bottom-nav { display: grid; }
    .detail-grid { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-aside { display: none; }
    .login-panel { min-height: 100vh; }
    .page-head { align-items: flex-start; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; justify-content: center; }
}

@media (max-width: 767.98px) {
    body { font-size: 14.5px; }
    .stat-grid { gap: 10px; }
    .stat-card { padding: 13px 14px; }
    .stat-value { font-size: 1.55rem; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .phone-row { grid-template-columns: 1fr 1fr auto; }
    .phone-row .remove-phone { grid-column: 3; }
    .desktop-table { display: none; }
    .mobile-list { display: flex; flex-direction: column; gap: 10px; }
    .filter-bar { padding: 10px; }
    .filter-bar .search-field { flex-basis: 100%; }
    .info-row { grid-template-columns: 105px minmax(0, 1fr); }
    .code-value { font-size: 1.3rem; letter-spacing: .12em; }
    .wizard-step .step-label { display: none; }
    .toast { font-size: .8rem; }
}

@media (max-width: 575.98px) {
    .content { padding-left: 12px; padding-right: 12px; }
    .card-body, .form-section { padding: 16px; }
    .card-head { padding: 14px 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-label { font-size: .7rem; }
    .btn { font-size: .82rem; }

    .pending-item { flex-wrap: wrap; align-items: flex-start; }
    .pending-item .item-main { flex: 1 1 calc(100% - 64px); }
    .pending-item .item-side {
        flex: 1 0 calc(100% - 52px);
        margin-left: 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        text-align: left;
    }
    .pending-item .item-side .mono { margin-top: 0 !important; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
    .sidebar, .topbar, .bottom-nav, .page-actions, .toast { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; max-width: none; }
    body { background: #fff; }
    .card-app { box-shadow: none; border-color: #ccc; }
}
