/* ============================================================
   STOCK SYSTEM - Mental Health App Theme
   Calm, soft, soothing. Lavender + wellness green on soft pastels.
   Soft 3D (gentle dual shadows), rounded, friendly.
   Fonts: Varela Round (headings) + Nunito Sans (body)
   ============================================================ */

:root {
    --radius-lg: 26px;
    --radius: 20px;
    --radius-sm: 14px;
    --border-w: 3px;

    /* Brand (calming lavender) */
    --primary: #8B5CF6;
    --primary-dark: #6D28D9;
    --primary-light: #EDE9FE;

    /* Accent (wellness green) */
    --accent: #10B981;
    --accent-dark: #059669;
    --accent-light: #D1FAE5;

    /* Surfaces & pastels */
    --bg: #FAF5FF;              /* soft lavender background */
    --card: #FFFFFF;
    --violet-soft: #F3EEFF;
    --mint-soft: #ECFDF5;
    --sky-soft: #E0F2FE;
    --rose-soft: #FCE7F3;
    --amber-soft: #FEF3C7;

    /* Text */
    --text: #3B2F54;
    --muted: #7A7191;
    --on-primary: #FFFFFF;

    /* Status */
    --success: #059669;
    --danger: #E11D48;
    --warn: #D97706;

    /* Soft 3D shadows (gentle, calm) */
    --shadow-outer: 8px 8px 24px rgba(139,92,246,.12), -4px -4px 12px rgba(255,255,255,.9);
    --shadow-soft: 4px 4px 14px rgba(139,92,246,.10);
    --shadow-inner: inset 3px 3px 8px rgba(107,74,204,.14), inset -2px -2px 6px rgba(255,255,255,.9);
    --shadow-btn-outer: 4px 4px 12px rgba(139,92,246,.20), -2px -2px 6px rgba(255,255,255,.9);
    --shadow-press: inset 3px 3px 8px rgba(107,74,204,.22), inset -2px -2px 5px rgba(255,255,255,.9);

    --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Prompt', 'Segoe UI', Tahoma, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 12% 10%, rgba(196,181,253,.35) 0%, transparent 40%),
        radial-gradient(circle at 88% 82%, rgba(209,250,229,.4) 0%, transparent 42%),
        radial-gradient(circle at 78% 12%, rgba(224,242,254,.4) 0%, transparent 38%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    letter-spacing: .2px;
}

h1, h2, h3, .brand, .card-value, .login-brand {
    font-family: 'Prompt', 'Segoe UI', sans-serif;
}

/* ================= TOP BAR ================= */
.topbar {
    background: linear-gradient(145deg, #a78bfa, #8B5CF6);
    color: #fff;
    display: flex;
    flex-direction: column;
    border-bottom: 3px solid #6D28D9;
    box-shadow: 0 6px 22px rgba(139,92,246,.30);
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand {
    font-size: 1.4rem;
    font-weight: 400;
    padding: 14px 22px 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-topbar-logo {
    width: 30px; height: 30px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
}
.login-logo {
    width: 56px; height: 56px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 16px 14px;
}
.nav a {
    color: #fff;
    text-decoration: none;
    padding: 9px 16px;
    font-size: .9rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    border: 3px solid transparent;
    background: rgba(255,255,255,.10);
    transition: all .2s var(--ease-soft);
    flex: 1;
    text-align: center;
    min-width: 110px;
}
.nav a:hover {
    background: rgba(255,255,255,.22);
    transform: translateY(-2px);
}
.nav a.active {
    background: #fff;
    color: var(--primary-dark);
    border: 3px solid var(--accent);
    box-shadow: var(--shadow-soft);
}
.nav-group { position: relative; flex: 1; min-width: 110px; }
.nav-group .nav-group-label { display: flex; align-items: center; justify-content: center; }
.nav-group .nav-group-label::after { content: " ▾"; }
.nav-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 260px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-outer);
    border: 3px solid var(--primary-light);
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 60;
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown { display: flex; }
.nav-group:hover .nav-group-label,
.nav-group:focus-within .nav-group-label { background: rgba(255,255,255,.22); }
.nav .nav-dropdown a {
    flex: none;
    min-width: 0;
    width: 100%;
    color: var(--text);
    background: none;
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}
.nav .nav-dropdown a:hover { background: var(--violet-soft); transform: none; }
.nav .nav-dropdown a.active {
    background: var(--violet-soft);
    color: var(--primary-dark);
    border: 3px solid var(--accent);
    box-shadow: none;
}

/* ================= USER BAR ================= */
.userbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 22px 4px;
}
.user-info {
    color: #fff;
    font-weight: 400;
    font-size: .95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.role-badge {
    background: rgba(255,255,255,.25);
    border: 2px solid rgba(255,255,255,.5);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 400;
}
.btn-logout {
    background: rgba(255,255,255,.16);
    color: #fff;
    border-color: rgba(255,255,255,.4);
}

/* ================= LOGIN SCREEN ================= */
.login-screen {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 18% 18%, rgba(196,181,253,.5) 0%, transparent 42%),
        radial-gradient(circle at 82% 82%, rgba(209,250,229,.55) 0%, transparent 42%),
        linear-gradient(150deg, #ece6ff, #f6fcfa);
    padding: 20px;
}
.login-box {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-outer);
    border: 3px solid var(--primary-light);
    text-align: center;
}
.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--primary-dark);
}
.login-sub {
    color: var(--muted);
    margin: 8px 0 22px;
    font-size: 1rem;
}
.login-error {
    background: var(--rose-soft);
    border: 1px solid #f9a8d4;
    color: var(--danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: .92rem;
    text-align: center;
}
.login-form { text-align: left; }
.btn-block {
    width: 100%;
    margin-top: 10px;
    font-size: 1.05rem;
}

/* ================= LAYOUT ================= */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 20px 40px;
    flex: 1;
}
.footer {
    text-align: center;
    padding: 18px;
    color: var(--muted);
    font-size: .85rem;
}
.page-title {
    font-size: 1.65rem;
    color: var(--text);
    margin-bottom: 22px;
    font-weight: 400;
}

