body {
    min-height: 100vh;
    background: url('/images/background.jpg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    font-family: 'Inter', sans-serif;
    z-index: 1;
    /* Ensure body content is above background */
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, rgba(34, 40, 49, 0.80) 60%, rgba(55, 65, 81, 0.92) 100%);
    z-index: -1;
    /* Changed from 1 to -1 to put it behind content */
    pointer-events: none;
    /* Prevent it from blocking clicks */
}

/* --- Navbar Styles (shared) --- */
.navbar {
    background: rgba(17, 24, 39, 0.98);
    border-bottom: 1.5px solid rgba(75, 85, 99, 0.18);
    padding: 1.1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.navbar .navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fbbf24 !important;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.navbar .navbar-brand i {
    color: #fbbf24 !important;
    font-size: 1.4rem;
}

.navbar .navbar-brand span {
    color: #fff !important;
    font-weight: 400;
}

.navbar .nav-link {
    color: #fff !important;
    font-weight: 600;
    font-size: 1.08rem;
    margin: 0 0.7rem;
    border-bottom: 2px solid transparent;
    transition: border 0.2s, color 0.2s;
    padding: 0.5rem 0;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    color: #fbbf24 !important;
    border-bottom: 2px solid #fbbf24;
    background: none;
}

@media (max-width: 768px) {
    .navbar .navbar-nav {
        flex-direction: column;
    }

    .navbar .nav-link {
        margin: 0.5rem 0;
    }
}

/* --- Admin Page Navbar Override --- */
/* Ensure admin pages always use horizontal navbar */
.admin-container .navbar,
.admin-container~.navbar,
body .navbar {
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    left: auto !important;
    top: auto !important;
}

.admin-container .navbar .navbar-nav,
.admin-container~.navbar .navbar-nav,
body .navbar .navbar-nav {
    flex-direction: row !important;
    width: 100% !important;
    justify-content: flex-end !important;
}

.admin-container .navbar .nav-link,
.admin-container~.navbar .nav-link,
body .navbar .nav-link {
    margin: 0 0.7rem !important;
    padding: 0.5rem 1rem !important;
}

/* --- End Navbar Styles --- */

.widget-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 22px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15), 0 1.5px 8px 0 rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(18px) saturate(120%);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 1.7rem;
    padding: 2.1rem 2rem;
    color: #1f2937;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    position: relative;
    z-index: 15;
    /* Ensure widgets are above background */
}

.widget-card:hover {
    box-shadow: 0 12px 36px 0 rgba(31, 38, 135, 0.18), 0 2px 12px 0 rgba(0, 0, 0, 0.13);
    background: rgba(255, 255, 255, 0.88);
    border-color: #fbbf24;
}

.widget-header {
    font-weight: 700;
    font-size: 1.18rem;
    margin-bottom: 1rem;
    color: #fbbf24;
    letter-spacing: 0.01em;
}

.main-card {
    background: rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    backdrop-filter: blur(18px);
    border: 1.5px solid rgba(255, 255, 255, 0.10);
    padding: 2.5rem;
    margin-bottom: 2rem;
    color: #f8fafc;
    transition: box-shadow 0.2s, border 0.2s, background 0.2s;
    animation: fadeInUp 0.6s ease-out;
}

.main-card:hover {
    box-shadow: 0 12px 36px 0 rgba(31, 38, 135, 0.18), 0 2px 12px 0 rgba(0, 0, 0, 0.13);
    background: rgba(255, 255, 255, 0.18);
    border-color: #ffc107;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Security Headers - Add to pages that need them */
.security-headers {
    /* This is a placeholder for security header implementation */
    /* In production, add these headers via PHP or server config */
}

/* CSRF Token Styling */
.csrf-token {
    display: none;
    /* Hidden but present for security */
}

/* Input Validation Feedback */
.input-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.input-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Security Notice Styling */
.security-notice {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #ffc107;
}

.security-notice strong {
    color: #ffc107;
}

/* File Upload Security */
.file-upload-security {
    position: relative;
}

.file-upload-security input[type="file"] {
    position: relative;
    z-index: 1;
}

.file-upload-security .security-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    pointer-events: none;
    z-index: 0;
}

