:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --primary-color: #4361ee;
    --primary-hover: #3a56d4;
    --bg-color: #f8f9fa;
    --sidebar-bg: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-active: #4361ee;
    --card-shadow: 0 0.125rem 0.25rem rgba(0,0,0,.075);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: #111827;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

/* ===== GLOBAL BACKGROUND SLIDESHOW ===== */
.global-slideshow {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.global-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.05);
    animation: globalZoom 8s ease-in-out infinite alternate;
}

.global-slide.active {
    opacity: 1;
}

@keyframes globalZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.12); }
}

.global-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(15, 23, 42, 0.5);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,0.05);
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

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

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

.sidebar.collapsed {
    transform: translateX(calc(-1 * var(--sidebar-width)));
}

.sidebar-brand {
    color: #fff;
    font-size: 1.25rem;
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.6rem 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 2px;
    transition: all 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    font-weight: 500;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar backdrop overlay */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1040;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
}

/* ===== PAGE CONTENT ===== */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.55);
}

#page-content-wrapper.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

#page-content-wrapper .navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    z-index: 1100;
}

#page-content-wrapper .navbar .dropdown-menu {
    z-index: 1200;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,.15);
}

/* ===== CARDS ===== */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,.1);
}

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

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    word-break: break-word;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLES ===== */
.table-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.table-card .card-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    border-radius: 0.75rem 0.75rem 0 0 !important;
    flex-wrap: wrap;
}

.table-responsive {
    border-radius: 0 0 0.75rem 0.75rem;
}

/* ===== FILTER FORMS ===== */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.filter-form .form-control,
.filter-form .form-select {
    min-width: 0;
    width: auto;
    flex: 1 1 140px;
    max-width: 100%;
}

.filter-form .btn {
    flex-shrink: 0;
}

/* ===== PAGE HEADERS ===== */
.page-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header .btn {
    flex-shrink: 0;
}

.page-header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: none;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.3);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.login-card .card-body {
    padding: 2rem;
}

.login-brand {
    color: var(--primary-color);
    font-size: 2rem;
    font-weight: 700;
}

/* ===== BADGES ===== */
.badge-status {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 500;
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* ===== DATATABLES ===== */
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
    border-radius: 0.25rem;
}

