* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, #eaf4ff, #f7fbff);
    color: #102033;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(0,115,255,.25), transparent 35%),
        linear-gradient(135deg, #e9f5ff, #ffffff);
}

.login-card {
    width: 420px;
    padding: 35px;
    border-radius: 28px;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(18px);
    box-shadow: 0 25px 70px rgba(0,75,150,.18);
    border: 1px solid rgba(255,255,255,.85);
}

.brand {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #0077ff, #00b7ff);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 28px;
    box-shadow: 0 12px 30px rgba(0,119,255,.35);
}

.brand h1,
.topbar h1,
.panel h2 {
    margin: 0;
    color: #063b73;
}

.brand p,
.topbar p {
    margin: 6px 0 0;
    color: #5e738d;
}

label {
    display: block;
    margin-top: 15px;
    margin-bottom: 7px;
    font-weight: 600;
    color: #193b5a;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 15px;
    border-radius: 14px;
    border: 1px solid #cfe2f5;
    outline: none;
    background: rgba(255,255,255,.9);
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #0077ff;
    box-shadow: 0 0 0 4px rgba(0,119,255,.12);
}

button,
.btn-link {
    display: inline-block;
    padding: 12px 18px;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #0077ff, #00a6ff);
    color: white;
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(0,119,255,.22);
}

button {
    width: 100%;
    margin-top: 22px;
}

.btn-link.secondary {
    background: #e8f4ff;
    color: #0068c9;
    box-shadow: none;
}

.small-btn {
    display: inline-block;
    padding: 7px 11px;
    border-radius: 10px;
    background: #e8f4ff;
    color: #0068c9;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    margin-right: 5px;
}

.small-btn.danger {
    background: #ffecec;
    color: #b00020;
}

.alert {
    padding: 12px;
    border-radius: 14px;
    color: #8a1f1f;
    background: rgba(255,220,220,.8);
    border: 1px solid #ffc2c2;
    margin-bottom: 15px;
}

.success-box {
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: rgba(0,168,107,.12);
    color: #007a4d;
    border: 1px solid rgba(0,168,107,.25);
    font-weight: 700;
}

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

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 20px 60px;
    background: linear-gradient(180deg, #063b73, #08284f);
    color: white;
    scrollbar-width: thin;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.35);
    border-radius: 20px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,.55);
}

.side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.side-brand .logo {
    margin: 0;
    width: 46px;
    height: 46px;
    font-size: 22px;
}

.side-brand h2 {
    margin: 0;
}

.sidebar nav a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 7px;
    border-radius: 14px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    background: rgba(255,255,255,.06);
}

.sidebar nav a:hover {
    background: rgba(255,255,255,.18);
}

.nav-title {
    margin: 18px 0 8px;
    font-size: 12px;
    text-transform: uppercase;
    opacity: .65;
    letter-spacing: 1px;
}

.main {
    margin-left: 280px;
    padding: 28px;
    width: calc(100% - 280px);
}

