@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Poppins:wght@300;400;600;700&display=swap');

:root {
    --color-primary: #8FC4D7;    /* Bleu ciel */
    --color-accent: #022D8C;     /* Bleu profond */
    --color-print: var(--color-primary);
    --color-text: #2A2B29;       /* Graphite */
    --color-bg: #FFFFFF;         /* Fond Blanc */
    --color-white: #FFFFFF;
    
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Lato', sans-serif;
    
    --shadow-soft: 0 10px 25px rgba(0,0,0,0.05);
    --shadow-hover: 0 15px 35px rgba(0,0,0,0.1);
    --radius-main: 15px;
    --radius-btn: 50px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

body.oreus-modal-open .main-content {
    overflow: hidden !important;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-accent);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

svg.lucide {
    display: inline-block;
    flex: 0 0 auto;
    vertical-align: -0.125em;
}

a svg.lucide,
button svg.lucide,
label svg.lucide {
    pointer-events: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    white-space: nowrap;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--color-white);
    color: var(--color-text);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0,0,0,0.03);
    z-index: 10;
    max-width: 100%;
    overflow: visible;
    position: relative;
    transition: width 0.22s ease, padding 0.22s ease;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -10px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(42, 43, 41, 0.14);
    background: rgba(255,255,255,0.96);
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text);
    transform: translateY(-50%);
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
    background: rgba(2, 45, 140, 0.06);
    transform: translateY(-50%) translateY(-1px);
}

.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

body.oreus-sidebar-collapsed .sidebar {
    width: 84px;
    padding: 20px 10px;
}

body.oreus-sidebar-collapsed .sidebar nav ul li a {
    justify-content: center;
    padding: 12px;
    gap: 0;
    font-size: 0;
}

body.oreus-sidebar-collapsed .sidebar nav ul li a svg {
    width: 22px;
    height: 22px;
}

body.oreus-sidebar-collapsed .sidebar nav ul li {
    margin-bottom: 10px;
}

body.oreus-sidebar-collapsed .sidebar .sidebar-logo {
    margin-bottom: 14px !important;
}

body.oreus-sidebar-collapsed .sidebar .sidebar-logo img {
    max-width: 44px !important;
}

body.oreus-sidebar-collapsed .sidebar-footer-profile {
    justify-content: center;
}

body.oreus-sidebar-collapsed .sidebar-footer-text {
    display: none !important;
}

body.oreus-sidebar-collapsed .sidebar-footer-avatar {
    width: 48px !important;
    height: 48px !important;
    border-radius: 14px !important;
}

.sidebar h2 {
    margin-bottom: 40px;
    font-size: 24px;
    text-align: center;
    justify-content: center;
    color: var(--color-accent);
    border-bottom: none;
    letter-spacing: 1px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin-bottom: 12px;
}

.sidebar nav ul li a {
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-radius: var(--radius-btn);
    font-weight: 500;
    transition: all 0.3s ease;
    font-family: var(--font-heading);
    font-size: 15px;
}

.sidebar nav ul li a:hover {
    background-color: var(--color-bg);
    color: var(--color-accent);
}

.sidebar nav ul li a[href*="logout.php"] {
    color: #e74c3c !important;
}

.sidebar nav ul li a[href*="logout.php"]:hover {
    background: rgba(231, 76, 60, 0.12) !important;
    color: #c0392b !important;
}

.sidebar nav ul li a.active {
    background-color: var(--color-accent);
    color: var(--color-white);
    box-shadow: 0 4px 10px rgba(2, 45, 140, 0.3);
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    margin-bottom: 22px;
    border-radius: 14px;
    border: 1px solid rgba(42, 43, 41, 0.12);
    background: rgba(143, 196, 215, 0.10);
}

.sidebar-profile .avatar {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 45, 140, 0.12);
    color: var(--color-accent);
    font-weight: 800;
    font-family: var(--font-heading);
    flex: 0 0 auto;
}

.sidebar-profile .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-profile .profile-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-profile .profile-name {
    font-weight: 800;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
    font-family: var(--font-heading);
}

.sidebar-footer-profile {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 2px 0;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-footer-avatar {
    width: 66px;
    height: 66px;
    border-radius: 18px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(143, 196, 215, 0.28);
    color: var(--color-text);
    font-weight: 800;
    flex: 0 0 auto;
}

.sidebar-footer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sidebar-footer-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    max-width: 100%;
    overflow: hidden;
}

