﻿/* =====================================================
   ADMIN DASHBOARD â€“ Cinci&Renov
   Contient tout : reset, variables, layout, sidebar,
   table, modaux, formulaires, toast, responsive.
   ===================================================== */

/* ===== RESET & BASE ===== */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body {
    font-family: 'Montserrat', 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p {
    margin: 0;
}

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

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ===== CSS VARIABLES ===== */

:root {
    /* Sidebar */
    --sidebar-w:      260px;
    --sidebar-bg:     #0d1b2a;
    --sidebar-text:   #8fa5bc;
    --sidebar-active: #e3c285;
    --sidebar-hover:  rgba(255, 255, 255, 0.055);

    /* Brand */
    --primary:        #1f4a73;
    --primary-dark:   #132f4b;
    --primary-light:  #2c6098;
    --accent:         #e3c285;
    --accent-dark:    #c9a05a;

    /* UI */
    --main-bg:        #f0f4f8;
    --card-bg:        #ffffff;
    --border:         rgba(19, 47, 75, 0.10);
    --border-strong:  rgba(19, 47, 75, 0.18);

    /* Text */
    --text-main:      #101b28;
    --text-muted:     #57697a;

    /* Radius */
    --r-sm:  8px;
    --r-md:  14px;
    --r-lg:  20px;
    --r-xl:  28px;

    /* Shadow */
    --shadow:    0 2px 12px rgba(8, 20, 32, 0.07);
    --shadow-md: 0 6px 24px rgba(8, 20, 32, 0.12);
    --shadow-lg: 0 20px 50px rgba(8, 20, 32, 0.20);

    /* Spacing (4px base) */
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --s7: 48px;
}

/* ===== MATERIAL SYMBOLS â€“ remove default margin ===== */
.material-symbols-outlined {
    font-size: 20px;
    line-height: 1;
    user-select: none;
    vertical-align: middle;
    flex-shrink: 0;
}

/* =====================================================
   DASHBOARD LAYOUT
   ===================================================== */

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

/* ===== SIDEBAR ===== */

.dashboard-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 200;
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: var(--s5) var(--s4) var(--s4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    object-fit: contain;
}

.sidebar-title {
    display: block;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #f3ece0;
    letter-spacing: 0.2px;
    line-height: 1.2;
}

.sidebar-subtitle {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: var(--sidebar-active);
    margin-top: 2px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: var(--s4) var(--s3);
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #f3ece0;
}

.sidebar-link.active {
    background: rgba(227, 194, 133, 0.14);
    color: var(--sidebar-active);
    font-weight: 700;
}

.sidebar-link .material-symbols-outlined {
    font-size: 20px;
}

/* Footer logout */
.sidebar-footer {
    padding: var(--s3);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px 14px;
    border-radius: var(--r-sm);
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    background: transparent;
    border: none;
    text-align: left;
    font-family: inherit;
}

.sidebar-logout:hover {
    background: rgba(231, 76, 60, 0.12);
    color: #ef5b4c;
}

.sidebar-logout.active {
    background: rgba(231, 76, 60, 0.16);
    color: #ef5b4c;
    font-weight: 700;
}

.sidebar-logout .material-symbols-outlined {
    font-size: 20px;
}

/* ===== MAIN AREA ===== */

.dashboard-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ===== TOPBAR ===== */

.dashboard-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: var(--s4) var(--s6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    box-shadow: 0 1px 4px rgba(8, 20, 32, 0.06);
}

.topbar-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
}

.topbar-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
}

.topbar-back {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.topbar-back:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.topbar-back .material-symbols-outlined {
    font-size: 16px;
}

/* ===== DASHBOARD CONTENT ===== */

.dashboard-content {
    padding: var(--s6);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--s5);
}

/* =====================================================
   ADMIN SETTINGS PAGES (reset password, logout)
   ===================================================== */

.admin-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: var(--s6);
    display: flex;
    flex-direction: column;
    gap: var(--s5);
    max-width: 760px;
}

.admin-card--narrow {
    max-width: 620px;
}

.admin-card-header {
    display: flex;
    align-items: center;
    gap: var(--s4);
}

.admin-card-heading {
    display: flex;
    flex-direction: column;
    gap: var(--s1);
}

.admin-card-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.admin-card-icon .material-symbols-outlined {
    font-size: 24px;
}