.topbar {
    padding: 25px;
    border-radius: 28px;
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(15px);
    box-shadow: 0 18px 45px rgba(0,75,150,.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.user-pill {
    padding: 10px 16px;
    border-radius: 999px;
    background: #e8f4ff;
    color: #0068c9;
    font-weight: 700;
    text-transform: capitalize;
}

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

.card,
.panel {
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 35px rgba(0,75,150,.1);
    border: 1px solid rgba(255,255,255,.85);
}

.card {
    padding: 22px;
    border-radius: 24px;
}

.card span {
    color: #607891;
    font-weight: 600;
}

.card h2 {
    margin: 10px 0 0;
    font-size: 30px;
    color: #063b73;
}

.panel {
    margin-top: 25px;
    padding: 25px;
    border-radius: 28px;
}

.form-panel {
    width: 100%;
    max-width: 900px;
    margin: 25px auto 0;

    padding: 35px;
    border-radius: 30px;

    background: rgba(255,255,255,.78);
    backdrop-filter: blur(15px);

    box-shadow: 0 14px 35px rgba(0,75,150,.10);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 13px;
    color: #385775;
    background: #eef7ff;
}

td {
    padding: 13px;
    border-bottom: 1px solid #edf3f9;
}

.badge {
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8f4ff;
    color: #0068c9;
    font-size: 12px;
    font-weight: 700;
}

.quick-actions {
    margin-top: 25px;
    display: grid;
    grid-template-columns: repeat(6, minmax(130px, 1fr));
    gap: 14px;
}

.quick-actions a {
    display: block;
    padding: 15px 14px;
    border-radius: 18px;
    text-align: center;
    text-decoration: none;
    font-weight: 800;
    color: #0068c9;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.85);
    box-shadow: 0 12px 28px rgba(0,75,150,.08);
}

.quick-actions a:hover {
    background: #e8f4ff;
}

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

.dashboard-total {
    margin-top: 18px;
    padding: 15px;
    border-radius: 16px;
    background: #e8f4ff;
    color: #063b73;
    font-weight: 700;
}

.calc-box {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 18px;
    background: #e8f4ff;
    border: 1px solid #cfe2f5;
    color: #063b73;
}

.calc-box p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.print-btn {
    width: auto;
    margin-top: 0;
    margin-left: 8px;
    padding: 12px 18px;
    border-radius: 15px;
}

.invoice-box {
    margin-top: 25px;
    padding: 35px;
    border-radius: 28px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 14px 35px rgba(0,75,150,.1);
}

.invoice-header {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    border-bottom: 2px solid #e8f4ff;
    padding-bottom: 25px;
    margin-bottom: 25px;
}

.invoice-header h1,
.invoice-header h2,
.invoice-grid h3,
.invoice-box h3 {
    margin: 0 0 10px;
    color: #063b73;
}

.invoice-meta {
    text-align: right;
}

.invoice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.invoice-table th {
    background: #e8f4ff;
    color: #063b73;
}

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

.invoice-summary {
    display: flex;
    justify-content: space-between;
    gap: 25px;
    margin-top: 25px;
}

.summary-card {
    min-width: 320px;
    padding: 20px;
    border-radius: 20px;
    background: #e8f4ff;
}

.summary-card p {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin: 8px 0;
}

.summary-card .balance {
    padding-top: 12px;
    border-top: 1px solid #cfe2f5;
    font-size: 18px;
    color: #063b73;
}

.calendar-legend {
    margin-top: 25px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.85);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: 0 12px 28px rgba(0,75,150,.08);
}

.calendar-legend span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #063b73;
}

