:root {
    /* FLC Premium Color Palette */
    --bg-main: #f4f7f6;
    --sidebar-bg: #0a2342; /* Dark Corporate Blue */
    --flc-blue: #006bb6;
    --primary-blue: #006bb6;
    --gold: #c29d47; /* FLC Gold / Bronze */
    --gold-hover: #b38e38;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    
    /* Unit Status Colors */
    --status-available-bg: #e5f6eb;
    --status-available-color: #22c55e;
    --status-available-border: rgba(34, 197, 94, 0.4);

    --status-hold-bg: #fefce8;
    --status-hold-color: #eab308;
    --status-hold-border: rgba(234, 179, 8, 0.4);

    --status-booked-bg: #fff7ed;
    --status-booked-color: #f97316;
    --status-booked-border: rgba(249, 115, 22, 0.4);

    --status-sold-bg: #fef2f2;
    --status-sold-color: #ef4444;
    --status-sold-border: rgba(239, 68, 68, 0.4);

    --status-unavailable-bg: #f1f5f9;
    --status-unavailable-color: #94a3b8;
    --status-unavailable-border: rgba(148, 163, 184, 0.4);

    --sidebar-width: 285px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-dark);
}

/* Layout */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    flex-shrink: 0;
    padding-bottom: 32px;
}
.sidebar > * {
    flex-shrink: 0;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--sidebar-bg);
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gold);
}

.logo i {
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item:hover {
    background-color: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--gold);
    border-right: 3px solid var(--gold);
}

.badge {
    background-color: #ef4444;
    color: white;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 99px;
    margin-left: auto;
}

.user-profile {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-profile .name {
    font-weight: 500;
    font-size: 0.95rem;
}

.user-profile .role {
    font-size: 0.8rem;
    color: var(--gold);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.top-header {
    height: 70px;
    background-color: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    box-shadow: 0 1px 0 #e2e8f0, 0 2px 8px rgba(10,35,66,0.04);
}

/* === SEARCH (takes up left side) === */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f1f5f9;
    padding: 9px 16px;
    border-radius: 8px;
    flex: 1;
    max-width: 480px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.header-search:focus-within {
    border-color: #c8d5e8;
    background: white;
    box-shadow: 0 0 0 3px rgba(10,35,66,0.04);
}
.header-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.88rem;
    color: #1e293b;
}
.header-search i { color: #94a3b8; font-size: 0.95rem; }

/* === RIGHT ZONE === */
.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* === MEGA MENU === */
.mega-menu-wrap { position: relative; }

.mega-menu-btn {
    font-size: 1.4rem !important;
    border-radius: 8px;
    padding: 6px 8px;
}
.mega-menu-btn:hover {
    background: #f1f5f9;
    color: var(--flc-blue) !important;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 680px;
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(10,35,66,0.18), 0 4px 16px rgba(10,35,66,0.08);
    border: 1px solid #e2e8f0;
    z-index: 1100;
    display: none;
    overflow: hidden;
    animation: mmFadeIn 0.18s ease-out;
}
.mega-menu.show { display: block; }

@keyframes mmFadeIn {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.mm-header {
    padding: 14px 20px 12px;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #0a2342 0%, #1a3a5c 100%);
}
.mm-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
}
.mm-sub {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.55);
    margin-top: 2px;
}

.mm-body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
}
.mm-col {
    padding: 16px 14px;
    border-right: 1px solid #f1f5f9;
}
.mm-col:last-child { border-right: none; }

.mm-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #94a3b8;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}
.mm-section-label i { font-size: 0.85rem; }

.mm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s;
    margin-bottom: 2px;
}
.mm-item:hover {
    background: #f8fafc;
    transform: translateX(2px);
}
.mm-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.mm-item-name {
    font-size: 0.84rem;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.mm-item-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 1px;
}
.mm-badge {
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 99px;
    font-weight: 700;
}

/* Avatar button */
.header-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 5px 10px 5px 5px;
    cursor: pointer;
    transition: all 0.15s;
    margin-left: 4px;
}
.header-avatar-btn:hover {
    background: #f8fafc;
    border-color: #c8d5e8;
}
.header-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), #e8c068);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #0a2342;
    flex-shrink: 0;
}
.header-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}
.hui-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
}
.hui-role {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
}

/* Header actions (legacy, keep for compat) */
.header-actions {
    display: flex;
    gap: 16px;
}

.action-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.action-btn:hover {
    color: var(--text-dark);
}

.notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Page Content */
.page-container {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--sidebar-bg);
}

.page-subtitle {
    color: var(--text-muted);
    margin-top: 4px;
}

.btn {
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    border: none;
}

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

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

.btn-outline {
    border: 1px solid #cbd5e1;
    background-color: white;
    color: var(--text-dark);
}

.btn-outline:hover {
    background-color: #f8fafc;
}

