* {
    box-sizing: border-box;
    font-family: "Prompt", sans-serif;
}

body {
    margin: 0;
    background: linear-gradient(135deg, #fff1e6, #ffe2c8);
    color: #222;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #fff7ed;
    padding: 20px;
    border-right: 1px solid #ffd7b5;
}

.logo {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 35px;
}

.logo-icon {
    background: #ff7a00;
    color: white;
    padding: 12px;
    border-radius: 12px;
    font-size: 24px;
}

.logo h2 {
    margin: 0;
    color: #ff6b00;
}

.logo p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

.menu a {
    display: block;
    padding: 14px 16px;
    text-decoration: none;
    color: #333;
    border-radius: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.menu a:hover,
.menu a.active {
    background: #ffe1c2;
    color: #ff6500;
}

.main {
    flex: 1;
    padding: 30px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar h1 {
    color: #ff6b00;
    margin: 0;
}

.btn {
    border: none;
    background: #ff7a00;
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
}

.btn:hover {
    background: #e85f00;
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 30px;
}

.card {
    background: white;
    padding: 22px;
    border-radius: 22px;
    box-shadow: 0 8px 25px rgba(255, 122, 0, 0.12);
}

.card h3 {
    margin: 0;
    color: #777;
    font-size: 15px;
}

.card .number {
    font-size: 34px;
    font-weight: bold;
    margin-top: 10px;
    color: #ff6b00;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 25px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.table th,
.table td {
    padding: 14px;
    border-bottom: 1px solid #f0d5c0;
    text-align: left;
}

.table th {
    background: #fff3e6;
    color: #ff6500;
}

.badge {
    background: #dcfce7;
    color: #15803d;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
}

.quick-btn {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    background: #fff0df;
    color: #ff6500;
    font-weight: bold;
    border: 1px solid #ffc89b;
}

.quick-btn:hover {
    background: #ffd9b0;
}

@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .cards,
    .content-grid {
        grid-template-columns: 1fr;
    }
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group select {
    padding: 14px 16px;
    border: 1px solid #ffd1a8;
    border-radius: 14px;
    font-size: 16px;
    outline: none;
    background: #fffaf5;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #ff7a00;
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
    background: white;
}

.form-action {
    grid-column: span 2;
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.big-btn {
    font-size: 16px;
    padding: 15px 24px;
}

.cancel-btn {
    padding: 15px 24px;
    border-radius: 12px;
    text-decoration: none;
    color: #ff6500;
    background: #fff0df;
    font-weight: bold;
}

.alert {
    padding: 14px 18px;
    border-radius: 14px;
    margin-top: 18px;
    font-weight: bold;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

@media (max-width: 900px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-action {
        grid-column: span 1;
        flex-direction: column;
    }
}
.checkout-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 25px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.search-box input {
    flex: 1;
    padding: 15px 18px;
    border-radius: 14px;
    border: 1px solid #ffd1a8;
    font-size: 16px;
    background: #fffaf5;
    outline: none;
}

.search-box input:focus {
    border-color: #ff7a00;
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.12);
    background: white;
}

.car-detail {
    margin-top: 25px;
    padding: 20px;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border: 1px solid #ffd7b5;
}

.detail-row,
.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #ffd1a8;
}

.detail-row span,
.receipt-row span {
    color: #777;
}

.price-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin: 22px 0;
}

.price-box div {
    background: white;
    padding: 20px;
    border-radius: 18px;
    box-shadow: 0 8px 22px rgba(255, 122, 0, 0.12);
}

.price-box span {
    color: #777;
}

.price-box h2 {
    margin: 8px 0 0;
    color: #ff6500;
}

.price-box h1 {
    margin: 8px 0 0;
    color: #16a34a;
    font-size: 34px;
}

.receipt-card {
    position: sticky;
    top: 25px;
    align-self: start;
}

.empty-receipt {
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    color: #999;
}

.receipt-icon {
    font-size: 70px;
}

.receipt-box {
    background: white;
    border: 2px dashed #ffb36b;
    border-radius: 20px;
    padding: 22px;
    margin-top: 15px;
}

.receipt-box h2 {
    text-align: center;
    margin-bottom: 4px;
    color: #ff6500;
}

.receipt-box p {
    text-align: center;
    color: #777;
}

.receipt-total {
    text-align: center;
    font-size: 42px;
    font-weight: 800;
    color: #16a34a;
    margin-top: 15px;
}

.thanks {
    font-weight: bold;
    color: #ff6500 !important;
}

.print-btn {
    width: 100%;
    margin-top: 15px;
}

@media print {
    body * {
        visibility: hidden;
    }

    #receipt, #receipt * {
        visibility: visible;
    }

    #receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 320px;
    }
}

@media (max-width: 900px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }

    .search-box,
    .price-box {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}
.report-area {
    margin-top: 25px;
}

.report-filter {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 15px;
    align-items: end;
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background: #fff7ed;
    border: 1px solid #ffd7b5;
}

@media print {
    .sidebar,
    .topbar,
    .report-filter {
        display: none !important;
    }

    .main {
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: none;
    }
}

@media (max-width: 900px) {
    .report-filter {
        grid-template-columns: 1fr;
    }
}
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-badge {
    background: #e0f2fe;
    color: #0369a1;
    padding: 7px 12px;
    border-radius: 20px;
    font-weight: bold;
}

.small-btn {
    background: #ff7a00;
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.small-btn:hover {
    background: #e85f00;
}
.logout-btn {
    background: #fee2e2 !important;
    color: #b91c1c !important;
    margin-top: 25px;
    border: 1px solid #fecaca;
}

.logout-btn:hover {
    background: #fecaca !important;
    color: #991b1b !important;
}

.user-box {
    margin-top: 25px;
    padding: 14px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ffd7b5;
    color: #555;
    font-size: 14px;
}

.user-box b {
    color: #ff6500;
}
.top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.clock-box {
    background: white;
    padding: 12px 18px;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    font-weight: bold;
    color: #ff6500;
}

.profile-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    padding: 10px 16px;
    border-radius: 18px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.profile-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #ff7a00, #ffb36b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.profile-info small {
    color: #777;
}

.profile-info b {
    color: #ff6500;
}

.notify-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.notify-btn:hover {
    background: #fff7ed;
}

/* ===== FIX: ปรับหน้าจอให้พอดีกับคอม / กันเมนูและตารางล้นจอ ===== */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.layout {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.sidebar {
    flex: 0 0 210px;
    width: 210px;
    min-width: 210px;
    max-width: 210px;
    padding: 16px 12px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.logo {
    gap: 10px;
    margin-bottom: 24px;
}

.logo-icon {
    flex: 0 0 auto;
    padding: 10px;
    font-size: 20px;
}

.logo h2 {
    font-size: 22px;
    line-height: 1.15;
    word-break: keep-all;
}

.logo p {
    font-size: 12px;
    line-height: 1.25;
}

.menu a {
    padding: 11px 12px;
    margin-bottom: 7px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.25;
    white-space: normal;
}

.user-box {
    padding: 10px;
    font-size: 12px;
    word-break: break-word;
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100vw - 210px);
    padding: 24px;
    overflow-x: hidden;
}

.topbar {
    gap: 14px;
    flex-wrap: wrap;
}

.topbar h1 {
    font-size: clamp(24px, 2.4vw, 34px);
    line-height: 1.2;
}

.card,
.report-card {
    max-width: 100%;
    overflow: hidden;
}

.summary-grid,
.cards {
    width: 100%;
    max-width: 100%;
}

.summary-card {
    min-width: 0;
}

.summary-card .big-number,
.card .number {
    overflow-wrap: anywhere;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap table,
table.modern-table,
.table {
    max-width: none;
}

@media (min-width: 901px) {
    .summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }

    .summary-card {
        padding: 20px !important;
    }

    .summary-card .big-number {
        font-size: clamp(24px, 2.1vw, 32px) !important;
        line-height: 1.1;
    }
}

@media (max-width: 1180px) and (min-width: 901px) {
    .sidebar {
        flex-basis: 185px;
        width: 185px;
        min-width: 185px;
        max-width: 185px;
    }

    .main {
        max-width: calc(100vw - 185px);
        padding: 20px;
    }

    .menu a {
        font-size: 13px;
        padding: 10px;
    }

    .logo h2 {
        font-size: 19px;
    }
}

@media (max-width: 900px) {
    html, body, .layout, .main {
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        position: relative;
        height: auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex-basis: auto;
    }

    .main {
        max-width: 100%;
        padding: 16px;
    }
}
