/* ============================================================================
   GAIA ANC APP - CORE DESIGN SYSTEM & STYLES (v1.1.0)
   ============================================================================ */

/* @import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #1E3A8A;        /* Bleu technique Pro */
    --primary-light: #3B82F6;  /* Bleu interactif */
    --primary-glow: rgba(30, 58, 138, 0.15);
    --secondary: #F97316;      /* Orange chantiers / sondages */
    --secondary-light: #FF9D5C;
    --secondary-glow: rgba(249, 115, 22, 0.15);
    
    /* Semantic Colors */
    --success: #10B981;        /* Vert perméable (gt_50) */
    --warning: #F59E0B;        /* Orange moyennement perméable (entre_15_50) */
    --danger: #EF4444;         /* Rouge peu perméable (lt_15) */
    
    /* Neutral Palette (Light Mode defaults for app) */
    --bg-app: #F8FAFC;
    --bg-card: #FFFFFF;
    --bg-input: #F1F5F9;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --border: #E2E8F0;
    
    /* Dark Mode variables for Admin Dashboard */
    --dark-bg: #0B0F19;
    --dark-card: #151D30;
    --dark-border: #222F4D;
    --dark-text: #F1F5F9;
    --dark-muted: #94A3B8;
    
    /* Layout & Effects */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-xl: 36px;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 16px -4px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 10px 10px -5px rgba(15, 23, 42, 0.04);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.25);
    --font-sans: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background-color: #0B0F19; /* Deep Space Dark background */
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.5;
}

/* ============================================================================
   SIMULATOR HEADER & CONTROLS (Top Bar)
   ============================================================================ */
.sim-header {
    background: linear-gradient(135deg, #151D30 0%, #0F172A 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.sim-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sim-logo svg {
    width: 32px;
    height: 32px;
}

.sim-logo h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.sim-logo h1 span {
    color: var(--secondary);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    font-weight: 500;
    margin-top: -2px;
}

.sim-modes {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sim-mode-btn {
    border: none;
    background: transparent;
    padding: 8px 20px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.sim-mode-btn:hover {
    color: #FFFFFF;
}

.sim-mode-btn.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 10px var(--primary-glow);
}

.sim-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sim-user-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

/* ============================================================================
   MAIN CONTAINER LAYOUT
   ============================================================================ */
.main-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - 65px);
    padding: 24px;
    position: relative;
}

/* ============================================================================
   WORKSPACE 1: PORTAIL MOBILE TECHNICIEN (RUGGED TABLET SIMULATOR)
   ============================================================================ */
.mobile-simulator-shell {
    width: 100%;
    max-width: 480px;
    height: 860px;
    background: #1E293B;
    border: 14px solid #334155;
    border-radius: 42px;
    box-shadow: 0 25px 60px -15px rgba(0,0,0,0.8), var(--shadow-glow);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

/* Device notch/speaker */
.mobile-simulator-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 25px;
    background: #334155;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 100;
}

/* Device screen area */
.mobile-screen {
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    font-size: 14px;
}

/* Status Bar */
.mobile-status-bar {
    height: 35px;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 24px 6px;
    font-size: 11px;
    font-weight: 600;
    z-index: 90;
}

.mobile-status-bar .icons {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Mobile App Header */
.mobile-app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #FFFFFF;
    padding: 16px;
    box-shadow: var(--shadow-md);
    position: relative;
    z-index: 80;
}

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

.mobile-header-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.mobile-header-subtitle {
    font-size: 11px;
    opacity: 0.8;
}

.sync-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sync-badge.offline {
    background: rgba(249, 115, 22, 0.2);
    border-color: var(--secondary);
    color: var(--secondary);
}

/* Mobile Scrollable Screen Content */
.mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 80px; /* Safe area for floating buttons/nav */
    background: #F8FAFC;
    scroll-behavior: smooth;
}

/* Native-like Bottom Navigation */
.mobile-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 99;
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.03);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    flex: 1;
    padding: 8px 0;
}

.mobile-nav-item i {
    font-size: 18px;
    transition: var(--transition);
}

.mobile-nav-item:hover {
    color: var(--primary-light);
}

.mobile-nav-item.active {
    color: var(--primary);
    font-weight: 700;
}

.mobile-nav-item.active i {
    transform: translateY(-2px);
    color: var(--primary);
}

/* ============================================================================
   FORM WIDGETS & MOBILE CARDS
   ============================================================================ */
.auth-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 8px;
}

.welcome-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border-left: 5px solid var(--primary-light);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.welcome-card h3 {
    font-family: var(--font-heading);
    color: var(--primary-dark);
    font-size: 16px;
    margin-bottom: 4px;
}

.welcome-card p {
    color: #1E3A8A;
    font-size: 12px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 16px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Input Fields & Forms Styling */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-light);
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-row .form-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    cursor: pointer;
}

.checkbox-group input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    user-select: none;
    margin: 0;
    cursor: pointer;
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 8px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px var(--primary-glow);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--border);
}

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

.btn-accent {
    background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary) 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 8px var(--secondary-glow);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px var(--secondary-glow);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
    border-radius: 6px;
}

