/* ─── Reset & Variables ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
    --nav-w: 224px;
    --map-sidebar-w: 384px;
    --primary: #166ee1;
    --primary-dark: #0f5abd;
    --primary-light: rgba(22, 110, 225, 0.08);
    --success: #10b981;
    --danger: #ef4444;
    --text: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card: #ffffff;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

html,
body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

/* ─── App Layout ─── */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ─── Navigation Sidebar ─── */
.nav-sidebar {
    width: var(--nav-w);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 900;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 24px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(22, 110, 225, 0.2);
}

.brand-name {
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--border);
}

.nav-admin {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Mobile nav overlay */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 899;
}

/* Mobile hamburger button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 800;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* ─── Main Content ─── */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* ─── Pages ─── */
.page {
    display: none;
    flex: 1;
    overflow: hidden;
}

.page.active {
    display: flex;
}

/* ─── Map Page Layout ─── */
#page-map {
    flex-direction: row;
}

/* ─── Map Sidebar ─── */
.map-sidebar {
    width: var(--map-sidebar-w);
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.map-sidebar-handle {
    display: none;
}

.map-sidebar-header {
    padding: 24px 24px 0;
}

.map-sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.map-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.sidebar-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-section>label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.sidebar-adresse {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

.parcels-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.map-sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ─── Form Elements ─── */
.select-wrapper {
    position: relative;
}

#chantier-select {
    width: 100%;
    appearance: none;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#chantier-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    pointer-events: none;
}

/* ─── Layer Toggle ─── */
.layer-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    border: none;
    background: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    transition: all 0.15s;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ─── Panel Parcelles ─── */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.panel-header label {
    margin-bottom: 0 !important;
}

.panel-count {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

#panel-content {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

#panel-summary {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 10px;
}

/* ─── Parcel Item ─── */
.parcel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

.parcel-item:last-child {
    border-bottom: none;
}

.parcel-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
}

.parcel-surface {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 12px;
}

.parcel-remove {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.15s;
}

.parcel-remove:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* ─── Map Area ─── */
.map-area {
    flex: 1;
    position: relative;
    background: #eee;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.map-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200;
    background: var(--card);
    padding: 14px 22px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--border);
}

.map-loader-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ─── Sessions Page ─── */
#page-sessions {
    flex-direction: column;
}

.page-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.page-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.page-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

/* ─── Buttons ─── */
.btn-primary {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    box-shadow: 0 4px 6px -1px rgba(22, 110, 225, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(22, 110, 225, 0.3);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.btn-primary:disabled {
    background: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

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

.btn-secondary:active {
    transform: scale(0.98);
}

/* ─── Animations ─── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Overlays ─── */
#overlay,
#success-overlay,
#preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hidden {
    display: none !important;
}

.overlay-content {
    background: var(--card);
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    position: relative;
}

.overlay-content p {
    margin-top: 16px;
    font-size: 16px;
    color: var(--text);
}

.overlay-close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.overlay-close-btn:hover {
    background: var(--bg);
}

/* Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

/* Success */
.success .success-icon {
    width: 56px;
    height: 56px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#success-detail {
    font-size: 13px !important;
    color: var(--text-secondary) !important;
    margin-top: 8px !important;
}

/* Overlay animations */
#success-overlay:not(.hidden),
#preview-overlay:not(.hidden) {
    animation: overlay-fade-in 0.2s ease;
}

#success-overlay:not(.hidden) .overlay-content,
#preview-overlay:not(.hidden) .preview-content {
    animation: overlay-scale-in 0.25s ease;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes overlay-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ─── Preview ─── */
.preview-content {
    background: var(--card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.preview-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.preview-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s;
}

.preview-close:hover {
    background: var(--bg);
}

.preview-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    overflow-y: auto;
}

.preview-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.15s;
}

.preview-card:hover {
    transform: translateY(-2px);
}

.preview-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}

.preview-label {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.preview-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
}

.preview-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.preview-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: all 0.15s;
}

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

/* ─── Sessions Table ─── */
.sessions-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 13px;
}

.sessions-table thead {
    background: var(--bg);
}

.sessions-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.sessions-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.sessions-table tr:last-child td {
    border-bottom: none;
}

.sessions-table tr:hover td {
    background: var(--bg);
}

.session-date {
    display: block;
    font-weight: 500;
}

.session-time {
    font-size: 11px;
    color: var(--text-secondary);
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.tag-ok {
    background: #dcfce7;
    color: #065f46;
}

.tag-error {
    background: #fee2e2;
    color: #991b1b;
}

.tag-no {
    background: var(--bg);
    color: var(--text-secondary);
}

.btn-download-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--primary);
    background: var(--primary-light);
    text-decoration: none;
    transition: all 0.15s;
}

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

