﻿:root {
    /* Primary gradient */
    --primary-dark: #1e40af;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-lighter: #dbeafe;
    /* Secondary (success) */
    --success-dark: #059669;
    --success: #10b981;
    --success-light: #6ee7b7;
    /* Alert colors */
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    /* Neutrals */
    --dark: #1f2937;
    --dark-gray: #374151;
    --gray: #6b7280;
    --light-gray: #e5e7eb;
    --lighter: #f3f4f6;
    --lightest: #f9fafb;
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.2);
    /* Spacing & Radius */
    --radius: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
}

* {
    --bs-primary: #2563eb;
    --bs-success: #10b981;
    --bs-danger: #ef4444;
    --bs-warning: #f59e0b;
    --bs-info: #06b6d4;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', 'Inter', -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--lightest) 0%, #f0f9ff 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}


/* Typography */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--dark);
}

h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.text-muted {
    color: var(--gray) !important;
}

.text-dark {
    color: var(--dark) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}


/* Navigation */

.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem 2rem;
    border-bottom: 3px solid var(--primary-light);
}

.navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: white !important;
    letter-spacing: -0.5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    margin: 0 0.5rem;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-2px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-light);
    border-radius: 3px 3px 0 0;
}

.navbar-toggler {
    border: none;
    color: white;
    font-size: 1.5rem;
}


/* Cards */

.card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

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

.card-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: var(--lightest);
    border-top: 1px solid var(--light-gray);
    padding: 1rem 1.5rem;
}


/* Buttons */

.btn {
    border-radius: var(--radius);
    font-weight: 600;
    padding: 0.625rem 1.25rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success-dark) 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: white;
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}


/* Forms */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.5rem;
    display: block;
}

.form-control {
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: white;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--light-gray);
}

.form-select {
    border: 2px solid var(--light-gray);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}


/* Alerts */

.alert {
    border: none;
    border-radius: var(--radius-lg);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: #d1fae5;
    border-left-color: var(--success);
    color: var(--success-dark);
}

.alert-danger {
    background-color: #fee2e2;
    border-left-color: var(--danger);
    color: #7f1d1d;
}

.alert-warning {
    background-color: #fef3c7;
    border-left-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background-color: #cffafe;
    border-left-color: var(--info);
    color: #164e63;
}


/* Modal */

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    background-color: var(--lightest);
    border-top: 1px solid var(--light-gray);
    padding: 1.5rem;
}

.modal.show .modal-dialog {
    animation: slideUp 0.3s ease;
}

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


/* Tables */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    border-top: 1px solid var(--light-gray);
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: var(--primary-lighter);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--lightest);
}


/* Badges */

.badge {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}

.badge.bg-success {
    background-color: var(--success) !important;
    color: white;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
    color: white;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: white;
}

.badge.bg-info {
    background-color: var(--info) !important;
    color: white;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
    color: white;
}


/* Nav Tabs */

.nav-tabs {
    border-bottom: 2px solid var(--light-gray);
    padding: 0 0 1rem 0;
}

.nav-tabs .nav-link {
    color: var(--gray);
    border: none;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.75rem 1.5rem;
}

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

.nav-tabs .nav-link.active {
    color: var(--primary);
    border: none;
    background: transparent;
    border-bottom: 3px solid var(--primary);
}

.tab-content {
    padding: 2rem 0;
}


/* Keep dashboard menu horizontal on small screens: allow horizontal scroll instead of stacking */

.nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-item {
    display: inline-block;
}

.nav-tabs .nav-link {
    white-space: nowrap;
}


/* Sidebar layout */

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

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(16, 185, 129, 0.02));
    padding: 1.25rem;
    border-right: 1px solid var(--light-gray);
    display: flex;
    flex-direction: column;
}

.sidebar .brand {
    color: var(--primary-dark);
    text-decoration: none;
}

.sidebar-logo i {
    font-size: 1.35rem;
    color: var(--primary);
}

.sidebar-title {
    font-weight: 700;
    color: var(--primary-dark);
}

.sidebar-nav ul {
    padding-left: 0;
    margin-top: 1rem;
}

.sidebar-link {
    display: block;
    padding: 0.75rem 0.5rem;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
    color: var(--primary);
}

.sidebar-link:hover,
.sidebar-link.active {
    background: white;
    box-shadow: var(--shadow-sm);
    color: var(--primary-dark);
}

