/* OP-SDIS - Styles Principaux */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #1a1a1a;
}

/* Screens */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Login Screen */
.login-container {
    max-width: 450px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.tagline {
    color: #666;
    font-size: 14px;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s;
}

.tab-btn.active {
    color: #c62828;
    border-bottom-color: #c62828;
    font-weight: bold;
}

/* Forms */
.auth-form {
    display: none;
}

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

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #c62828;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-secondary {
    padding: 10px 20px;
    background: transparent;
    color: white;
    border: 2px solid white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: white;
    color: #c62828;
}

/* Messages */
.error-message, .success-message {
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: none;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

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

/* SDIS Selection */
.sdis-selection-container {
    max-width: 800px;
    margin: 50px auto;
    background: white;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
}

.sdis-selection-container h2 {
    color: #c62828;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
}

.sdis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.sdis-card {
    padding: 25px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.sdis-card:hover {
    border-color: #c62828;
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(198, 40, 40, 0.2);
}

.sdis-card h3 {
    color: #333;
    margin-bottom: 5px;
}

.sdis-card p {
    color: #666;
    font-size: 14px;
}

/* Dashboard */
.main-header {
    background: #c62828;
    color: white;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.main-header .logo {
    font-size: 32px;
    background: none;
    -webkit-text-fill-color: white;
    margin: 0;
}

.current-sdis {
    display: inline-block;
    margin-left: 20px;
    padding: 5px 15px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
    font-size: 14px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-name {
    color: white;
    font-weight: 600;
}

.dashboard-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.welcome-section {
    background: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.06);
}

.welcome-section h2 {
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 24px;
}

.sdis-title {
    color: #c62828;
    font-size: 18px;
    font-weight: 600;
}

/* Modules Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.module-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.06);
    transition: all 0.25s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
    border-color: rgba(198, 40, 40, 0.2);
}

.module-icon {
    font-size: 48px;
    margin-bottom: 16px;
    filter: grayscale(0.2);
}

.module-card h3 {
    color: #1a1a1a;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 600;
}

.module-card p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
}

.btn-module {
    padding: 12px 28px;
    background: #c62828;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.btn-module:hover:not(:disabled) {
    background: #b71c1c;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-module:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    border: 1px solid #d1d5db;
}
}

/* Admin Panel */
.admin-panel {
    margin-top: 40px;
    padding: 30px;
    background: #fff9e6;
    border-radius: 12px;
    border: 3px solid #FFD700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.admin-title {
    color: #c62828;
    margin-bottom: 25px;
    font-size: 28px;
    text-align: center;
}

.admin-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-section h3 {
    color: #c62828;
    margin: 0 0 12px 0;
    font-size: 20px;
}

.admin-section p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 15px;
    line-height: 1.6;
}

.btn-admin {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.btn-admin:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #a51818 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.4);
}

/* ===== UNIFIED HEADER ===== */
.unified-header {
    background: #c62828;
    color: white;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.header-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    padding: 4px;
}

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

.header-title .logo {
    font-size: 20px;
    font-weight: 700;
    color: white;
    background: none;
    -webkit-text-fill-color: white;
    margin: 0;
}

.current-sdis {
    font-size: 13px;
    opacity: 0.9;
    font-weight: 500;
    padding-left: 12px;
    border-left: 1px solid rgba(255,255,255,0.3);
}

/* Navigation */
.header-nav {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
}

.nav-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-btn.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-icon {
    font-size: 16px;
}

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

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    min-width: 220px;
    overflow: hidden;
    z-index: 1001;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-btn:hover {
    background: rgba(255,255,255,0.2);
}

.header-btn .btn-icon {
    font-size: 16px;
}

.header-btn .btn-text {
    font-size: 13px;
}

.admin-btn {
    background: rgba(255,255,255,0.2);
}

.admin-btn:hover {
    background: rgba(255,255,255,0.3);
}

.logout-btn {
    background: rgba(0,0,0,0.2);
}

.logout-btn:hover {
    background: rgba(0,0,0,0.3);
}

.user-info {
    padding: 0 12px;
    border-left: 1px solid rgba(255,255,255,0.2);
    border-right: 1px solid rgba(255,255,255,0.2);
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
}

/* Settings Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

.modal-close:hover {
    color: #c62828;
}

.modal-body {
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #c62828;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-modal {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-modal-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-modal-cancel:hover {
    background: #e0e0e0;
}

.btn-modal-save {
    background: #c62828;
    color: white;
}

.btn-modal-save:hover {
    background: #b71c1c;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #81c784;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef5350;
}

/* Responsive */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }
    
    .header-right {
        flex-direction: column;
        width: 100%;
    }
    
    .header-right button {
        width: 100%;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .sdis-grid {
        grid-template-columns: 1fr;
    }
}