.admin-card-icon--accent {
    background: rgba(31, 74, 115, 0.09);
    color: var(--primary);
}

.admin-card-icon--danger {
    background: rgba(231, 76, 60, 0.12);
    color: #c0392b;
}

.admin-card-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.4rem;
    color: var(--primary-dark);
    line-height: 1.2;
}

.admin-card-subtitle,
.admin-card-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.admin-form {
    margin-top: var(--s2);
}

.admin-input-with-action {
    position: relative;
}

.admin-input-with-action input[type="password"] {
    padding-right: 52px;
}

.admin-input-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 1px solid #d7dfe8;
    border-radius: 10px;
    background: #f6f9fc;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-input-toggle:hover {
    border-color: var(--primary);
    background: rgba(31, 74, 115, 0.08);
}

.admin-input-toggle .material-symbols-outlined {
    font-size: 18px;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--s3);
    flex-wrap: wrap;
}

.admin-alert {
    display: flex;
    align-items: center;
    gap: var(--s3);
    border-radius: var(--r-sm);
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 600;
}

.admin-alert p {
    margin: 0;
}

.admin-alert--error {
    background: rgba(231, 76, 60, 0.09);
    border: 1px solid rgba(231, 76, 60, 0.20);
    color: #b7392c;
}

.admin-alert--success {
    background: rgba(39, 174, 96, 0.10);
    border: 1px solid rgba(39, 174, 96, 0.25);
    color: #1b7e4e;
}

/* =====================================================
   STATS CARDS
   ===================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s4);
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--r-md);
    padding: var(--s5) var(--s5);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: var(--s4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .material-symbols-outlined {
    font-size: 26px;
}

.stat-icon--blue  { background: rgba(31, 74, 115, 0.09);  color: var(--primary); }
.stat-icon--gold  { background: rgba(227, 194, 133, 0.22); color: #9a7230; }
.stat-icon--green { background: rgba(39, 174, 96, 0.10);   color: #1a7a4c; }

.stat-body {
    min-width: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 5px;
    letter-spacing: 0.2px;
}

/* =====================================================
   PROJECTS SECTION
   ===================================================== */

.projects-section {
    background: var(--card-bg);
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
    flex: 1;
}

.projects-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s5) var(--s6);
    border-bottom: 1px solid var(--border);
    gap: var(--s4);
    flex-wrap: wrap;
}

.projects-section-header h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ===== TABLE ===== */

.projects-table {
    width: 100%;
}

.table-header {
    display: grid;
    grid-template-columns: 2fr 130px 220px;
    padding: 10px var(--s6);
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.table-row {
    display: grid;
    grid-template-columns: 2fr 130px 220px;
    padding: var(--s4) var(--s6);
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: var(--s4);
    transition: background 0.15s ease;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #f7f9fc;
}

.col-name strong {
    display: block;
    font-size: 0.93rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 2px;
}

.project-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 340px;
    font-weight: 400;
    line-height: 1.4;
}

/* ===== BADGES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.badge .material-symbols-outlined {
    font-size: 14px;
}

.badge-featured {
    background: rgba(39, 174, 96, 0.12);
    color: #1a7a4c;
    border: 1px solid rgba(39, 174, 96, 0.28);
}

.badge-unfeatured {
    background: rgba(87, 105, 122, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(87, 105, 122, 0.18);
}

/* ===== ACTION BUTTONS ===== */

.col-actions {
    display: flex;
    gap: var(--s2);
    align-items: center;
    flex-wrap: wrap;
}

/* Fix bug: retirer border:none du groupe commun */
.edit-btn,
.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.edit-btn {
    background: rgba(31, 74, 115, 0.07);
    color: var(--primary);
    border: 1px solid rgba(31, 74, 115, 0.18);
}

.edit-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 74, 115, 0.25);
}

.delete-btn {
    background: rgba(231, 76, 60, 0.07);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.20);
}

.delete-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.30);
}

.edit-btn .material-symbols-outlined,
.delete-btn .material-symbols-outlined {
    font-size: 15px;
}

/* ===== EMPTY STATE ===== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--s7) var(--s5);
    color: var(--text-muted);
    gap: var(--s3);
    text-align: center;
}

.empty-icon {
    font-size: 48px !important;
    opacity: 0.3;
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== ADD PROJECT BUTTON ===== */