.sidebar-bottom {
    margin-top: auto;
}

.app-main {
    flex: 1;
    padding: 2.5rem 3rem;
    background: transparent;
}

@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: .8rem;
    }
    .sidebar-title {
        display: none;
    }
    .sidebar-link {
        font-size: .85rem;
    }
    .app-main {
        padding: 1.25rem;
    }
}


/* ===== TENANT DASHBOARD ===== */

.page-header {
    margin-top: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--gray);
    font-size: 1rem;
    margin: 0;
}

.stat-card {
    background: white;
    border: none;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

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

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.1));
    color: var(--primary);
}

.stat-icon.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(110, 231, 183, 0.1));
    color: var(--success);
}

.stat-icon.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(253, 224, 71, 0.1));
    color: var(--warning);
}

.stat-icon.info {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(34, 211, 238, 0.1));
    color: var(--info);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 0.25rem;
}


/* Pass Cards */

.pass-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
}

.pass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.pass-qr-section {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.04));
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
}

.pass-qr {
    max-width: 140px;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.pass-code {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    margin-top: 1rem;
    margin-bottom: 0;
    color: var(--primary);
}

.pass-info {
    padding: 1.5rem;
}

.pass-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.pass-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: 1.5px solid var(--light-gray);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-icon:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05), transparent);
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.5rem;
}


/* ===== AGENT SCANNER STYLES ===== */

.scanner-card {
    width: 520px;
    background: #050505;
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.scanner-header {
    padding: 2rem 2rem 1rem 2rem;
    background: transparent;
    color: #f3f4f6;
}

.scanner-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.scanner-header p {
    margin: 0;
    color: rgba(243, 244, 246, 0.6);
}

.scanner-body {
    padding: 1.5rem 2rem 2rem 2rem;
}

.scanner-area {
    width: 340px;
    height: 340px;
    margin: 0 auto;
    border-radius: 24px;
    background: #111111;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.02);
}

.qr-input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    border-radius: 8px;
    padding: 0.7rem 1rem;
}

.btn-light {
    background: #f8f9fa;
    color: #111827;
    border-radius: 8px;
    padding: 0.6rem 1rem;
}

.divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.03);
}

.codes-list .badge {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 9999px;
    padding: 0.5rem 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}


/* Visitor card inside scanner */

.visitor-card {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.55));
    border-radius: 14px;
    padding: 1rem;
    color: #fff;
}

.visitor-card .card-details {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.visitor-card .scanner-icon {
    width: 72px;
    height: 72px;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 164, 0, 0.12);
}

.visitor-card .btn-success {
    padding: 0.9rem 1.25rem;
    font-size: 1.05rem;
}

.visitor-card .cancel-validate {
    padding: 0.6rem 1rem;
    border-radius: 10px;
}

@media (max-width: 992px) {
    .scanner-card {
        width: 100%;
        margin: 0 1rem;
    }
    .scanner-area {
        width: 260px;
        height: 260px;
    }
}


/* Keep dashboard menu horizontal on small screens: allow horizontal scroll instead of stacking */

.nav-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs .nav-item {
    display: inline-block;
}

.nav-tabs .nav-link {
    white-space: nowrap;
}


/* Avatar */

.avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: var(--shadow);
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-full);
}


/* Page Hero */

.page-hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: white;
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 3rem;
    border-radius: var(--radius-lg);
}

.page-hero h1 {
    color: white;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
}

.page-hero p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin: 0;
}


/* Empty State */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    color: var(--gray);
}


/* Loading Spinner */

.spinner-border {
    border: 3px solid var(--light-gray);
    border-right-color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* Utility Classes */

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

.text-start {
    text-align: left;
}

.text-end {
    text-align: right;
}

.fw-bold {
    font-weight: 700;
}

.fw-semi-bold {
    font-weight: 600;
}

.fw-normal {
    font-weight: 400;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}

.p-2 {
    padding: 1rem;
}

.p-3 {
    padding: 1.5rem;
}

.p-4 {
    padding: 2rem;
}

.rounded {
    border-radius: var(--radius);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}


/* Responsive */

@media (max-width: 768px) {
    h1 {
        font-size: 1.75rem;
    }
    h2 {
        font-size: 1.5rem;
    }
    h3 {
        font-size: 1.25rem;
    }
    .page-hero {
        padding: 2rem 1rem;
    }
    .navbar {
        padding: 0.75rem 1rem;
    }
    .card {
        margin-bottom: 1rem;
    }
    .table {
        font-size: 0.875rem;
    }
    .table thead th,
    .table tbody td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.5rem;
    }
    h2 {
        font-size: 1.25rem;
    }
    h3 {
        font-size: 1rem;
    }
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }
    .modal-body {
        padding: 1rem;
    }
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #162749;
    border-color: #162749;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(31, 58, 147, 0.3);
}

