:root {
    /* Colors */
    --primary-color: #f0b131; /* The green color */
    --bg-color: #f7f8fa;
    --text-primary: #1a1a1a;
    --text-secondary: #8e8e93;
    --white: #ffffff;
    --black: #000000;
    --border-color: #eaeaea;
    
    /* Gradients */
    --gradient-workspace: linear-gradient(135deg, #f0b131, #e2db5c);
    --gradient-rooms: linear-gradient(135deg, #f0b131, #e2db5c);
    
    /* Layout */
    --nav-height: 60px;
    --border-radius-lg: 20px;
    --border-radius-md: 12px;
}

body {
    background-color: var(--bg-color) !important;
    font-family: 'Inter', sans-serif !important;
    color: var(--text-primary) !important;
    margin: 0;
    padding: 0;
    padding-bottom: var(--nav-height); /* Space for bottom nav */
    -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1200px; /* Expand for desktop */
    margin: 0 auto;
    background-color: var(--bg-color);
    min-height: 100vh;
    position: relative;
}

/* Views */
.view {
    display: none; /* Hidden by default */
    animation: fadeIn 0.3s ease-in-out;
}

.view.active {
    display: block; /* Show active view */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius-md);
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.3s ease;
}
.btn-primary:hover {
    background-color: #dca32d;
}
.btn-primary:active {
    background-color: #c99529;
}

/* --- WORKSPACE VIEW --- */
.workspace-header {
    background: var(--gradient-workspace);
    border-radius: var(--border-radius-lg);
    margin: 15px;
    padding: 25px;
    color: var(--white);
    position: relative;
    overflow: hidden;
    height: 180px;
}

@media (min-width: 768px) {
    .workspace-header {
        height: 250px;
        padding: 40px;
        margin: 20px;
    }
    .workspace-header h1 { font-size: 36px !important; }
    .workspace-header p { font-size: 18px !important; }
    .workspace-header .zebra-img { width: 300px !important; height: 300px !important; right: 0px !important; bottom: -40px !important; }
}

.workspace-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.workspace-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 15px 0;
}

.workspace-header .btn-arrow {
    background: var(--white);
    color: var(--primary-color);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.workspace-header .workspace-label {
    position: absolute;
    bottom: 25px;
    left: 25px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.workspace-header .zebra-img {
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 200px;
    height: 200px;
    object-fit: cover;
    z-index: 1;
}

.section-title {
    padding: 20px 20px 10px;
}

@media (min-width: 768px) {
    .section-title { padding: 30px 20px 15px; }
    .section-title h2 { font-size: 22px !important; }
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 4px 0;
}

.section-title p {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.menu-list {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    margin: 0 15px 20px;
    padding: 5px 0;
}

@media (min-width: 768px) {
    .menu-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 0;
        padding: 10px;
        margin: 0 20px 30px;
    }
    .menu-item:not(:last-child)::after { display: none; }
    .menu-item { border: 1px solid var(--border-color); border-radius: var(--border-radius-md); margin: 5px; }
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #f9f9f9;
}

.menu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 60px;
    right: 20px;
    height: 1px;
    background-color: var(--border-color);
}

.menu-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    margin-right: 15px;
}

.menu-item .text-wrap {
    flex: 1;
}

.menu-item .title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 2px;
}

.menu-item .subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.menu-item .chevron {
    color: #c7c7cc;
    font-size: 14px;
}

/* --- ROOMS VIEW --- */
.rooms-header {
    background: var(--gradient-rooms);
    padding: 20px 15px 30px;
    color: var(--white);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}

@media (min-width: 768px) {
    .rooms-header { padding: 40px 20px 50px; }
    .search-bar { max-width: 600px; margin: 0 auto; }
}

.rooms-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-align: center;
}

.search-bar {
    background: var(--white);
    border-radius: 30px;
    display: flex;
    padding: 5px 5px 5px 20px;
    align-items: center;
}

.search-bar i {
    color: var(--text-secondary);
}

.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.search-bar .btn-search {
    background: var(--black);
    color: var(--white);
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    gap: 10px;
    flex-wrap: wrap;
}

@media (min-width: 768px) {
    .filter-bar { padding: 20px; }
}

.date-tabs {
    display: flex;
    background: var(--white);
    border-radius: 6px;
    overflow: hidden;
}