/* ─── Toast ─── */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--text);
    color: white;
    padding: 12px 24px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.3s ease-out forwards;
}

@keyframes toast-in {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ─── Focus visible ─── */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.nav-item:focus-visible,
.toggle-btn:focus-visible,
#chantier-select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ─── Admin page styles ─── */

/* Admin layout uses same .app-layout + .nav-sidebar from main app */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.admin-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.admin-view.active {
    display: flex;
}

.admin-page-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.admin-page-header h1 {
    font-size: 22px;
    font-weight: 700;
}

.admin-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.admin-page-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.admin-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
}

.admin-container {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Two-column layout for edit view */
.admin-two-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    max-width: 1100px;
}

.admin-col-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-col-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Colored card headers */
.card-header-blue {
    background: #eff6ff;
    color: var(--primary);
}

.card-header-blue svg {
    stroke: var(--primary);
}

.card-header-blue h3 {
    color: var(--primary);
}

.card-header-orange {
    background: #fff7ed;
}

.card-header-orange svg {
    stroke: #ea580c;
}

.card-header-orange h3 {
    color: #ea580c;
}

.card-header-green {
    background: #f0fdf4;
}

.card-header-green svg {
    stroke: #16a34a;
}

.card-header-green h3 {
    color: #16a34a;
}

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 48px;
    width: 380px;
    max-width: 90vw;
    text-align: center;
    box-shadow: var(--shadow);
}

.login-card h2 {
    font-size: 20px;
    margin-top: 16px;
    margin-bottom: 4px;
}

.login-icon {
    color: var(--text-secondary);
}

.login-error {
    margin-top: 12px;
    padding: 8px 12px;
    background: #fde8ec;
    color: #c02040;
    border-radius: 6px;
    font-size: 13px;
}

.config-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.config-container {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.config-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.field input,
.field select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.field-row {
    display: flex;
    gap: 12px;
}

.field-row .field {
    flex: 1;
}

.field-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

.config-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.config-status {
    text-align: center;
    font-size: 13px;
    padding: 8px;
    border-radius: 6px;
}

.config-status.ok {
    background: #dcfce7;
    color: #065f46;
}

.config-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.clients-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.client-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

.client-card:hover {
    border-color: #ccc;
    box-shadow: var(--shadow-sm);
}

.client-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.client-card-info {
    flex: 1;
    min-width: 0;
}

.client-card-name {
    font-weight: 600;
    font-size: 15px;
}

.client-card-slug {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
    margin-right: 12px;
}

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

.btn-danger {
    padding: 8px 16px;
    background: #ef3061;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

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

/* Admin two-col responsive */
@media (max-width: 900px) {
    .admin-two-col {
        grid-template-columns: 1fr;
    }

    .admin-page-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-scroll {
        padding: 16px 20px;
    }
}

/* ─── Responsive: Mobile ─── */
@media (max-width: 768px) {
    /* Nav sidebar = drawer */
    .nav-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: var(--shadow-lg);
    }

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

    /* Show hamburger */
    .mobile-menu-btn {
        display: flex;
    }

    /* Map sidebar = bottom sheet */
    .map-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 55vh;
        border-right: none;
        border-top: 1px solid var(--border);
        border-radius: 16px 16px 0 0;
        z-index: 500;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(calc(100% - 64px));
        transition: transform 0.3s ease;
    }

    .map-sidebar.expanded {
        transform: translateY(0);
    }

    .map-sidebar-handle {
        display: flex;
        justify-content: center;
        padding: 10px 0 4px;
        cursor: pointer;
    }

    .handle-bar {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: var(--border);
    }

    .map-sidebar-header {
        padding: 8px 20px 0;
    }

    .map-sidebar-header h2 {
        font-size: 16px;
    }

    .map-sidebar-body {
        padding: 12px 20px;
    }

    .map-sidebar-footer {
        padding: 12px 20px;
    }

    .map-area {
        height: 100vh;
    }

    /* Sessions page */
    .page-header {
        padding: 16px 20px;
    }

    .page-body {
        padding: 16px 20px;
    }

    /* Preview mobile */
    .preview-content {
        width: 95vw;
        max-height: 95vh;
    }

    .preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 12px;
    }

    .preview-card img {
        height: 110px;
    }

    .preview-footer {
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .preview-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .preview-actions .btn-primary {
        flex: 1;
        width: auto;
    }

    /* Toast mobile */
    .toast-container {
        left: 16px;
        right: 16px;
        transform: none;
        bottom: 80px;
    }

    .toast {
        white-space: normal;
    }

    /* Sessions table mobile */
    .sessions-table th,
    .sessions-table td {
        padding: 10px 12px;
    }
}

/* Small screens */
@media (max-width: 480px) {
    .preview-actions {
        flex-direction: column;
    }

    .preview-actions>* {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
