/* =====================================================
   PCT.Planning - Styles CSS v2.2
   Planning Multi-Société EBP
   ===================================================== */

:root {
    /* Couleurs principales */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --bg-hover: #30363d;
    
    --border-color: #30363d;
    --border-light: #484f58;
    
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    
    --accent-blue: #388bfd;
    --accent-green: #3fb950;
    --accent-purple: #a371f7;
    --accent-orange: #d29922;
    --accent-red: #f85149;
    --accent-pink: #db61a2;
    --accent-cyan: #39c5cf;
    --accent-yellow: #e3b341;
    
    /* Couleurs des commandes (12 couleurs) */
    --order-1: #388bfd;
    --order-2: #3fb950;
    --order-3: #a371f7;
    --order-4: #d29922;
    --order-5: #f85149;
    --order-6: #db61a2;
    --order-7: #39c5cf;
    --order-8: #e3b341;
    --order-9: #58a6ff;
    --order-10: #56d364;
    --order-11: #bc8cff;
    --order-12: #f0883e;
    
    /* Dimensions */
    --header-height: 60px;
    --team-label-width: 200px;
    --day-cell-min-width: 120px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.hidden { display: none !important; }

/* =====================================================
   ÉCRAN DE CONNEXION
   ===================================================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a2332 100%);
}

.login-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 48px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon.large {
    font-size: 64px;
    margin-bottom: 16px;
}

.login-header .logo-text {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color var(--transition-fast);
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.btn-login:hover {
    background: #1f6feb;
}

.login-error {
    color: var(--accent-red);
    font-size: 14px;
    margin-top: 16px;
    text-align: center;
    min-height: 20px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* =====================================================
   APPLICATION PRINCIPALE
   ===================================================== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* HEADER */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* Login Logo */
.login-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
    border-radius: 12px;
}

/* Header Logo */
.header-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.company-selector {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
    cursor: pointer;
}

.company-selector:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.nav-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.nav-tab.active {
    background: var(--accent-blue);
    color: white;
}

