﻿/* =========================================================
   VMS2026 - Dual Theme (Dark + Light) - Smooth & Clean
   Change theme by: documentElement.dataset.theme = "dark"/"light"
   ========================================================= */

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans Bengali", "Noto Sans", sans-serif;
    line-height: 1.35;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button, input, select, textarea {
    font: inherit;
}

pre {
    margin: 0;
    white-space: pre-wrap;
}

.hidden {
    display: none !important;
}

:root {
    --r: 18px;
    --r2: 14px;
    --shadow: 0 18px 42px rgba(0,0,0,.28);
    --shadow2: 0 10px 26px rgba(0,0,0,.18);
}

    /* =========================
   DARK THEME (default)
   ========================= */
    :root[data-theme="dark"] {
        color-scheme: dark;
        --bg: radial-gradient(1200px 700px at 15% 0%, rgba(88,128,255,.20), transparent 60%), radial-gradient(800px 520px at 85% 10%, rgba(45,212,191,.12), transparent 55%), radial-gradient(900px 700px at 50% 95%, rgba(168,85,247,.10), transparent 60%), linear-gradient(180deg, #070b16 0%, #070a12 60%, #050812 100%);
        --panel: rgba(15, 23, 42, .55);
        --panel2: rgba(2, 6, 23, .55);
        --border: rgba(255,255,255,.08);
        --border2: rgba(255,255,255,.12);
        --text: rgba(255,255,255,.92);
        --muted: rgba(255,255,255,.70);
        --muted2: rgba(255,255,255,.55);
        --btn: rgba(255,255,255,.06);
        --btnHover: rgba(255,255,255,.10);
        --inputBg: rgba(255,255,255,.04);
        --inputBgFocus: rgba(255,255,255,.06);
        --accent: #2d5cff;
        --accent2: #4f7bff;
        --ripple: rgba(255,255,255,.20);
    }

    /* =========================
   LIGHT THEME
   ========================= */
    :root[data-theme="light"] {
        color-scheme: light;
        --bg: radial-gradient(900px 520px at 15% 0%, rgba(45,92,255,.10), transparent 60%), radial-gradient(800px 520px at 90% 10%, rgba(34,197,94,.09), transparent 55%), linear-gradient(180deg, #f7f9ff 0%, #f4f7ff 50%, #f7f9ff 100%);
        --panel: rgba(255,255,255,.78);
        --panel2: rgba(255,255,255,.86);
        --border: rgba(15,23,42,.10);
        --border2: rgba(15,23,42,.14);
        --text: #0b1220;
        --muted: rgba(11,18,32,.62);
        --muted2: rgba(11,18,32,.48);
        --btn: rgba(255,255,255,.92);
        --btnHover: #ffffff;
        --inputBg: rgba(255,255,255,.92);
        --inputBgFocus: #ffffff;
        --accent: #2d5cff;
        --accent2: #4f7bff;
        --ripple: rgba(45,92,255,.20);
        --shadow: 0 18px 40px rgba(15,23,42,.10);
        --shadow2: 0 10px 26px rgba(15,23,42,.08);
    }

/* =========================
   Layout
   ========================= */
.container {
    width: min(1100px, 94vw);
    margin: 0 auto;
    padding: 14px 0 60px;
}

hr.sep {
    border: none;
    height: 1px;
    background: var(--border2);
    margin: 18px 0;
}

.message {
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--muted2);
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

    .panel.pad2 {
        padding: 18px;
    }

.sectionTitle {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: .3px;
    margin: 0 0 10px;
}

/* =========================
   Topbar
   ========================= */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 12px 0;
    background: color-mix(in oklab, var(--panel2) 80%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

    .topbar .row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--panel2) 85%, transparent);
    border: 1px solid var(--border);
    box-shadow: var(--shadow2);
}

    .brand img {
        width: 64px;
        height: 64px;
        object-fit: contain;
        filter: drop-shadow(0 6px 12px rgba(0,0,0,.18));
    }

    .brand .title {
        font-weight: 900;
        font-size: 16px;
    }

    .brand .sub {
        font-size: 12px;
        color: var(--muted2);
        margin-top: 2px;
    }

.topActions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Tabs */
.tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 70%, transparent);
    box-shadow: var(--shadow2);
}

.tab {
    border: none;
    background: transparent;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--muted);
    transition: background .18s ease, transform .06s ease, color .18s ease;
}

    .tab:hover {
        color: var(--text);
    }

    .tab.active {
        background: color-mix(in oklab, var(--accent) 14%, transparent);
        border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
        color: var(--text);
    }

    .tab:active {
        transform: translateY(1px);
    }

