:root {
    /* Color Palette */
    --primary: #264796;
    /* Enterprise Blue */
    --primary-dark: #1a3370;
    /* Darker shade for active states/sidebar */
    --primary-light: #3b5fa8;
    /* Lighter shade for gradients/hover */

    --secondary: #898989;
    /* Gray for secondary text */

    --btn-color: #0097D3;
    /* Bright Blue Actions */
    --btn-hover: #007bb0;
    --btn-active: #006da0;

    --text-main: #000000;
    /* Black text */
    --text-light: #ffffff;
    /* White text (for dark backgrounds) */
    --text-muted: #64748b;

    /* Backgrounds - Light Theme Base */
    --bg-body: #f8fafc;
    /* Light Gray Background */
    --bg-card: #ffffff;
    /* White Content Cards */
    --bg-sidebar: #264796;
    /* Dark Sidebar */

    --border: #e2e8f0;
    /* Light Borders */

    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
}

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

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Authentication */
.auth-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.auth-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.auth-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-main);
    transition: all 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--btn-color);
    box-shadow: 0 0 0 3px rgba(0, 151, 211, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    color: white;
}

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

.btn-primary:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--btn-active);
    transform: translateY(0);
}

/* Filter Buttons */
.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.filter-btn {
    background: white;
    border: 1px solid var(--border);
    color: var(--secondary);
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    color: var(--text-light);
    /* Forced white text for dark sidebar */
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

.logo {
    margin-bottom: 2.5rem;
    /* font-size removed here to control via h2 */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center horizontally */
    gap: 10px;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.logo span {
    color: var(--btn-color);
    /* Accent in logo */
}

#nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.85rem 1rem;
    border-radius: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

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

.nav-item.active {
    background: rgba(255, 255, 255, 0.15);
    /* Subtle highlight */
    color: white;
    border-left: 4px solid var(--btn-color);
    padding-left: calc(1rem - 4px);
    /* Valid CSS adjustment for border */
}

.sidebar-status-box {
    margin-top: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.sidebar-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-status-item i {
    font-size: 1.1rem;
}

.sidebar-status-info {
    display: flex;
    flex-direction: column;
}

.sidebar-status-info strong {
    font-weight: 600;
    color: white;
}

.sidebar-status-info small {
    color: rgba(255, 255, 255, 0.6);
}

.user-profile {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info span {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-info small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

#logout-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s;
}

#logout-btn:hover {
    color: white;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-body);
}

.top-bar {
    height: 70px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
}

/* Cards & Tables */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* Soft light shadow */
}

/* Dashboard Grid & Summary Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

.summary-card {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.summary-content h3 {
    font-size: 0.9rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-content .count {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
}

.summary-content .sub-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-weight: 500;
}

.summary-icon {
    font-size: 2rem;
    color: rgba(38, 71, 150, 0.1);
    /* Light Primary Opacity */
    background: rgba(38, 71, 150, 0.05);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-dot {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    border: 2px solid white;
    font-size: 0.7rem;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Enhanced Split Card Right Panel */
.summary-right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.total-stats {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.total-stats span {
    font-size: 0.7rem;
    color: var(--secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.total-stats strong {
    font-size: 1rem;
    color: var(--text-main);
}

/* Content Blocks */
.content-block {
    background: var(--bg-card);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content-block h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    align-items: start;
    /* Align top for multi-line text */
    gap: 12px;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
    cursor: pointer;
}

.recent-item:hover {
    background: #f8fafc;
}

.recent-item .avatar {
    width: 40px;
    height: 40px;
    background: rgba(38, 71, 150, 0.1);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.recent-item .info {
    flex: 1;
}

.recent-item .info h4 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.recent-item .info p {
    font-size: 0.85rem;
    color: var(--secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-item.unread .info h4::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--btn-color);
    border-radius: 50%;
    margin-left: 8px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background-color: #f8fafc;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover td {
    background-color: #f1f5f9;
    /* Light primary tint hover could be rgba(38,71,150, 0.05) */
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Action Buttons */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 0.3rem;
    margin-right: 0.5rem;
    color: white;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.btn-sm:hover {
    opacity: 0.85;
}

.btn-edit {
    background-color: var(--btn-color);
}

.btn-delete {
    background-color: var(--danger);
}

.btn-success {
    background-color: var(--success);
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: #666;
}

.btn-danger {
    background-color: var(--danger);
}

.btn-danger:hover {
    background-color: #dc2626;
}

/* Modal */
#modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    /* Lighter backdrop */
    backdrop-filter: blur(2px);
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    /* Prevent vertical overflow */
    overflow-y: auto;
    /* Scroll if too tall */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Context for absolute close button */
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #E53935;
    color: white;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #d32f2f;
}

/* ... existing header code ... */

/* Image Preview Grid */
.image-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, 64px);
    gap: 8px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    padding: 2px;
}

.preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.preview-item .remove-btn:hover {
    background: var(--danger);
}

.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    background: white;
    border-left: 4px solid var(--btn-color);
    color: var(--text-main);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Review Carousel */
.review-carousel-container {
    margin-top: 1rem;
}

.carousel-wrapper {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 10px;
    /* Space for scrollbar */
}

.carousel-slides {
    display: inline-flex;
    gap: 10px;
}

.carousel-img {
    height: 150px;
    width: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}

.carousel-img:hover {
    transform: scale(1.02);
}

/* Custom Scrollbar for Carousel */
.carousel-wrapper::-webkit-scrollbar {
    height: 6px;
}

.carousel-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.carousel-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.carousel-wrapper::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Mobile Branding */
.mobile-brand {
    display: none !important;
    /* Hidden on desktop */
}

.mobile-brand h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
    color: var(--primary);
}

.mobile-brand span {
    color: var(--btn-color);
}

/* Burger Button Base Style */
.burger-btn {
    display: none;
    /* Hidden on desktop */
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 0.5rem;
    align-items: center;
    justify-content: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-container {
        display: block;
        /* Stack layout */
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1000;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

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

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        width: 100%;
        margin-left: 0;
        min-height: 100vh;
    }

    .top-bar {
        padding: 0 1.5rem;
        gap: 1rem;
    }

    .burger-btn {
        display: flex;
        /* Visible on mobile */
        order: -1;
    }

    .mobile-brand {
        display: block !important;
        flex: 1;
        text-align: center;
    }

    /* Hide Page Title on Mobile */
    #page-title {
        display: none;
    }

    /* Adjust Grid */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet: 2 cols */
    }
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        /* Mobile: 1 col */
    }

    .top-bar h1 {
        font-size: 1.25rem;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    /* Table Responsive */
    .card {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
        /* Force scroll */
    }
}
/* Dropdown Menus */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    z-index: 1000;
    display: none;
    min-width: 160px;
    padding: 0.5rem 0;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-main);
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.5rem 1.5rem;
    clear: both;
    font-weight: 500;
    color: var(--text-main);
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}

.dropdown-item.text-danger {
    color: var(--danger);
}

.dropdown-item.text-danger:hover {
    background-color: #fef2f2;
}

.dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-info { background-color: #3b82f6; color: white; }
.badge-success { background-color: #22c55e; color: white; }
.badge-warning { background-color: #f59e0b; color: white; }
.badge-danger { background-color: #ef4444; color: white; }

.badge.is-light {
    background-color: rgba(0, 0, 0, 0.05);
    color: inherit;
}

.badge-info.is-light { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.badge-success.is-light { background-color: rgba(34, 197, 94, 0.1); color: #22c55e; }
.badge-warning.is-light { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.badge-danger.is-light { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }

