/* =========================================================
   BaoAoo POS
   Blue Modern Theme
   Powered by BaoAoo Computer
   ========================================================= */


/* =========================================================
   COLOR VARIABLES
   ========================================================= */

:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary-darker: #084298;
    --primary-light: #e7f1ff;
    --primary-soft: #f3f8ff;

    --success: #198754;
    --success-dark: #146c43;
    --success-light: #d1e7dd;

    --danger: #dc3545;
    --danger-dark: #b02a37;
    --danger-light: #f8d7da;

    --warning: #ffc107;

    --white: #ffffff;
    --background: #f4f7fb;

    --text: #1f2937;
    --text-light: #6b7280;

    --border: #dfe5ec;

    --shadow:
        0 4px 14px
        rgba(0, 0, 0, 0.07);

    --shadow-hover:
        0 8px 24px
        rgba(13, 110, 253, 0.15);

    --radius: 10px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    font-family:
        Arial,
        "Noto Sans Thai",
        Tahoma,
        sans-serif;

    background: var(--background);

    color: var(--text);

    line-height: 1.5;
}


/* =========================================================
   LINKS
   ========================================================= */

a {
    color: var(--primary);

    text-decoration: none;

    transition: 0.2s;
}

a:hover {
    color: var(--primary-dark);
}


/* =========================================================
   TOP HEADER
   ========================================================= */

.topbar {
    min-height: 68px;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    flex-wrap: wrap;

    padding: 14px 22px;

    color: white;

    background:
        linear-gradient(
            135deg,
            #0d6efd 0%,
            #0b5ed7 55%,
            #084298 100%
        );

    box-shadow:
        0 3px 12px
        rgba(0, 0, 0, 0.15);

    position: relative;

    z-index: 10;
}


.topbar strong {
    font-size: 21px;

    letter-spacing: 0.2px;
}


.brand {
    margin-left: 12px;

    color:
        rgba(255, 255, 255, 0.8);

    font-size: 12px;
}


.user-info {
    font-size: 13px;

    color:
        rgba(255, 255, 255, 0.92);
}


.topbar a {
    color: white;

    font-weight: bold;

    padding: 5px 8px;

    border-radius: 5px;
}


.topbar a:hover {
    background:
        rgba(255, 255, 255, 0.15);

    color: white;
}


/* =========================================================
   NAVIGATION
   ========================================================= */

.nav {
    padding: 10px 20px;

    background: white;

    border-bottom:
        1px solid var(--border);

    box-shadow:
        0 2px 5px
        rgba(0, 0, 0, 0.03);

    position: sticky;

    top: 0;

    z-index: 9;
}


.nav a {
    display: inline-block;

    margin: 3px 3px;

    padding: 9px 15px;

    border-radius: 7px;

    color: var(--primary-dark);

    background: var(--primary-light);

    font-size: 14px;

    font-weight: 600;

    transition: all 0.2s ease;
}


.nav a:hover {
    background: var(--primary);

    color: white;

    transform:
        translateY(-1px);

    box-shadow:
        0 3px 8px
        rgba(13, 110, 253, 0.25);
}


/* =========================================================
   MAIN CONTAINER
   ========================================================= */

.container {
    width: 100%;

    max-width: 1500px;

    margin: auto;

    padding: 22px;
}


/* =========================================================
   CARD
   ========================================================= */

.card {
    background: white;

    border:
        1px solid var(--border);

    border-radius: var(--radius);

    padding: 18px;

    margin-bottom: 18px;

    box-shadow: var(--shadow);

    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


.card h1,
.card h2,
.card h3 {
    margin-top: 0;
}


.card h2 {
    font-size: 21px;

    color: var(--primary-darker);

    padding-bottom: 9px;

    border-bottom:
        2px solid var(--primary-light);
}


.card h3 {
    color: #374151;
}


/* =========================================================
   GRID
   ========================================================= */

.grid2 {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 18px;
}


.grid3 {
    display: grid;

    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );

    gap: 18px;
}


.order-layout {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        430px;

    gap: 20px;

    align-items: start;
}


/* ตะกร้า Order ด้านขวา */

.order-layout > div:last-child {
    position: sticky;

    top: 78px;
}


/* =========================================================
   MENU GRID
   ========================================================= */

.menu-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(180px, 1fr)
        );

    gap: 13px;

    margin-bottom: 25px;
}


