:root {
    --primary: #0f2d5e;
    --accent: #c9a84c;
    --bg-color: #f5f7fa;
    --white: #ffffff;
    --text-main: #333333;
    --text-muted: #666666;
    --border-color: #e2e8f0;
    --danger: #e53e3e;
    --success: #38a169;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4 {
    font-family: 'Libre Baskerville', serif;
    color: var(--primary);
}

/* Fallback dummy image handling */
.fallback-image {
    background-color: #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.8rem;
    position: relative;
    overflow: hidden;
}
.fallback-image::after {
    content: 'Image non disponible';
    position: absolute;
    color: #fff;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #1a498a 100%);
}

.login-container {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

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

.login-header h1 {
    font-size: 2rem;
    margin: 0 0 5px 0;
    color: var(--primary);
}

.login-header p {
    color: var(--text-muted);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

.banner-restricted {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.2);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: #0b2247;
}

.error-message {
    color: var(--danger);
    font-size: 0.85rem;
    margin-top: 10px;
    text-align: center;
    min-height: 18px;
}

.demo-credentials {
    margin-top: 20px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* --- Dashboard --- */
.main-header {
    background-color: var(--primary);
    color: var(--white);
    padding: 15px 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.5rem;
    font-weight: bold;
}

.logo span {
    color: var(--accent);
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: normal;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

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

.dashboard-container {
    display: flex;
    max-width: 1200px;
    margin: 30px auto;
    gap: 30px;
    padding: 0 20px;
}

.sidebar {
    width: 250px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar nav {
    display: flex;
    flex-direction: column;
}

.sidebar nav a {
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.sidebar nav a:hover {
    background: #f8fafc;
}

.sidebar nav a.active {
    background: #f1f5f9;
    border-left-color: var(--accent);
    color: var(--primary);
}

.admin-sidebar-section {
    margin-top: auto;
    border-top: 2px dashed var(--border-color);
}

.admin-link {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    background: #e2e8f0;
    cursor: pointer;
}

.admin-link:hover, .admin-link.active {
    background: #cbd5e1;
    color: var(--primary);
}

.content-area {
    flex: 1;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 30px;
    min-height: 500px;
}

.tab-content {
    display: none;
}

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

.tab-content h2 {
    margin-top: 0;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Profile Tab */
.profile-card {
    display: flex;
    align-items: center;
    gap: 30px;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
}

.profile-details h3 {
    margin: 0 0 5px;
    font-size: 1.5rem;
}

.position {
    font-weight: 600;
    color: var(--primary);
    margin: 0;
}

.department {
    color: var(--text-muted);
    margin: 5px 0 0;
}

/* Congés */
.stat-box {
    display: inline-block;
    text-align: center;
    padding: 20px;
    background: #f8fafc;
    border-radius: 6px;
    margin-right: 20px;
    min-width: 150px;
    border: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    display: block;
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Annonces */
.announcement {
    display: flex;
    gap: 20px;
}

.news-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

.urgent {
    border-left: 4px solid var(--danger);
    background: #fff5f5;
}

/* Admin Console */
.admin-console {
    background: repeating-linear-gradient(
        45deg,
        #f8fafc,
        #f8fafc 10px,
        #ffffff 10px,
        #ffffff 20px
    );
}

.locked-card {
    border: 2px solid #cbd5e1;
    background: #f1f5f9;
}

.vault-status {
    padding: 10px;
    background: var(--white);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: 4px;
    font-family: monospace;
    color: var(--text-muted);
}

.pin-form {
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.pin-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#pinInput {
    width: 100px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 5px;
    padding: 10px;
    border: 2px solid var(--primary);
    border-radius: 4px;
}

.btn-gold {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
}

.btn-gold:hover {
    background: #b0913f;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
    border: none;
    padding: 15px 30px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 20px 0;
}

.unlocked-card {
    border: 2px solid var(--success);
    background: #f0fff4;
    text-align: center;
}

.flag-container {
    background: var(--primary);
    color: var(--accent);
    font-family: 'Source Code Pro', monospace;
    padding: 20px;
    font-size: 1.2rem;
    border-radius: 4px;
    margin-top: 20px;
    word-break: break-all;
}
