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

:root {
    --primary: #0284c7;
    --primary-light: #e0f2fe;
    --primary-dark: #075985;
    --secondary: #64748b;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --office: #BFD8B8;
    --office-text: #3d5a37;
    --remote: #A7C7E7;
    --remote-text: #2c5282;
    --absent: #FBC6A4;
    --absent-text: #8a4a1e;
    --holiday: #F7CDCC;
    --holiday-text: #8a3a3a;
    --holiday-light: #fef2f2;
    --exterieur: #D8BFD8;
    --exterieur-text: #5a4a5a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --input-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary: #38bdf8;
    --primary-light: #1e3a5f;
    --primary-dark: #0ea5e9;
    --secondary: #94a3b8;
    --office: #8fb88a;
    --office-text: #e8f5e6;
    --remote: #7ab0d8;
    --remote-text: #e6f0fa;
    --absent: #e8a67a;
    --absent-text: #fef0e6;
    --holiday: #e8a5a3;
    --holiday-text: #fef2f2;
    --holiday-light: #3b2a2a;
    --exterieur: #b8a0b8;
    --exterieur-text: #f0e6f0;
    --bg: #0f172a;
    --card-bg: #1e293b;
    --text: #f1f5f9;
    --text-light: #94a3b8;
    --border: #334155;
    --input-bg: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    font-size: 16px;
    letter-spacing: 0.02em;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 4rem auto;
    position: relative;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.auth-logo img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

[data-theme="dark"] .logo-light {
    display: none;
}

[data-theme="dark"] .logo-dark {
    display: block;
}

.auth-logo .logo-light,
.auth-logo .logo-dark {
    margin: 0 auto;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

.form-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
}

button:focus,
a:focus,
select:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.calendar-day:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

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

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

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.switch-form {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-light);
}

.switch-form a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.switch-form a:hover {
    text-decoration: underline;
}

.error-message {
    color: var(--error);
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--success);
    background: #d1fae5;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 1rem;
    display: none;
}

.success-message.show {
    display: block;
}

.header {
    background: var(--card-bg);
    padding: 1.5rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header h1 {
    font-size: 1.25rem;
    color: var(--primary);
    margin: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.username {
    color: var(--text);
    font-weight: 500;
}

.header .btn {
    width: auto;
}

.tabs {
    background: var(--card-bg);
    border-bottom: 2px solid var(--border);
    margin-bottom: 2rem;
}

.tabs .container {
    display: flex;
    gap: 0.5rem;
    padding: 0;
}

.tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--primary);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.main-content {
    padding: 2rem 0;
}

.tab-content {
    display: none;
}

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

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.calendar-header h2 {
    font-size: 1.5rem;
    color: var(--text);
}

.calendar-header .btn {
    width: auto;
    padding: 0.5rem 1rem;
}

.calendar {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 12px;
    width: 100%;
}

.calendar-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    min-height: 80px;
}

.calendar-day:hover {
    border-color: var(--primary);
}

.calendar-day.header {
    font-weight: 600;
    background: var(--primary-light);
    border-color: var(--primary-light);
    cursor: default;
}

.calendar-day.other-month {
    opacity: 0.3;
    cursor: default;
}

.calendar-day.office {
    background: var(--office);
    color: var(--office-text);
    border-color: var(--office);
}

.calendar-day.remote {
    background: var(--remote);
    color: var(--remote-text);
    border-color: var(--remote);
}

.calendar-day.absent {
    background: var(--absent);
    color: var(--absent-text);
    border-color: var(--absent);
}

.calendar-day.weekend {
    background: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
    justify-content: center;
}

.calendar-day.weekend:hover {
    border-color: #e2e8f0;
}

.calendar-day.holiday {
    background: var(--holiday);
    color: var(--holiday-text);
    border-color: var(--holiday);
    cursor: not-allowed;
    justify-content: center;
}

.calendar-day.holiday:hover {
    border-color: var(--holiday);
}

