:root {
    --bg-dark: #0a0c10;
    --bg-panel: #12151b;
    --bg-panel-hover: #1b2028;
    --primary: #4a5c43; /* Olive Drab */
    --primary-light: #5d7454;
    --primary-glow: rgba(74, 92, 67, 0.4);
    --accent: #d4a373; /* Desert Tan Accent */
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --danger: #ef4444;
    --border: #2a313c;
    
    --font-main: 'Inter', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    position: relative;
}

/* Scanline Effect */
body::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    z-index: 9999;
    background-size: 100% 4px;
    pointer-events: none;
    opacity: 0.15;
}

/* Custom Scrollbar & Selection */
::selection {
    background-color: var(--primary);
    color: #fff;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 12, 16, 0.8);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Typography Utilities */
.text-muted { color: var(--text-muted); }
.mb-2 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.5rem; }
.w-100 { width: 100%; }
.hidden { display: none !important; }

/* =======================================
   SCREENS & TRANSITIONS
   ======================================= */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    pointer-events: all;
    z-index: 20;
}

/* =======================================
   LOGIN SCREEN
   ======================================= */
#login-screen {
    background: linear-gradient(rgba(10, 12, 16, 0.85), rgba(10, 12, 16, 0.95)), url('https://cdn.discordapp.com/attachments/1465060924590133441/1503518926338789496/dazdaz.webp?ex=6a03a49e&is=6a02531e&hm=8ad2750d3fef520302504125b3494f19ee4e99891623d5847a652d84c5f2a02d') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-container {
    background: rgba(18, 21, 27, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(74, 92, 67, 0.2);
    transform: translateY(20px);
    animation: fadeUp 0.6s ease-out forwards;
}

@keyframes fadeUp {
    to { transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-image {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.login-header h1 {
    font-family: var(--font-mono);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--accent);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Forms */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success);
    color: #fff;
    animation: btn-pulse 2s infinite;
}

@keyframes btn-pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.btn-success:hover {
    background: #16a34a;
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
    animation: none;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.05);
}

.btn-large {
    padding: 1.5rem;
    font-size: 1.2rem;
    width: 100%;
}

/* Custom Checkbox */
.checkbox-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
    color: var(--text-main);
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.checkbox-container:hover input ~ .checkmark {
    background-color: rgba(255,255,255,0.05);
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}


/* =======================================
   LOADING SCREEN (HUD STYLE)
   ======================================= */
#loading-screen {
    background: radial-gradient(circle at center, rgba(18, 21, 27, 0.8), rgba(10, 12, 16, 0.95));
    display: flex;
    justify-content: center;
    align-items: center;
}

.hud-loading-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    animation: fadeInScale 0.5s ease-out;
}

@keyframes fadeInScale {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.hud-logo-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hud-logo-image {
    width: 60px;
    height: auto;
    z-index: 2;
    filter: drop-shadow(0 0 15px var(--primary-glow));
}

.hud-ring-1, .hud-ring-2 {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 50%;
    border: 2px solid transparent;
}

.hud-ring-1 {
    border-top-color: var(--accent);
    border-bottom-color: var(--accent);
    animation: spin 3s linear infinite;
    opacity: 0.6;
}

.hud-ring-2 {
    border-left-color: var(--primary-light);
    border-right-color: var(--primary-light);
    width: 140px;
    height: 140px;
    top: -10px;
    left: -10px;
    animation: spinReverse 4s linear infinite;
    opacity: 0.4;
}

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

@keyframes spinReverse {
    100% { transform: rotate(-360deg); }
}

.hud-text-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.hud-system-status {
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 3px;
    opacity: 0.8;
}

.hud-welcome {
    font-family: var(--font-main);
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hud-callname {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--accent);
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(212, 163, 115, 0.4);
    margin: 0;
}

.hud-progress-wrapper {
    width: 350px;
}

.hud-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.8rem;
    position: relative;
}

