:root {
    --primary-color: #0D9488;
    --primary-hover: #0F766E;
    --bg-light: #F9FAFB;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --sidebar-width: 240px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-light);
    overflow-x: hidden;
}

.flex { display: flex; }
.h-screen { height: 100vh; }

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background-color: #fff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: fixed;
    z-index: 100;
    transition: transform 0.3s ease;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-top {
    padding: 1.5rem;
}

.sidebar-brand {
    display: flex;
    align-items: center; gap: 0.75rem; margin-bottom: 2rem;
}

.brand-text {
    font-weight: 600; color: var(--primary-color); font-size: 1.25rem;
}

.sidebar-nav {
    display: flex; flex-direction: column; gap: 0.25rem;
}

.sidebar-link {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem;
    color: #374151; text-decoration: none; border-radius: 0.5rem; font-size: 0.875rem;
    font-weight: 500; transition: all 0.2s;
}

.sidebar-link:hover { background-color: #F3F4F6; }
.sidebar-link.active { background-color: #F0FDFA; color: var(--primary-color); }

.sidebar-divider { height: 1px; background-color: var(--border-color); margin: 1.5rem 0; }
.sidebar-bottom { padding: 1.5rem; border-top: 1px solid var(--border-color); }
.sidebar-link.logout { color: #EF4444; }

/* Main Content Layout */
.main-content {
    flex: 1; margin-left: var(--sidebar-width); min-height: 100vh;
    display: flex; flex-direction: column; width: calc(100% - var(--sidebar-width));
}

.top-header {
    height: 82px; /* Augmenté de 70px à 82px (+12px) */
    padding: 1.5rem; display: flex; justify-content: space-between;
    align-items: center; background-color: #fff; border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 40;
}

.menu-toggle { display: none; background: none; border: none; padding: 0.5rem; cursor: pointer; color: #374151; }

.header-left .email { font-size: 0.75rem; color: var(--text-muted); }
.header-left .location { font-weight: 600; font-size: 0.875rem; color: #111827; }
.content-wrapper { padding: 1.5rem; flex: 1; }

/* Dashboard Cards */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem; margin-bottom: 2rem;
}

.stat-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 0.75rem;
    padding: 1.25rem; display: flex; align-items: center; gap: 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.stat-icon {
    width: 44px; height: 44px; border-radius: 0.5rem; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}

.bg-green-light { background-color: #DCFCE7; color: #166534; }
.bg-orange-light { background-color: #FFEDD5; color: #9A3412; }
.bg-teal-light { background-color: #F0FDFA; color: #0D9488; }

.stat-info .stat-value { font-size: 1.25rem; font-weight: 700; color: #111827; margin: 0; }
.stat-info .stat-label { font-size: 0.75rem; color: var(--text-muted); margin: 0; }

/* Tables */
.card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); overflow: hidden;
}

.table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.main-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.main-table th {
    background-color: #F9FAFB; padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem;
    color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}
.main-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); font-size: 0.875rem; color: #374151; }
.main-table tr:last-child td { border-bottom: none; }

/* Filters bar */
.filters-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.search-wrapper { position: relative; flex: 1; min-width: 200px; }

/* Candidate Profile Styles */
.candidate-profile { max-width: 1000px; margin: 0 auto; }
.profile-header {
    background: white; padding: 2rem; border-radius: 1rem; display: flex;
    justify-content: space-between; align-items: center; margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); border-left: 4px solid var(--primary-color);
}
.profile-info h1 { font-size: 1.75rem; font-weight: 700; color: #111827; margin: 0; }
.profile-status { padding: 0.5rem 1rem; border-radius: 2rem; font-size: 0.875rem; font-weight: 600; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 1.5rem; }
.info-card { background: white; padding: 1.5rem; border-radius: 1rem; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.info-card h3 {
    font-size: 1.1rem; font-weight: 600; color: var(--primary-color); margin-bottom: 1.5rem;
    padding-bottom: 0.75rem; border-bottom: 1px solid #F3F4F6; display: flex; align-items: center; gap: 0.5rem;
}

.data-row { display: flex; margin-bottom: 1rem; font-size: 0.95rem; }
.data-label { width: 180px; color: #6B7280; font-weight: 500; }
.data-value { flex: 1; color: #111827; font-weight: 600; }

.action-bar {
    margin-top: 2rem; padding: 1.5rem; background: white; border-radius: 1rem;
    display: flex; justify-content: space-between; align-items: center; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.btn-action {
    padding: 0.75rem 1.5rem; border-radius: 0.5rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; border: none;
}
.btn-back { background: #F3F4F6; color: #374151; }
.btn-approve { background: var(--primary-color); color: white; }
.btn-reject { background: white; color: #DC2626; border: 1px solid #FEE2E2; }
.btn-reject:hover { background: #FEF2F2; }

/* Modal Styles */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
    z-index: 1000; backdrop-filter: blur(4px); align-items: center; justify-content: center;
}
.modal-card { background: white; width: 100%; max-width: 500px; padding: 2rem; border-radius: 1.25rem; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.modal-title { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 1rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 1rem; margin-top: 2rem; }
.observation-textarea {
    width: 100%; min-height: 120px; padding: 1rem; border: 1px solid #E5E7EB; border-radius: 0.75rem;
    background: #F9FAFB; font-family: inherit; resize: none; margin-top: 0.5rem;
}
.observation-textarea:focus { outline: none; border-color: var(--primary-color); background: white; }

/* Document Preview Styles */
.docs-section { margin-top: 2rem; grid-column: 1 / -1; }
.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.doc-card {
    background: white; border: 1px solid var(--border-color); border-radius: 0.75rem;
    padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
    transition: all 0.2s; text-decoration: none; color: inherit;
}
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); border-color: var(--primary-color); }
.doc-icon { color: var(--primary-color); }
.doc-name { font-size: 0.8rem; font-weight: 600; text-align: center; color: #374151; word-break: break-all; }
.doc-preview-img { width: 100%; height: 120px; object-fit: cover; border-radius: 0.5rem; margin-bottom: 0.5rem; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    :root { --sidebar-width: 0px; }
    .sidebar { transform: translateX(-100%); width: 240px; }
    .sidebar.open { transform: translateX(0); }
    .sidebar.open + .sidebar-overlay { display: block; }
    .main-content { margin-left: 0; width: 100%; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

@media (max-width: 640px) {
    .top-header { height: 82px; padding: 0 1rem; } /* Hauteur augmentée appliquée aussi au mobile */
    .header-left .email { display: none; }
    .content-wrapper { padding: 1rem; }
    .page-header { flex-direction: column; gap: 1rem; align-items: flex-start !important; }
    .filters-bar { flex-direction: column; }
    .search-wrapper { width: 100%; max-width: none; }
}