.btn-full {
    width: 100%;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f1f5f9;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Map Legend */
.map-legend {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    padding: 0 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.color-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.color-box.available { background-color: var(--status-available-color); }
.color-box.hold { background-color: var(--status-hold-color); }
.color-box.booked { background-color: var(--status-booked-color); }
.color-box.sold { background-color: var(--status-sold-color); }
.color-box.unavailable { background-color: var(--status-unavailable-color); }

/* Floor Map Grid */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.floor-map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
}

.unit-card {
    background-color: white;
    border-radius: 10px;
    padding: 16px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 110px;
}

.unit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.unit-code {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.unit-detail-sm {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Status variants for Unit Cards */
.unit-card.available {
    background-color: var(--status-available-bg);
    border-color: var(--status-available-border);
    color: var(--status-available-color);
}
.unit-card.hold {
    background-color: var(--status-hold-bg);
    border-color: var(--status-hold-border);
    color: #ca8a04;
}
.unit-card.booked {
    background-color: var(--status-booked-bg);
    border-color: var(--status-booked-border);
    color: var(--status-booked-color);
}
.unit-card.sold {
    background-color: var(--status-sold-bg);
    border-color: var(--status-sold-border);
    color: var(--status-sold-color);
}
.unit-card.unavailable {
    background-color: var(--status-unavailable-bg);
    border-color: var(--status-unavailable-border);
    color: var(--status-unavailable-color);
    opacity: 0.6;
    cursor: not-allowed;
}
.unit-card.unavailable:hover {
    transform: none;
}

/* Countdown Timer */
.lock-timer {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(202, 138, 4, 0.15);
}

.timer-critical {
    color: #ef4444 !important;
    animation: heartbeat 1s infinite alternate;
}

/* Side Panel (Slide out) */
.side-panel-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 900;
}

.side-panel {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.side-panel-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.side-panel.active {
    right: 0;
}

.panel-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover { opacity: 1; }

.panel-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.03);
}

.unit-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
}

/* Badge colors for dark panel */
.badge-available { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid #4ade80; }
.badge-hold { background: rgba(234, 179, 8, 0.2); color: #facc15; border: 1px solid #facc15; }
.badge-booked { background: rgba(249, 115, 22, 0.2); color: #fb923c; border: 1px solid #fb923c; }
.badge-sold { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #f87171; }

.unit-price {
    margin-bottom: 24px;
}
.unit-price .label { font-size: 0.9rem; color: #94a3b8; }
.unit-price h3 { font-size: 2rem; color: var(--gold); margin-top: 4px; }

.unit-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 8px;
}

.detail-item i {
    font-size: 1.5rem;
    color: var(--gold);
}

.detail-item p {
    font-size: 0.75rem;
    color: #94a3b8;
}

.detail-item strong {
    font-size: 0.95rem;
}

.panel-actions {
    margin-bottom: 32px;
}

.lock-info-box {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 32px;
}

.lock-info-box h4 { color: #facc15; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.lock-info-box p { font-size: 0.9rem; margin-bottom: 6px; color: #e2e8f0; }

.hidden { display: none !important; }

/* Timeline */
.history-section h4 {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.timeline {
    list-style: none;
    border-left: 2px solid rgba(255,255,255,0.1);
    padding-left: 16px;
    margin-left: 8px;
}
.timeline li {
    position: relative;
    margin-bottom: 20px;
}
.timeline li::before {
    content: '';
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--gold);
    border-radius: 50%;
}
.timeline .time {
    font-size: 0.8rem;
    color: #94a3b8;
}
.timeline p {
    font-size: 0.9rem;
    margin-top: 4px;
    line-height: 1.4;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 450px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: var(--text-dark);
}

.modal-header .close-btn { color: var(--text-muted); }

.modal-body {
    padding: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    font-size: 0.95rem;
}
.form-control:focus { border-color: var(--gold); }

.alert-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #b45309;
}
.alert-warning i { color: #d97706; font-size: 1.25rem; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Toast Container */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: white;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 350px;
    border-left: 4px solid var(--gold);
    animation: slideInRight 0.3s ease-out forwards;
}

.toast.success { border-left-color: #22c55e; }
.toast.warning { border-left-color: #eab308; }
.toast.error { border-left-color: #ef4444; }

.toast-icon { font-size: 1.5rem; }
.toast.success .toast-icon { color: #22c55e; }
.toast.warning .toast-icon { color: #eab308; }
.toast.error .toast-icon { color: #ef4444; }

.toast-content h4 { font-size: 0.95rem; margin-bottom: 4px; }
.toast-content p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* Animations */
@keyframes heartbeat {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.1); opacity: 0.8; }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* FLC Logo */
.flc-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}
.flc-shapes {
    display: flex;
    gap: 4px;
}
.flc-shape {
    width: 26px;
    height: 32px;
    background-color: var(--flc-blue);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: skewX(-15deg);
    border-top-right-radius: 12px;
    border-bottom-left-radius: 12px;
}
.flc-shape span {
    transform: skewX(15deg);
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    font-family: Arial, sans-serif;
}
.flc-text {
    color: var(--gold);
    font-weight: 800;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-left: 5px;
    font-family: Arial, sans-serif;
}