.legend-dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.reserved { background: #0077ff; }
.legend-dot.checked-in { background: #ff9800; }
.legend-dot.available { background: #00a86b; }
.legend-dot.maintenance { background: #d32f2f; }
.legend-dot.blocked { background: #777; }
.legend-dot.cleaning { background: #7b61ff; }

.calendar-wrap {
    overflow-x: auto;
}

.booking-calendar {
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

.booking-calendar th {
    text-align: center;
    min-width: 105px;
}

.booking-calendar th span {
    display: block;
    font-size: 12px;
    color: #607891;
    margin-top: 4px;
}

.booking-calendar .room-col {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 220px;
    text-align: left;
    background: #eef7ff;
}

.booking-calendar td.room-col {
    background: rgba(255,255,255,.95);
    border-radius: 16px 0 0 16px;
}

.room-col strong,
.room-col span,
.room-col small {
    display: block;
}

.room-col strong { color: #063b73; }
.room-col span { color: #385775; font-size: 13px; }
.room-col small { color: #607891; }

.calendar-cell {
    display: block;
    min-height: 54px;
    padding: 10px 8px;
    border-radius: 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    color: white;
}

.calendar-cell small {
    display: block;
    margin-top: 4px;
    font-weight: 600;
    opacity: .9;
}

.calendar-cell.available {
    background: rgba(0,168,107,.15);
    color: #007a4d;
    border: 1px solid rgba(0,168,107,.25);
}

.calendar-cell.available.clickable:hover {
    background: rgba(0,168,107,.25);
}

.calendar-cell.reserved {
    background: linear-gradient(135deg, #0077ff, #00a6ff);
}

.calendar-cell.checked-in {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
}

.calendar-cell.maintenance {
    background: linear-gradient(135deg, #d32f2f, #ff5c5c);
}

.calendar-cell.blocked {
    background: linear-gradient(135deg, #555, #888);
}

.calendar-cell.cleaning {
    background: linear-gradient(135deg, #7b61ff, #9c8cff);
}

@media (max-width: 1100px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1000px) {
    .app {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 70vh;
    }

    .main {
        margin-left: 0;
        width: 100%;
    }
}

@media (max-width: 700px) {
    .invoice-header,
    .invoice-summary,
    .topbar {
        display: block;
    }

    .invoice-meta {
        text-align: left;
        margin-top: 20px;
    }

    .invoice-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-width: auto;
        margin-top: 20px;
    }

    .user-pill {
        display: inline-block;
        margin-top: 15px;
    }
}

@media (max-width: 600px) {
    .login-card {
        width: 92%;
    }

    .cards,
    .quick-actions {
        grid-template-columns: 1fr;
    }
}

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

    .main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 0 !important;
    }

    body {
        background: white !important;
    }

    .invoice-box {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 20px !important;
    }

    html,
body {
    min-height: 100%;
    overflow-x: hidden;
}

body {
    overflow-y: auto;
}

.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;

    width: 280px !important;
    height: 100vh !important;
    max-height: 100vh !important;

    overflow-y: scroll !important;
    overflow-x: hidden !important;

    padding: 20px 20px 90px !important;
    z-index: 999 !important;
}

.sidebar nav {
    min-height: max-content;
    padding-bottom: 80px;
}

.main {
    margin-left: 280px !important;
    width: calc(100% - 280px) !important;
}

}
/* FORCE SIDEBAR SCROLL FIX */
.sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;

    width: 280px !important;
    height: 100vh !important;
    max-height: 100vh !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    padding: 20px 20px 120px !important;
}

.sidebar nav {
    display: block !important;
    height: auto !important;
    min-height: max-content !important;
    padding-bottom: 120px !important;
}

.main {
    margin-left: 280px !important;
}

/* CENTER FORM PANELS FIX */
.main > .form-panel,
section.form-panel {
    width: 100% !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

section.panel.form-panel {
    margin-top: 28px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.pos-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
}

.pos-item {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(255,255,255,.85);
    box-shadow: 0 12px 28px rgba(0,75,150,.08);
}

.pos-item strong,
.pos-item span,
.pos-item em {
    display: block;
}

.pos-item strong {
    color: #063b73;
    font-size: 16px;
}

.pos-item span {
    margin-top: 5px;
    color: #607891;
    font-size: 13px;
}

.pos-item em {
    margin-top: 8px;
    color: #0068c9;
    font-style: normal;
    font-weight: 800;
}

@media (max-width: 1100px) {
    .pos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.receipt-box {
    max-width: 520px;
    margin: 25px auto 0;
    padding: 28px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 14px 35px rgba(0,75,150,.1);
    color: #102033;
}

.receipt-header {
    text-align: center;
}

.receipt-header h1 {
    margin: 0;
    color: #063b73;
    font-size: 26px;
}

.receipt-header h2 {
    margin: 8px 0 4px;
    color: #063b73;
    font-size: 20px;
}

.receipt-header p {
    margin: 5px 0;
    color: #385775;
}

.receipt-header hr {
    border: none;
    border-top: 1px dashed #cfe2f5;
    margin: 18px 0;
}

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

.receipt-table th,
.receipt-table td {
    padding: 10px 6px;
    border-bottom: 1px dashed #d9e8f8;
    text-align: left;
    font-size: 14px;
}

.receipt-table th:nth-child(2),
.receipt-table td:nth-child(2) {
    text-align: center;
}

.receipt-table th:nth-child(3),
.receipt-table td:nth-child(3),
.receipt-table th:nth-child(4),
.receipt-table td:nth-child(4) {
    text-align: right;
}

.receipt-table tfoot th {
    font-size: 16px;
    color: #063b73;
}

.receipt-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #cfe2f5;
    text-align: center;
    color: #385775;
    font-weight: 700;
}

@media print {
    .receipt-box {
        max-width: 80mm;
        margin: 0 auto !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .receipt-table th,
    .receipt-table td {
        font-size: 12px;
        padding: 6px 2px;
    }
}

.danger-badge {
    background: #ffecec !important;
    color: #b00020 !important;
}

.pos-item small {
    display: block;
    margin-top: 8px;
    color: #607891;
    font-weight: 700;
}

.card-link {
    display: block;
    text-decoration: none;
}

.status-available {
    background: rgba(0,168,107,.15) !important;
    color: #007a4d !important;
}

.status-occupied {
    background: rgba(255,152,0,.16) !important;
    color: #a85d00 !important;
}

.status-cleaning {
    background: rgba(123,97,255,.16) !important;
    color: #4d35d9 !important;
}

.status-maintenance {
    background: rgba(211,47,47,.14) !important;
    color: #b00020 !important;
}

.status-blocked {
    background: rgba(80,80,80,.15) !important;
    color: #444 !important;
}

.sidebar .logout-btn{
    background:#dc2626 !important;
    color:#ffffff !important;
    border-radius:10px;
    margin-top:8px;
    font-weight:600;
}

.sidebar .logout-btn:hover{
    background:#b91c1c !important;
    color:#ffffff !important;
}

.sidebar .logout-btn.active{
    background:#b91c1c !important;
    color:#ffffff !important;
}