﻿:root {
    --kan-col-width: 340px;
    --kan-col-gap: 12px;
    --card-gap: 10px;
}

body {
    min-height: 100vh;
    background: var(--bs-body-bg);
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.brand {
    font-weight: 700;
    letter-spacing: .3px
}

.header-btn {
    margin-inline: 4px
}

.indicator {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border-radius: 999px;
    font-weight: 600;
    background: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.indicator small {
    opacity: .8;
    font-weight: 500
}

#shiftStatusBtn.is-opening { color:#052c65; background:#6edff6; border-color:#6edff6; }
#shiftStatusBtn.is-open { color:#fff; background:#198754; border-color:#198754; }
#shiftStatusBtn.is-unavailable { color:#fff; background:#6c757d; border-color:#6c757d; }
.shift-section { padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--bs-border-color); border-radius: 12px; }
.shift-staff-option { min-height: 58px; display: flex; align-items: center; gap: .65rem; font-size: 1.05rem; }
.shift-check-group { margin-bottom: 1rem; border: 1px solid var(--bs-border-color); border-radius: 12px; overflow: hidden; }
.shift-check-group-header { padding: .8rem 1rem; background: var(--bs-tertiary-bg); font-weight: 700; display: flex; justify-content: space-between; }
.shift-check-row { padding: .8rem 1rem; border-top: 1px solid var(--bs-border-color); }
.shift-check-actions .btn { min-width: 115px; min-height: 44px; cursor: pointer; touch-action: manipulation; }
.shift-check-row.is-warning { border-left: 5px solid #ffc107; }
.shift-check-row.is-failed { border-left: 5px solid #dc3545; }
.shift-notice-modal { position:fixed; inset:0; z-index:20000; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(15,23,42,.72); backdrop-filter:blur(6px); pointer-events:auto; }
.shift-notice-modal.d-none { display:none!important; }
.shift-notice-modal .modal-dialog { width:min(560px,100%); margin:0; animation:shiftNoticeIn .2s ease-out; }
.shift-notice-modal .modal-content { overflow:hidden; border:0; border-radius:22px; background:#fff; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.shift-notice-heading { display:flex; align-items:center; gap:16px; padding:24px 24px 18px; }
.shift-notice-icon { flex:0 0 52px; width:52px; height:52px; display:flex; align-items:center; justify-content:center; border-radius:16px; font-size:27px; }
.shift-notice-eyebrow { margin-bottom:3px; color:#64748b; font-size:.72rem; font-weight:800; letter-spacing:.1em; }
.shift-notice-heading .modal-title { color:#0f172a; font-size:1.35rem; font-weight:800; line-height:1.25; }
.shift-notice-body { padding:2px 24px 24px; color:#334155; font-size:1.05rem; line-height:1.6; }
.shift-notice-body p:last-child { margin-bottom:0; }
.shift-notice-body ul { max-height:220px; overflow:auto; margin-top:12px!important; padding:10px 12px 10px 34px; border-radius:12px; background:#f8fafc; }
.shift-notice-body li { padding:5px 2px; }
.shift-notice-modal .modal-footer { gap:10px; padding:16px 24px 22px; border-top:1px solid #e2e8f0; background:#f8fafc; }
.shift-notice-modal .modal-footer .btn { min-width:150px; min-height:48px; margin:0; border-radius:12px; font-weight:750; }
.shift-notice-modal.is-warning .shift-notice-icon { color:#854d0e; background:#fef3c7; }
.shift-notice-modal.is-error .shift-notice-icon { color:#b91c1c; background:#fee2e2; }
.shift-notice-modal.is-success .shift-notice-icon { color:#047857; background:#d1fae5; }
@keyframes shiftNoticeIn { from { opacity:0; transform:translateY(12px) scale(.98); } to { opacity:1; transform:none; } }
@media (max-width:575.98px) {
    .shift-notice-modal { padding:14px; align-items:flex-end; }
    .shift-notice-modal .modal-content { border-radius:20px; }
    .shift-notice-heading { padding:20px 18px 14px; }
    .shift-notice-body { padding:2px 18px 20px; font-size:1rem; }
    .shift-notice-modal .modal-footer { display:grid; grid-template-columns:1fr; padding:14px 18px 18px; }
    .shift-notice-modal .modal-footer .btn { width:100%; }
    #shiftNoticeConfirmBtn { order:-1; }
}

.global-loading {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
    pointer-events: all;
}

.global-loading-box {
    min-width: 240px;
    max-width: calc(100vw - 32px);
    padding: 24px;
    border-radius: 8px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    text-align: center;
    box-shadow: var(--bs-box-shadow-lg);
}

.global-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Kanban */
.kanbanWrap {
    overflow-x: auto;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--kan-col-width);
    gap: var(--kan-col-gap);
    height: calc(100vh - 60px);
    align-items: start;
    align-content: start;
}

.kanCol {
    min-height: auto;
    display: flex;
    flex-direction: column;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 16px;
    box-shadow: var(--bs-box-shadow-sm);
    height: auto;
    align-self: start;
}

.kanCol-Head {
    padding: 10px 12px;
    border-bottom: 1px solid var(--bs-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: inherit;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.kanCol-Head .title {
    font-weight: 700
}

.kanCol-Body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: var(--card-gap);
}

.orderCard {
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--bs-body-bg);
    transition: transform .08s ease, box-shadow .08s ease, border-color .2s ease;
}
.orderCard-diaChi {
    font-size: 0.7rem;
    color: var(--bs-secondary-color);
    padding: 5px 10px;
}
.orderCard:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08)
}

.orderCard.selected {
    outline: 2px solid var(--bs-primary);
    border-color: var(--bs-primary);
}

.orderCard-Head,
.orderCard-Foot {
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.orderCard-Body {
    padding: 8px 10px;
    padding-top: 0px;
}

.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .6rem
}

.mon {
    background: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 600;
}

.timer {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    padding: .2rem .45rem;
    border-radius: .5rem;
}

.timer.ok {
    background: #e7f8ee
}

.timer.warn {
    background: #fff7e0
}

.timer.bad {
    background: #ffebee
}

.timer.over {
    background: #e9ecef
}

.ship-assign-table {
    min-width: 680px;
}

.ship-status-dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    margin-right: .4rem;
    border-radius: 50%;
    vertical-align: middle;
}

.ship-status-dot.is-online {
    background: #198754;
    box-shadow: 0 0 0 .18rem rgba(25, 135, 84, .16);
}

.ship-status-dot.is-offline {
    background: #adb5bd;
}

.ship-distance-cell {
    cursor: pointer;
    color: var(--bs-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ship-location-map {
    height: min(70vh, 620px);
    min-height: 420px;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
}

/* QR modal camera */
#qrVideo {
    width: 100%;
    border-radius: 12px;
    background: #000
}

canvas {
    display: none
}

/* Dropdown notifications */
.notif-menu {
    width: 380px;
    max-height: 50vh;
    overflow: auto
}

#orderRefundListBody {
    font-size: 11px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    :root {
        --kan-col-width: 86vw;
    }

    .brand {
        font-size: 1.05rem
    }

    .kanbanWrap {
        padding: 10px
    }

    .shift-check-actions .btn { min-width: 100px; }
}

#orderMap {
    width: 100%;
    height: 300px;
    position: relative;
}
