* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a3a5c;
    --secondary: #2d6a9f;
    --accent: #e8b84b;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --light: #f4f6f9;
    --white: #ffffff;
    --gray: #6c757d;
    --border: #dee2e6;
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: #333;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--primary);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo {
    width: 60px;
    height: 60px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 24px;
}

.sidebar-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 4px;
}

.sidebar-menu {
    padding: 15px 0;
}

.menu-section {
    padding: 8px 20px 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    gap: 12px;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--accent);
}

.menu-item.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--accent);
}

.menu-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.menu-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: var(--primary);
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
}

.user-details p {
    font-size: 13px;
    font-weight: 600;
}

.user-details span {
    font-size: 11px;
    opacity: 0.6;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
    background: white;
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.topbar h1 {
    font-size: 20px;
    color: var(--primary);
    font-weight: 700;
}

.breadcrumb {
    font-size: 13px;
    color: var(--gray);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--secondary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    filter: brightness(0.9);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(0.9);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--gray);
}

.btn-outline:hover {
    background: var(--light);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 30px;
    flex: 1;
}

/* ===== SECTIONS ===== */
.section {
    display: none;
}

.section.active {
    display: block;
}

/* ===== CARDS STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid;
}

.stat-card:nth-child(1) {
    border-color: var(--secondary);
}

.stat-card:nth-child(2) {
    border-color: var(--success);
}

.stat-card:nth-child(3) {
    border-color: var(--warning);
}

.stat-card:nth-child(4) {
    border-color: var(--danger);
}

.stat-icon {
    font-size: 32px;
}

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-info p {
    font-size: 13px;
    color: var(--gray);
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 17px;
    color: var(--primary);
    font-weight: 600;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    background: var(--light);
    padding: 12px 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

tbody tr:hover {
    background: rgba(45, 106, 159, 0.03);
}

tbody td {
    padding: 14px 15px;
    font-size: 14px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-archived {
    background: #e2e3e5;
    color: #383d41;
}

.actions-cell {
    display: flex;
    gap: 6px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

label .required {
    color: var(--danger);
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(45, 106, 159, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

.editor-toolbar {
    display: flex;
    gap: 5px;
    padding: 8px;
    background: var(--light);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 5px 10px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

.editor-btn:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

.editor-area {
    border-radius: 0 0 6px 6px !important;
    min-height: 200px;
}

.file-upload {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.file-upload:hover {
    border-color: var(--secondary);
    background: rgba(45, 106, 159, 0.03);
}

.file-upload input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.file-upload p {
    font-size: 14px;
    color: var(--gray);
}

.file-upload span {
    color: var(--secondary);
    font-weight: 600;
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--primary);
}

.modal p {
    color: var(--gray);
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== RECENT ACTIVITY ===== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.activity-item p {
    font-size: 13px;
    line-height: 1.5;
}

.activity-item time {
    font-size: 11px;
    color: var(--gray);
}

/* ===== CALENDAR EVENTS ===== */
.event-item {
    display: flex;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.event-date {
    background: var(--primary);
    color: white;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    min-width: 50px;
}

.event-date .day {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
}

.event-date .month {
    font-size: 11px;
    text-transform: uppercase;
}

.event-info h4 {
    font-size: 14px;
    margin-bottom: 3px;
}

.event-info p {
    font-size: 12px;
    color: var(--gray);
}

/* ===== TOGGLE ===== */
.toggle-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.toggle-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.toggle {
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle.on {
    background: var(--success);
}

.toggle::after {
    content: '';
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle.on::after {
    transform: translateX(18px);
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--primary);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.login-screen.show {
    display: flex;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
}

.login-box .logo-area {
    text-align: center;
    margin-bottom: 30px;
}

.login-box .logo-icon {
    width: 70px;
    height: 70px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 30px;
}

.login-box h2 {
    color: var(--primary);
    font-size: 22px;
}

.login-box p {
    color: var(--gray);
    font-size: 14px;
    margin-top: 5px;
}

.login-form .form-group {
    margin-bottom: 15px;
}

.remember-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-row a {
    color: var(--secondary);
    text-decoration: none;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: var(--secondary);
}

/* ===== RESPONSIVE ===== */
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--primary);
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .hamburger {
        display: block;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-content {
        padding: 15px;
    }

    .topbar {
        padding: 12px 15px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Notifications bell */
.notif-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

.notif-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
}

.progress-bar {
    background: var(--border);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--secondary);
    border-radius: 10px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.tag-event {
    background: blue;
    color: #dbeafe;
}

.tag-information {
    background: green;
    color: #d1fae5;
}

.tag-mairie {
    background: orange;
    color: #ffedd5;
}

.tag-sport {
    background: gray;
    color: #dbeafe;
}

.tag-environment {
    background: maroon;
    color: #d1fae5;
}

.tag-culture {
    background: yellow;
    color: black;
}

.tag-market {
    background: pink;
    color: black;
}


.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #1b6ec2;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}