.menu-card {
    min-height: 135px;

    display: flex;

    flex-direction: column;

    justify-content: space-between;

    background:
        linear-gradient(
            180deg,
            #ffffff,
            #f8fbff
        );

    border:
        1px solid #d9e6f7;

    border-radius: 10px;

    padding: 15px;

    transition: all 0.2s ease;
}


.menu-card:hover {
    border-color: var(--primary);

    transform:
        translateY(-3px);

    box-shadow: var(--shadow-hover);
}


.menu-card strong {
    font-size: 17px;

    color: #1f2937;
}


.menu-card .small {
    margin-top: 5px;
}


/* =========================================================
   FORM
   ========================================================= */

label {
    display: block;

    margin-top: 10px;

    margin-bottom: 5px;

    font-weight: 600;

    color: #374151;

    font-size: 14px;
}


input,
select,
textarea,
button {
    font: inherit;
}


input,
select,
textarea {
    width: 100%;

    min-height: 40px;

    padding: 9px 11px;

    border:
        1px solid #cfd8e3;

    border-radius: 7px;

    background: white;

    color: #1f2937;

    outline: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}


input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px
        rgba(13, 110, 253, 0.12);
}


textarea {
    min-height: 85px;

    resize: vertical;
}


input::placeholder,
textarea::placeholder {
    color: #9ca3af;
}


/* =========================================================
   BUTTON
   ========================================================= */

button,
.btn {
    display: inline-block;

    min-height: 38px;

    padding: 9px 14px;

    border: none;

    border-radius: 7px;

    background:
        linear-gradient(
            135deg,
            var(--primary),
            var(--primary-dark)
        );

    color: white;

    cursor: pointer;

    font-weight: 600;

    text-align: center;

    transition:
        all 0.18s ease;

    box-shadow:
        0 2px 5px
        rgba(13, 110, 253, 0.18);
}


button:hover,
.btn:hover {
    color: white;

    background:
        linear-gradient(
            135deg,
            var(--primary-dark),
            var(--primary-darker)
        );

    transform:
        translateY(-1px);

    box-shadow:
        0 5px 12px
        rgba(13, 110, 253, 0.25);
}


button:active,
.btn:active {
    transform:
        translateY(0);
}


/* LIGHT BUTTON */

button.light,
.btn.light {
    background: white;

    color: var(--primary-dark);

    border:
        1px solid #b8cff2;

    box-shadow: none;
}


button.light:hover,
.btn.light:hover {
    background: var(--primary-light);

    color: var(--primary-darker);

    border-color: var(--primary);
}


/* RED BUTTON */

button.red,
.btn.red {
    background:
        linear-gradient(
            135deg,
            #dc3545,
            #b02a37
        );

    color: white;
}


button.red:hover,
.btn.red:hover {
    background: #a61e2c;
}


/* GREEN BUTTON */

button.green,
.btn.green {
    background:
        linear-gradient(
            135deg,
            #198754,
            #146c43
        );

    color: white;
}


button.green:hover,
.btn.green:hover {
    background: #105c37;
}


/* =========================================================
   TABLE
   ========================================================= */

table {
    width: 100%;

    border-collapse: separate;

    border-spacing: 0;

    background: white;

    border:
        1px solid var(--border);

    border-radius: 8px;

    overflow: hidden;
}


th,
td {
    padding: 10px;

    border-bottom:
        1px solid #e5e7eb;

    text-align: left;

    vertical-align: top;

    font-size: 14px;
}


th {
    background:
        linear-gradient(
            180deg,
            #eef5ff,
            #e5efff
        );

    color: #174a8b;

    font-weight: 700;

    border-bottom:
        1px solid #cbdcf4;
}


tbody tr:nth-child(even) {
    background: #fafcff;
}


tbody tr:hover {
    background: #eef6ff;
}


tbody tr:last-child td {
    border-bottom: none;
}


/* =========================================================
   ALERT
   ========================================================= */

.alert {
    padding: 12px 15px;

    margin-bottom: 15px;

    border-radius: 7px;

    border: 1px solid transparent;

    font-weight: 500;
}


.alert.success {
    background: #d1e7dd;

    color: #0f5132;

    border-color: #badbcc;
}


.alert.error {
    background: #f8d7da;

    color: #842029;

    border-color: #f5c2c7;
}