/* ===== STATUS COLORS ===== */
.status-active, .status-occupied { color: #198754; }
.status-vacant, .status-inactive { color: #6c757d; }
.status-maintenance { color: #ffc107; }
.status-pending { color: #ffc107; }
.status-in_progress { color: #0d6efd; }
.status-completed { color: #198754; }
.status-expired, .status-terminated { color: #dc3545; }

/* ===== ACTION BUTTON GROUPS IN DETAIL VIEWS ===== */
.action-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ===== REPORT CARDS ===== */
.report-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.75rem 1.5rem rgba(0,0,0,.12);
}

/* ===== DETAIL INFO GRID ===== */
.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.detail-info-grid .detail-field {
    padding: 0.5rem 0;
}

.detail-info-grid .detail-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

.detail-info-grid .detail-value {
    font-weight: 500;
    color: #1e293b;
}

/* ===== RESPONSIVE: TABLET (≤ 991.98px) ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }

    .sidebar.show {
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 0 !important;
    }

    #page-content-wrapper.expanded {
        margin-left: 0 !important;
    }
}

/* ===== RESPONSIVE: MOBILE (≤ 767.98px) ===== */
@media (max-width: 767.98px) {
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .stat-card .stat-value {
        font-size: 1.2rem;
    }

    .stat-card .stat-label {
        font-size: 0.7rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .login-card .card-body {
        padding: 1.5rem;
    }

    .login-brand {
        font-size: 1.5rem;
    }

    .filter-form .form-control,
    .filter-form .form-select {
        flex: 1 1 100%;
    }

    .chart-container {
        height: 220px;
    }

    .detail-info-grid {
        grid-template-columns: 1fr;
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: flex;
        flex-wrap: wrap;
        border-bottom: 1px solid #dee2e6;
        padding: 0.5rem 0;
    }

    .table tbody td {
        display: flex;
        justify-content: space-between;
        border: none;
        padding: 0.25rem 0;
        width: 100%;
    }

    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        margin-right: 1rem;
    }
}

/* ===== RESPONSIVE: EXTRA SMALL (≤ 575.98px) ===== */
@media (max-width: 575.98px) {
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card-body {
        padding: 0.75rem;
    }

    .action-btn-group .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
}

/* ===== PRINT ===== */
@media print {
    .sidebar, .sidebar-backdrop, .navbar, .btn, .no-print {
        display: none !important;
    }
    #page-content-wrapper {
        margin-left: 0 !important;
    }
}

/* ===== LANDING PAGE ===== */
.landing-navbar {
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(12px);
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.landing-nav-logo {
    height: 34px;
    width: auto;
}

.landing-hero {
    min-height: 100vh;
    padding-top: 100px;
    position: relative;
    overflow: hidden;
    background: transparent;
}

.hero-slideshow {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.05);
    animation: heroZoom 8s ease-in-out infinite alternate;
}

.hero-slide.active {
    opacity: 1;
}

@keyframes heroZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.12); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(160deg, rgba(15,23,42,0.85) 0%, rgba(30,41,59,0.75) 50%, rgba(15,23,42,0.9) 100%);
}

.hero-badge {
    display: inline-block;
    background: rgba(67,97,238,0.15);
    color: #818cf8;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(67,97,238,0.25);
}

.hero-title {
    line-height: 1.15;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.15rem;
    max-width: 500px;
}

.hero-btn {
    border-radius: 0.75rem;
    transition: all 0.3s;
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(67,97,238,0.4);
}

/* Hero floating cards */
.hero-visual {
    position: relative;
    width: 350px;
    height: 350px;
}

.hero-card {
    position: absolute;
    background: #fff;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 1rem 3rem rgba(0,0,0,.15);
    white-space: nowrap;
    animation: floatCard 6s ease-in-out infinite;
}

.hero-card-1 {
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.hero-card-2 {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    animation-delay: 2s;
}

.hero-card-3 {
    bottom: 0;
    left: 10%;
    animation-delay: 4s;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-card-2 {
    animation-name: floatCard2;
}

@keyframes floatCard2 {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(calc(-50% - 10px)); }
}

.hero-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.hero-wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
}

.hero-wave svg {
    width: 100%;
    height: auto;
}

/* Stats */
.landing-stats {
    background: #f8f9fa;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.stat-text {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Features */
.landing-features {
    background: #fff;
}

.feature-card {
    border-radius: 1rem;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0 !important;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 1.5rem 3rem rgba(0,0,0,.08) !important;
}

.feature-card-blue:hover { border-color: rgba(13,110,253,0.3) !important; }
.feature-card-green:hover { border-color: rgba(25,135,84,0.3) !important; }
.feature-card-orange:hover { border-color: rgba(255,193,7,0.3) !important; }
.feature-card-cyan:hover { border-color: rgba(13,202,240,0.3) !important; }
.feature-card-red:hover { border-color: rgba(220,53,69,0.3) !important; }
.feature-card-purple:hover { border-color: rgba(124,58,237,0.3) !important; }

.feature-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
}

/* How it works */
.landing-how {
    background: #f8f9fa;
}

.step-card {
    padding: 2rem;
}

.step-number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #3a56d4);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 15px rgba(67,97,238,0.3);
}

/* CTA */
.landing-cta {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

/* Footer */
.landing-footer {
    background: #0a0f1a;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.text-purple {
    color: #7c3aed !important;
}

.bg-purple {
    background-color: #7c3aed !important;
}

/* Landing responsive */
@media (max-width: 991.98px) {
    .landing-hero {
        text-align: center;
        padding-top: 120px;
        padding-bottom: 100px;
    }
    .landing-hero .d-flex {
        justify-content: center;
    }
    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 767.98px) {
    .stat-number {
        font-size: 2rem;
    }
    .step-card {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .landing-hero h1 {
        font-size: 1.8rem;
    }
    .hero-subtitle {
        font-size: 1rem;
    }
    .landing-hero .btn-lg {
        padding: 0.6rem 1.5rem;
        font-size: 1rem;
    }
    .hero-badge {
        font-size: 0.75rem;
    }
}
