/* ============================================================
   ATLAS WORKING - Admin Styles
   Brand Identity: Édition Végétale & Zeste
   ============================================================ */

:root {
    --primary: #2F4F4F;
    --primary-light: #3d6b6b;
    --primary-dark: #1f3a3a;
    --accent: #99CC33;
    --accent-dark: #7fb32a;
    --text: #2D3748;
    --text-light: #4a5568;
    --text-lighter: #718096;
    --bg: #F4F6F0;
    --bg-alt: #eaeee3;
    --border: #dde3d4;
    --white: #ffffff;
    --danger: #e74c3c;
    --success: #2ecc71;
    --shadow: rgba(47, 79, 79, 0.12);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Auth Pages (login / register) ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary) 60%, var(--primary-light));
    padding: 24px;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(153, 204, 51, 0.12), transparent 70%);
    top: -150px;
    right: -150px;
}

.auth-card {
    position: relative;
    background: var(--white);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 44px 40px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.auth-card__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    justify-content: center;
}

.auth-card__logo-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--white);
    font-weight: 800;
    border-radius: 10px;
    font-size: 0.95rem;
    letter-spacing: 1px;
}

.auth-card__logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
}

.auth-card h1 {
    font-size: 1.5rem;
    color: var(--text);
    text-align: center;
    margin-bottom: 6px;
    font-family: 'Playfair Display', Georgia, serif;
}

.auth-card__subtitle {
    text-align: center;
    color: var(--text-lighter);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(153, 204, 51, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 30px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 30px;
    transition: all 0.25s;
}

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

.btn--primary:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(153, 204, 51, 0.3);
}

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

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

.auth-card__footer {
    text-align: center;
    margin-top: 22px;
    font-size: 0.85rem;
    color: var(--text-lighter);
}

.auth-card__footer a {
    color: var(--accent-dark);
    font-weight: 600;
}

.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
}

.alert.show { display: block; }
.alert--error { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.alert--success { background: rgba(46, 204, 113, 0.1); color: var(--success); }

/* ---------- Dashboard ---------- */
.dash-body {
    background: var(--bg);
    min-height: 100vh;
}

.dash-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.dash-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dash-topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-topbar__logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-topbar__logo-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--white);
    font-weight: 800;
    border-radius: 8px;
    font-size: 0.8rem;
}

.dash-topbar__logo-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.2rem;
}

.dash-topbar__user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-topbar__user-info {
    text-align: right;
}

.dash-topbar__user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.dash-topbar__user-role {
    font-size: 0.72rem;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dash-topbar__logout {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-alt);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
}

.dash-topbar__logout:hover {
    background: var(--danger);
    color: var(--white);
}

.dash-content {
    padding: 32px 0 60px;
}

.dash-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 4px 15px var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card__icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
}

.stat-card--projects .stat-card__icon { background: rgba(153, 204, 51, 0.15); color: var(--accent-dark); }
.stat-card--products .stat-card__icon { background: rgba(47, 79, 79, 0.1); color: var(--primary); }
.stat-card--users .stat-card__icon { background: rgba(140, 170, 200, 0.15); color: #52708f; }

.stat-card__number {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-card__label {
    font-size: 0.8rem;
    color: var(--text-lighter);
}

.dash-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 4px 15px var(--shadow);
    margin-bottom: 28px;
}

.dash-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 22px;
}

.dash-section__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.btn--small {
    padding: 9px 18px;
    font-size: 0.82rem;
}

.table-wrapper { overflow-x: auto; }

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

.table th {
    text-align: left;
    padding: 12px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-lighter);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafcf6; }

.cell-title { font-weight: 600; color: var(--text); }

.cell-thumb {
    width: 54px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-lighter);
    font-size: 0.8rem;
}

.badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--resort { background: #eef7df; color: #5e8a1f; }
.badge--institutions { background: #e4efe4; color: #2d5a27; }
.badge--etablissement { background: #e7eaee; color: #3d4a5c; }
.badge--acoustique { background: #e2ecec; color: #2f4f4f; }
.badge--bureautique { background: #e8eaf6; color: #3949ab; }
.badge--mobilier-interieur { background: #fff3e0; color: #e65100; }
.badge--showroom { background: #fce4ec; color: #c62828; }
.badge--bien-etre { background: #e8f5e9; color: #2e7d32; }
.badge--spa { background: #e0f7fa; color: #00695c; }
.badge--agencement { background: #f3e5f5; color: #7b1fa2; }
.badge--acoustique-small { background: #e2ecec; color: #2f4f4f; }
.badge--acoustique-medium { background: #e0f2f1; color: #00695c; }
.badge--acoustique-large { background: #fff8e1; color: #f57f17; }
.badge--acoustique-sur-mesure { background: #fce4ec; color: #ad1457; }

.row-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.action-btn--edit { background: rgba(153, 204, 51, 0.12); color: var(--accent-dark); }
.action-btn--edit:hover { background: var(--accent); color: var(--white); }
.action-btn--delete { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.action-btn--delete:hover { background: var(--danger); color: var(--white); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-lighter);
}

.empty-state i { font-size: 2rem; margin-bottom: 10px; color: var(--border); }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(31, 58, 58, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.modal__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
}

.modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-alt);
    color: var(--text-light);
    font-size: 0.9rem;
}

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

.modal .form-group { margin-bottom: 16px; }

.modal label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.modal input,
.modal select,
.modal textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}

.modal input:focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.modal textarea { resize: vertical; min-height: 80px; }

.modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn--ghost {
    background: var(--bg-alt);
    color: var(--text-light);
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.88rem;
}

.btn--ghost:hover { background: var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .auth-card { padding: 32px 24px; }

    .dash-stats { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 16px; }

    .dash-topbar__user-info { display: none; }
    .dash-section { padding: 20px; }
}

@media (max-width: 480px) {
    .dash-stats { grid-template-columns: 1fr; }
}