/* Session Security Indicators */
.session-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.session-status.secure {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.session-status.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.session-status.danger {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

/* Security Log Styling */
.security-log {
    background: rgba(0, 0, 0, 0.05);
    border-left: 4px solid #6c757d;
    padding: 12px;
    margin: 8px 0;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    border-radius: 4px;
}

.security-log.critical {
    border-left-color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.security-log.high {
    border-left-color: #fd7e14;
    background: rgba(253, 126, 20, 0.1);
}

.security-log.medium {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.security-log.low {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

/* Security Checklist */
.security-checklist {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.security-checklist h3 {
    color: #ffc107;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.security-checklist ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.security-checklist li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-checklist li:last-child {
    border-bottom: none;
}

.security-checklist .check {
    color: #28a745;
    font-weight: bold;
}

.security-checklist .warning {
    color: #ffc107;
    font-weight: bold;
}

.security-checklist .danger {
    color: #dc3545;
    font-weight: bold;
}

/* Development Security Notice */
.dev-security-notice {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(253, 126, 20, 0.2) 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.dev-security-notice h4 {
    color: #ffc107;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.dev-security-notice p {
    color: #f8f9fa;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.dev-security-notice .btn {
    background: #ffc107;
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.dev-security-notice .btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

/* User Management Page Styles */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
    /* Ensure it's above background */
}

.current-user-badge {
    background: #28a745;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 8px;
    font-weight: 600;
}

.role-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-admin {
    background: #dc3545;
    color: white;
}

.role-office {
    background: #fd7e14;
    color: white;
}

.role-customer {
    background: #6c757d;
    color: white;
}

.user-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.user-actions .btn {
    padding: 4px 8px;
    font-size: 0.8rem;
}

.permission-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.permission-badge {
    background: #17a2b8;
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 500;
}

.password-strength {
    margin-top: 5px;
    font-size: 0.85rem;
    font-weight: 500;
}

.search-box {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
}

.search-box:focus {
    background: white;
    border-color: #fbbf24;
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.25);
}

/* Modal Styles for User Management */
.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(251, 191, 36, 0.1);
    border-radius: 15px 15px 0 0;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(248, 249, 250, 0.5);
    border-radius: 0 0 15px 15px;
}

/* Table Styles */
.table {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
    color: #1f2937;
}

.table th {
    background: rgba(251, 191, 36, 0.2);
    border-bottom: 2px solid rgba(251, 191, 36, 0.4);
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    vertical-align: middle;
    font-weight: 500;
    color: #374151;
}

.table tbody tr:hover {
    background: rgba(251, 191, 36, 0.05);
}

/* Form Styles */
.form-control,
.form-select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    transition: all 0.2s;
    color: #1f2937;
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    background: white;
    border-color: #fbbf24;
    box-shadow: 0 0 0 0.2rem rgba(251, 191, 36, 0.25);
    color: #1f2937;
}

.form-control::placeholder {
    color: #6b7280;
    font-weight: 400;
}

.form-text {
    color: #374151;
    font-weight: 500;
}

.form-check-input:checked {
    background-color: #fbbf24;
    border-color: #fbbf24;
}

/* Alert Styles */
.alert {
    border-radius: 10px;
    border: none;
    backdrop-filter: blur(5px);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

/* System Settings Page Styles */
.system-stat {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.system-stat:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px 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: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #e5e7eb;
    font-weight: 500;
}

.metric-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.metric-header {
    font-size: 1rem;
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 15px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 10px;
}

.metric-details {
    font-size: 0.85rem;
    color: #d1d5db;
}

.config-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.config-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.config-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.health-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.health-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.health-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.health-content {
    flex: 1;
}

.health-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 5px;
}

.health-status {
    font-size: 0.9rem;
    font-weight: 500;
}

.info-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-label {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.8);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Progress bars for metrics */
.progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .system-stat {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .health-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .health-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* Health Status Styles */
.health-stat {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.health-stat:hover {
    transform: translateY(-2px);
}

.health-stat .health-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: white;
    font-size: 1.2rem;
}

.health-stat .health-content {
    flex: 1;
}

.health-stat .health-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.health-stat .health-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Maintenance Tool Styles */
.maintenance-tool {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}

.maintenance-tool:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: white;
    font-size: 1.5rem;
}

.tool-content {
    flex: 1;
}

.tool-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.tool-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Stat Item Styles */
.stat-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-item .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    color: white;
    font-size: 1.2rem;
}

.stat-item .stat-content {
    flex: 1;
}

.stat-item .stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* Chart Container */
.chart-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}