.card {
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius) !important;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md) !important;
}

.badge {
    border-radius: 99px;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.nav-link {
    color: var(--text-light) !important;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

.nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.btn-sm {
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
}

.alert {
    border: none;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--secondary-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.05);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background-color: rgba(245, 158, 11, 0.05);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
.form-select {
    border-color: var(--border-light) !important;
    border-radius: calc(var(--radius) - 2px);
    transition: all 0.3s ease;
}

input:focus,
textarea:focus,
.form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(31, 58, 147, 0.1) !important;
}

.modal-content {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
}

.modal-header {
    border-bottom: 1px solid var(--border-light);
    background-color: var(--primary-light);
}

.navbar {
    box-shadow: var(--shadow-sm);
    border-bottom: 1px solid var(--border-light);
}

table {
    font-size: 0.9375rem;
}

table thead {
    background-color: var(--primary-light);
}

table th {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--border-light);
}

@media (max-width: 768px) {
    body {
        font-size: 0.9375rem;
    }
    .h1,
    .h2,
    .h3 {
        font-size: 1.5rem;
    }
}


/* Page container hero */

.page-hero {
    background: linear-gradient(90deg, rgba(31, 58, 147, 0.06), rgba(16, 185, 129, 0.03));
    padding: 2rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1.25rem;
}

.card {
    background: linear-gradient(180deg, #ffffff, #fbfcfe);
}

.card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 10px 30px rgba(31, 58, 147, 0.12) !important;
}


/* Avatar */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

.nav-tabs .nav-link {
    padding: .6rem 1rem;
    border-radius: .6rem;
}

.modal-header .modal-title {
    color: var(--primary-color);
    font-weight: 700;
}

.modal-footer .btn {
    min-width: 100px;
}


/* Table row hover */

table tbody tr:hover {
    background-color: #fbfbff;
}


/* Styled empty state */

.empty-state {
    background: linear-gradient(90deg, rgba(31, 58, 147, 0.02), rgba(16, 185, 129, 0.01));
    border: 1px dashed var(--border-light);
    padding: 1rem;
    border-radius: .75rem;
    text-align: center;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .card {
        margin-bottom: 0.9rem;
    }
}


/* Small helpers */

.muted {
    color: var(--text-light);
}

.section-title {
    color: var(--primary-color);
    font-weight: 700;
}


/* ===== BUILDING CARDS - ENHANCED ===== */

.building-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border: none;
}

.building-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
}

.building-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.building-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.building-card:hover .building-image img {
    transform: scale(1.1) rotate(1deg);
}

.building-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    opacity: 0.8;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}

.building-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.building-card:hover .building-overlay {
    opacity: 1;
}

.building-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--success) 0%, var(--success-light) 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.building-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.building-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.4rem;
    transition: color 0.3s ease;
}

.building-card:hover .building-name {
    color: var(--primary);
}

.building-address {
    display: flex;
    align-items: center;
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.building-address i {
    margin-right: 0.5rem;
    color: var(--primary);
}

.building-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-top: 2px solid var(--lighter);
    border-bottom: 2px solid var(--lighter);
    margin-bottom: 0.75rem;
}

.info-item {
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.info-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.2rem;
}

.building-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.building-actions .btn {
    flex: 1;
    padding: 0.6rem;
    font-size: 0.8rem;
    border-radius: var(--radius);
}

.building-actions .btn-edit {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
}

.building-actions .btn-edit:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
}

.building-actions .btn-delete {
    background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
    color: white;
    border: none;
}

.building-actions .btn-delete:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    color: white;
}


/* ===== BUILDING GRID LAYOUT ===== */

.buildings-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 1rem 0;
}

