/* =========================================
   ROXIMA FOCUS - DESIGN SYSTEM
   Minimal Premium (Apple-like)
   ========================================= */

:root {
    /* --- Palette --- */
    --bg-app: #F5F5F7;
    /* Gris Apple très clair */
    --bg-card: #FFFFFF;
    /* Blanc pur */
    --text-main: #1D1D1F;
    /* Noir doux */
    --text-muted: #86868B;
    /* Gris texte secondaire */

    /* Accents */
    --accent-color: #FF6B00;
    /* Orange Focus (selon maquette) */
    --accent-blue: #0071E3;
    /* Bleu action */
    --danger: #FF3B30;
    /* Rouge alerte */
    --success: #34C759;
    /* Vert succès */

    /* --- Shapes (Formes) --- */
    /* 1. Carré arrondi (Card) */
    --radius-sq: 24px;
    /* 2. Pilule (Boutons, Badges) */
    --radius-pill: 999px;
    /* 3. Cercle (Avatar, Status) */
    --radius-circle: 50%;

    /* --- Spacing --- */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;

    /* --- Layout --- */
    --gap-grid: 32px;
    /* Horizontal gap between cards */

    /* --- Typography --- */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* --- Shadows --- */
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
    /* Soft ambient */
    --shadow-md: 0 12px 24px rgba(0, 0, 0, 0.05);
    /* Lifted */
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
    /* Floating */

    /* --- Transitions --- */
    --ease-ios: cubic-bezier(0.25, 1, 0.5, 1);
    /* "Rubber" feel */
    --duration-fast: 0.2s;
    --duration-med: 0.4s;
}

/* --- Reset & Base --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-app);
    color: var(--text-main);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    min-height: 100vh;
    overflow-y: auto;
    /* Dashboard fixe mais défilable si besoin */
}

/* --- Utilities & Components --- */

/* 1. Card (Rounded Square) */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-sq);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg);
    transition: transform var(--duration-fast) var(--ease-ios), box-shadow var(--duration-fast) var(--ease-ios);
}

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

/* Header de card standard */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.card-actions {
    display: flex;
    gap: var(--space-sm);
}

/* 2. Pill (Badge / Button) */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.badge.accent {
    background: var(--accent-color);
    color: white;
}

/* 3. Button Reset + Styles */
button {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-main);
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--duration-fast);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Helper Text */
.text-muted {
    color: var(--text-muted);
}

/* --- Modal System --- */
#modal-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    /* Pass through when empty */
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

#modal-layer.active {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.4);
    /* Darker dim */
    backdrop-filter: blur(4px);
    opacity: 1;
}

.modal {
    background: var(--bg-card);
    width: 500px;
    max-width: 90vw;
    border-radius: var(--radius-sq);
    box-shadow: var(--shadow-lg);
    padding: var(--space-lg);
    transform: scale(0.9);
    transition: transform 0.4s var(--ease-ios);
}

#modal-layer.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-circle);
    background: #F5F5F7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
}

.modal-close:hover {
    background: #E5E5EA;
    color: var(--text-main);
}

/* --- Global Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}