/* ==========================================================
   TRA CỨU HỒ SƠ TUYỂN SINH - GIAO DIỆN V2 (timeline + thẻ gọn)
   ========================================================== */
:root {
    --primary: #006b7b;
    --primary-dark: #00525f;
    --primary-soft: #e6f4f6;
    --accent: #f59e0b;
    --success: #16a34a;
    --success-soft: #f0fdf4;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --warn: #d97706;
    --warn-soft: #fffbeb;
    --info: #0284c7;
    --info-soft: #eff6ff;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #eef2f6;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(1200px 400px at 50% -100px, rgba(0, 107, 123, 0.18), transparent 70%),
        var(--bg);
    color: var(--ink);
    line-height: 1.5;
    min-height: 100vh;
}

.app-shell {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 14px 56px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ---------- Header ---------- */
.hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 18px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary) 0%, #0b8b9e 100%);
    color: #fff;
    box-shadow: var(--shadow);
}
.brand-mark {
    width: 46px; height: 46px; flex: none;
    display: grid; place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: 1.25rem;
}
.hero p { margin: 0; font-size: 0.78rem; opacity: 0.85; letter-spacing: 0.03em; text-transform: uppercase; }
.hero h1 { margin: 2px 0 0; font-size: 1.22rem; font-weight: 800; }

/* ---------- Form tra cứu ---------- */
.lookup-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.lookup-card form { display: grid; gap: 6px; }
.lookup-card label { font-size: 0.85rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
.lookup-card select,
.lookup-card input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    font-size: 1rem;
    background: #fbfdfe;
    color: var(--ink);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
}
.lookup-card select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.lookup-card select:focus, .lookup-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 107, 123, 0.12);
    background: #fff;
}
#lookup-submit {
    margin-top: 12px;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    font-size: 1.02rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.15s, transform 0.05s;
}
#lookup-submit:hover { background: var(--primary-dark); }
#lookup-submit:active { transform: scale(0.99); }
#lookup-submit:disabled { opacity: 0.65; cursor: default; }