.date-tab {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.date-tab.active {
    color: var(--text-primary);
    font-weight: 500;
}

.filter-dropdowns {
    display: flex;
    gap: 10px;
}

.filter-btn {
    background: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.style-switch {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.date-display {
    padding: 0 15px;
    font-weight: 600;
    font-size: 15px;
}

@media (min-width: 768px) {
    .date-display { padding: 0 20px; font-size: 18px; }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 60px;
    color: #e0e0e0;
    margin-bottom: 15px;
}

/* --- PROFILE VIEW --- */
.profile-view {
    background-color: var(--bg-color);
}

.profile-header {
    background: var(--black);
    color: var(--white);
    padding: 20px 20px 80px;
}

@media (min-width: 768px) {
    .profile-header { padding: 40px 40px 100px; }
}

.profile-header-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.profile-header-top .logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.profile-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.profile-info .name {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 5px 0;
}

.profile-info .phone {
    color: #a0a0a0;
    font-size: 14px;
    margin: 0;
}

.profile-info .date {
    border: 1px solid #444;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
}

.stats-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    margin: -50px 15px 20px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    .stats-card { margin: -60px 40px 30px; padding: 30px; }
    .stat-item .icon { font-size: 28px !important; margin-bottom: 12px !important; }
    .stat-item .label { font-size: 16px !important; }
    .stat-item .value { font-size: 14px !important; }
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-item .icon {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.stat-item .label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-item .value {
    font-size: 12px;
    color: var(--text-secondary);
}

/* --- BOTTOM NAVIGATION --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    height: var(--nav-height);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

/* Handle max-width container for nav */
@media (min-width: 768px) {
    .bottom-nav {
        height: 70px;
    }
    .nav-item i { font-size: 24px !important; }
    .nav-item span { font-size: 14px !important; }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    text-decoration: none;
    width: 33%;
    height: 100%;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item:hover {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 11px;
}

.nav-item.active {
    color: var(--primary-color);
}

/* --- ROLE SWITCHER --- */
.role-switcher {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.8);
    color: white;
    z-index: 1000;
    padding: 10px;
    display: flex;
    justify-content: center;
    gap: 10px;
}
@media (min-width: 481px) {
    .role-switcher { left: 50%; transform: translateX(-50%); max-width: 1200px; }
}
.role-btn {
    background: #333;
    border: 1px solid #555;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}
.role-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* --- MODALS & BOTTOM SHEETS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s;
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}
.modal-close {
    position: absolute;
    top: 15px; right: 15px;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

.bottom-sheet {
    position: absolute;
    bottom: -100%;
    left: 0; right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    transition: bottom 0.3s ease-out;
}
.modal-overlay.active .bottom-sheet {
    bottom: 0;
}
.bottom-sheet-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* --- QR SCANNER --- */
.qr-scanner-frame {
    width: 250px;
    height: 250px;
    margin: 20px auto;
    position: relative;
    border: 2px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}
.qr-scanner-frame::before {
    content: '';
    position: absolute;
    top: 10px; left: 10px; right: 10px; bottom: 10px;
    border: 2px dashed rgba(255,255,255,0.5);
    border-radius: 8px;
}
.qr-scanner-line {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
    animation: scan 2s linear infinite;
}
@keyframes scan {
    0% { top: 10px; }
    50% { top: calc(100% - 10px); }
    100% { top: 10px; }
}

/* --- ROOM GRID --- */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 20px;
}
.room-card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.room-card:hover {
    border-color: var(--primary-color);
}
.room-card.status-available .room-icon { color: var(--primary-color); }
.room-card.status-occupied .room-icon { color: #ff3b30; }
.room-card.status-cleanup .room-icon { color: #ffcc00; }
.room-card h3 {
    margin: 10px 0 5px;
    font-size: 16px;
    font-weight: 700;
}
.room-card p {
    margin: 0;
    font-size: 11px;
    color: var(--text-secondary);
}

/* --- TOGGLE SWITCH --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 22px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px; width: 18px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary-color);
}
input:checked + .slider:before {
    transform: translateX(18px);
}

/* --- MANAGER LISTS --- */
.manager-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--white);
    margin-bottom: 10px;
    border-radius: var(--border-radius-md);
}
.manager-list-item .info h4 { margin: 0 0 4px; font-size: 15px; }
.manager-list-item .info p { margin: 0; font-size: 12px; color: var(--text-secondary); }
.manager-list-item .controls { display: flex; align-items: center; gap: 10px; }
.manager-list-item .status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.badge-green { background: #e8f8f2; color: var(--primary-color); }
.badge-gray { background: #f0f0f0; color: var(--text-secondary); }
.badge-blue { background: #e8f4f8; color: #3dbdf5; }

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* --- STORE MGR DASHBOARD NEW --- */
.sm-header {
    background: var(--white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.sm-header .btn-icon {
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
}
.sm-header h1 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.sm-search-container {
    padding: 0 15px 15px;
    background: var(--white);
}
.sm-search-bar {
    background: #f5f5f5;
    border-radius: 20px;
    display: flex;
    padding: 5px 5px 5px 15px;
    align-items: center;
}
.sm-search-bar input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    padding: 8px;
    font-size: 14px;
}
.sm-search-bar i { color: #aaa; }
.sm-search-bar .btn-search {
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-weight: 600;
    padding: 5px 15px;
    cursor: pointer;
}

.sm-filters {
    background: var(--white);
    padding: 0 15px 15px;
}
.sm-date-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.sm-date-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 6px 12px;
    background: #f5f5f5;
    color: #666;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.sm-date-tab.active {
    background: var(--black);
    color: var(--white);
}
.sm-date-tab.right { margin-left: auto; }
.sm-secondary-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.sm-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    background: #f5f5f5;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
}

.sm-data-title {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    background: var(--white);
    border-top: 10px solid #f7f8fa;
}
.sm-data-title h2 { font-size: 16px; font-weight: 700; margin: 0; }
.sm-data-title .date { color: #d67a3a; font-size: 14px; font-weight: 500; }

/* CSS Bar Chart */
.sm-chart-container {
    background: var(--white);
    padding: 20px 15px 30px;
    position: relative;
}
.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    top: 20px; bottom: 60px; left: 15px;
    width: 20px;
    color: #999;
    font-size: 11px;
}
.chart-y-axis span {
    transform: translateY(-50%);
}
.chart-grid {
    position: absolute;
    top: 20px; bottom: 60px; left: 40px; right: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.chart-grid-line {
    border-bottom: 1px solid #f0f0f0;
    width: 100%;
}
.chart-bars-area {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    margin-left: 40px;
    height: 200px;
    position: relative;
    z-index: 2;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}
.chart-group {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    position: relative;
    width: 30px;
    height: 100%;
}
.chart-bar {
    width: 12px;
    border-top-left-radius: 2px;
    border-top-right-radius: 2px;
    position: relative;
}
.chart-bar.c1 { background-color: #f36c21; }
.chart-bar.c2 { background-color: #facd5c; }
.chart-value {
    position: absolute;
    top: -15px;
    font-size: 10px;
    color: #666;
    width: 100%;
    text-align: center;
}
.chart-x-axis {
    display: flex;
    justify-content: space-around;
    margin-left: 40px;
    margin-top: 10px;
    font-size: 11px;
    color: #333;
}
.chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
    font-size: 12px;
    color: #666;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.legend-color { width: 10px; height: 10px; border-radius: 2px; }

/* Team Detail Cards */
.sm-team-list {
    background: #f7f8fa;
    padding: 15px;
}
.sm-team-card {
    background: var(--white);
    border-radius: var(--border-radius-md);
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.sm-team-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}
.sm-team-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 5px; }
.sm-team-card .emp-count { color: #888; font-size: 13px; margin: 0; }
.sm-team-badge {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
}
.sm-team-badge span { margin-right: 8px; font-size: 13px; font-weight: 400; }
.badge-box { display: flex; border-radius: 4px; overflow: hidden; border: 1px solid #e87c3e; }
.badge-left { background: var(--white); color: #e87c3e; padding: 4px 8px; }
.badge-right { background: #e87c3e; color: var(--white); padding: 4px 8px; }

.sm-team-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    text-align: center;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px 5px;
}
.sm-grid-item .val { font-size: 16px; font-weight: 500; color: #333; margin-bottom: 4px; }
.sm-grid-item .lbl { font-size: 10px; color: #999; }
.sm-card-arrow { text-align: center; color: #999; margin-top: 15px; font-size: 16px; cursor: pointer; }

/* --- TRM DETAILED ROOMS LAYOUT --- */
.trm-zone {
    margin-bottom: 25px;
}

.trm-zone-header {
    position: relative;
    text-align: center;
    margin-bottom: 15px;
}

.trm-zone-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e8eaf6; /* Very light gray/blue line */
    z-index: 1;
}

.trm-zone-header span {
    position: relative;
    z-index: 2;
    background: #f7f9fa; /* Matches body bg */
    padding: 0 10px;
    font-size: 12px;
    color: #888;
}

.trm-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 15px;
}

.trm-card {
    position: relative;
    width: 90px;
    height: 75px;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

.trm-card-top, .trm-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 9px;
    line-height: 1.1;
}

.trm-card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Green (Available) */
.trm-green {
    background: #1cb556;
    color: #fff;
}
.trm-green .trm-card-center i {
    font-size: 24px;
    font-weight: 300;
}

/* Yellow (Occupied) */
.trm-yellow {
    background: #fff8dc;
    border: 1px solid #fbd382;
    color: #c7892b;
}

/* Red (Active/Alert) */
.trm-red {
    background: #e42939;
    color: #fff;
}
.trm-red .trm-card-center {
    font-size: 11px;
    font-weight: 600;
    width: 100%;
}
.trm-red .trm-card-bottom {
    align-items: flex-end;
}

