:root {
    --tbs-bg: #f4f6f9;
}

body {
    background: var(--tbs-bg);
    font-size: 0.95rem;
    padding-bottom: 80px;
}

.login-page {
    background: linear-gradient(160deg, #0b5ed7 0%, #0a3d8f 100%);
    min-height: 100vh;
}

.nav-search {
    width: 260px;
}

@media (max-width: 575.98px) {
    .nav-search {
        width: 150px;
    }
}

.card {
    border-color: #e3e7ee;
}

.card-header {
    background: #fff;
}

.stat {
    background: #fff;
    border: 1px solid #e3e7ee;
    border-radius: 0.5rem;
    padding: 0.6rem 0.4rem;
    height: 100%;
}

.stat-label {
    font-size: 0.78rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
}

.fab-new {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1030;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    background: rgba(244, 246, 249, 0.96);
    border-top: 1px solid #dee2e6;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
    z-index: 10;
    display: flex;
    align-items: center;
}

.suggest-box {
    position: absolute;
    left: 0.25rem;
    right: 0.25rem;
    top: 100%;
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
}

.item-row {
    background: #fbfcfe;
}

.item-row .f-hint {
    min-height: 1em;
}

.totals td {
    border: 0;
    padding: 0.25rem 0.25rem;
}

.zalo-text {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 0.92rem;
    background: #f8fbff !important;
    white-space: pre-wrap;
}

.pre-wrap {
    white-space: pre-wrap;
}

.orders-table tr[role="button"],
table tr[role="button"] {
    cursor: pointer;
}

.thumb {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
}

.ktv-job {
    border-left: 4px solid #ffc107;
}

.ktv-job.job-thuhoi {
    border-left-color: #dc3545;
}

.border-dashed {
    border-style: dashed !important;
}

.tab-content {
    min-height: 120px;
}

/* ---------- Bản xem giấy tờ khổ A4 ---------- */
.doc-frame {
    overflow-x: auto;
}

.doc-page {
    background: #fff;
    width: 794px;
    max-width: 100%;
    margin: 0 auto;
    padding: 38px 44px 46px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12);
}

@media (max-width: 820px) {
    .doc-page {
        width: auto;
        padding: 16px 12px 24px;
    }
    .doc { font-size: 13.5px !important; }
    .doc .dt { min-width: 600px; }
    .doc .dt th, .doc .dt td { font-size: 12px !important; padding: 3px 4px !important; }
    .doc .lh-logo img { max-width: 120px !important; }
    .doc .d-title { font-size: 19px !important; }
}

.public-quote {
    background: #eef1f5;
    padding-bottom: 30px;
}

.pq-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
}

/* ---------- Kho ảnh ---------- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.media-card {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    padding: 4px;
    box-shadow: 0 0 0 1px #e3e7ee;
    position: relative;
    min-width: 0;
}

.media-card:hover {
    box-shadow: 0 0 0 1px #9ec5fe;
}

.media-card.selected {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.media-thumb {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f6f7f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.media-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.media-tick {
    display: none;
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #0d6efd;
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.media-card.selected .media-tick {
    display: flex;
}

.media-name {
    font-size: 12px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-grid.manage .media-card {
    cursor: default;
}

.drop-hint {
    border: 2px dashed #b6c2d2;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: center;
    color: #5c6b7f;
    background: #fafbfd;
}

.drop-on,
.drop-on .drop-hint {
    outline: 3px dashed #0d6efd;
    outline-offset: -6px;
    background: #eef5ff;
}