/* Buttons */
.btn {
    border: 1px solid var(--border2);
    background: var(--btn);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 14px;
    cursor: pointer;
    box-shadow: var(--shadow2);
    transition: transform .06s ease, background .18s ease, border-color .18s ease;
}

    .btn:hover {
        background: var(--btnHover);
        border-color: var(--border2);
    }

    .btn:active {
        transform: translateY(1px);
    }

    .btn.primary {
        background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 92%, white 8%), color-mix(in oklab, var(--accent) 76%, black 24%));
        border-color: color-mix(in oklab, var(--accent) 40%, transparent);
        color: #fff;
    }

        .btn.primary:hover {
            background: linear-gradient(180deg, color-mix(in oklab, var(--accent2) 92%, white 8%), color-mix(in oklab, var(--accent) 76%, black 24%));
        }

    .btn.danger {
        background: rgba(239,68,68,.12);
        border-color: rgba(239,68,68,.24);
        color: color-mix(in oklab, #b91c1c 90%, var(--text) 10%);
    }

/* Inputs */
.input, input[type="text"], input[type="password"], input[type="tel"], select, textarea {
    width: 100%;
    background: var(--inputBg);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 12px 12px;
    border-radius: 14px;
    outline: none;
    box-shadow: var(--shadow2);
    transition: border-color .18s ease, background .18s ease;
}

    .input:focus, input:focus, select:focus, textarea:focus {
        border-color: color-mix(in oklab, var(--accent) 45%, transparent);
        background: var(--inputBgFocus);
    }

::placeholder {
    color: color-mix(in oklab, var(--muted2) 80%, transparent);
}

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, color-mix(in oklab, var(--text) 40%, transparent) 50%), linear-gradient(135deg, color-mix(in oklab, var(--text) 40%, transparent) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

/* Grid */
.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.searchRow {
    display: grid;
    grid-template-columns: 1fr 140px;
    gap: 12px;
    align-items: center;
}

@media (max-width: 820px) {
    .grid2, .searchRow {
        grid-template-columns: 1fr;
    }
}

/* Login box */
.loginBox {
    width: min(520px, 94vw);
    margin: 28px auto 0;
}

/* =========================
   Results Cards + Ripple
   ========================= */
#results {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.resultCard {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 75%, transparent);
    box-shadow: var(--shadow2);
    -webkit-tap-highlight-color: transparent;
}

    .resultCard, .resultCard * {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

.resultMain {
    flex: 1 1 auto;
    min-width: 0;
}

.resultName {
    font-size: 17px;
    font-weight: 900;
    line-height: 1.15;
}

.resultNo {
    font-weight: 800;
    opacity: .75;
    margin-left: 6px;
    font-size: 13px;
}

.resultMeta {
    margin-top: 6px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--accent) 8%, transparent);
    color: color-mix(in oklab, var(--text) 85%, transparent);
}

.resultAddr {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chevron {
    flex: 0 0 auto;
    width: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    opacity: .5;
    color: var(--muted2);
}

/* clickable */
.resultCard.clickable {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform .12s ease, border-color .18s ease, background .18s ease;
}

    .resultCard.clickable:hover {
        transform: translateY(-1px);
        border-color: color-mix(in oklab, var(--accent) 28%, var(--border));
        background: color-mix(in oklab, var(--panel2) 90%, transparent);
    }

    .resultCard.clickable:active {
        transform: translateY(0);
    }

/* ripple */
.resultCard .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    animation: ripple 520ms ease-out;
    background: var(--ripple);
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(3.2);
        opacity: 0;
    }
}



/* =========================
   Modal (Slip)
   ========================= */
.modalOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.40);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 60;
}

:root[data-theme="light"] .modalOverlay {
    background: rgba(15,23,42,.30);
}

.modal {
    width: min(980px, 96vw);
    background: color-mix(in oklab, var(--panel2) 96%, white 4%);
    border: 1px solid var(--border2);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.modalHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 85%, transparent);
}

    .modalHeader .title {
        font-weight: 900;
    }

.modalBody {
    padding: 16px;
}

.slipGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

@media (max-width: 900px) {
    .slipGrid {
        grid-template-columns: 1fr;
    }
}

.slipBox {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 88%, transparent);
    box-shadow: var(--shadow2);
    padding: 14px;
}

#slipText {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Noto Sans Bengali", monospace;
    font-size: 14px;
    line-height: 1.4;
    color: var(--text);
}

.actionsRow {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

    .actionsRow button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 10px 14px;
        border: 1px solid var(--border2);
        background: var(--btn);
        color: var(--text);
        border-radius: 14px;
        cursor: pointer;
        box-shadow: var(--shadow2);
        transition: transform .06s ease, background .18s ease, border-color .18s ease;
        font-size: 14px;
    }

        .actionsRow button:hover {
            background: var(--btnHover);
            border-color: var(--border2);
        }

        .actionsRow button:active {
            transform: translateY(1px);
        }

        .actionsRow button.primary {
            background: linear-gradient(180deg, color-mix(in oklab, var(--accent) 92%, white 8%), color-mix(in oklab, var(--accent) 76%, black 24%));
            border-color: color-mix(in oklab, var(--accent) 40%, transparent);
            color: #fff;
        }

            .actionsRow button.primary:hover {
                background: linear-gradient(180deg, color-mix(in oklab, var(--accent2) 92%, white 8%), color-mix(in oklab, var(--accent) 76%, black 24%));
            }

        .actionsRow button span:first-child {
            font-size: 16px;
            line-height: 1;
        }