.add-project-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: 9px 18px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #10253d;
    border: none;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(201, 160, 106, 0.3);
    font-family: inherit;
}

.add-project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 160, 106, 0.45);
}

.empty-add-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--s2);
    padding: 11px 22px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: var(--s2);
}

.empty-add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 74, 115, 0.35);
}

/* =====================================================
   MODAUX
   ===================================================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 32, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--s4);
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

/* Placed with modal-small, modal-large in correct order */
.modal-small {
    max-width: 400px;
}

.modal-large {
    max-width: 720px;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--s5) var(--s6);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
}

.modal-header h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #f3ece0;
    letter-spacing: 0.2px;
}

.modal-header-danger {
    background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.14);
    border: none;
    border-radius: 50%;
    color: #f3ece0;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.26);
    transform: rotate(90deg);
}

/* modal-body scrolls if form is long; modal-footer stays fixed at bottom */
.modal-body {
    padding: var(--s5) var(--s6);
    overflow-y: auto;
    flex: 1;
}

/* modal-footer is OUTSIDE the form in Pug â€“ no double-padding bug */
.modal-footer {
    padding: var(--s4) var(--s6);
    display: flex;
    justify-content: flex-end;
    gap: var(--s3);
    border-top: 1px solid var(--border);
    background: #f7f9fc;
    flex-shrink: 0;
}

/* ===== FORM ELEMENTS ===== */

form {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--s2);
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.15px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea {
    padding: 10px 14px;
    border: 1px solid #cdd5de;
    border-radius: var(--r-sm);
    background: #fafbfc;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.92rem;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(31, 74, 115, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* Section labels inside form */
.form-section-label {
    display: flex;
    align-items: center;
    gap: var(--s3);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    padding-bottom: var(--s2);
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--s1);
}

.form-section-hint {
    font-size: 0.74rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
}

/* Checkbox */
.checkbox-group {
    margin-top: var(--s1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--s3);
    padding: 10px 14px;
    background: rgba(31, 74, 115, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.checkbox-label:hover {
    background: rgba(31, 74, 115, 0.07);
    border-color: var(--border-strong);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
}

/* File input */
.file-group {
    min-width: 0;
}

.file-input-wrapper {
    position: relative;
    min-width: 0;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

.file-label {
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 10px 14px;
    background: #fafbfc;
    border: 2px dashed #cdd5de;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
}

.file-label:hover {
    border-color: var(--primary);
    background: rgba(31, 74, 115, 0.03);
}

.file-label .material-symbols-outlined {
    color: var(--primary);
    font-size: 18px;
    flex-shrink: 0;
}

.file-text {
    flex: 1;
    font-size: 0.83rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

/* ===== RENOVATION CARDS ===== */

#renovations-container {
    display: flex;
    flex-direction: column;
    gap: var(--s4);
    margin-bottom: var(--s3);
}

.renovation-card {
    border: 1px solid #e1e8f0;
    border-radius: var(--r-md);
    padding: var(--s4) var(--s5);
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(8, 20, 32, 0.02);
    display: flex;
    flex-direction: column;
    gap: var(--s3);
    animation: fadeIn 0.2s ease;
    transition: box-shadow 0.2s ease;
}

.renovation-card:hover {
    box-shadow: 0 4px 12px rgba(8, 20, 32, 0.05);
    border-color: #d0dbe6;
}

.renovation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.renovation-card-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.remove-renovation-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: rgba(231, 76, 60, 0.09);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.22);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remove-renovation-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
    transform: scale(1.1);
}

.remove-renovation-btn .material-symbols-outlined {
    font-size: 16px;
}

.renovation-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s3);
}

.add-renovation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s2);
    padding: 10px var(--s4);
    width: 100%;
    background: rgba(31, 74, 115, 0.05);
    color: var(--primary);
    border: 2px dashed rgba(31, 74, 115, 0.22);
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: var(--s2);
}

.add-renovation-btn:hover {
    background: rgba(31, 74, 115, 0.09);
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* ===== MODAL BUTTONS ===== */

.cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.cancel-btn:hover {
    background: rgba(31, 74, 115, 0.05);
    border-color: var(--primary);
    color: var(--primary);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #10253d;
    border: none;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(201, 160, 106, 0.28);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 160, 106, 0.45);
}

