:root {
    --primary-color: #1a1a1a;
    --accent-color: #c5a059; /* Gold accent for luxury */
    --bg-color: #f8f9fa;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --primary-color: #ffffff;
    --bg-color: #121212;
    --sidebar-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --border-color: #333333;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    min-height: 100vh;
    transition: var(--transition);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-links li {
    margin-bottom: 0.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: var(--transition);
    font-weight: 500;
}

.nav-links a.active, .nav-links a:hover {
    background-color: var(--accent-color);
    color: white;
}

.nav-links a i {
    margin-right: 10px;
    width: 20px;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    padding: 2rem;
    max-width: calc(100% - 260px);
    width: 100%;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

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

/* Dashboard Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

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

/* Sections */
.section-panel {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    display: none; /* Hidden by default, shown via JS */
}

.section-panel.active {
    display: block;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

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

.btn-primary:hover {
    opacity: 0.9;
}

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

.btn-outline:hover {
    background-color: var(--bg-color);
}

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

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    background-color: var(--bg-color);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

tr:hover {
    background-color: var(--bg-color);
}

.img-preview-sm {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.1);
}

/* Utility */
.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-gold { background: #fff3cd; color: #856404; }

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters input {
    min-width: 200px;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 101;
}

/* Tablet Responsive (768px to 1024px) */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
        padding: 1.5rem 1rem;
    }

    .logo {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .main-content {
        margin-left: 220px;
        max-width: calc(100% - 220px);
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        gap: 0.75rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.75rem;
    }

    .img-preview-sm {
        width: 35px;
        height: 35px;
    }

    .filters input {
        min-width: 150px;
    }
}

/* Mobile Responsive (max-width: 768px) */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        width: 260px;
        height: 100vh;
        padding: 1.5rem;
        transition: left 0.3s ease;
        z-index: 1000;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1rem;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

    .page-title h1 {
        font-size: 1.25rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
    }

    .header-actions .btn {
        width: 100%;
        text-align: center;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 999;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

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

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

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

    .panel-header h2 {
        font-size: 1.1rem;
    }

    .panel-header .btn {
        width: 100%;
    }

    .table-container {
        border-radius: 0;
        margin: 0 -1rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .img-preview-sm {
        width: 30px;
        height: 30px;
    }

    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .btn-sm {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
    }

    input, select, textarea {
        padding: 0.6rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }

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

    label {
        font-size: 0.9rem;
    }

    .filters {
        flex-direction: column;
    }

    .filters input {
        width: 100%;
        min-width: unset;
    }

    .theme-toggle {
        margin-top: auto;
    }

    .theme-toggle .btn {
        width: 100%;
    }

    /* Hide sidebar text on very small screens */
    @media (max-width: 480px) {
        .logo {
            font-size: 0.9rem;
            margin-bottom: 1.5rem;
        }

        .nav-links a span {
            display: inline;
        }

        .page-title h1 {
            font-size: 1rem;
        }

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

        .panel-header h2 {
            font-size: 0.95rem;
        }

        th, td {
            padding: 0.4rem;
        }

        .btn {
            padding: 0.35rem 0.6rem;
            font-size: 0.7rem;
        }

        .btn i {
            margin-right: 0.25rem;
        }

        .section-panel {
            padding: 1rem;
            border-radius: 8px;
        }
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
    }

    header {
        margin-bottom: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .panel-header {
        margin-bottom: 1rem;
    }

    .section-panel {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .table-container {
        margin: 0 -0.75rem;
    }

    input, select, textarea {
        padding: 0.5rem;
    }

    .btn {
        width: 100%;
        padding: 0.5rem;
    }
}