/* =========================================================
   STATUS
   ========================================================= */

.status {
    display: inline-block;

    padding: 5px 9px;

    border-radius: 999px;

    background: var(--primary-light);

    color: var(--primary-darker);

    border:
        1px solid #c9dcf8;

    font-size: 12px;

    font-weight: 600;

    white-space: nowrap;
}


/* =========================================================
   SMALL TEXT / UTILITIES
   ========================================================= */

.small {
    color: var(--text-light);

    font-size: 12px;
}


.right {
    text-align: right;
}


/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    padding: 20px;

    background:
        linear-gradient(
            135deg,
            #e7f1ff 0%,
            #f7fbff 45%,
            #d9eaff 100%
        );

    position: relative;

    overflow: hidden;
}


/* วงกลมตกแต่ง Background */

.login-page::before {
    content: "";

    position: absolute;

    width: 420px;

    height: 420px;

    border-radius: 50%;

    background:
        rgba(13, 110, 253, 0.08);

    top: -180px;

    right: -100px;
}


.login-page::after {
    content: "";

    position: absolute;

    width: 360px;

    height: 360px;

    border-radius: 50%;

    background:
        rgba(13, 110, 253, 0.07);

    bottom: -180px;

    left: -100px;
}


.login-box {
    position: relative;

    z-index: 2;

    width: 100%;

    max-width: 430px;

    padding: 32px;

    background:
        rgba(255, 255, 255, 0.96);

    border:
        1px solid #dce8f7;

    border-radius: 14px;

    box-shadow:
        0 18px 50px
        rgba(31, 71, 120, 0.15);
}


.login-box h1 {
    margin-top: 0;

    margin-bottom: 5px;

    color: var(--primary-darker);

    text-align: center;
}


.login-box p {
    margin-top: 0;

    margin-bottom: 25px;

    text-align: center;

    color: var(--text-light);
}


.login-box button {
    min-height: 45px;

    font-size: 16px;
}


/* =========================================================
   RECEIPT
   ========================================================= */

.receipt {
    max-width: 80mm;

    margin-left: auto;

    margin-right: auto;

    background: white;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    padding: 20px;

    text-align: center;

    color: #7b8794;

    font-size: 12px;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 9px;

    height: 9px;
}


::-webkit-scrollbar-track {
    background: #eef2f7;
}


::-webkit-scrollbar-thumb {
    background: #b8c8dc;

    border-radius: 10px;
}


::-webkit-scrollbar-thumb:hover {
    background: #8ea8c8;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .order-layout {
        grid-template-columns:
            minmax(0, 1fr)
            360px;
    }

}


/* =========================================================
   MOBILE / SMALL TABLET
   ========================================================= */

@media (max-width: 900px) {

    .grid2,
    .grid3,
    .order-layout {
        grid-template-columns: 1fr;
    }


    .order-layout > div:last-child {
        position: static;
    }


    .container {
        padding: 13px;
    }


    .topbar {
        padding: 12px 15px;
    }


    .nav {
        padding: 8px;
    }


    .nav a {
        padding: 8px 10px;

        font-size: 13px;
    }


    .card {
        padding: 13px;
    }


    table {
        display: block;

        overflow-x: auto;

        white-space: nowrap;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 550px) {

    .topbar {
        flex-direction: column;

        align-items: flex-start;
    }


    .brand {
        display: block;

        margin-left: 0;

        margin-top: 3px;
    }


    .user-info {
        width: 100%;
    }


    .login-box {
        padding: 22px;
    }


    .menu-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );
    }


    button,
    .btn {
        padding: 8px 10px;
    }

}


/* =========================================================
   PRINT RECEIPT
   ========================================================= */

@media print {

    @page {
        margin: 3mm;
    }


    .topbar,
    .nav,
    .footer,
    .no-print {
        display: none !important;
    }


    body {
        background: white;

        color: black;
    }


    .container {
        margin: 0;

        padding: 0;

        max-width: none;
    }


    .card {
        margin: 0;

        padding: 0;

        border: none;

        box-shadow: none;
    }


    .receipt {
        width: 80mm;

        max-width: 80mm;

        margin: 0 auto;
    }


    table {
        border: none;
    }


    th,
    td {
        padding: 4px;

        font-size: 11px;

        border-color: #ccc;
    }


    button,
    .btn {
        display: none !important;
    }

}