.holiday-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--holiday-text);
    text-align: center;
    line-height: 1.2;
    word-break: break-word;
    max-width: 100%;
}

.calendar-day.today {
    border-color: var(--primary);
    font-weight: 600;
}

.day-number {
    font-size: 1.125rem;
}

.day-status {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.history-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.history-filters select {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    flex: 1;
}

.history-list {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

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

.history-date {
    font-weight: 600;
    color: var(--text);
}

.history-status {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

.history-status.office {
    background: var(--office);
    color: white;
}

.history-status.remote {
    background: var(--remote);
    color: white;
}

.history-status.absent {
    background: var(--absent);
    color: white;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.export-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
}

.export-section h3 {
    margin-bottom: 1rem;
}

.export-section .btn {
    width: auto;
}

.my-account-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.my-account-section h3 {
    margin-bottom: 1rem;
}

.profile-info {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.profile-item {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

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

.profile-label {
    font-weight: 500;
    color: var(--text-light);
    min-width: 150px;
}

.profile-value {
    color: var(--text);
}

.profile-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--primary-light);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    text-align: center;
}

.change-nip-section {
    margin-top: 1rem;
}

.change-nip-section h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.member-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-fullname {
    color: var(--text-light);
    font-size: 0.9rem;
}

.profile-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-form .form-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

.profile-form .form-group input {
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--background);
    color: var(--text);
}

.profile-form .form-group input:disabled {
    background: var(--border);
    color: var(--text-light);
    cursor: not-allowed;
}

.profile-form .form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.change-nip-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.change-nip-form input {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.members-section {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

.members-section h3 {
    margin-bottom: 1rem;
}

.add-member-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.add-member-form input {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

.add-member-form .btn {
    width: auto;
}

.members-list {
    max-height: 300px;
    overflow-y: auto;
}

.member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

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

.member-name {
    font-weight: 500;
}

.member-badge {
    font-size: 0.75rem;
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.btn-danger {
    background: var(--error);
    color: white;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
    width: auto;
}

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

.btn-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    min-width: auto;
    width: auto;
}

.member-actions {
    display: flex;
    gap: 0.5rem;
}

.member-nip {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-left: 0.5rem;
    font-family: monospace;
}

.member-nip-container {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.btn-nip-toggle {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border: 1px solid var(--primary);
    cursor: pointer;
}

.color-legend {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.legend-color.office {
    background: var(--office);
}

.legend-color.remote {
    background: var(--remote);
}

.legend-color.absent {
    background: var(--absent);
}

.stat-value.office {
    color: var(--office);
}

.stat-value.remote {
    color: var(--remote);
}

.stat-value.absent {
    color: var(--absent);
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.calendar-hint {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.legend-color.conge {
    background: var(--absent);
}

.legend-color.exterieur {
    background: var(--exterieur);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
    width: 100%;
    table-layout: fixed;
}

.calendar-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.calendar-day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.5rem;
    background: var(--primary-light);
    border-radius: 6px;
    font-size: 0.875rem;
}

.calendar-day.empty {
    background: transparent;
    border: none;
}

.calendar-day.ampm-day {
    min-height: 80px;
    padding: 0.25rem;
    cursor: default;
    justify-content: flex-start;
}

.day-ampm {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
    margin-top: 4px;
}

.period-am, .period-pm {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    cursor: pointer;
    background: #f1f5f9;
    transition: all 0.2s;
    gap: 4px;
}

.period-am:hover, .period-pm:hover {
    background: var(--primary-light);
}

.period-am.office, .period-pm.office {
    background: var(--office);
    color: var(--office-text);
}

.period-am.remote, .period-pm.remote {
    background: var(--remote);
    color: var(--remote-text);
}

.period-am.conge, .period-pm.conge {
    background: var(--absent);
    color: var(--absent-text);
}

.period-am.absent, .period-pm.absent {
    background: var(--absent);
    color: var(--absent-text);
}

.period-am.exterieur, .period-pm.exterieur {
    background: var(--exterieur);
    color: var(--exterieur-text);
}

.period-label {
    font-size: 0.65rem;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
}

.day-content {
    text-align: center;
}

.weekend-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.team-day {
    min-height: 80px;
    padding: 0.25rem;
    justify-content: flex-start;
}

.team-day.clickable {
    cursor: pointer;
}

.team-day.clickable:hover {
    background: var(--primary-light);
}

.team-summary {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 2px;
    margin-top: 4px;
}

.team-period {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px;
    background: #f8fafc;
    border-radius: 4px;
}

.period-mini {
    font-size: 0.6rem;
    color: var(--text-light);
    font-weight: 600;
}

.count-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
}

.count-badge.office {
    background: var(--office);
    color: var(--office-text);
}

.count-badge.remote {
    background: var(--remote);
    color: var(--remote-text);
}

.count-badge.exterieur {
    background: var(--exterieur);
    color: var(--exterieur-text);
}

.info-hint {
    display: block;
    font-size: 0.6rem;
    color: var(--primary);
    text-align: center;
    margin-top: 4px;
    opacity: 0.8;
    font-weight: 500;
}

.team-day.clickable:hover .info-hint {
    opacity: 1;
    color: var(--primary-dark);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: white;
}

.modal-header h3 {
    font-size: 1.25rem;
    color: var(--text);
    text-transform: capitalize;
}

.modal-header .btn {
    padding: 0.25rem 0.75rem;
    font-size: 1.25rem;
    line-height: 1;
}

.day-detail-content {
    padding: 1.5rem;
}

.day-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.detail-section {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
}

.detail-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid;
}

.detail-title.office {
    color: var(--office);
    border-color: var(--office);
}

.detail-title.remote {
    color: var(--remote);
    border-color: var(--remote);
}

.detail-title.exterieur {
    color: var(--exterieur);
    border-color: var(--exterieur);
}

.detail-list {
    list-style: none;
}

.detail-list li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
}

.detail-list li.empty {
    color: var(--text-light);
    font-style: italic;
}

.no-data {
    text-align: center;
    color: var(--text-light);
    padding: 2rem;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 0.25rem;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .main-content {
        padding: 0.25rem;
        overflow-x: hidden;
    }
    
    .tab-content {
        padding: 0;
        overflow-x: hidden;
    }
    
    .calendar {
        padding: 0.5rem;
        border-radius: 8px;
        overflow-x: hidden;
        max-width: 100%;
    }
    
    .calendar-grid {
        gap: 3px;
        width: 100%;
        max-width: 100%;
    }
    
    .calendar-day {
        overflow: hidden;
        word-break: break-all;
    }
    
    .calendar-day-header {
        font-size: 0.75rem;
        padding: 0.4rem 0.2rem;
    }
    
    .calendar-day {
        padding: 3px;
        min-height: 70px;
        border-width: 1px;
        border-radius: 6px;
    }
    
    .calendar-day.ampm-day,
    .team-day {
        min-height: 70px;
    }
    
    .day-number {
        font-size: 0.85rem;
        font-weight: 600;
    }
    
    .period-label, .period-mini {
        font-size: 0.6rem;
    }
    
    .period-am, .period-pm {
        padding: 3px;
    }
    
    .count-badge {
        font-size: 0.6rem;
        padding: 1px 3px;
    }
    
    .weekend-label {
        font-size: 0.65rem;
    }
    
    .holiday-label {
        font-size: 0.5rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
        display: block;
    }
    
    .color-legend {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .calendar-hint {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .calendar-header {
        margin-bottom: 0.75rem;
        padding: 0 0.25rem;
    }
    
    .calendar-header h2 {
        font-size: 1rem;
    }
    
    .calendar-header .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .header .container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .header .brand-title {
        font-size: 1.25rem;
    }
    
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }
    
    .tabs {
        gap: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .tabs::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    .calendar-legend {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .legend-item {
        font-size: 0.75rem;
    }
    
    .admin-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .day-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    .card {
        padding: 1.25rem;
        margin: 2rem 0.5rem;
    }
}

.holidays-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.holidays-section h3 {
    margin-bottom: 1rem;
    color: var(--holiday);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.holiday-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.holiday-form input {
    padding: 0.5rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
}

.holiday-form input[type="date"] {
    min-width: 150px;
}

.holiday-form input[type="text"] {
    flex: 1;
    min-width: 150px;
}

.holiday-list {
    max-height: 300px;
    overflow-y: auto;
}

.holiday-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--holiday-light);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--holiday);
}

.holiday-item-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.holiday-item-date {
    font-weight: 600;
    color: var(--holiday);
}

.holiday-item-name {
    font-size: 0.875rem;
    color: var(--text);
}

.legend-item.holiday .legend-color {
    background: var(--holiday);
}

/* User Selector for Individual Schedule */
.user-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-selector label {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
}

.user-select {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text);
    cursor: pointer;
    max-width: 300px;
}

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

.no-selection-message {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
    background: var(--card-bg);
    border-radius: 8px;
    margin-top: 1rem;
}

.no-selection-message p {
    font-size: 1.1rem;
}

/* Read-only calendar for individual schedule */
.calendar-readonly .calendar-day {
    cursor: default;
}

.calendar-readonly .calendar-day:not(.weekend):not(.holiday):hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .user-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .user-select {
        max-width: 100%;
    }
}

/* Theme Toggle Button */
.theme-toggle,
.info-toggle {
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text);
    font-size: 1.2rem;
}

.theme-toggle:hover,
.info-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.theme-toggle:hover {
    transform: rotate(15deg);
}

.info-toggle:hover {
    transform: scale(1.1);
}

.info-modal-content {
    max-width: 400px;
}

.info-modal-body {
    padding: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    font-weight: 600;
    color: var(--text-light);
}

.info-value {
    color: var(--text);
    font-weight: 500;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

:root .theme-toggle .icon-moon {
    display: block;
}

:root .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* Dark theme adjustments for inputs */
[data-theme="dark"] input,
[data-theme="dark"] select {
    background-color: var(--input-bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] input::placeholder {
    color: var(--text-light);
}

[data-theme="dark"] .card {
    box-shadow: 0 1px 3px var(--shadow);
}

[data-theme="dark"] .btn-secondary {
    background: var(--card-bg);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--border);
}

[data-theme="dark"] .calendar-day {
    box-shadow: 0 1px 3px var(--shadow);
}

[data-theme="dark"] .stat-card {
    box-shadow: 0 1px 3px var(--shadow);
}

/* Dark mode calendar visibility improvements */
[data-theme="dark"] .calendar-day {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .day-number {
    color: var(--text);
}

[data-theme="dark"] .period-am,
[data-theme="dark"] .period-pm {
    background: var(--border);
    color: var(--text-light);
}

[data-theme="dark"] .period-am .period-label,
[data-theme="dark"] .period-pm .period-label {
    color: var(--text-light);
}

[data-theme="dark"] .period-am.office,
[data-theme="dark"] .period-pm.office {
    background: var(--office);
    color: var(--office-text);
}

[data-theme="dark"] .period-am.remote,
[data-theme="dark"] .period-pm.remote {
    background: var(--remote);
    color: var(--remote-text);
}

[data-theme="dark"] .period-am.conge,
[data-theme="dark"] .period-pm.conge {
    background: var(--absent);
    color: var(--absent-text);
}

[data-theme="dark"] .period-am.exterieur,
[data-theme="dark"] .period-pm.exterieur {
    background: var(--exterieur);
    color: var(--exterieur-text);
}

[data-theme="dark"] .period-am.office .period-label,
[data-theme="dark"] .period-am.remote .period-label,
[data-theme="dark"] .period-am.conge .period-label,
[data-theme="dark"] .period-am.exterieur .period-label,
[data-theme="dark"] .period-pm.office .period-label,
[data-theme="dark"] .period-pm.remote .period-label,
[data-theme="dark"] .period-pm.conge .period-label,
[data-theme="dark"] .period-pm.exterieur .period-label {
    color: inherit;
}

[data-theme="dark"] .weekend-label,
[data-theme="dark"] .holiday-label {
    color: var(--text-light);
}

[data-theme="dark"] .calendar-day.weekend {
    background: var(--border);
}

[data-theme="dark"] .calendar-day.holiday {
    background: var(--holiday-light);
}

[data-theme="dark"] .calendar-day-header {
    background: var(--primary-dark);
    color: #ffffff;
}

[data-theme="dark"] .count-badge {
    color: #ffffff;
    font-weight: 600;
}

[data-theme="dark"] .period-mini {
    color: var(--text-light);
}

[data-theme="dark"] .team-period {
    color: var(--text);
}

[data-theme="dark"] .color-legend {
    background: var(--card-bg);
}

[data-theme="dark"] .user-selector {
    background: var(--card-bg);
    border: 1px solid var(--border);
}

[data-theme="dark"] .user-selector label {
    color: var(--text);
}

[data-theme="dark"] .user-select {
    background: var(--background);
    color: var(--text);
    border-color: var(--border);
}

[data-theme="dark"] .user-select option {
    background: var(--card-bg);
    color: var(--text);
}

[data-theme="dark"] .no-selection-message {
    background: var(--card-bg);
    color: var(--text-light);
    border: 1px solid var(--border);
}

[data-theme="dark"] .calendar-header h2 {
    color: var(--text);
}

[data-theme="dark"] .calendar-hint {
    color: var(--text-light);
}

[data-theme="dark"] .tabs {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .tab {
    color: var(--text-light);
}

[data-theme="dark"] .tab.active {
    color: var(--primary);
}

[data-theme="dark"] .header {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .info-modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] .info-modal-body {
    background: var(--card-bg);
}

[data-theme="dark"] .modal-content {
    background: var(--card-bg);
}

[data-theme="dark"] .modal-header {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .modal-header h3 {
    color: var(--text);
}

[data-theme="dark"] .modal-body {
    background: var(--card-bg);
    color: var(--text);
}

[data-theme="dark"] .modal-body p {
    color: var(--text);
}

[data-theme="dark"] .modal-body label {
    color: var(--text);
}

[data-theme="dark"] .day-detail-content {
    background: var(--card-bg);
}

[data-theme="dark"] .detail-section {
    background: var(--background);
    border: 1px solid var(--border);
}

[data-theme="dark"] .detail-list li {
    color: var(--text);
}

[data-theme="dark"] .detail-list li.empty {
    color: var(--text-light);
}

[data-theme="dark"] .modal-footer {
    border-color: var(--border);
}

[data-theme="dark"] .info-item {
    border-color: var(--border);
}

[data-theme="dark"] .info-label {
    color: var(--text-light);
}

[data-theme="dark"] .info-value {
    color: var(--text);
}

.dashboard-section {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.dashboard-section h3 {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 600;
}

.today-date {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 500;
}

.today-members {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.member-row {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--background);
    border-radius: 0.5rem;
    gap: 0.75rem;
}

.member-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    min-width: 100px;
}

.member-status {
    display: flex;
    gap: 0.5rem;
}

.status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 70px;
    text-align: center;
}

.status-pill.office {
    background: var(--office);
    color: white;
}

.status-pill.remote {
    background: var(--remote);
    color: white;
}

.status-pill.conge {
    background: var(--conge);
    color: white;
}

.status-pill.exterieur {
    background: var(--exterieur);
    color: var(--exterieur-text);
}

.status-pill.empty {
    background: var(--border);
    color: var(--text-light);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.week-day {
    background: var(--background);
    border-radius: 0.5rem;
    padding: 0.75rem 0.5rem;
    text-align: center;
}

.week-day.today {
    background: var(--primary-light);
    border: 2px solid var(--primary);
}

.week-day.weekend {
    background: var(--border);
    opacity: 0.7;
}

.week-day.holiday {
    background: var(--holiday-light);
}

.week-day.clickable {
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.week-day.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.week-day-header {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.week-day-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.week-day.today .week-day-num {
    color: var(--primary-dark);
}

.week-day.weekend .week-day-num,
.week-day.holiday .week-day-num {
    color: var(--text-light);
}

.week-members {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.week-member {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
}

.week-member-name {
    font-size: 0.65rem;
    color: var(--text);
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.mini-status {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.mini-status.office {
    background: var(--office);
}

.mini-status.remote {
    background: var(--remote);
}

.mini-status.conge {
    background: var(--conge);
}

.mini-status.exterieur {
    background: var(--exterieur);
}

.mini-status.empty {
    background: var(--border);
}

.loading-text {
    color: var(--text-light);
    text-align: center;
    padding: 2rem;
}

.holiday-label-week {
    font-size: 0.65rem;
    color: var(--holiday);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .week-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 0.15rem;
    }
    
    .week-day {
        padding: 0.35rem 0.15rem;
        min-height: auto;
    }
    
    .week-day-header {
        font-size: 0.6rem;
    }
    
    .week-day-num {
        font-size: 0.85rem;
        margin-bottom: 0.25rem;
    }
    
    .week-members {
        display: flex;
        flex-direction: column;
        gap: 0.15rem;
    }
    
    .week-member {
        padding: 0.1rem;
        gap: 0.1rem;
    }
    
    .week-member-name {
        display: none;
    }
    
    .mini-status {
        width: 6px;
        height: 6px;
    }
    
    .member-row {
        flex-wrap: wrap;
    }
    
    .member-name {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .status-pill {
        min-width: 55px;
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

[data-theme="dark"] .dashboard-section {
    background: var(--card-bg);
}

[data-theme="dark"] .member-row {
    background: var(--background);
}

[data-theme="dark"] .week-day {
    background: var(--background);
}

[data-theme="dark"] .week-day.today {
    background: rgba(2, 132, 199, 0.2);
    border-color: var(--primary);
}

[data-theme="dark"] .week-day.weekend {
    background: var(--border);
}

[data-theme="dark"] .week-day.holiday {
    background: var(--holiday-light);
}

.copy-week-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.copy-week-container .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-icon {
    font-size: 1rem;
}

#selected-week-info {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-style: italic;
}

.modal-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
    .copy-week-container .btn {
        width: 100%;
        justify-content: center;
    }
}

.status-dropdown {
    position: absolute;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow);
    z-index: 1000;
    min-width: 180px;
    padding: 0.5rem 0;
    animation: dropdownFadeIn 0.15s ease-out;
}

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

.status-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
}

.status-dropdown-item:hover {
    background: var(--primary-light);
}

.status-dropdown-item.selected {
    background: var(--primary-light);
    font-weight: 600;
}

.status-dropdown-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
}

.status-dropdown-color.office {
    background: var(--office);
}

.status-dropdown-color.remote {
    background: var(--remote);
}

.status-dropdown-color.conge {
    background: var(--absent);
}

.status-dropdown-color.exterieur {
    background: var(--exterieur);
}

.status-dropdown-color.none {
    background: var(--border);
    border: 2px dashed var(--text-light);
}

.status-dropdown-label {
    font-size: 0.9rem;
    color: var(--text);
}

.dropdown-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
}

[data-theme="dark"] .status-dropdown {
    background: var(--card-bg);
    border-color: var(--border);
}

[data-theme="dark"] .status-dropdown-item:hover {
    background: var(--border);
}

[data-theme="dark"] .status-dropdown-item.selected {
    background: var(--border);
}

[data-theme="dark"] .status-dropdown-label {
    color: var(--text);
}

@media (max-width: 768px) {
    .status-dropdown {
        min-width: 150px;
    }
    
    .status-dropdown-item {
        padding: 0.5rem 0.75rem;
    }
    
    .status-dropdown-color {
        width: 14px;
        height: 14px;
    }
    
    .status-dropdown-label {
        font-size: 0.85rem;
    }
}