.sidebar-footer-name {
    font-weight: 800;
    color: var(--color-text);
    font-family: var(--font-heading);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-footer-email {
    color: rgba(42, 43, 41, 0.75);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.sidebar-footer-meta {
    color: rgba(42, 43, 41, 0.55);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.oreus-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 40px 50px;
    overflow-y: auto;
    background-color: var(--color-bg);
    min-width: 0;
}

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

header h1 {
    font-size: 32px;
    color: var(--color-accent);
}

/* Buttons */
.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 15px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(2, 45, 140, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(2, 45, 140, 0.3);
    background-color: var(--color-accent);
}

.btn-secondary {
    background-color: var(--color-primary);
    color: var(--color-text);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font-heading);
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--color-primary);
    transform: translateY(-2px);
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 13px;
    transition: background 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Grid & Cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--color-white);
    padding: 30px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(143, 196, 215, 0.3);
}

.project-card h3 {
    margin-bottom: 15px;
    color: var(--color-accent);
    font-size: 20px;
}

.project-meta {
    color: rgba(42, 43, 41, 0.72);
    font-size: 0.95em;
    margin-top: auto;
    margin-bottom: 20px;
    line-height: 1.6;
}

.project-meta p {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tables */
.users-table, table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 25px;
    background: var(--color-white);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-main);
    overflow: visible;
}

th, td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid rgba(42, 43, 41, 0.10);
}

th {
    background-color: rgb(235, 244, 248);
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td {
    border-bottom: none;
}

table tr {
    background-color: var(--color-white);
}

table th:first-child,
table td:first-child {
    position: -webkit-sticky;
    position: sticky;
    left: 0;
    box-shadow: 2px 0 0 rgba(42, 43, 41, 0.10);
    background-clip: padding-box;
    overflow: hidden;
}

table td:first-child {
    z-index: 2;
    background-color: var(--color-white) !important;
}

table thead th:first-child {
    z-index: 5;
    background-color: rgb(235, 244, 248) !important;
}

table tbody tr:hover td:first-child {
    background-color: rgb(242, 248, 250) !important;
}

tr:hover {
    background-color: rgb(242, 248, 250);
}

/* Forms */
.filter-bar {
    background: var(--color-white);
    padding: 20px 30px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-bar label {
    font-weight: 600;
    color: var(--color-accent);
    font-family: var(--font-heading);
}

select, input[type="text"], input[type="email"], input[type="password"], input[type="number"], .form-control {
    padding: 10px 15px;
    border: 1px solid rgba(42, 43, 41, 0.18);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    background-color: #fff;
    transition: border-color 0.3s;
    min-width: 150px;
}

select:focus, input:focus, .form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(143, 196, 215, 0.2);
}

/* Empty State */
.empty-state {
    text-align: center;
    color: rgba(42, 43, 41, 0.62);
    padding: 60px;
    border: 2px dashed rgba(42, 43, 41, 0.25);
    border-radius: var(--radius-main);
    background-color: rgba(255,255,255,0.5);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: var(--radius-btn);
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

/* Hub */
.hub-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    gap: 40px;
}

.hub-card {
    background: var(--color-white);
    padding: 50px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    width: 320px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hub-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: var(--color-primary);
}

.hub-icon {
    font-size: 5em;
    margin-bottom: 25px;
    color: var(--color-primary);
}

.hub-title {
    font-size: 1.8em;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--color-accent);
}

.hub-desc {
    color: rgba(42, 43, 41, 0.68);
    font-size: 1em;
    line-height: 1.5;
}

/* Utilities */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kpi-card {
    background: var(--color-white);
    padding: 20px;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    text-align: center;
    border: 1px solid rgba(0,0,0,0.02);
}

.kpi-card h4 {
    font-size: 14px;
    color: rgba(42, 43, 41, 0.72);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-heading);
}

.kpi-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-accent);
    font-family: var(--font-heading);
}

.kpi-card .desc {
    font-size: 12px;
    color: rgba(42, 43, 41, 0.55);
    margin-top: 5px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(143, 196, 215, 0.18);
}
 
::-webkit-scrollbar-thumb {
    background: rgba(42, 43, 41, 0.25);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(42, 43, 41, 0.35);
}

.oreus-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.oreus-modal.is-open {
    display: block;
}

.oreus-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.oreus-modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(1100px, calc(100vw - 32px));
    height: min(92vh, 860px);
    background: var(--color-white);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(42, 43, 41, 0.10);
}

.oreus-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(42, 43, 41, 0.12);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: rgba(42, 43, 41, 0.78);
    z-index: 2;
}

.oreus-modal-close:hover {
    background: rgba(255, 255, 255, 1);
}

.oreus-popup-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(42, 43, 41, 0.12);
    background: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    color: rgba(42, 43, 41, 0.78);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
    z-index: 9999;
}

.oreus-popup-close:hover {
    background: rgba(255, 255, 255, 1);
}

.oreus-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: var(--color-white);
}

body.oreus-modal-open {
    overflow: hidden !important;
}