/* Form */
.formRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 820px) {
    .formRow {
        grid-template-columns: 1fr;
    }
}

.checkboxRow {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 85%, transparent);
}

    .checkboxRow input {
        width: 18px;
        height: 18px;
    }

/* Scrollbar */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--muted2) 40%, transparent);
    border-radius: 999px;
    border: 2px solid color-mix(in oklab, var(--panel2) 85%, transparent);
}

*::-webkit-scrollbar-track {
    background: color-mix(in oklab, var(--panel2) 60%, transparent);
}

/* Print */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    .topbar, .tabs, .btn, #results, .hint, .modalHeader, .actionsRow, #loginView {
        display: none !important;
    }

    .modal, .panel, .slipBox {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    #slipText {
        color: #000 !important;
        font-size: 12pt;
    }
}

/* POS modes */
body.pos58 #slipText {
    font-size: 10.5px;
}

body.pos80 #slipText {
    font-size: 12px;
}

.filtersPanel {
    margin-top: 10px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: color-mix(in oklab, var(--panel2) 70%, transparent);
}
/* ===== Mobile font boost ===== */
@media (max-width: 720px) {
    body {
        font-size: 16px;
    }

    .sectionTitle {
        font-size: 18px;
    }

    .btn {
        font-size: 16px;
        padding: 12px 16px;
    }

    .input, input, select, textarea {
        font-size: 16px;
        padding: 14px 14px;
    }

    .resultName {
        font-size: 18px;
    }

    .resultNo {
        font-size: 14px;
    }

    .badge {
        font-size: 13px;
        padding: 6px 10px;
    }

    .resultAddr {
        font-size: 14px;
        white-space: normal;
    }
}

/* ===== Visit History ===== */
.historyBox {
    margin-top: 12px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.historyHeaderRow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.historyHeader {
    font-weight: 700;
}

.historyCount {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in oklab, var(--accent) 10%, transparent);
    color: var(--text);
}

.historyList {
    display: grid;
    gap: 10px;
}

.historyGroup {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px;
}

    .historyGroup summary {
        cursor: pointer;
        list-style: none;
        user-select: none;
    }

        .historyGroup summary::-webkit-details-marker {
            display: none;
        }

.historyGroupTitle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    padding: 4px 0;
}

.historyGroupBadge {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    background: color-mix(in oklab, var(--accent) 12%, transparent);
    color: var(--text);
}

.historyItems {
    margin-top: 8px;
    display: grid;
    gap: 8px;
}

.historyItem {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in oklab, var(--panel2) 60%, transparent);
}

.historyTop {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    opacity: 0.9;
}

.historyWhen {
    color: var(--muted);
}

.historyWho {
    font-weight: 600;
}

.historyMeta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.historyPill {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 11px;
    background: color-mix(in oklab, var(--panel2) 80%, transparent);
}

.historyNote {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    color: var(--muted);
    padding: 8px;
    border-left: 2px solid var(--border2);
    background: color-mix(in oklab, var(--panel2) 50%, transparent);
    border-radius: 6px;
}

.historyEmpty {
    font-size: 13px;
    opacity: 0.8;
    text-align: center;
    padding: 20px;
    color: var(--muted2);
}
/* Dark mode এ */
:root[data-theme="dark"] select option {
    background: #1e293b; /* Dark gray background */
    color: #e2e8f0; /* Light text */
}

/* Light mode এ */
:root[data-theme="light"] select option {
    background: #ffffff; /* White background */
    color: #0f172a; /* Dark text */
}

/* ========== MODAL SMOOTH SCROLLING FIX ========== */

.modalBody {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.slipContent {
    max-height: 350px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 8px;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-end;
    z-index: 1000;
}

.modal {
    width: 100%;
    max-width: 100%;
    border-radius: 12px 12px 0 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modalHeader {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
}

.modalFooter {
    position: sticky;
    bottom: 0;
    z-index: 10;
    flex-shrink: 0;
    border-top: 1px solid var(--border-color, #2a3345);
    padding: 12px;
    background-color: var(--bg-card, #1a1f35);
}

.modalBody {
    flex-grow: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.slipGrid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.slipBox {
    background-color: var(--bg-input, #242d42);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color, #2a3345);
    overflow: visible;
}

.actionsRow {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 480px) {
    .slipContent {
        max-height: 300px;
    }

    .modal {
        max-height: 95vh;
    }

    .modalBody {
        padding: 12px;
    }
}