/* ================= FLASH ================= */
#flash { position: fixed; top: 90px; left: 50%; transform: translateX(-50%); z-index: 150; width: min(92%, 480px); }
.flash {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    border: var(--border-w) solid;
    box-shadow: var(--shadow-soft);
    font-weight: 400;
    text-align: center;
    margin-bottom: 8px;
}
.flash-success { background: var(--accent-light); color: var(--accent-dark); border-color: #6ee7b7; }
.flash-error { background: var(--rose-soft); color: var(--danger); border-color: #f9a8d4; }

/* ================= PANELS & GRIDS ================= */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 22px;
    align-items: start;
}
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
    background: var(--card);
    padding: 22px;
    border-radius: var(--radius-lg);
    border: 3px solid var(--primary-light);
    box-shadow: var(--shadow-outer);
    margin-bottom: 20px;
}
.panel h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--primary-dark);
    font-weight: 400;
}

/* ================= CARDS (dashboard) ================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 3px solid var(--primary-light);
    padding: 20px;
    box-shadow: var(--shadow-outer);
    text-align: center;
}
.card-icon {
    width: 54px; height: 54px;
    margin: 0 auto 10px;
    border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid;
    box-shadow: var(--shadow-soft);
}
.card-icon svg { width: 26px; height: 26px; }
.card:nth-child(1) .card-icon { background: var(--accent-light); color: var(--accent-dark); border-color: #6ee7b7; }
.card:nth-child(2) .card-icon { background: var(--sky-soft); color: #0284c7; border-color: #7dd3fc; }
.card:nth-child(3) .card-icon { background: var(--violet-soft); color: var(--primary-dark); border-color: #c4b5fd; }
.card:nth-child(4) .card-icon { background: var(--amber-soft); color: var(--warn); border-color: #fde68a; }
.card-label { color: var(--muted); margin: 6px 0 4px; font-weight: 400; }
.card-value { font-size: 2.1rem; font-weight: 400; color: var(--primary-dark); }
.card-warning .card-value { color: var(--warn); }

/* ================= QUICK LINKS ================= */
.quick-links h2 { margin-bottom: 14px; font-size: 1.2rem; }
.quick-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}
.quick-item {
    background: var(--card);
    padding: 20px;
    border-radius: var(--radius);
    border: 3px solid var(--primary-light);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 400;
    cursor: pointer;
    color: var(--text);
    box-shadow: var(--shadow-soft);
    transition: transform .15s var(--ease-bounce), box-shadow .15s;
    display: flex; align-items: center; gap: 10px;
}
.quick-item svg { width: 22px; height: 22px; color: var(--primary); flex-shrink: 0; }
.quick-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-outer); }