/* ============================================================================
   FICHE TERRAIN STEP-BY-STEP WORKFLOW
   ============================================================================ */
.progress-stepper {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.step-indicator {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

.step-bar-container {
    flex: 1;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    margin: 0 12px;
    position: relative;
    overflow: hidden;
}

.step-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--secondary) 100%);
    width: 12.5%; /* Changes based on step (12.5% to 100%) */
    border-radius: 3px;
    transition: width 0.4s ease-out;
}

.step-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Wizard step panels */
.step-panel {
    display: none;
    animation: slideIn 0.3s ease-out;
}

.step-panel.active {
    display: block;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(15px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-instructions {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.04) 0%, rgba(249, 115, 22, 0.04) 100%);
    border: 1px dashed rgba(30, 58, 138, 0.2);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--primary-dark);
}

.step-instructions strong {
    font-family: var(--font-heading);
    color: var(--secondary);
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

/* ============================================================================
   WIDGET INTERACTIF : SONDAGES & HORIZONS DE SOL (Schéma 2)
   ============================================================================ */
.soil-visualizer-container {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.sounding-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 14px;
    gap: 4px;
}

.sounding-tab {
    flex: 1;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 8px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    text-align: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.sounding-tab.active {
    background: #FFFFFF;
    color: var(--primary);
    border-color: var(--border);
    border-bottom: 2px solid #FFFFFF;
    margin-bottom: -1px;
    font-weight: 700;
}

.sounding-layout {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    min-height: 320px;
}

/* Soil Cylinder graphic */
.soil-column-graphic {
    background: #F1F5F9;
    border: 3px solid #64748B;
    border-radius: 20px;
    height: 300px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.soil-layer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    text-align: center;
    padding: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    box-shadow: inset 0 6px 12px rgba(0,0,0,0.15);
}

.soil-layer-A {
    background: linear-gradient(180deg, #4A3E3D 0%, #3D3231 100%); /* Horizon A - Terre végétale */
    height: 25%;
}

.soil-layer-B {
    background: linear-gradient(180deg, #8C6A5C 0%, #76564B 100%); /* Horizon B - Limon / Sable */
    height: 45%;
}

.soil-layer-C {
    background: linear-gradient(180deg, #B58A55 0%, #9C7240 100%); /* Horizon C - Graviers / Argile */
    height: 30%;
}

/* Depth markers on column */
.soil-column-graphic::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 10px;
    background: linear-gradient(90deg, rgba(255,255,255,0.4) 0%, transparent 100%);
}

.sounding-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Info Banner for Guides */
.guide-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    padding: 10px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
    font-size: 11px;
    color: #1E40AF;
}

.guide-banner i {
    font-size: 20px;
    color: var(--primary-light);
}

/* ============================================================================
   WIDGET INTERACTIF : PROTOCOLE PORCHET (Schéma 1)
   ============================================================================ */
.porchet-section {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.chrono-container {
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.chrono-display {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chrono-display span {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.trials-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.trial-tab {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.trial-tab.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

/* Result Indicators K */
.result-k-card {
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin-top: 16px;
    border: 2px solid var(--border);
    background: #F8FAFC;
    transition: var(--transition);
}

.result-k-card.gt_50 {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--success);
    color: #065F46;
}

.result-k-card.entre_15_50 {
    background: rgba(245, 158, 11, 0.08);
    border-color: var(--warning);
    color: #92400E;
}

.result-k-card.lt_15 {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: #991B1B;
}

.result-k-value {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin: 6px 0;
}

.result-k-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #FFFFFF;
}

.result-k-badge.gt_50 {
    background: var(--success);
}
.result-k-badge.entre_15_50 {
    background: var(--warning);
}
.result-k-badge.lt_15 {
    background: var(--danger);
}

/* ============================================================================
   WIDGET INTERACTIF : CARTE D'IMPLANTATION (Schéma 3)
   ============================================================================ */
.map-canvas-container {
    background: #EFF6FF;
    border: 2px dashed #BFDBFE;
    border-radius: var(--radius-md);
    height: 280px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: inset 0 2px 8px rgba(30, 58, 138, 0.05);
}

/* Dynamic Interactive SVG Elements on Parcel Map */
.interactive-parcel-map {
    width: 100%;
    height: 100%;
}

.parcel-boundary {
    stroke: #64748B;
    stroke-width: 3;
    stroke-dasharray: 6,4;
    fill: #F8FAFC;
}

.house-rect {
    fill: #CBD5E1;
    stroke: #475569;
    stroke-width: 2;
    cursor: grab;
    transition: fill 0.2s;
}

.house-rect:hover {
    fill: #94A3B8;
}

.anc-zone-rect {
    fill: var(--secondary-glow);
    stroke: var(--secondary);
    stroke-dasharray: 4,4;
    stroke-width: 2;
    cursor: grab;
}

.anc-zone-rect.valid {
    fill: rgba(16, 185, 129, 0.15);
    stroke: var(--success);
}

.well-circle {
    fill: #BFDBFE;
    stroke: #2563EB;
    stroke-width: 2;
}

/* Compliance indicators list */
.distance-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.distance-item {
    background: #FFFFFF;
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.distance-item .label {
    font-weight: 600;
    color: var(--text-main);
}

.distance-item .value {
    font-family: var(--font-heading);
    font-weight: 700;
}

.distance-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 11px;
}

.distance-status.pass {
    background: var(--success);
}

.distance-status.fail {
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 0 8px var(--danger); }
    100% { transform: scale(1); }
}

/* ============================================================================
   CAMERA SIMULATION & PHOTOS PREVIEWS
   ============================================================================ */
.camera-dropzone {
    border: 2px dashed var(--border);
    background: var(--bg-input);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.camera-dropzone:hover {
    border-color: var(--primary-light);
    background: #FFFFFF;
}

.camera-dropzone i {
    font-size: 32px;
    color: var(--primary-light);
}

.photo-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.photo-preview-box {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    height: 100px;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.photo-preview-box .delete-photo {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(239, 68, 68, 0.8);
    color: #FFFFFF;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 10px;
}

/* ============================================================================
   DOCUSIGN & MODAL POPUPS
   ============================================================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

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

.modal-content {
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalShow 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

@keyframes modalShow {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    background: linear-gradient(135deg, #151D30 0%, #0F172A 100%);
    color: #FFFFFF;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
}

.modal-body {
    padding: 24px;
}

.docusign-frame {
    background: #F8FAFC;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.signature-pad {
    width: 100%;
    height: 180px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: crosshair;
}

/* ============================================================================
   WORKSPACE 2: CONSOLE BACKOFFICE ADMIN (GAYA DASHBOARD)
   ============================================================================ */
.admin-workspace {
    width: 100%;
    max-width: 1400px;
    background-color: var(--dark-bg);
    color: var(--dark-text);
    border-radius: var(--radius-lg);
    border: 1px solid var(--dark-border);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    display: none; /* Toggled in simulator */
}

.admin-workspace.active {
    display: block;
}

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

.admin-title h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
}

.admin-title p {
    font-size: 13px;
    color: var(--dark-muted);
}

/* Analytical Cards Grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.kpi-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.1);
}

.kpi-details h4 {
    font-size: 13px;
    color: var(--dark-muted);
    font-weight: 500;
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 800;
    color: #FFFFFF;
    margin-top: 4px;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-icon.primary {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
}

.kpi-icon.accent {
    background: rgba(249, 115, 22, 0.15);
    color: var(--secondary);
}

.kpi-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Secondary Panels Layout */
.admin-panels {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.panel {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    padding: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
}

/* Custom Table design for backoffice */
.data-table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13px;
}

.data-table th {
    color: var(--dark-muted);
    font-weight: 600;
    padding: 12px;
    border-bottom: 1px solid var(--dark-border);
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--dark-text);
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badge Status Styles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.badge-active, .badge-signe, .badge-terminee {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-pending, .badge-en_cours, .badge-en_attente {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-archive, .badge-expire {
    background: rgba(148, 163, 184, 0.2);
    color: var(--dark-muted);
}

/* ============================================================================
   A4 PRINT-PREVIEW MODAL TECHNICAL REPORT FORMAT (Premium Dossier)
   ============================================================================ */
.report-viewer {
    max-width: 800px;
    margin: 0 auto;
    background: #FFFFFF;
    color: #0F172A;
    box-shadow: 0 0 20px rgba(0,0,0,0.15);
    padding: 40px;
    border-radius: 4px;
    font-family: 'Inter', sans-serif;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.report-logo-area h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

.report-logo-area p {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary);
    font-weight: 600;
}

.report-title-box {
    text-align: right;
}

.report-title-box h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}

.report-title-box p {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.report-grid-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.report-block {
    background: #F8FAFC;
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
}

.report-block h3 {
    font-family: var(--font-heading);
    font-size: 13px;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

.report-block p {
    font-size: 12px;
    margin-bottom: 4px;
}

.report-block p strong {
    color: var(--text-main);
}

.report-section-divider {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    background: var(--primary);
    padding: 6px 12px;
    margin: 20px 0 10px 0;
    border-radius: 4px;
}

.report-soundings-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.report-soundings-table th {
    background: #F1F5F9;
    font-size: 11px;
    font-weight: 700;
    padding: 8px;
    border: 1px solid var(--border);
}

.report-soundings-table td {
    font-size: 11px;
    padding: 8px;
    border: 1px solid var(--border);
}

.report-signature-block {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-signature-box {
    width: 250px;
    text-align: center;
}

.report-signature-image {
    width: 100%;
    height: 80px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.report-signature-image img {
    max-height: 70px;
    max-width: 220px;
}

/* ============================================================================
   RESPONSIVE DESIGN ADAPTATIONS
   ============================================================================ */
@media(max-width: 1200px) {
    .admin-panels {
        grid-template-columns: 1fr;
    }
}

@media(max-width: 900px) {
    .sim-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .main-container {
        padding: 12px;
    }
}