/* ---------- Thông báo ---------- */
.message {
    padding: 13px 15px;
    border-radius: 12px;
    background: var(--info-soft);
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 0.93rem;
    font-weight: 600;
}
.message.error { background: var(--danger-soft); border-color: #fecaca; color: var(--danger); }

/* ---------- Vùng kết quả ---------- */
.result-card { display: flex; flex-direction: column; gap: 14px; }

/* Hero kết quả */
.result-hero {
    background: linear-gradient(150deg, #ffffff 0%, var(--primary-soft) 100%);
    border: 1px solid #d3e8ec;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.chip-status { background: var(--primary); color: #fff; }
.chip-ok { background: var(--success-soft); color: var(--success); border-color: #bbf7d0; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.result-hero h2 { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--primary-dark); }
.result-hero > p { margin: 3px 0 0; color: var(--muted); font-weight: 600; }
.hero-meta {
    display: flex; flex-wrap: wrap; gap: 8px 18px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed #cbdfe4;
    font-size: 0.88rem; color: #334155;
}
.hero-meta i { color: var(--primary); margin-right: 5px; }
.hero-meta b { color: var(--ink); }

/* ---------- Timeline tiến trình ---------- */
.timeline-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px 14px 14px;
}
.timeline { display: flex; align-items: flex-start; }
.tl-step {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    min-width: 0;
}
.tl-dot {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 0.92rem;
    background: #f1f5f9;
    color: #94a3b8;
    border: 2px solid var(--line);
    transition: all 0.2s;
}
.tl-label { font-size: 0.74rem; font-weight: 700; color: #94a3b8; text-align: center; line-height: 1.25; }
.tl-sub { display: block; margin-top: 3px; font-size: 0.68rem; font-weight: 700; color: var(--primary); }
.tl-bar { flex: 0.7; height: 3px; border-radius: 3px; background: var(--line); margin-top: 18px; }
.tl-bar.on { background: var(--success); }
.tl-step.done .tl-dot { background: var(--success); border-color: var(--success); color: #fff; }
.tl-step.done .tl-label { color: var(--success); }
.tl-step.active .tl-dot {
    background: var(--primary); border-color: var(--primary); color: #fff;
    box-shadow: 0 0 0 5px rgba(0, 107, 123, 0.15);
    animation: tl-pulse 2s infinite;
}
.tl-step.active .tl-label { color: var(--primary); }
.tl-step.error .tl-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.tl-step.error .tl-label { color: var(--danger); }
@keyframes tl-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(0, 107, 123, 0.16); }
    50% { box-shadow: 0 0 0 8px rgba(0, 107, 123, 0.07); }
}
.timeline-caption {
    margin-top: 13px; padding-top: 11px;
    border-top: 1px dashed var(--line);
    text-align: center;
    font-size: 0.88rem; color: var(--muted);
}
.timeline-caption b { color: var(--primary-dark); }

/* ---------- Việc cần làm ---------- */
.action-center {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: flex; flex-direction: column; gap: 10px;
}
.action-head { font-weight: 800; font-size: 0.98rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.action-head i { color: var(--primary); }
.action-empty {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 2px;
    color: var(--success); font-weight: 600; font-size: 0.93rem;
}
.action-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #f8fafc;
}
.action-item .action-ico {
    width: 40px; height: 40px; flex: none;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 1.02rem;
}
.action-item.warn { background: var(--warn-soft); border-color: #fde68a; }
.action-item.warn .action-ico { background: #fef3c7; color: var(--warn); }
.action-item.danger { background: var(--danger-soft); border-color: #fecaca; }
.action-item.danger .action-ico { background: #fee2e2; color: var(--danger); }
.action-item.info { background: var(--info-soft); border-color: #bfdbfe; }
.action-item.info .action-ico { background: #dbeafe; color: var(--info); }
.action-item.neutral .action-ico { background: var(--primary-soft); color: var(--primary); }
.action-text { flex: 1; min-width: 0; }
.action-text > b { display: block; font-size: 0.92rem; }
.action-text small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 1px; line-height: 1.4; word-break: break-word; }
.action-text small b,
.action-text small i { display: inline; font-size: inherit; }
.action-text small b { color: var(--ink); }
.action-btn {
    flex: none;
    border: 0; border-radius: 10px;
    background: var(--primary); color: #fff;
    font-size: 0.82rem; font-weight: 700;
    padding: 9px 14px;
    cursor: pointer;
}
.action-btn:hover { background: var(--primary-dark); }

/* ---------- Thông tin nhập học (trúng tuyển) ---------- */
.admission-card {
    background: linear-gradient(150deg, #ffffff 0%, var(--success-soft) 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
}
.admission-head { display: flex; align-items: center; gap: 12px; }
.admission-head > i {
    width: 46px; height: 46px; flex: none;
    display: grid; place-items: center;
    border-radius: 13px;
    background: var(--success); color: #fff;
    font-size: 1.3rem;
}
.admission-head b { display: block; font-size: 1.05rem; color: #15803d; }
.admission-head small { display: block; color: var(--muted); font-size: 0.83rem; margin-top: 1px; }
.admission-rows { margin-top: 14px; display: grid; gap: 10px; }
.admission-row { display: flex; align-items: center; gap: 12px; }
.admission-row .admission-ico {
    width: 38px; height: 38px; flex: none;
    display: grid; place-items: center;
    border-radius: 11px;
    background: #fff; border: 1px solid #bbf7d0;
    color: var(--success); font-size: 0.95rem;
}
.admission-row span { display: block; font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.admission-row strong { display: block; font-size: 0.98rem; color: var(--ink); margin-top: 1px; }
.admission-docs {
    margin-top: 14px; padding-top: 13px;
    border-top: 1px dashed #bbf7d0;
}
.admission-docs-title { font-weight: 800; font-size: 0.9rem; color: #15803d; display: flex; align-items: center; gap: 8px; }
.admission-docs ul { margin: 9px 0 0; padding-left: 20px; display: grid; gap: 5px; }
.admission-docs li { font-size: 0.9rem; color: #334155; line-height: 1.5; }

/* ---------- Dải điểm ---------- */
.score-strip {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}
.score-strip > div {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}
.score-strip span { display: block; font-size: 0.72rem; font-weight: 700; color: var(--muted); line-height: 1.3; min-height: 28px; }
.score-strip strong { display: block; margin-top: 3px; font-size: 1.12rem; color: var(--primary-dark); }
.score-strip > div.total { background: var(--success-soft); border-color: #bbf7d0; }
.score-strip > div.total strong { color: var(--danger); font-size: 1.3rem; }

/* ---------- Panel thu gọn ---------- */
.panel {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    overflow: hidden;
}
.panel.panel-warn { border-color: #fde68a; }
.panel summary {
    list-style: none;
    display: flex; align-items: center; gap: 10px;
    padding: 15px 16px;
    cursor: pointer;
    user-select: none;
}
.panel summary::-webkit-details-marker { display: none; }
.panel-title { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.panel-title i { color: var(--primary); width: 18px; text-align: center; }
.panel-caret { color: #94a3b8; font-size: 0.8rem; transition: transform 0.2s; }
.panel[open] .panel-caret { transform: rotate(180deg); }
.panel-tag {
    font-size: 0.72rem; font-weight: 800;
    padding: 3px 10px; border-radius: 999px;
}
.panel-tag.ok { background: var(--success-soft); color: var(--success); }
.panel-tag.warn { background: #fef3c7; color: var(--warn); }
.panel-tag.off { background: #f1f5f9; color: #94a3b8; }
.panel-body { padding: 2px 16px 16px; border-top: 1px solid #f1f5f9; padding-top: 13px; }

/* Lưới thông tin trong panel */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.info-item span { display: block; font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.info-item strong { display: block; font-size: 0.92rem; margin-top: 2px; word-break: break-word; }
.info-item.wide { grid-column: 1 / -1; }
@media (max-width: 430px) { .info-grid { grid-template-columns: 1fr; } }

/* Pill hồ sơ đính kèm */
.doc-list { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.82rem; font-weight: 600;
    border: 1px solid var(--line);
}
.doc-pill.ok { background: var(--success-soft); border-color: #bbf7d0; color: #15803d; }
.doc-pill.missing { background: #f8fafc; color: #94a3b8; }

/* ---------- Form điều chỉnh ---------- */
#dieuchinh-form { display: grid; gap: 6px; margin-top: 10px; }
#dieuchinh-form label { font-size: 0.84rem; font-weight: 700; color: var(--muted); margin-top: 6px; }
#dieuchinh-form select {
    width: 100%; height: 46px;
    padding: 0 40px 0 13px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    font-size: 0.95rem;
    background: #fbfdfe url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 20 20'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%2364748b' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 13px center;
    appearance: none;
    outline: none;
}
#dieuchinh-form select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 107, 123, 0.12); }
.adjust-window {
    display: flex; gap: 9px; align-items: flex-start;
    padding: 11px 13px;
    background: var(--info-soft);
    border: 1px solid #bfdbfe;
    border-radius: 11px;
    font-size: 0.85rem; color: #1e40af;
}
.adjust-window i { margin-top: 2px; }
.adjust-last { font-size: 0.85rem; color: var(--success); font-weight: 600; margin-top: 8px; }
.adjust-doc-preview { margin-top: 8px; padding: 11px 13px; background: #f8fafc; border: 1px dashed var(--line); border-radius: 11px; }
.adjust-doc-title { font-size: 0.83rem; font-weight: 800; color: var(--primary-dark); margin-bottom: 8px; }
.adjust-doc-list { display: flex; flex-wrap: wrap; gap: 6px; }
.adjust-doc-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 600;
    padding: 5px 10px; border-radius: 999px;
    border: 1px solid var(--line); background: #fff; color: #94a3b8;
}
.adjust-doc-pill.ok { color: #15803d; border-color: #bbf7d0; background: var(--success-soft); }
.adjust-doc-pill.missing { color: var(--warn); border-color: #fde68a; background: var(--warn-soft); }
.adjust-score-grid { display: grid; gap: 8px; margin-top: 4px; }
.adjust-score-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 11px;
}
.adjust-score-item span { font-size: 0.84rem; font-weight: 600; color: #334155; line-height: 1.3; }
.adjust-score-item input {
    height: 42px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    outline: none;
    background: #fff;
}
.adjust-score-item input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 107, 123, 0.12); }
.adjust-score-note { margin-top: 7px; font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.adjust-score-live {
    margin-top: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 0.85rem;
    background: #f1f5f9;
    color: var(--muted);
}
.adjust-score-live.ok { background: var(--success-soft); color: #166534; }
.adjust-score-live.err { background: var(--danger-soft); color: var(--danger); }

.supplement-status.adjust-confirm {
    background: var(--warn-soft);
    border: 1px solid #fde68a;
    color: var(--ink);
}
.adjust-confirm-title { font-weight: 800; font-size: 0.92rem; color: var(--warn); display: flex; align-items: center; gap: 8px; }
.adjust-confirm-rows { margin-top: 8px; display: grid; gap: 5px; font-size: 0.86rem; font-weight: 400; }
.adjust-confirm-rows span { color: var(--muted); font-weight: 700; }
.adjust-confirm-rows i { color: var(--warn); font-size: 0.75rem; }
.adjust-confirm-actions { display: flex; gap: 9px; margin-top: 11px; }
.adjust-confirm-actions button {
    flex: 1; height: 42px;
    border: 0; border-radius: 10px;
    font-size: 0.88rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
#dieuchinh-confirm-back { background: #fff; border: 1.5px solid var(--line); color: #475569; }
#dieuchinh-confirm-save { background: var(--success); color: #fff; }

.adjust-actions { display: flex; gap: 10px; margin-top: 12px; }
.adjust-actions button {
    flex: 1; height: 46px;
    border-radius: 11px; border: 0;
    font-size: 0.92rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
#dieuchinh-cancel { background: #eef2f6; color: #475569; }
#dieuchinh-submit { background: var(--primary); color: #fff; }
#dieuchinh-submit:hover { background: var(--primary-dark); }
#dieuchinh-submit:disabled, #zalo-self-submit:disabled, #supplement-submit:disabled { opacity: 0.65; cursor: default; }

/* ---------- Bổ sung file ---------- */
.supplement-list { display: grid; gap: 12px; }
.supplement-upload {
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    padding: 12px;
    background: #fbfdfe;
}
.supplement-upload label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 7px; }
.supplement-upload input[type="file"] { width: 100%; font-size: 0.85rem; }
.supplement-current {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.8rem; color: var(--info);
    margin-bottom: 7px;
    text-decoration: none;
    word-break: break-all;
}
.supplement-file-status { font-size: 0.8rem; margin-top: 6px; min-height: 0; }
.supplement-file-status.ready { color: var(--success); font-weight: 600; }
.supplement-file-status.pending { color: var(--warn); font-weight: 600; }
.supplement-file-status.error { color: var(--danger); font-weight: 600; }
#supplement-form label[for="supplement-note"] { display: block; font-size: 0.84rem; font-weight: 700; color: var(--muted); margin: 12px 0 5px; }
#supplement-note {
    width: 100%;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    padding: 10px 13px;
    font-size: 0.92rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
}
#supplement-note:focus { border-color: var(--primary); }
.supplement-status {
    margin-top: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 0.86rem; font-weight: 600;
    background: var(--info-soft); color: #1d4ed8;
}
.supplement-status.success { background: var(--success-soft); color: var(--success); }
.supplement-status.error { background: var(--danger-soft); color: var(--danger); }
#supplement-submit, #zalo-self-submit {
    margin-top: 12px;
    width: 100%; height: 47px;
    border: 0; border-radius: 11px;
    background: var(--primary); color: #fff;
    font-size: 0.94rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
#supplement-submit:hover, #zalo-self-submit:hover { background: var(--primary-dark); }
.supplement-empty {
    display: flex; gap: 9px; align-items: flex-start;
    font-size: 0.88rem; color: var(--muted);
    padding: 4px 0;
    line-height: 1.5;
}
.supplement-empty i { color: var(--info); margin-top: 2px; }

/* ---------- Zalo ---------- */
.zalo-self-status-grid > div span { display: block; font-size: 0.74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.zalo-self-status-grid > div strong { font-size: 0.95rem; }
.zalo-group-link {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-top: 11px;
    height: 47px;
    border-radius: 11px;
    background: #0068ff; color: #fff;
    font-weight: 700; font-size: 0.93rem;
    text-decoration: none;
}
.zalo-self-check {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1.5px solid var(--line);
    border-radius: 11px;
    font-size: 0.9rem; font-weight: 600;
    cursor: pointer;
    background: #fbfdfe;
}
.zalo-self-check input { width: 19px; height: 19px; }

/* ---------- Thông báo nhà trường ---------- */
.school-notice {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--accent);
    padding: 14px 16px;
}
.notice-title { font-weight: 800; font-size: 0.95rem; display: flex; align-items: center; gap: 9px; }
.notice-title i { color: var(--accent); }
.notice-body { margin-top: 8px; font-size: 0.9rem; color: #334155; white-space: pre-line; line-height: 1.55; }

/* ---------- Cropper modal ---------- */
.crop-overlay {
    position: fixed; inset: 0;
    z-index: 2147483647;
    background: #0b1220;
    color: #fff;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    overscroll-behavior: contain;
    isolation: isolate;
    opacity: 1;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    touch-action: none;
}
@supports (height: 100dvh) {
    .crop-overlay { height: 100dvh; min-height: 100dvh; }
}
@supports (height: 100svh) {
    .crop-overlay { height: 100svh; min-height: 100svh; }
}
.crop-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: #0b1220;
}
.crop-overlay > * {
    position: relative;
    z-index: 1;
}
.crop-overlay[hidden] { display: none; }
.cropper-modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 13px 16px;
    background: #0b1220;
    color: #fff; font-weight: 700; font-size: 0.95rem;
    border-bottom: 1px solid #1e293b;
    padding-top: calc(13px + env(safe-area-inset-top, 0px));
}
.cropper-stage {
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: 12px;
    background: #0b1220;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cropper-stage img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}
.cropper-stage .cropper-container {
    max-width: 100% !important;
    max-height: 100% !important;
    background: #111827 !important;
}
.cropper-stage .cropper-bg {
    background-color: #111827 !important;
    background-image: none !important;
}
.cropper-stage .cropper-drag-box {
    background: rgba(15, 23, 42, 0.72) !important;
    opacity: 1 !important;
}
.cropper-stage .cropper-modal {
    background: rgba(2, 6, 23, 0.55) !important;
    opacity: 1 !important;
}
.cropper-actions {
    display: flex; gap: 8px; justify-content: center;
    padding: 10px 14px;
    background: #0b1220;
    border-top: 1px solid #1e293b;
}
.cropper-actions button {
    flex: 1; max-width: 180px;
    height: 44px;
    border: 1px solid #334155; border-radius: 10px;
    background: #16233a; color: #e2e8f0;
    font-size: 0.85rem; font-weight: 700;
    cursor: pointer;
}
#supplement-crop-preview { background: var(--primary); border-color: var(--primary); color: #fff; }
.cropper-help {
    padding: 8px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    background: #0b1220;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
}
.cropper-ghost-btn {
    border: 1px solid #475569; border-radius: 9px;
    background: transparent; color: #e2e8f0;
    padding: 7px 15px; font-size: 0.85rem; font-weight: 700;
    cursor: pointer;
}
.cropper-primary-btn {
    border: 0; border-radius: 9px;
    background: var(--primary); color: #fff;
    padding: 8px 15px; font-size: 0.85rem; font-weight: 700;
    cursor: pointer;
}
.crop-preview-panel {
    position: absolute; inset: 0;
    background: #0b1220;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    z-index: 3;
    overflow: hidden;
}
.crop-preview-panel[hidden] { display: none; }
.crop-preview-actions { display: flex; gap: 8px; }
.crop-preview-stage {
    min-height: 0;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background: #111827;
}
.crop-preview-stage img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
}

html.cropper-open,
body.cropper-open {
    width: 100%;
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

@media (min-width: 900px) {
    .cropper-stage { padding: 18px 24px; }
    .cropper-actions { padding: 12px 24px; }
    .cropper-actions button { max-width: 220px; }
}

@media (max-width: 420px) {
    .cropper-modal-head {
        padding-left: 12px;
        padding-right: 12px;
        font-size: 0.9rem;
    }
    .cropper-actions {
        gap: 7px;
        padding-left: 10px;
        padding-right: 10px;
    }
    .cropper-actions button {
        height: 42px;
        font-size: 0.78rem;
        border-radius: 9px;
    }
}

/* ---------- Footer nhỏ ---------- */
.page-foot { text-align: center; color: #94a3b8; font-size: 0.78rem; padding-top: 4px; }