/* ================= BUTTONS ================= */
.btn {
    font-family: inherit;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: var(--border-w) solid #c4b5fd;
    background: #fff;
    color: var(--text);
    font-weight: 400;
    font-size: .95rem;
    cursor: pointer;
    box-shadow: var(--shadow-btn-outer);
    transition: transform .15s var(--ease-bounce), box-shadow .15s;
    display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { box-shadow: var(--shadow-press); transform: translateY(1px); }
.btn-primary {
    background: linear-gradient(145deg, #7c3aed, #8B5CF6);
    color: #fff;
    border-color: #6D28D9;
}
.btn-danger { background: var(--rose-soft); color: var(--danger); border-color: #f9a8d4; }
.btn-sm { padding: 8px 14px; font-size: .85rem; border-width: 3px; }
.actions { white-space: nowrap; }

/* ================= FORM ================= */
.form .form-row { margin-bottom: 14px; }
.form label {
    display: block;
    font-weight: 400;
    font-size: .88rem;
    margin-bottom: 6px;
    color: var(--muted);
}
.form label.check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.5;
    cursor: pointer;
    color: var(--text);
}
.form label.check-label input { width: auto; margin: 0; }
.form input, .form select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 3px solid #e9d5ff;
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    box-shadow: var(--shadow-inner);
    transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--shadow-inner), 0 0 0 4px rgba(139,92,246,.20);
}
.stock-hint {
    display: none;
    margin-top: 8px;
    font-size: .9rem;
    color: var(--accent-dark);
    font-weight: 400;
    background: var(--accent-light);
    padding: 6px 12px;
    border-radius: 10px;
    border: 2px solid #6ee7b7;
}
.pick-wrap { position: relative; }
.pick-sug {
    position: absolute;
    z-index: 50;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    display: none;
}
.pick-item {
    padding: 9px 12px;
    cursor: pointer;
    font-size: .92rem;
    border-bottom: 1px solid #f3f0fa;
}
.pick-item:hover, .pick-item:focus { background: var(--violet-soft); }
.pick-item:last-child { border-bottom: 0; }