@media (max-width: 1400px) {
    .buildings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 1024px) {
    .buildings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 768px) {
    .buildings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 576px) {
    .buildings-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .building-card {
        border-radius: var(--radius);
    }
    .building-image {
        height: 140px;
    }
}


/* ===== STAT CARDS - ENHANCED ===== */

.stat-card {
    background: white;
    border: none;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.75rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-dark) 0%, var(--success) 100%);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info) 0%, #22d3ee 100%);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}


/* ===== SECTION HEADERS ===== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    animation: slideInDown 0.6s ease;
}

@keyframes slideInDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ===== GRADIENT ANIMATION ===== */

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.gradient-animated {
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
}


/* ===== PAGE TRANSITIONS ===== */

.tab-pane {
    animation: fadeInUp 0.6s ease;
}

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


/* ===== IMPROVED BUTTONS ===== */

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary,
.btn-success,
.btn-danger,
.btn-info,
.btn-warning {
    color: white;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--radius);
}


/* ===== CARD SHADOWS WITH GLOW ===== */

.card:hover {
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.15) !important;
}

.building-card:hover {
    box-shadow: 0 25px 50px rgba(37, 99, 235, 0.2) !important;
}


/* ===== BADGE ANIMATION ===== */

.badge {
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* ===== INFO VALUE COUNTER ANIMATION ===== */

.info-value {
    animation: slideInRight 0.6s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}


/* ===== IMPROVED FORM CONTROLS ===== */

.form-control:focus,
.form-select:focus {
    background-color: white;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.form-control::placeholder {
    color: #cbd5e1;
    font-weight: 500;
}


/* ===== LOADER ANIMATION ===== */

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}


/* ===== HOVER EFFECTS ON TABLES ===== */

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: #f0f9ff !important;
    transform: translateX(4px);
}


/* ===== IMPROVED MODALS ===== */

.modal.show .modal-dialog {
    animation: modalSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}


/* ===== IMPROVED SECTION TITLES ===== */

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}


/* ===== BUILDING CARD HOVER EFFECTS ===== */

.building-name {
    position: relative;
}

.building-name::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.building-card:hover .building-name::after {
    width: 100%;
}


/* ===== STAT CARD COUNTER EFFECT ===== */

.stat-number {
    font-variant-numeric: tabular-nums;
}


/* ===== IMPROVED TABS ===== */

.nav-tabs {
    position: relative;
    border-bottom: 2px solid var(--light-gray);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.02) 0%, transparent 100%);
    padding: 1rem 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.nav-tabs .nav-link {
    position: relative;
    color: var(--gray);
    border: none;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
}

.nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.nav-tabs .nav-link:hover::before {
    width: 100%;
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    background: transparent;
    border: none;
}

.nav-tabs .nav-link.active::before {
    width: 100%;
}


/* ===== IMAGE MODAL ENHANCEMENTS ===== */

#imagePreview {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


/* ===== BUILDING CARD IMAGE SKELETON ===== */

.building-image.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmerLoad 2s infinite;
}

@keyframes shimmerLoad {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}


/* ===== BUILDING GRID RESPONSIVE ===== */

.buildings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

@media (max-width: 1400px) {
    .buildings-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 1024px) {
    .buildings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .buildings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .buildings-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .building-image {
        height: 150px;
    }
    .stat-card {
        margin-bottom: 1rem;
    }
}


/* ===== EMPTY STATE IMPROVEMENTS ===== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.02) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 2px dashed var(--light-gray);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty-state-icon {
    font-size: 3.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.empty-state h3 {
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--gray);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}


/* ===== SCROLLBAR STYLING ===== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--lighter);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary) 0%, var(--success) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--success-dark) 100%);
}


/* ===== TOOLTIP IMPROVEMENTS ===== */

.tooltip-inner {
    background-color: var(--dark);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.tooltip.show {
    opacity: 1;
}


/* ===== HEADER STICKY IMPROVEMENTS ===== */

.navbar.sticky-top {
    z-index: 1030;
}


/* ===== PAGE CONTAINER IMPROVEMENTS ===== */

.container-fluid {
    padding-top: 2rem;
    padding-bottom: 3rem;
}


/* ===== FOOTER IMPROVEMENTS ===== */

footer {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-gray) 100%);
    color: white !important;
    border-top: 1px solid var(--light-gray);
}

footer p {
    color: rgba(255, 255, 255, 0.8) !important;
}