/* View Controls */
.view-controls {
    display: flex;
    gap: 4px;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.view-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.view-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Date Navigation */
.date-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-nav button {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.date-nav button:hover {
    background: var(--bg-hover);
}

.current-date {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 200px;
    text-align: center;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.btn-primary:hover {
    background: #1f6feb;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.btn-danger {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.btn-export {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.btn-export:hover {
    background: #2ea043;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
}

.btn-logout:hover {
    color: var(--accent-red);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: var(--text-secondary);
    font-size: 14px;
}

.user-role {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.user-role.admin {
    background: rgba(248, 81, 73, 0.15);
    color: var(--accent-red);
}

.user-role.planner {
    background: rgba(56, 139, 253, 0.15);
    color: var(--accent-blue);
}

.user-role.reader {
    background: rgba(139, 148, 158, 0.15);
    color: var(--text-secondary);
}

/* Form select */
.form-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* =====================================================
   MAIN CONTAINER (Sans sidebar)
   ===================================================== */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.main-container.no-sidebar {
    padding: 0;
}

/* =====================================================
   PLANNING CONTAINER
   ===================================================== */
.planning-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Planning Header */
.planning-header {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.planning-header-spacer {
    width: var(--team-label-width);
    min-width: var(--team-label-width);
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.planning-days {
    display: flex;
    flex: 1;
}

.day-header {
    flex: 1 1 0;
    min-width: 0;
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.day-header:last-child {
    border-right: none;
}

.day-header.week-start {
    box-shadow: inset 3px 0 0 0 var(--accent-blue);
}

.day-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.day-date {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.day-header.today .day-date {
    background: var(--accent-blue);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.day-header.weekend {
    background: rgba(255, 255, 255, 0.02);
}

/* Planning Body */
.planning-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
}

.planning-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    min-height: 80px;
}

.team-label {
    width: var(--team-label-width);
    min-width: var(--team-label-width);
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    left: 0;
    z-index: 5;
}

.team-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Groupe d'équipe avec header repliable */
.team-group {
    border-bottom: 1px solid var(--border-color);
}

.team-group-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--bg-tertiary);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
}

.team-group-header:hover {
    background: var(--bg-secondary);
}

.team-group-toggle {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.team-group.collapsed .team-group-toggle {
    transform: rotate(-90deg);
}

.team-group-badge {
    font-weight: 600;
}

.team-group-count {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: auto;
}

.team-group-content {
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.team-group.collapsed .team-group-content {
    max-height: 0 !important;
    overflow: hidden;
}

/* Ligne collaborateur */
.collaborator-row .team-label {
    padding: 8px 16px 8px 32px;
}

.collaborator-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.collaborator-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.collaborator-name {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collaborator-job {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.team-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-cells {
    display: flex;
    flex: 1;
}

.day-cell {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-primary);
    transition: background var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.day-cell:last-child {
    border-right: none;
}

.day-cell.week-start {
    box-shadow: inset 3px 0 0 0 var(--accent-blue);
}

/* Vue mois : réduire la largeur minimale des cellules */
.view-month .day-header,
.view-month .day-cell {
    min-width: 60px;
}

/* Vue mois : correction alignement des indicateurs semaine */
.view-month .day-header.week-start,
.view-month .day-cell.week-start {
    position: relative;
    box-shadow: none;
}

.view-month .day-header.week-start::before,
.view-month .day-cell.week-start::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-blue);
    z-index: 1;
}

.day-cell:hover {
    background: var(--bg-tertiary);
}

.day-cell.drag-over {
    background: rgba(56, 139, 253, 0.15);
    outline: 2px dashed var(--accent-blue);
    outline-offset: -2px;
}

.day-cell.weekend {
    background: rgba(255, 255, 255, 0.01);
}

/* Planning Block (dans la grille) */
.planning-block {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: grab;
    border-left: 4px solid var(--accent-blue);
    transition: all var(--transition-fast);
    position: relative;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.planning-block:hover {
    background: var(--bg-hover);
    transform: translateY(-1px);
}

.planning-block:active {
    cursor: grabbing;
}

.planning-block.dragging {
    opacity: 0.5;
}

.block-number {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-customer {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.block-day-indicator {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Couleurs par commande (basé sur data-order-color) */
.planning-block[data-order-color="0"] { border-left-color: var(--order-1); }
.planning-block[data-order-color="1"] { border-left-color: var(--order-2); }
.planning-block[data-order-color="2"] { border-left-color: var(--order-3); }
.planning-block[data-order-color="3"] { border-left-color: var(--order-4); }
.planning-block[data-order-color="4"] { border-left-color: var(--order-5); }
.planning-block[data-order-color="5"] { border-left-color: var(--order-6); }
.planning-block[data-order-color="6"] { border-left-color: var(--order-7); }
.planning-block[data-order-color="7"] { border-left-color: var(--order-8); }
.planning-block[data-order-color="8"] { border-left-color: var(--order-9); }
.planning-block[data-order-color="9"] { border-left-color: var(--order-10); }
.planning-block[data-order-color="10"] { border-left-color: var(--order-11); }
.planning-block[data-order-color="11"] { border-left-color: var(--order-12); }

/* Bloc terminé */
.planning-block.completed {
    opacity: 0.6;
    background: var(--bg-secondary);
    cursor: default;
}

.planning-block.completed:hover {
    transform: none;
}

.planning-block.completed .block-number,
.planning-block.completed .block-customer {
    text-decoration: line-through;
    color: var(--text-muted);
}

.planning-block.completed .block-day-indicator {
    color: var(--accent-green);
}

.block-completed-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    background: var(--accent-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Bloc sélectionné (multi-sélection) */
.planning-block.selected {
    outline: 2px solid var(--accent-blue);
    outline-offset: 1px;
    background: rgba(56, 139, 253, 0.15);
}

.planning-block.selected::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 12px;
    height: 12px;
    background: var(--accent-blue);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =====================================================
   UNPLANNED SECTION
   ===================================================== */

/* Filter controls */
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--text-secondary);
    font-size: 13px;
}

.filter-date {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.filter-date:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.unplanned-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.unplanned-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: background var(--transition-fast);
    gap: 16px;
    flex-wrap: wrap;
}

.unplanned-header:hover {
    background: var(--bg-tertiary);
}

.unplanned-header .filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: default;
}

.unplanned-header .filter-group label {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}

.unplanned-header .filter-date {
    padding: 4px 8px;
    font-size: 12px;
    width: 130px;
}

.unplanned-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.unplanned-title h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.unplanned-badge {
    background: var(--accent-blue);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.toggle-icon {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform var(--transition-fast);
}

.unplanned-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.unplanned-section.collapsed .unplanned-content {
    display: none;
}

.unplanned-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
}

.unplanned-cards-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 32px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-text {
    font-size: 14px;
}

/* Unplanned Card */
.unplanned-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 14px;
    min-width: 180px;
    max-width: 220px;
    cursor: grab;
    position: relative;
    transition: all var(--transition-fast);
}

.unplanned-card:hover {
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.unplanned-card:active {
    cursor: grabbing;
}

.unplanned-card.dragging {
    opacity: 0.5;
}

.unplanned-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 8px 0 0 8px;
    background: var(--accent-blue);
}

/* Couleur par commande pour les cartes non planifiées */
.unplanned-card[data-order-color="0"]::before { background: var(--order-1); }
.unplanned-card[data-order-color="1"]::before { background: var(--order-2); }
.unplanned-card[data-order-color="2"]::before { background: var(--order-3); }
.unplanned-card[data-order-color="3"]::before { background: var(--order-4); }
.unplanned-card[data-order-color="4"]::before { background: var(--order-5); }
.unplanned-card[data-order-color="5"]::before { background: var(--order-6); }
.unplanned-card[data-order-color="6"]::before { background: var(--order-7); }
.unplanned-card[data-order-color="7"]::before { background: var(--order-8); }
.unplanned-card[data-order-color="8"]::before { background: var(--order-9); }
.unplanned-card[data-order-color="9"]::before { background: var(--order-10); }
.unplanned-card[data-order-color="10"]::before { background: var(--order-11); }
.unplanned-card[data-order-color="11"]::before { background: var(--order-12); }

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

.card-number {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.card-date {
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(56, 139, 253, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.card-customer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-city {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-warning {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 10px;
    color: var(--accent-orange);
}

/* =====================================================
   CONTEXT MENU
   ===================================================== */
.context-menu {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    min-width: 200px;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.context-menu-item:hover {
    background: var(--bg-hover);
}

.context-menu-item.danger,
.context-menu-item[data-action="unplan"],
.context-menu-item[data-action="unplan-day"] {
    color: var(--accent-red);
}

.context-menu-item.danger:hover,
.context-menu-item[data-action="unplan"]:hover {
    background: rgba(248, 81, 73, 0.1);
}

.context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

/* =====================================================
   TOOLTIP
   ===================================================== */
.block-tooltip {
    position: fixed;
    z-index: 10000;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
    max-width: 350px;
    pointer-events: none;
    transform: translateX(-50%);
    animation: tooltipFadeIn 0.15s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.block-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--border-color);
}

.block-tooltip::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--bg-primary);
}

/* =====================================================
   USERS PANEL
   ===================================================== */
.users-container {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

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

.users-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.users-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.users-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green { background: rgba(63, 185, 80, 0.15); color: var(--accent-green); }
.badge-red { background: rgba(248, 81, 73, 0.15); color: var(--accent-red); }
.badge-blue { background: rgba(56, 139, 253, 0.15); color: var(--accent-blue); }
.badge-gray { background: rgba(139, 148, 158, 0.15); color: var(--text-secondary); }

.companies-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.company-tag {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
}

.action-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    margin-right: 4px;
    transition: all var(--transition-fast);
}

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

.action-btn.danger {
    color: var(--accent-red);
}

/* =====================================================
   MODALS
   ===================================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-small {
    max-width: 400px;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* User Form */
.user-form {
    padding: 24px;
}

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

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

.user-form .form-group {
    margin-bottom: 16px;
}

.user-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-form input[type="text"],
.user-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.user-form input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

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

.checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.checkboxes-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* =====================================================
   NO COMPANY STATE
   ===================================================== */
.no-company-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 48px;
    text-align: center;
}

.no-company-state .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.no-company-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.no-company-state p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* =====================================================
   NOTIFICATIONS
   ===================================================== */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 300;
    animation: slideIn 0.3s ease;
}

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

.notification.success {
    border-left: 4px solid var(--accent-green);
}

.notification.error {
    border-left: 4px solid var(--accent-red);
}

.notification.info {
    border-left: 4px solid var(--accent-blue);
}

/* =====================================================
   PRINT / PDF
   ===================================================== */
@media print {
    .header,
    .filters-bar,
    .unplanned-section,
    .context-menu,
    .notification {
        display: none !important;
    }
    
    .main-container {
        padding: 0;
    }
    
    .planning-container {
        overflow: visible;
    }
    
    .planning-body {
        overflow: visible;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .planning-block {
        background: #f0f0f0;
        color: black;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1200px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 12px;
        gap: 12px;
    }
    
    .header-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Permettre au header de défiler si nécessaire */
    .header-left,
    .header-center,
    .header-right {
        flex-shrink: 0;
    }
}

/* Tablettes intermédiaires (Surface 3, iPad) */
@media (max-width: 1400px) and (min-width: 1201px) {
    .header {
        padding: 10px 16px;
        gap: 12px;
    }
    
    .header-controls {
        gap: 10px;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .view-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .date-nav .current-date {
        font-size: 13px;
        min-width: 120px;
    }
    
    .company-selector {
        min-width: 160px;
        font-size: 13px;
    }
}

/* =====================================================
   RESPONSIVE TABLETTE (768px - 1024px)
   ===================================================== */
@media (max-width: 1024px) {
    :root {
        --team-label-width: 160px;
        --day-cell-min-width: 100px;
    }
    
    .header {
        padding: 10px 12px;
    }
    
    .logo-text {
        display: none;
    }
    
    .nav-tabs {
        gap: 4px;
    }
    
    .nav-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .view-controls {
        display: none;
    }
    
    .date-nav {
        gap: 6px;
    }
    
    .date-nav .current-date {
        font-size: 13px;
        min-width: auto;
    }
    
    #todayBtn {
        display: none;
    }
    
    .user-name {
        display: none;
    }
    
    /* Planning adapté tablette */
    .planning-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .planning-header,
    .planning-body {
        min-width: 800px;
    }
    
    /* Tâches non planifiées */
    .unplanned-section {
        margin: 10px;
    }
    
    .filter-group {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .filter-group label {
        width: 100%;
    }
    
    /* Menu burger visible */
    .menu-toggle {
        display: flex;
    }
}

/* =====================================================
   RESPONSIVE MOBILE (< 768px)
   ===================================================== */
@media (max-width: 768px) {
    :root {
        --team-label-width: 120px;
        --day-cell-min-width: 80px;
    }
    
    /* Header mobile */
    .header {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .header-left {
        flex: 0 0 auto;
    }
    
    .header-center {
        flex: 1;
        justify-content: center;
    }
    
    .header-right {
        flex: 0 0 auto;
    }
    
    .header-logo {
        width: 28px;
        height: 28px;
    }
    
    .nav-tabs {
        display: none;
    }
    
    .company-selector {
        min-width: 120px;
        max-width: 180px;
        font-size: 13px;
        padding: 8px;
    }
    
    .date-nav {
        display: none;
    }
    
    .btn-export {
        display: none;
    }
    
    .online-indicator .indicator-text {
        display: none;
    }
    
    .user-menu {
        gap: 4px;
    }
    
    .user-role {
        display: none;
    }
    
    .btn-logout {
        padding: 8px;
        min-width: 36px;
    }
    
    /* Navigation mobile par onglets en bas */
    .mobile-nav {
        display: flex;
    }
    
    /* Planning mobile */
    .main-container {
        padding-bottom: 60px;
    }
    
    .planning-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .planning-header,
    .planning-body {
        min-width: 600px;
    }
    
    .team-label {
        padding: 8px 10px;
    }
    
    .team-group-header {
        padding: 10px 12px;
    }
    
    .collaborator-row .team-label {
        padding: 8px 10px 8px 20px;
    }
    
    .collaborator-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .collaborator-name {
        font-size: 12px;
    }
    
    .collaborator-job {
        font-size: 10px;
    }
    
    /* Blocs planning plus compacts */
    .planning-block {
        padding: 4px 6px;
        font-size: 10px;
        min-height: 28px;
    }
    
    .block-content {
        gap: 2px;
    }
    
    .block-order {
        font-size: 10px;
    }
    
    .block-customer {
        font-size: 9px;
    }
    
    .block-badge {
        font-size: 8px;
        padding: 1px 4px;
    }
    
    /* Tâches non planifiées mobile */
    .unplanned-section {
        margin: 8px;
        border-radius: 8px;
    }
    
    .unplanned-header {
        padding: 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .unplanned-title h3 {
        font-size: 14px;
    }
    
    .filter-group {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-group label {
        display: none;
    }
    
    .filter-date {
        flex: 1;
        min-width: 0;
    }
    
    .unplanned-content {
        padding: 10px;
        gap: 8px;
        max-height: 200px;
    }
    
    .task-card {
        padding: 10px;
    }
    
    .task-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .task-customer {
        font-size: 13px;
    }
    
    .task-details {
        font-size: 11px;
    }
    
    /* Modals plein écran mobile */
    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        padding: 16px;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }
    
    /* Formulaires tactiles */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 14px 12px;
        font-size: 16px; /* Évite le zoom sur iOS */
    }
    
    /* Tables responsive */
    .users-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .users-table {
        min-width: 600px;
    }
    
    .users-table th,
    .users-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .action-btn {
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
    }
}

/* =====================================================
   MENU BURGER & DRAWER MOBILE
   ===================================================== */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
}

.menu-toggle:hover {
    background: var(--bg-tertiary);
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Drawer mobile */
.mobile-drawer {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-overlay {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 99;
}

.drawer-overlay.open {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    padding: 16px;
}

.drawer-section {
    margin-bottom: 24px;
}

.drawer-section h4 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.drawer-view-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-view-controls .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.drawer-date-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drawer-date-nav .btn {
    width: 100%;
    padding: 12px;
}

/* Navigation mobile en bas */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 50;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
    
    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 10px;
        cursor: pointer;
        border-radius: 8px;
        transition: all 0.2s;
    }
    
    .mobile-nav-btn.active {
        color: var(--accent-green);
    }
    
    .mobile-nav-btn:hover {
        background: var(--bg-tertiary);
    }
    
    .mobile-nav-btn .nav-icon {
        font-size: 20px;
    }
}

/* =====================================================
   INDICATEUR ONLINE/OFFLINE
   ===================================================== */

.online-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 10px;
}

.online-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.online-indicator.online {
    background: rgba(35, 134, 54, 0.2);
    color: var(--accent-green);
}

.online-indicator.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.online-indicator.online .indicator-dot {
    background: var(--accent-green);
}

.online-indicator.offline .indicator-dot {
    background: var(--accent-red);
    animation: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.indicator-text {
    display: none;
}

@media (min-width: 768px) {
    .indicator-text {
        display: inline;
    }
}

.pending-sync-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent-orange);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    animation: bounce-badge 1s ease-in-out infinite;
}

@keyframes bounce-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Toast de synchronisation */
.sync-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slide-up 0.3s ease;
}

@keyframes slide-up {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.sync-toast.success {
    border-color: var(--accent-green);
}

.sync-toast.error {
    border-color: var(--accent-red);
}

.sync-toast .sync-icon {
    font-size: 20px;
}

.sync-toast .sync-message {
    font-size: 14px;
    color: var(--text-primary);
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 1000;
    animation: slide-up 0.3s ease;
}

.pwa-install-banner .banner-text {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-banner .banner-icon {
    font-size: 24px;
}

.pwa-install-banner .banner-message {
    font-size: 14px;
}

.pwa-install-banner .banner-actions {
    display: flex;
    gap: 10px;
}

.pwa-install-banner .btn-install {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.pwa-install-banner .btn-dismiss {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

/* =====================================================
   MODAL NOTE
   ===================================================== */

.modal-note {
    max-width: 600px;
    width: 90%;
}

/* Onglets de la modale Note */
.note-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.note-tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: -2px;
}

.note-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.note-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
    background: transparent;
}

.note-tab-content {
    display: none;
}

.note-tab-content.active {
    display: block;
}

/* Référence EBP */
.reference-display {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: monospace;
    border: 1px solid var(--border-color);
}

/* Conteneur détails commande */
.order-details-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 250px;
    overflow-y: auto;
}

.order-details-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.order-details-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.order-details-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.order-details-table th {
    background: var(--bg-secondary);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
}

.order-details-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.order-details-table tr:hover {
    background: var(--bg-secondary);
}

.order-details-table .qty-cell {
    text-align: right;
    font-weight: 500;
    white-space: nowrap;
    width: 80px;
}

.order-details-table .unit-cell {
    text-align: center;
    color: var(--text-secondary);
    width: 60px;
}

.order-details-table .desc-cell {
    word-break: break-word;
}

/* Conteneur notes EBP */
.ebp-notes-container {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
}

.ebp-notes-loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

.ebp-notes-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

.ebp-notes-content {
    padding: 15px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}

.note-task-info {
    background: var(--bg-tertiary);
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 13px;
    color: var(--text-secondary);
}

.note-task-info strong {
    color: var(--text-primary);
}

.note-input-container {
    position: relative;
    display: flex;
    gap: 10px;
}

.note-textarea {
    flex: 1;
    min-height: 180px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.note-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.note-textarea::placeholder {
    color: var(--text-muted);
}

.btn-voice {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-voice:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
}

.btn-voice.recording {
    background: var(--accent-red);
    animation: pulse-recording 1s infinite;
}

@keyframes pulse-recording {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.note-char-count {
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Badge note sur le bloc */
.block-note-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Indicateur visuel si note présente */
.planning-block.has-note {
    border-left-width: 4px;
}

.planning-block.has-note::after {
    content: '📝';
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 10px;
    opacity: 0.7;
}

/* Ajustement pour éviter chevauchement avec badge terminé */
.planning-block.has-note.completed::after {
    right: 22px;
}

/* Voice recognition status */
.voice-status {
    font-size: 12px;
    color: var(--accent-blue);
    margin-top: 5px;
    font-style: italic;
}

.voice-status.error {
    color: var(--accent-red);
}

/* =====================================================
   SIGNATURE - Styles pour la zone de signature
   ===================================================== */

/* Modale note + signature plus grande */
.modal-note-signature {
    max-width: 600px;
    width: 100%;
    height: 90vh;
    max-height: 90vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-note-signature .modal-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.modal-note-signature .note-tabs {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-color);
}

.modal-note-signature .note-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    min-height: 0;
}

.modal-note-signature .note-tab-content {
    display: none;
}

.modal-note-signature .note-tab-content.active {
    display: block;
}

.modal-note-signature .note-modal-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    padding: 15px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 600px) {
    .modal-note-signature {
        max-width: 100%;
    }
}

/* Séparateur signature */
.signature-separator {
    display: flex;
    align-items: center;
    margin: 20px 0 15px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.signature-separator::before,
.signature-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.signature-separator span {
    padding: 0 15px;
    white-space: nowrap;
}

/* Checkbox Commande terminée */
.completed-checkbox-group {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.completed-checkbox-group:has(.completed-checkbox:checked) {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
}

.completed-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    font-size: 16px;
    font-weight: 500;
}

.completed-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #22c55e;
}

.completed-checkbox-text {
    color: var(--text-primary);
}

.completed-checkbox:checked + .completed-checkbox-text {
    color: #22c55e;
}

/* Section signature */
.signature-section {
    background: var(--bg-tertiary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

/* Container du canvas */
.signature-container {
    position: relative;
    background: #ffffff;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    touch-action: none; /* Important pour tablettes */
}

.signature-container.has-signature {
    border-style: solid;
    border-color: var(--accent-green);
}

/* Canvas de signature */
.signature-canvas {
    display: block;
    width: 100%;
    height: 200px;
    cursor: crosshair;
    background: transparent;
}

/* Placeholder quand vide */
.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 16px;
    pointer-events: none;
    user-select: none;
}

.signature-container.has-signature .signature-placeholder {
    display: none;
}

/* Actions signature */
.signature-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.signature-status {
    font-size: 12px;
    color: var(--text-muted);
}

.signature-status.signed {
    color: var(--accent-green);
}

/* Bouton petit */
.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Label de formulaire */
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Input de formulaire */
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 139, 253, 0.2);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Indicateur signature sur bloc planning */
.planning-block.has-signature::before {
    content: '✍️';
    position: absolute;
    bottom: 2px;
    left: 2px;
    font-size: 10px;
    opacity: 0.8;
}

/* Ajustement position des badges */
.planning-block.has-note.has-signature::after {
    right: 2px;
}

.planning-block.has-note.has-signature.completed::after {
    right: 22px;
}

/* Responsive pour tablettes */
@media (max-width: 768px) {
    .modal-note-signature {
        max-width: 100%;
        width: 100%;
        margin: 10px;
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }
    
    .signature-canvas {
        height: 180px;
    }
    
    .signature-section {
        padding: 12px;
    }
}

/* Responsive pour tablettes intermédiaires (Surface, iPad) */
@media (max-width: 1024px) and (min-width: 769px) {
    .modal-note-signature {
        max-width: 90%;
        width: 90%;
        height: 85vh;
        max-height: 85vh;
    }
    
    .signature-canvas {
        height: 150px;
    }
    
    .note-textarea {
        min-height: 120px;
    }
}

/* Animation lors de la signature */
@keyframes signaturePulse {
    0% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(35, 134, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0); }
}

.signature-container.signing {
    animation: signaturePulse 0.5s ease-out;
}

/* =====================================================
   PANNEAU DE SYNCHRONISATION v2.7
   ===================================================== */

/* Rendre l'indicateur online cliquable */
.online-status {
    cursor: pointer;
    transition: opacity 0.2s;
}

.online-status:hover {
    opacity: 0.8;
}

/* Modal de synchronisation */
.modal-sync {
    max-width: 480px;
    width: 95%;
}

.sync-panel {
    padding: 0;
}

/* Section statut */
.sync-status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
}

.sync-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
}

.sync-status-indicator .status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #28a745;
}

.sync-status-indicator.offline .status-dot {
    background: #dc3545;
}

.sync-status-indicator.online {
    color: #28a745;
}

.sync-status-indicator.offline {
    color: #dc3545;
}

.sync-last-update {
    font-size: 0.85rem;
    color: #333;
}

/* Sections repliables */
.sync-section {
    border-bottom: 1px solid #e9ecef;
}

.sync-section:last-child {
    border-bottom: none;
}

.sync-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    background: #fff;
    transition: background 0.2s;
    color: #222;
}

.sync-section-header:hover {
    background: #f8f9fa;
}

.sync-section-header span:first-child {
    flex: 1;
    font-weight: 500;
    color: #222;
}

.section-arrow {
    color: #6c757d;
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.sync-section-content {
    padding: 0 20px 16px;
    animation: slideDown 0.2s ease-out;
}

.sync-section-content.collapsed {
    display: none;
}

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

/* Compteur de modifications en attente */
.pending-count {
    background: #e9ecef;
    color: #495057;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

.pending-count.has-pending {
    background: #dc3545;
    color: white;
}

/* Hint */
.sync-hint {
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Options de téléchargement */
.sync-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.sync-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sync-option:hover {
    background: #e9ecef;
}

.sync-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0d6efd;
}

.sync-option span {
    font-size: 0.9rem;
    color: #222;
}

/* Barre de progression */
.download-progress {
    margin-bottom: 16px;
}

.download-progress.hidden {
    display: none;
}

.progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #0b5ed7);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #333;
}

/* Liste des modifications en attente */
.pending-changes-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.pending-change-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.pending-change-item:last-child {
    margin-bottom: 0;
}

.pending-change-info {
    flex: 1;
}

.pending-change-type {
    font-weight: 500;
    color: #222;
}

.pending-change-time {
    font-size: 0.75rem;
    color: #555;
}

.pending-change-delete {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.pending-change-delete:hover {
    opacity: 1;
}

/* Historique des syncs */
.sync-history-list {
    max-height: 200px;
    overflow-y: auto;
}

.sync-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #222;
}

.sync-history-item:last-child {
    margin-bottom: 0;
}

.sync-history-icon {
    font-size: 1.1rem;
}

.sync-history-details {
    flex: 1;
}

.sync-history-type {
    font-weight: 500;
    color: #222;
}

.sync-history-time {
    font-size: 0.75rem;
    color: #555;
}

.sync-history-result {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.sync-history-result.success {
    background: #d4edda;
    color: #155724;
}

.sync-history-result.error {
    background: #f8d7da;
    color: #721c24;
}

/* Statistiques de stockage */
.storage-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.storage-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.storage-label {
    color: #222;
}

.storage-value {
    font-weight: 600;
    color: #222;
}

/* Message vide */
.sync-empty {
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    padding: 20px;
    margin: 0;
}

/* Boutons */
.btn-block {
    display: block;
    width: 100%;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* État désactivé */
#syncNowBtn:disabled,
#downloadBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 480px) {
    .modal-sync {
        max-width: 100%;
        margin: 10px;
        max-height: 90vh;
    }
    
    .sync-status-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .sync-section-header {
        padding: 12px 16px;
    }
    
    .sync-section-content {
        padding: 0 16px 14px;
    }
}

/* Amélioration toast sync */
.sync-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    font-size: 0.9rem;
}

.sync-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.sync-toast.success {
    background: #28a745;
}

.sync-toast.error {
    background: #dc3545;
}

.sync-toast .sync-icon {
    font-size: 1.2rem;
}

.sync-toast .sync-message {
    flex: 1;
}

/* =====================================================
   ALERTE DONNÉES PÉRIMÉES v2.7
   ===================================================== */

.stale-data-alert {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10002;
    max-width: 450px;
    width: 90%;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
}

.stale-data-alert.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.stale-alert-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
}

.stale-alert-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.stale-alert-text {
    flex: 1;
}

.stale-alert-text strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 4px;
}

.stale-alert-text p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

.stale-alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.stale-alert-close:hover {
    opacity: 1;
}

/* Alerte Warning (orange) */
.stale-alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    border: 1px solid #ffc107;
    color: #856404;
}

.stale-alert-warning .stale-alert-close {
    color: #856404;
}

/* Alerte Critique (rouge) */
.stale-alert-critical {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    color: #721c24;
}

.stale-alert-critical .stale-alert-close {
    color: #721c24;
}

/* Animation pulse pour critique */
.stale-alert-critical .stale-alert-icon {
    animation: alertPulse 1s ease-in-out infinite;
}

@keyframes alertPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive */
@media (max-width: 480px) {
    .stale-data-alert {
        top: 60px;
        width: 95%;
        max-width: none;
    }
    
    .stale-alert-content {
        padding: 14px 16px;
    }
    
    .stale-alert-icon {
        font-size: 1.5rem;
    }
    
    .stale-alert-text strong {
        font-size: 0.95rem;
    }
    
    .stale-alert-text p {
        font-size: 0.85rem;
    }
}

/* =====================================================
   BADGE VERSION (v2.7)
   ===================================================== */

.version-badge {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(13, 17, 23, 0.8);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    z-index: 50;
    transition: all 0.2s;
}

.version-badge:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Cacher sur mobile (barre de nav en bas) */
@media (max-width: 768px) {
    .version-badge {
        bottom: 70px;
    }
}

/* Section version dans le panneau sync */
.sync-version-section {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 10px;
}

.version-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.version-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.version-value {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: monospace;
}

/* =====================================================
   CORRECTIONS TABLETTES SURFACE / iPad (v2.7)
   ===================================================== */

/* Cacher la vue Mois sur appareils tactiles (tablette/mobile) */
.touch-device .view-btn[data-view="month"] {
    display: none !important;
}

/* =====================================================
   HISTORIQUE DES CONNEXIONS (v2.7)
   ===================================================== */

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

.modal-login-history {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
}

.modal-login-history .modal-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.login-history-filters {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    align-items: flex-end;
}

.login-history-filters .filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-history-filters .filter-group label {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-history-filters .form-input {
    min-width: 150px;
}

.login-history-table-container {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.login-history-table {
    width: 100%;
    border-collapse: collapse;
}

.login-history-table th,
.login-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.login-history-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    position: sticky;
    top: 0;
    z-index: 1;
}

.login-history-table td {
    font-size: 13px;
    color: var(--text-primary);
}

.login-history-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.login-history-table .date-cell {
    white-space: nowrap;
    font-family: monospace;
    font-size: 12px;
}

.login-history-table .user-cell {
    font-weight: 500;
}

.login-history-table .device-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    color: var(--text-muted);
}

.login-history-empty {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-login-history {
        max-width: 100%;
        width: 100%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .login-history-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .login-history-filters .form-input {
        width: 100%;
    }
    
    .login-history-table th,
    .login-history-table td {
        padding: 10px;
        font-size: 12px;
    }
    
    .login-history-table .device-cell {
        display: none;
    }
}

/* Surface 3, iPad Pro, tablettes avec scaling Windows */
@media (max-width: 1400px) {
    /* Header - éviter troncature */
    .header {
        min-height: var(--header-height);
        height: auto;
        flex-wrap: wrap;
        padding: 8px 12px;
        gap: 8px;
    }
    
    .header-controls {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    
    /* Réduire les boutons de vue */
    .view-controls {
        gap: 2px;
        padding: 3px;
    }
    
    .view-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    /* Navigation date plus compacte */
    .date-nav {
        gap: 4px;
    }
    
    .date-nav .current-date {
        min-width: 100px;
        font-size: 12px;
    }
    
    .date-nav button {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    /* Sélecteur société */
    .company-selector {
        min-width: 140px;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    /* Onglets navigation */
    .nav-tabs {
        gap: 2px;
        padding: 3px;
    }
    
    .nav-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
}

/* Tablettes en mode portrait ou petites tablettes */
@media (max-width: 1100px) {
    /* Header sur 2 lignes si nécessaire */
    .header {
        flex-wrap: wrap;
        padding: 8px 10px;
    }
    
    .header-left {
        order: 1;
        flex: 1;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
    
    .header-right {
        order: 2;
    }
    
    /* Cacher le texte du logo */
    .logo-text {
        display: none;
    }
    
    /* Vue mois : cellules plus petites */
    .view-month .day-header,
    .view-month .day-cell {
        min-width: 50px;
        padding: 4px;
    }
    
    .view-month .day-date {
        font-size: 14px;
    }
    
    .view-month .day-name {
        font-size: 10px;
    }
    
    .view-month .planning-block {
        padding: 4px 6px;
    }
    
    .view-month .block-number {
        font-size: 10px;
    }
    
    .view-month .block-customer {
        display: none;
    }
}

/* Modal note/signature - corrections hauteur tablettes */
@media (max-height: 800px) {
    .modal-note-signature {
        height: 95vh;
        max-height: 95vh;
    }
    
    .note-textarea {
        min-height: 100px;
    }
    
    .signature-canvas {
        height: 120px;
    }
    
    .signature-section {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
}

/* Très petits écrans en hauteur (tablette paysage) */
@media (max-height: 600px) {
    .modal-note-signature {
        height: 98vh;
        max-height: 98vh;
        margin: 5px;
    }
    
    .modal-note-signature .note-modal-body {
        padding: 10px;
    }
    
    .modal-header {
        padding: 10px 15px;
    }
    
    .modal-note-signature .note-modal-footer {
        padding: 10px 15px;
    }
    
    .note-textarea {
        min-height: 80px;
    }
    
    .signature-canvas {
        height: 100px;
    }
    
    .signature-section {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .signature-separator {
        margin: 10px 0;
    }
}

/* Fix spécifique vue mois - alignement lignes bleues */
@media (max-width: 1400px) {
    .view-month .planning-header,
    .view-month .planning-body {
        min-width: 100%;
    }
    
    .view-month .day-cells {
        position: relative;
    }
    
    .view-month .day-cell {
        position: relative;
    }
}