/* ================= PRODUCT IMAGE & CATEGORY ================= */
.mini-img {
    width: 42px; height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #e9d5ff;
    box-shadow: var(--shadow-soft);
    background: var(--violet-soft);
}
.mini-img-none {
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-weight: 400;
}
.cat-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 400;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 2px solid #c4b5fd;
}
.role-staff {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 400;
    background: var(--sky-soft);
    color: #0369a1;
    border: 2px solid #7dd3fc;
}
.log-action { font-weight: 400; color: var(--primary-dark); }
.img-upload { display: inline-block; cursor: pointer; }
.img-upload input[type="file"] { display: none; }
.img-upload-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 3px solid #a5f3fc;
    background: var(--sky-soft);
    color: var(--text);
    font-weight: 400;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: transform .15s var(--ease-bounce);
}
.img-upload-btn:hover { transform: translateY(-2px); }
.img-preview { margin-top: 10px; min-height: 0; }
.img-preview-img {
    width: 72px; height: 72px;
    border-radius: 14px;
    object-fit: cover;
    border: 3px solid #e9d5ff;
    box-shadow: var(--shadow-soft);
}
.comp-logo-img { width: 88px; height: 88px; object-fit: contain; border-color: #bae6fd; }
.brand-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--card);
    border: 3px solid var(--primary-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px 22px;
    margin-bottom: 18px;
}
.brand-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 12px; }
.brand-name { font-size: 1.35rem; color: var(--primary-dark); }
.receipt-logo { max-height: 46px; max-width: 100%; object-fit: contain; margin-bottom: 4px; }

/* ================= TABLE ================= */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .92rem;
}
.table th {
    text-align: left;
    padding: 12px 12px;
    background: var(--violet-soft);
    color: var(--primary-dark);
    font-weight: 400;
    border-bottom: 3px solid #ddd6fe;
}
.table td {
    padding: 11px 12px;
    border-bottom: 2px solid #f3f0fa;
    color: var(--text);
}
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fbf7ff; }
.table th:first-child { border-radius: 12px 0 0 0; }
.table th:last-child { border-radius: 0 12px 0 0; }
.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: .8rem;
    font-weight: 400;
    border: 2px solid;
}
.badge-ok { background: var(--accent-light); color: var(--accent-dark); border-color: #6ee7b7; }
.badge-danger { background: var(--rose-soft); color: var(--danger); border-color: #f9a8d4; }
.badge-warn { background: var(--amber-soft); color: var(--warn); border-color: #fde68a; }
.text-green { color: var(--success); font-weight: 400; }
.text-red { color: var(--danger); font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 26px; font-weight: 400; }
.report-num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.row-void td { color: var(--muted); text-decoration: line-through; }
.table tr.row-void .badge { text-decoration: none; }
.footer-row { background: var(--violet-soft) !important; font-weight: 400; }
.report-count { color: var(--muted); font-weight: 400; }
.report-tools {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 10px;
}
.filter-bar {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px; margin-bottom: 16px;
    padding: 14px;
    background: var(--violet-soft);
    border-radius: var(--radius-sm);
    border: 3px solid var(--primary-light);
}
.filter-bar input[type="text"], .filter-bar input[type="date"], .filter-bar select {
    padding: 8px 12px;
    border: 3px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
}
.filter-bar input[type="text"] { width: 150px; }
.filter-sep { color: var(--muted); }
.report-summary { margin-top: 18px; display: flex; justify-content: flex-end; }
.summary-box {
    background: var(--accent-light);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    border: 3px solid #6ee7b7;
    font-size: 1rem;
    font-weight: 400;
    color: var(--accent-dark);
    box-shadow: var(--shadow-soft);
    display: inline-block;
}
.summary-box strong { font-size: 1.15rem; }
.sub-title { font-size: 1.1rem; margin: 22px 0 14px; color: var(--primary-dark); }
.filter-bar { margin-bottom: 16px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-group .form-row { margin-bottom: 0; }

/* ================= MODAL ================= */
.modal {
    display: none;
    position: fixed; inset: 0;
    z-index: 100;
    background: rgba(59,47,84,.45);
    align-items: center; justify-content: center;
    padding: 20px;
}
.modal-box {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 460px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-outer);
    border: 3px solid var(--primary-light);
}
.modal-box h2 { font-size: 1.3rem; margin-bottom: 18px; color: var(--primary-dark); }
.modal-box-wide { max-width: 860px; }
.msm-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 24px;
}
.msm-grid .form-row { margin-bottom: 16px; }
.msm-span { grid-column: 1 / -1; }
@media (max-width: 700px) { .msm-grid { grid-template-columns: 1fr; } }
.member-search {
    padding: 8px 12px;
    border: 3px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .92rem;
    background: #fff;
    width: 220px;
}
.form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 3px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: .92rem;
    resize: vertical;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-close { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); padding: 0 4px; line-height: 1; }
.modal-body { color: var(--text); }
.modal-body h4 { margin-top: 8px; margin-bottom: 6px; color: var(--text); }
.receipt-box { max-width: 380px; }
.receipt-header { text-align: center; margin-bottom: 10px; }
.receipt-title { font-weight: 700; font-size: 1.05rem; }
.receipt-sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.receipt-doc-title { font-weight: 700; font-size: .95rem; text-align: center; margin: 6px 0 4px; }
.receipt-preview { border: 1px solid #e5e7eb; border-radius: var(--radius-sm); padding: 14px; background: #fff; }
.receipt-table { width: 100%; }
.receipt-table th { text-align: left; font-size: .82rem; }
.receipt-table th:last-child, .receipt-table td:last-child { text-align: right; }
.receipt-table td { font-size: .9rem; }
.receipt-meta { font-size: .8rem; color: var(--muted); text-align: center; margin: 6px 0 0; }

/* ================= SVG ICON HELPERS ================= */
.ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
}
.ic svg { width: 100%; height: 100%; }
.btn svg, .quick-item svg, .img-upload-btn svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    display: inline-block;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 640px) {
    .container { padding: 18px 14px 32px; }
    .page-title { font-size: 1.35rem; }
    .panel { padding: 16px; }
    .staff .actions { white-space: normal; }
    .card-value { font-size: 1.7rem; }
}