.submit-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.submit-btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(16, 37, 61, 0.2);
    border-top-color: #10253d;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

.danger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(231, 76, 60, 0.4);
}

.danger-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
    box-shadow: none;
}

.danger-btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

/* ===== DELETE CONFIRM BODY ===== */

.delete-confirm-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--s3);
    padding: var(--s3) 0;
}

.delete-icon {
    font-size: 40px !important;
    color: #e74c3c;
    opacity: 0.85;
}

.delete-confirm-body p {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.project-name-display {
    color: var(--primary-dark);
    font-size: 1rem;
}

/* ===== TOAST ===== */

.toast {
    position: fixed;
    bottom: var(--s6);
    right: var(--s6);
    padding: 12px 18px;
    border-radius: var(--r-md);
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    gap: var(--s2);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.toast.success { background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%); }
.toast.error   { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================
   RESPONSIVE â€“ single merged @media block
   ===================================================== */

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 32, 0.65);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Hamburger Menu Button */
.sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--primary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: var(--s3);
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: rgba(31, 74, 115, 0.05);
    color: var(--primary-dark);
}

.sidebar-toggle .material-symbols-outlined {
    font-size: 24px;
}

@media (max-width: 900px) {

    .dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: none;
    }

    body.sidebar-open .dashboard-sidebar {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-toggle {
        display: flex;
    }

    .dashboard-main {
        margin-left: 0;
    }

    .dashboard-topbar {
        padding: var(--s4);
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .topbar-left {
        min-width: 0;
    }

    .topbar-title {
        font-size: 1.15rem;
    }

    .topbar-back {
        margin-left: auto;
    }

    .dashboard-content {
        padding: var(--s4);
    }

    .admin-card {
        padding: var(--s5);
    }

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

    .table-header {
        display: none;
    }

    .table-row {
        grid-template-columns: 1fr;
        gap: var(--s3);
        padding: var(--s4);
    }

    .project-desc {
        white-space: normal;
        max-width: 100%;
    }

    .col-featured {
        display: flex;
        align-items: center;
    }

    .col-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .edit-btn,
    .delete-btn {
        flex: 1;
        justify-content: center;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: var(--r-md);
    }

    .modal-header {
        padding: var(--s4) var(--s5);
    }

    .modal-body {
        padding: var(--s4) var(--s5);
    }

    .modal-footer {
        padding: var(--s3) var(--s5);
        flex-direction: column-reverse;
    }

    .cancel-btn,
    .submit-btn,
    .danger-btn {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .renovation-photos {
        grid-template-columns: 1fr;
    }

    .modal-large {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .dashboard-topbar {
        gap: var(--s3);
    }

    .topbar-title {
        font-size: 1.05rem;
    }

    .topbar-meta {
        font-size: 0.75rem;
    }

    .topbar-back {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .stat-card {
        padding: var(--s4);
    }

    .stat-value {
        font-size: 1.65rem;
    }

    .admin-card {
        padding: var(--s4);
        gap: var(--s4);
    }

    .admin-card-header {
        align-items: flex-start;
    }

    .admin-actions {
        flex-direction: column-reverse;
    }

    .admin-actions .cancel-btn,
    .admin-actions .submit-btn,
    .admin-actions .danger-btn {
        width: 100%;
    }

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

    .projects-section-header {
        padding: var(--s4);
    }

    .table-row {
        padding: var(--s3) var(--s4);
    }
}



/* ─── NEW POPUP STYLES ─── */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(19, 47, 75, 0);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: background 0.6s cubic-bezier(0.16,1,0.3,1);
}
.popup-overlay.active {
  background: rgba(19, 47, 75, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.popup {
  background: #ffffff;
  width: min(480px, 90vw);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(8, 20, 32, 0.2);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(32px) scale(0.94);
  display: flex;
  flex-direction: column;
  max-height: 92vh;
}
.popup.popup-large {
  width: min(720px, 95vw);
}

.popup-overlay.active .popup {
  animation: popReveal 0.72s cubic-bezier(0.16,1,0.3,1) forwards;
}
.popup-overlay.closing .popup {
  animation: popDismiss 0.45s cubic-bezier(0.4,0,1,1) forwards;
}

@keyframes popReveal {
  0%   { opacity:0; transform: translateY(40px) scale(0.92); clip-path: inset(100% 0 0 0); }
  40%  { opacity:1; clip-path: inset(0% 0 0 0); }
  100% { opacity:1; transform: translateY(0) scale(1); clip-path: inset(0% 0 0 0); }
}
@keyframes popDismiss {
  0%   { opacity:1; transform: translateY(0) scale(1); clip-path: inset(0% 0 0 0); }
  100% { opacity:0; transform: translateY(-24px) scale(0.95); clip-path: inset(0 0 100% 0); }
}

.popup-line {
  height: 4px;
  background: #e3c285;
  transform: scaleX(0);
  transform-origin: left;
  flex-shrink: 0;
}
.popup-overlay.active .popup-line {
  animation: lineIn 0.6s 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
}
@keyframes lineIn {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.popup-close {
  position: absolute;
  top: 20px; right: 20px;
  width: 32px; height: 32px;
  background: #f6f1ea;
  border: 1px solid rgba(19, 47, 75, 0.12);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.3s, transform 0.2s;
  z-index: 10;
}
.popup-overlay.active .popup-close {
  animation: fadeIn 0.3s 0.9s ease forwards;
}
.popup-close:hover { 
  background: #132f4b;
  transform: scale(1.1);
}
.popup-close:hover svg line { stroke: #e3c285; }

.popup-inner {
  padding: 40px 40px 36px;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
  flex: 1;
}

.popup-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #e3c285;
  opacity: 0;
  transform: translateY(8px);
  flex-shrink: 0;
}
.popup-overlay.active .popup-tag {
  animation: fadeUp 0.5s 0.42s ease forwards;
}

.popup-title {
  font-family: 'Fraunces', 'Playfair Display', Georgia, serif;
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.2;
  margin-top: 12px;
  color: #132f4b;
  opacity: 0;
  transform: translateY(12px);
  flex-shrink: 0;
}
.popup-overlay.active .popup-title {
  animation: fadeUp 0.55s 0.52s cubic-bezier(0.16,1,0.3,1) forwards;
}
.popup-title em {
  font-style: italic;
  color: #2f5f8c;
}

.popup-body {
  font-size: 14px;
  line-height: 1.6;
  color: #4c5b68;
  margin-top: 16px;
  opacity: 0;
  transform: translateY(10px);
  flex: 1;
  overflow-y: auto;
  padding-right: 12px;
}
.popup-body::-webkit-scrollbar {
  width: 6px;
}
.popup-body::-webkit-scrollbar-thumb {
  background: #cfd8dc;
  border-radius: 4px;
}
.popup-overlay.active .popup-body {
  animation: fadeUp 0.5s 0.62s ease forwards;
}

.popup-divider {
  height: 1px;
  background: rgba(19, 47, 75, 0.12);
  margin: 28px 0;
  transform: scaleX(0);
  transform-origin: left;
  flex-shrink: 0;
}
.popup-overlay.active .popup-divider {
  animation: lineIn 0.5s 0.7s ease forwards;
}

.popup-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  opacity: 0;
  flex-shrink: 0;
}
.popup-overlay.active .popup-actions {
  animation: fadeUp 0.45s 0.78s ease forwards;
}

.popup-btn-primary {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 28px;
  background: #132f4b;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.popup-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #1f4a73;
  transform: translateX(-101%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  z-index: -1;
}
.popup-btn-primary:hover::after { transform: translateX(0); }
.popup-btn-primary:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 4px 12px rgba(19, 47, 75, 0.3);
}
.popup-btn-primary span { 
  position: relative; 
  z-index: 10; 
  color: #ffffff !important;
}

/* COLORS */
.popup-btn-danger {
  background: #C62828 !important;
}
.popup-btn-danger::after {
  background: #E53935 !important;
}

.popup-btn-success {
  background: #2E7D32 !important;
}
.popup-btn-success::after {
  background: #1B5E20 !important;
}

.popup-btn-ghost {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.05em;
  background: none;
  border: none;
  color: #4c5b68;
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.popup-btn-ghost:hover { color: #132f4b; border-color: #132f4b; }

@keyframes fadeUp {
  from { opacity:0; transform: translateY(10px); }
  to   { opacity:1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity:0; }
  to   { opacity:1; }
}
