/* ==================== VARIABLES ==================== */
:root {
    --primary: #c8553d;
    --primary-dark: #a83e2a;
    --secondary: #2c3e50;
    --accent: #f0a500;
    --bg-light: #faf9f6;
    --bg-white: #ffffff;
    --bg-dark: #1a1a2e;
    --text-dark: #2d2d2d;
    --text-muted: #6c757d;
    --text-light: #f8f9fa;
    --border: #dee2e6;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

/* ==================== RESET ==================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text-dark);
    background: var(--bg-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* ==================== FRONT OFFICE ==================== */

/* -- Header -- */
.front-header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #16213e 100%);
    color: var(--text-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.front-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.front-header .logo {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.front-header .logo span {
    color: var(--text-light);
}

.front-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.front-nav a {
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
}

.front-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* -- Hero -- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    text-align: center;
    padding: 5rem 1.5rem;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero .btn-hero {
    display: inline-block;
    background: white;
    color: var(--primary);
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: var(--transition);
}

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

/* -- Sections -- */
.section {
    padding: 4rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.1rem;
}

/* -- Category -- */
.category-block {
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.6rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent);
    display: inline-block;
}

/* -- Plat Cards -- */
.plats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.plat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.plat-card-img {
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.plat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plat-card-img .no-img {
    font-size: 3rem;
    opacity: 0.3;
}

.plat-card-body {
    padding: 1.25rem;
}

.plat-card-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.plat-card-body .description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plat-card-body .prix {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
}

.plat-card-body .allergenes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.allergene-badge {
    background: #fff3cd;
    color: #856404;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* -- Contact Form -- */
.contact-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow);
    max-width: 700px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--secondary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(200, 85, 61, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* -- Footer -- */
.front-footer {
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin-top: 4rem;
}

.front-footer p {
    opacity: 0.7;
    font-size: 0.9rem;
}

.front-footer a {
    color: var(--accent);
}

/* -- Buttons -- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

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

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

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

.btn-success:hover {
    background: #218838;
}

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

.btn-danger:hover {
    background: #c82333;
}

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

.btn-secondary:hover {
    background: #5a6268;
}

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

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

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

/* ==================== BACK OFFICE ==================== */

/* -- Login -- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-dark), #16213e);
}

.login-box {
    background: var(--bg-white);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary);
    font-size: 1.5rem;
}

.login-box .logo-text {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* -- Admin Layout -- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--bg-dark), #16213e);
    color: var(--text-light);
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.admin-sidebar .sidebar-brand {
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.admin-sidebar .sidebar-brand h2 {
    color: var(--accent);
    font-size: 1.3rem;
}

.admin-sidebar .sidebar-brand small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    font-size: 0.95rem;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-left-color: var(--accent);
}

.sidebar-nav .nav-section {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
}

.badge-count {
    background: var(--danger);
    color: white;
    padding: 0.15rem 0.55rem;
    border-radius: 50px;
    font-size: 0.75rem;
    margin-left: auto;
}

.admin-content {
    margin-left: 260px;
    flex: 1;
    padding: 2rem;
    background: var(--bg-light);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.admin-topbar h1 {
    font-size: 1.6rem;
    color: var(--secondary);
}

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

.stat-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-info h3 {
    font-size: 1.6rem;
    font-weight: 800;
}

.stat-card .stat-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.stat-icon.plats {
    background: #e3f2fd;
    color: #1565c0;
}

.stat-icon.categories {
    background: #f3e5f5;
    color: #7b1fa2;
}

.stat-icon.users {
    background: #e8f5e9;
    color: #2e7d32;
}

.stat-icon.messages {
    background: #fff3e0;
    color: #e65100;
}

/* -- Tables -- */
.table-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.table-wrapper th,
.table-wrapper td {
    padding: 0.85rem 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table-wrapper th {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-wrapper tr:hover {
    background: #f8f9fa;
}

.table-wrapper .actions {
    display: flex;
    gap: 0.4rem;
}

.table-wrapper img.thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

/* -- Forms -- */
.form-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 700px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
}

.checkbox-grid input[type="checkbox"] {
    width: auto;
}

.photo-preview {
    margin-top: 0.5rem;
}

.photo-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
}

/* -- Alerts -- */
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* -- Role Badges -- */
.role-badge {
    padding: 0.2rem 0.7rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

.role-admin {
    background: #e3f2fd;
    color: #1565c0;
}

.role-contributeur {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* -- Status badges -- */
.status-unread {
    color: var(--primary);
    font-weight: 700;
}

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

/* -- Message detail -- */
.message-detail {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.message-detail .meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.message-detail .meta dt {
    font-weight: 700;
    color: var(--secondary);
}

.message-detail .meta dd {
    color: var(--text-dark);
}

.message-detail .body {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    line-height: 1.7;
}

/* -- Mobile nav toggle -- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* -- Responsive -- */
@media (max-width: 768px) {
    .front-header .container {
        flex-wrap: wrap;
        height: auto;
        padding: 1rem 1.5rem;
    }

    .nav-toggle {
        display: block;
    }

    .front-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1rem;
    }

    .front-nav.open {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

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

    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-content {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

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