/* ================= POS ================= */
.pos-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pos-products, .pos-cart { min-height: 420px; }
.pos-search { width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 2px solid var(--primary); font-size: 1.05rem; font-family: inherit; outline: none; margin-bottom: 8px; }
.pos-search:focus { box-shadow: 0 0 0 3px rgba(139,92,246,.18); }
.pos-results { max-height: 540px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.pos-card { padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: var(--radius-sm); background: #fff; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pos-card div { flex: 1; }
.pos-card .muted { font-size: .82rem; color: var(--muted); }
.pos-card .in-cart { color: var(--primary); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.pos-total { padding: 14px; background: var(--violet-soft); border-radius: var(--radius-sm); margin: 12px 0; font-size: 1.15rem; text-align: right; }
.pos-cart .table { margin-bottom: 10px; }
.pos-cart .actions button { font-size: .85rem; padding: 6px 10px; }
.btn-xs { padding: 3px 8px; font-size: .8rem; min-width: 30px; }
.muted { color: var(--muted); }
.pos-sale-box { max-width: 620px; }
.pos-sale-box h3 { color: var(--primary-dark); margin: 0; }
.pos-services { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pos-service-btn { border: 2px solid var(--primary-light); background: var(--card); border-radius: var(--radius-sm); }
.pos-service-btn:hover { background: var(--violet-soft); }
.svc-tag { font-weight: 400; font-size: .75rem; vertical-align: middle; }
.pos-cash-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; }
.pos-cash-row label { font-weight: 700; font-size: .95rem; }
.pos-cash-row input { width: 150px; padding: 8px 10px; border-radius: var(--radius-sm); border: 2px solid #e5e7eb; font-size: 1rem; font-family: inherit; text-align: right; }
.pos-cash-row input:focus { border-color: var(--primary); outline: none; }
.pos-member-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--violet-soft); border: 1px solid #ddd6fe; border-radius: var(--radius-sm); padding: 5px 8px; font-size: .85rem; }
.pos-member-chip button { padding: 0 6px; }
.scan-card { border: 1px dashed var(--primary); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; text-align: left; background: #f8fafc; }
.scan-header { font-weight: 700; font-size: .95rem; margin-bottom: 8px; }
.scan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.scan-preview { display: block; max-width: 220px; max-height: 140px; margin: 8px 0; border-radius: var(--radius-sm); border: 1px solid #e5e7eb; }
.scan-status { font-size: .88rem; margin-top: 8px; }
.scan-ok { color: #15803d; }
.scan-warn { color: #b45309; }
.scan-err { color: #dc2626; }
.pos-points-box { display: flex; flex-direction: column; align-items: stretch; gap: 4px; margin: 6px 0; }
.pos-points-box label { font-weight: 700; font-size: .9rem; }
.pos-points-box .muted { font-size: .82rem; }
.pos-points-box input { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 2px solid #e5e7eb; font-size: 1rem; font-family: inherit; text-align: right; }
.pos-points-box input:focus { border-color: var(--primary); outline: none; }
.pos-invoice-row { display: flex; align-items: center; gap: 6px; font-size: .9rem; margin: 6px 0; }
.pos-invoice-warn { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; border-radius: var(--radius-sm); padding: 6px 8px; font-size: .82rem; margin: 4px 0; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.receipt-customer { font-size: 11px; margin: 6px 0; border: 1px dashed #999; padding: 4px 6px; }
.receipt-customer .receipt-customer-title { font-weight: 700; font-size: 10px; margin-bottom: 2px; }
.input-invalid { border-color: var(--danger) !important; box-shadow: 0 0 0 2px rgba(239,68,68,.15); }
.pos-change-short { color: var(--danger); }
.req-star { color: var(--danger); font-weight: 700; margin-left: 2px; }
.form-row label .req-star, .msm-grid label .req-star { color: var(--danger); }
@media (max-width: 800px) { .pos-layout { grid-template-columns: 1fr; } }

/* ---------- สถานที่ / การจอง ---------- */
.form-row-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.room-pay-total { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
#bk_days { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.bk-day {
  position: relative; border: 2px solid #e5e7eb; border-radius: var(--radius-sm);
  padding: 8px 6px; background: #fff; cursor: pointer; text-align: center; transition: all .15s;
}
.bk-day:hover:not(:disabled) { border-color: var(--primary); }
.bk-day.on, .bk-day-on { border-color: var(--primary); background: var(--accent-light); }
.bk-day:disabled { opacity: .5; cursor: not-allowed; background: #fafafa; }
.bk-day-date { font-weight: 700; font-size: .95rem; }
.bk-day-count { font-size: .78rem; color: var(--success); margin-top: 2px; }
.bk-day:disabled .bk-day-count { color: var(--muted); }
.bk-day-today {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: .66rem; padding: 1px 6px; border-radius: 999px;
}
.cal-scroll { overflow-x: auto; }
.cal-table { table-layout: fixed; min-width: 640px; }
.cal-table th, .cal-table td { padding: 6px 8px; vertical-align: top; }
.cal-table .cal-th { text-align: center; font-size: .8rem; white-space: nowrap; }
.cal-table .cal-room-th { text-align: left; width: 130px; }
.cal-room { font-size: .85rem; white-space: nowrap; }
.cal-td { min-height: 40px; }
.cal-empty { color: var(--muted); font-size: .8rem; }
.cal-chip {
    display: inline-block; margin: 2px 3px 2px 0; padding: 2px 7px; border-radius: 999px;
    font-size: .76rem; line-height: 1.4; white-space: nowrap; cursor: default;
}
.cal-chip.cal-booked { background: var(--amber-soft); color: var(--warn); border: 1px solid #fde68a; }
.cal-chip.cal-paid { background: var(--accent-light); color: var(--accent-dark); border: 1px solid #bbf7d0; }
.cal-chip.cal-checked_in { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.cal-chip.cal-cancelled { background: var(--rose-soft); color: var(--danger); border: 1px solid #fecaca; text-decoration: line-through; }
.cal-legend { margin-top: 10px; text-align: left; }
