:root {
    --bg-dark: #1e1e2f;
    --bg-card: #27293d;
    --text-main: #ffffff;
    --text-muted: #9a9a9a;
    --primary: #e14eca;
    --success: #00f2c3;
    --warning: #ff8d72;
    --danger: #fd5d93;
    --info: #1d8cf8;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
}

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

/* Sidebar */
.sidebar {
    width: 130px;
    background-color: var(--bg-card);
    padding: 10px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
}

.sidebar h2 {
    margin-top: 0;
    text-align: center;
    color: var(--primary);
    font-size: 20px;
}

.sidebar button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.sidebar button:hover, .sidebar button.active {
    background-color: var(--primary);
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Room Grid */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.room-card {
    position: relative; /* Ensure icons are positioned relative to the card */
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.room-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.room-card.status-empty {
    border-top: 3px solid var(--success);
}

.room-card.status-occupied {
    border-top: 3px solid var(--danger);
    background-color: rgba(253, 93, 147, 0.1);
}

.room-card.status-dirty {
    border-top: 3px solid var(--warning);
}

.room-card.status-hourly {
    border-top: 3px solid #ffeb3b; /* Yellow */
    background-color: rgba(255, 235, 59, 0.15);
}

@keyframes blinkPinkBorder {
    0% {
        box-shadow: 0 0 5px var(--primary);
        outline-color: var(--primary);
    }
    50% {
        box-shadow: 0 0 50px var(--primary);
        outline-color: rgba(78, 225, 98, 0.5);
    }
    100% {
        box-shadow: 0 0 10px var(--primary);
        outline-color: var(--primary);
    }
}

.room-card.selected {
    outline: 2px solid var(--primary);
    background-color: rgba(225, 78, 202, 0.1);
    animation: blinkPinkBorder 1.2s infinite ease-in-out;
    z-index: 5;
}

.room-card.status-multi {
    border: 2px solid #ffcc00; /* Yellow border for multi-checkin */
    background-color: rgba(255, 204, 0, 0.15); /* Slight yellow tint */
}

.room-booking-icon {
    position: absolute;
    bottom: 1px;
    right: 1px;
    font-size: 14px;
    z-index: 10;
    cursor: help;
}

/* Inputs & Money Formatting */
input, select, textarea {
    background-color: #1b1e2f;
    border: 1px solid #2b3553;
    color: white;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
}

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

/* Money Input Wrapper */
.money-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.money-input-wrapper input {
    padding-right: 35px; /* Space for 'k' */
    text-align: right;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.money-input-wrapper::after {
    content: 'k';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-70%); /* Adjust vertical alignment */
    color: var(--text-muted);
    font-weight: bold;
    pointer-events: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

th {
    background-color: rgba(255,255,255,0.05);
    color: var(--primary);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(255,255,255,0.02);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.btn-primary:hover {
    filter: brightness(1.1);
}

.btn-success {
    background-color: #22c55e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-secondary {
    background-color: #555;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.toolbar button {
    min-width: 180px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

    /* Calculator - Black Pink Theme */
    .floating-calculator {
        display: none; /* Default hidden */
        position: fixed;
        bottom: 20px;
        left: 20px;
        z-index: 1000;
        background: #000000;
        border: 2px solid #ff4081;
        border-radius: 15px;
        box-shadow: 0 0 20px rgba(255, 64, 129, 0.4);
        padding: 15px;
        width: 280px;
        font-family: 'Segoe UI', sans-serif;
    }

    .floating-calculator.active {
        display: block;
    }

    .calc-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
        color: #ff4081;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    .close-calc {
        background: none;
        border: none;
        color: #ff4081;
        font-size: 24px;
        cursor: pointer;
        line-height: 1;
        padding: 0 5px;
    }
    .close-calc:hover {
        color: #fff;
        text-shadow: 0 0 5px #ff4081;
    }

    .calc-display {
        margin-bottom: 15px;
    }

    .calc-display input {
        width: 100%;
        background: #1a1a1a;
        color: #ff4081;
        border: 1px solid #ff4081;
        padding: 15px;
        font-size: 24px;
        text-align: right;
        border-radius: 8px;
        box-sizing: border-box;
        font-family: monospace;
    }

/* New Layout for Vertical Actions */
.modal-flex-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.modal-main-content {
    flex: 1;
}

.vertical-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: center;
    padding-left: 10px;
    border-left: 1px solid #444;
    min-width: 90px;
}

.vertical-actions button, 
.vertical-actions .btn-photo,
.vertical-actions .btn-primary,
.vertical-actions .btn-danger,
.vertical-actions .btn-secondary {
    width: 100%; 
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 !important;
    font-size: 12px;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Specific colors for vertical buttons if needed */
.vertical-actions .btn-calc {
    background: #e91e63;
    color: white;
}

.stay-days-control,
.edit-stay-days-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    font-size: 16px;
}

.stay-days-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.stay-days-control button,
.edit-stay-days-control button {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: #555;
    color: #fff;
    cursor: pointer;
}

.stay-days-control span,
.edit-stay-days-control span {
    min-width: 18px;
    text-align: center;
}
 
.stay-days-label {
    font-size: 15px;
}


    .calc-keys {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }

    .calc-keys button {
        background: #333;
        color: #fff;
        border: none;
        padding: 12px;
        font-size: 18px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        font-weight: bold;
    }

    .calc-keys button:hover {
        background: #444;
        transform: translateY(-2px);
        box-shadow: 0 2px 5px rgba(255, 64, 129, 0.2);
    }

    .calc-keys button.op {
        background: #ff4081;
        color: #000;
    }
    .calc-keys button.op:hover {
        background: #ff80ab;
    }

    .calc-keys button.equal {
        background: #ff4081;
        color: #000;
    }
    .calc-keys button.equal:hover {
        background: #ff80ab;
    }

    .calc-keys button.clear {
        grid-column: span 2;
        background: #c2185b;
        color: white;
        margin-top: 5px;
    }
    .calc-keys button.clear:hover {
        background: #e91e63;
    }

    .calc-keys button.backspace {
        grid-column: span 2;
        background: #7b1fa2;
        color: white;
        margin-top: 5px;
    }
    .calc-keys button.backspace:hover {
        background: #ba68c8;
    }

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.modal-content.sm {
    width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    color: var(--primary);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

/* Layout Helpers */
.flex-row {
    display: flex;
    gap: 10px;
}

.flex-1 {
    flex: 1;
}

/* Quick Options */
.quick-options {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.quick-btn {
    background-color: rgba(255,255,255,0.1);
    border: none;
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.quick-btn:hover {
    background-color: var(--primary);
    color: white;
}

/* =========================================
   NEW STYLES ADDED FOR UI FIXES
   ========================================= */

/* Money Control (- Input +) */
.money-control {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}

.money-control button {
    background-color: #444;
    color: white;
    border: 1px solid #555;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.money-control button:hover {
    background-color: #666;
}

.money-control input {
    flex: 1;
    margin-bottom: 0; /* Override default */
    text-align: center;
    font-weight: bold;
}

/* Quick Tags */
.quick-tag {
    display: inline-block;
    background-color: #333;
    color: #ccc;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #444;
    user-select: none;
}

.quick-tag:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Input Grid (2 columns) */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Report Grid */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.report-grid .card {
    background-color: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.report-grid .card h4 {
    margin: 0 0 10px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.report-grid .card p {
    margin: 0;
    font-size: 20px;
    font-weight: bold;
    color: var(--success);
}

.report-grid .card.highlight p {
    color: var(--warning);
}

/* Room Workflow Header */
.room-workflow-header {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.room-badge {
    background-color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #444;
    white-space: nowrap;
}

.room-badge.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.room-badge.done {
    border-color: var(--success);
    color: var(--success);
}
.room-badge.active.done {
    color: white; /* Active overrides done color */
}

/* Input Colors */
.inp-yellow { color: #ffeb3b !important; border-color: #ffeb3b; }
.inp-blue-light { color: #add8e6 !important; border-color: #add8e6; }
.inp-green-light { color: #90ee90 !important; border-color: #90ee90; }
.inp-violet { color: #9400d3 !important; border-color: #9400d3; }
.inp-green { color: #008000 !important; border-color: #008000; }

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none; /* Hidden on Desktop */
}

/* Calculator Toggle Button (Mobile) */
.calc-toggle-btn {
    display: none; /* Hidden on Desktop */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9900;
    background: var(--primary);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.78);
    z-index: 1999;
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile Zoom Controls */
.mobile-zoom-controls {
    display: none; /* Hidden on Desktop */
}

/* ===========================
   MOBILE RESPONSIVE
   =========================== */
@media (max-width: 768px) {
    /* Layout */
    .sidebar {
        position: fixed;
        height: 100%;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
        z-index: 2000;
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 60px 10px 10px 10px; /* Top padding for Menu Button */
    }

    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        z-index: 2100;
        background: var(--primary);
        border: none;
        color: white;
        padding: 8px 12px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 18px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }

    .mobile-zoom-controls {
        display: flex;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 2100;
        gap: 8px;
        flex-direction: column;
        align-items: flex-end;
    }

    .mobile-zoom-controls button {
        background: var(--primary);
        border: none;
        color: white;
        width: 35px;
        height: 35px;
        border-radius: 4px;
        cursor: pointer;
        font-size: 20px;
        font-weight: bold;
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .calc-toggle-btn {
        display: flex;
    }

    .top-right-shortcuts {
        position: fixed;
        left: 150px;
        bottom: 90px; /* tách xa cụm zoom ở góc phải */
        right: auto;
        top: auto;
        z-index: 2090;
    }

    .nv-shortcut-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }



    /* Modals */
    .modal-content {
        width: 95% !important;
        margin: 10px auto;
        padding: 15px;
        max-height: 85vh;
    }
}

/* Image Upload Styles */
.btn-photo {
    background: #faad14;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-photo:hover {
    background: #d48806;
}
.image-preview-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.img-thumb-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border: 1px solid #555;
    border-radius: 4px;
    overflow: hidden;
}
.img-thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.img-thumb-remove {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(244, 67, 54, 0.9);
    color: white;
    width: 16px;
    height: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom-left-radius: 4px;
}

.img-thumb-copy {
    position: absolute;
    bottom: 0;
    right: 0;
    background: rgba(24, 144, 255, 0.9);
    color: white;
    width: 18px;
    height: 18px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-top-left-radius: 4px;
}
.icon-camera {
    margin-left: 5px;
    font-size: 14px;
    cursor: pointer;
}

.chat-toggle-btn {
    position: fixed;
    right: 30px;
    bottom: 100px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #1890ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    z-index: 2100;
}

.chat-toggle-btn-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-unread-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: #f5222d;
    color: #fff;
    font-size: 11px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.top-right-shortcuts {
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 2050;
}

.nv-shortcut-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.nv-shortcut-btn:hover {
    background: rgba(225, 78, 202, 0.25);
    border-color: var(--primary);
}

.chat-window {
    position: fixed;
    right: 20px;
    bottom: 160px;
    width: 320px;
    max-height: 65vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 2100;
}

.chat-header {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: #1890ff;
    color: #fff;
    gap: 8px;
}

.chat-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
}

.chat-user-select {
    border-radius: 4px;
    border: none;
    padding: 2px 6px;
    font-size: 12px;
}

.chat-close-btn {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.chat-messages {
    padding: 8px;
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
}

.chat-image-wrapper {
    position: relative;
    display: inline-block;
}

.chat-image-copy-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(24, 144, 255, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-message {
    display: flex;
    margin-bottom: 6px;
}

.chat-message.self {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: 80%;
    background: #fff;
    border-radius: 6px;
    padding: 6px 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.chat-message.self .chat-bubble {
    background: #e6f7ff;
}

.chat-meta {
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
}

.chat-text {
    font-size: 13px;
    color: #333;
    word-break: break-word;
}

.chat-image {
    max-width: 100%;
    border-radius: 4px;
    margin-top: 4px;
}

.chat-input-row {
    display: flex;
    align-items: center;
    padding: 6px;
    border-top: 1px solid #eee;
    gap: 4px;
    background: #fafafa;
}

.chat-icon-btn {
    border: none;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.chat-text-input {
    flex: 1;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #d9d9d9;
    font-size: 13px;
}

.chat-send-btn {
    border: none;
    background: #1890ff;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.img-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.img-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}