.hud-progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--primary-glow);
}

.hud-progress-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 2px;
}

/* =======================================
   DASHBOARD
   ======================================= */
#dashboard-screen {
    display: flex;
    background: linear-gradient(rgba(10, 12, 16, 0.85), rgba(10, 12, 16, 0.95)), url('https://cdn.discordapp.com/attachments/1465060924590133441/1503522945019019373/ss.webp?ex=6a03a85c&is=6a0256dc&hm=d74e8eada9b7df63e98b758af7098bf14f63df9c836e3e38180c712e30979503') center/cover no-repeat fixed;
}

.sidebar {
    width: 280px;
    background: rgba(18, 21, 27, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.sidebar-header {
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo {
    width: 40px;
    height: auto;
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

.sidebar-header .brand {
    font-family: var(--font-mono);
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.2rem;
}

.user-info-sidebar {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border);
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}
.avatar-small {
    width: 35px;
    height: 35px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-info-sidebar .details {
    display: flex;
    flex-direction: column;
}

.user-info-sidebar #current-user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.rank-badge {
    font-size: 0.75rem;
    background: var(--accent);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    display: inline-block;
    margin-top: 4px;
    width: fit-content;
}

.nav-links {
    list-style: none;
    padding: 1rem 0;
    flex-grow: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-links li a i {
    width: 24px;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.nav-links li a:hover {
    background: var(--bg-panel-hover);
    color: var(--text-main);
}
.nav-links li a:hover i {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
    color: var(--accent);
}

.nav-links li a.active {
    background: linear-gradient(90deg, rgba(74, 92, 67, 0.3) 0%, transparent 100%);
    color: var(--text-main);
    border-left-color: var(--accent);
    box-shadow: inset 3px 0 0 0 var(--primary);
    position: relative;
    font-weight: 600;
}
.nav-links li a.active i {
    color: var(--accent);
    filter: drop-shadow(0 0 3px var(--accent));
}

.badge {
    background: var(--primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: auto;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
}

#logout-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

#logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    padding: 1.5rem 2rem;
    background: rgba(18, 21, 27, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
    z-index: 5;
    position: relative;
}

.topbar h2 {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 400;
}

.datetime {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.2rem;
}

.views-container {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

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

/* Cards & Layout */
.card {
    background: rgba(18, 21, 27, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(74, 92, 67, 0.1);
    border-color: rgba(74, 92, 67, 0.4);
    border-left-color: var(--accent);
}

.card:hover::before {
    transform: translateX(100%);
}

.card h3 {
    margin-bottom: 1.5rem;
    color: var(--accent);
    font-family: var(--font-mono);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.pointage-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-card {
    display: flex;
    flex-direction: column;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex-grow: 1;
}

.stat-box {
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.online-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    color: var(--success);
    font-weight: 600;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.offline {
    background: var(--text-muted);
    box-shadow: 0 0 10px rgba(148, 163, 184, 0.5);
}

.dot.online {
    background: var(--success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: dotPulse 2s infinite;
}

@keyframes dotPulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.data-table tbody tr {
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.005);
}

.badge-warning {
    background: #eab308;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}
.badge-danger {
    background: var(--danger);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Forms in Admin */
.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
    flex: 1;
}

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

.form-group input[type="text"], 
.form-group input[type="email"], 
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    color-scheme: dark; /* Force native date/time pickers to use dark mode */
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    cursor: pointer;
}

.form-group select option, .form-group select optgroup {
    background: var(--bg-panel);
    color: var(--text-main);
    padding: 10px;
    font-size: 1rem;
}

.form-group select optgroup {
    color: var(--accent);
    font-weight: 800;
    font-family: var(--font-mono);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(0,0,0,0.6);
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Messages System (Gmail Style) */
.messages-layout {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 180px);
}

.messages-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nav-folders {
    list-style: none;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.nav-folders li a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}
.nav-folders li a i {
    width: 24px;
    color: var(--text-muted);
}
.nav-folders li a:hover {
    background: rgba(255,255,255,0.05);
}
.nav-folders li a.active {
    background: rgba(74, 92, 67, 0.1);
    border-left-color: var(--primary);
    font-weight: 600;
}

.mail-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.message-content {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.gmail-list {
    display: flex;
    flex-direction: column;
}

/* =======================================
   STYLISH TECH EFFECTS
   ======================================= */
.glitch {
    position: relative;
    display: inline-block;
    color: var(--accent);
}
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: transparent;
    opacity: 0.8;
}
.glitch::before {
    left: 2px;
    text-shadow: -1px 0 rgba(255,0,0,0.7);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px;
    text-shadow: -1px 0 rgba(0,255,255,0.7);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(15px, 9999px, 44px, 0); transform: skew(0.2deg); }
    10% { clip: rect(55px, 9999px, 88px, 0); transform: skew(0.1deg); }
    20% { clip: rect(10px, 9999px, 20px, 0); transform: skew(0.5deg); }
    30% { clip: rect(35px, 9999px, 60px, 0); transform: skew(0.1deg); }
    40% { clip: rect(80px, 9999px, 95px, 0); transform: skew(0.3deg); }
    100% { clip: rect(20px, 9999px, 30px, 0); transform: skew(0); }
}

.tech-img-container {
    position: relative;
    display: inline-block;
    padding: 8px;
    margin-bottom: 1rem;
}

.tech-img-container::before, .tech-img-container::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border: 2px solid var(--accent);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.tech-img-container::before {
    top: 0; left: 0;
    border-right: none;
    border-bottom: none;
}

.tech-img-container::after {
    bottom: 0; right: 0;
    border-left: none;
    border-top: none;
}

.tech-img-container:hover::before, .tech-img-container:hover::after {
    width: 100%;
    height: 100%;
    opacity: 0.3;
    border-color: var(--primary-light);
}

.tech-img-container img {
    display: block;
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    filter: sepia(0.3) hue-rotate(-10deg) saturate(1.2);
    transition: filter 0.3s;
}

.tech-img-container:hover img {
    filter: sepia(0) hue-rotate(0) saturate(1);
}

.mail-row {
    display: grid;
    grid-template-columns: 200px 1fr 100px;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    align-items: center;
    transition: background 0.2s;
}

.mail-row:hover {
    background: var(--bg-panel-hover);
    box-shadow: inset 3px 0 0 var(--border);
}

.mail-row.unread {
    background: rgba(255,255,255,0.02);
    box-shadow: inset 3px 0 0 var(--primary);
}
.mail-row.unread .mail-sender, .mail-row.unread .mail-subject {
    font-weight: 800;
    color: #fff;
}

.mail-sender {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.mail-content-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-subject {
    color: var(--text-main);
    margin-right: 0.5rem;
}

.mail-snippet {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.mail-date {
    text-align: right;
    color: var(--text-muted);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Mail Reader */
.msg-reader-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.msg-reader-subject {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.sender-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.msg-reader-body {
    line-height: 1.6;
    white-space: pre-wrap;
}

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

/* Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-panel);
    border-left: 4px solid var(--primary);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease forwards;
}

.toast.error {
    border-left-color: var(--danger);
}

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

/* MODAL */
.modal {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

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

/* =======================================
   GLITCH EFFECT
   ======================================= */
.glitch {
    position: relative;
    display: inline-block;
}
.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}
.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--primary-light);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 3s infinite linear alternate-reverse;
}
.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--accent), 2px 2px var(--primary-light);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 4s infinite linear alternate-reverse;
}
@keyframes glitch-anim {
    0% { clip: rect(21px, 9999px, 96px, 0); }
    10% { clip: rect(81px, 9999px, 98px, 0); }
    20% { clip: rect(42px, 9999px, 60px, 0); }
    30% { clip: rect(88px, 9999px, 12px, 0); }
    40% { clip: rect(66px, 9999px, 39px, 0); }
    50% { clip: rect(11px, 9999px, 96px, 0); }
    60% { clip: rect(83px, 9999px, 43px, 0); }
    70% { clip: rect(29px, 9999px, 12px, 0); }
    80% { clip: rect(35px, 9999px, 54px, 0); }
    90% { clip: rect(98px, 9999px, 92px, 0); }
    100% { clip: rect(63px, 9999px, 76px, 0); }
}
@keyframes glitch-anim2 {
    0% { clip: rect(52px, 9999px, 79px, 0); }
    10% { clip: rect(48px, 9999px, 63px, 0); }
    20% { clip: rect(27px, 9999px, 39px, 0); }
    30% { clip: rect(99px, 9999px, 96px, 0); }
    40% { clip: rect(54px, 9999px, 18px, 0); }
    50% { clip: rect(61px, 9999px, 74px, 0); }
    60% { clip: rect(15px, 9999px, 36px, 0); }
    70% { clip: rect(24px, 9999px, 19px, 0); }
    80% { clip: rect(69px, 9999px, 47px, 0); }
    90% { clip: rect(96px, 9999px, 25px, 0); }
    100% { clip: rect(89px, 9999px, 14px, 0); }
}

/* Mission Report Styles */
.mission-team-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}
.mission-team-row select {
    flex-grow: 1;
}
.mission-team-row .btn-remove {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 0.85rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}
.mission-team-row .btn-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

.mission-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.mission-section h4 {
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}
.mission-field {
    margin-bottom: 0.5rem;
}
.mission-field strong {
    color: var(--accent);
}

/* =======================================
   ORGANIZATIONAL TREE
   ======================================= */
.org-tree-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    gap: 4rem; /* Spacing between ranks */
    cursor: grab;
    max-height: 70vh;
}

.org-tree-container.dragging {
    cursor: grabbing;
    user-select: none;
}

.org-tree-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.org-tree-container::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}
.org-tree-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

/* Central spine connecting all levels */
.org-tree-container::before {
    content: '';
    position: absolute;
    top: 3rem;
    bottom: 5rem;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background-color: var(--primary);
    z-index: 0;
    box-shadow: 0 0 8px var(--primary-glow);
}

.org-level {
    display: flex;
    justify-content: center;
    gap: 2rem;
    position: relative;
    padding-top: 2.5rem;
    width: max-content;
    z-index: 1;
}

.org-level-title {
    position: absolute;
    top: -0.8rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 5px 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 20px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 10px rgba(255,255,255,0.1);
    border: 1px solid var(--primary-light);
    white-space: nowrap;
}

/* Horizontal connector for the level */
.org-level::after {
    content: '';
    position: absolute;
    top: 0;
    left: calc(50% - (var(--level-width) / 2));
    width: var(--level-width);
    height: 2px;
    background-color: var(--primary);
    z-index: 1;
    box-shadow: 0 0 5px var(--primary-glow);
}

.org-node {
    background: linear-gradient(145deg, rgba(18, 21, 27, 0.9), rgba(10, 12, 16, 0.9));
    border: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    border-radius: 10px;
    min-width: 180px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

.org-node:hover {
    border-color: var(--accent);
    box-shadow: 0 15px 30px rgba(0,0,0,0.6), inset 0 0 15px rgba(212, 163, 115, 0.1);
    transform: translateY(-5px);
}

/* Vertical connector from node up to horizontal line */
.org-node::before {
    content: '';
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2.5rem;
    background-color: var(--primary);
    z-index: -1;
}

.org-node-rank {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: bold;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.org-node-name {
    font-size: 1.15rem;
    color: var(--text-main);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.org-node-fonction {
    font-size: 0.8rem;
    color: var(--accent);
    margin-top: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}
