/* assets/css/main.css */

:root {
    --color-bg-main: #0F0F1C;
    --color-bg-card: rgba(22, 22, 40, 0.95);
    --color-bg-card-soft: rgba(35, 35, 60, 0.85);
    --color-primary: #8247E5;   /* Violet Polygon */
    --color-secondary: #4C7FF5; /* Bleu électrique */
    --color-accent: #E95BFF;    /* Rose violet */
    --color-text-main: #FFFFFF;
    --color-text-muted: #B3B3C2;
    --color-danger: #FF4C6A;
    --color-success: #29DCA8;
    --color-warning: #FFC857;
    --shadow-soft: 0 14px 35px rgba(0, 0, 0, 0.5);
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    --transition-fast: 0.18s ease-out;
    --transition-normal: 0.25s ease;
    --navbar-height: 70px;
    --sidebar-width: 250px;
    --font-main: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset simple */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top left, #1a1030 0, #0F0F1C 45%, #05040A 100%);
    color: var(--color-text-main);
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

/* Scrollbar custom */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #060612;
}
::-webkit-scrollbar-thumb {
    background: #2d2d4c;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #42426d;
}

/* Containers généraux */

.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout global après connexion (header + sidebar + contenu) */

.layout {
    display: flex;
    min-height: 100vh;
}

.layout__sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, rgba(18, 10, 35, 0.98), rgba(9, 7, 26, 0.98));
    border-right: 1px solid rgba(130, 71, 229, 0.35);
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.7);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
}

.layout__sidebar--hidden {
    transform: translateX(-100%);
}

.layout__content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header (navbar) */

.app-header {
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    backdrop-filter: blur(20px);
    background: linear-gradient(90deg, rgba(12, 10, 30, 0.95), rgba(12, 10, 30, 0.85));
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 40;
}

.app-header__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-header__logo img {
    width: 32px;
    height: 32px;
}

.app-header__brand-title {
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.app-header__brand-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.app-header__right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header__icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: radial-gradient(circle at top left, rgba(130, 71, 229, 0.3), rgba(18, 10, 35, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.app-header__icon-btn:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    background: radial-gradient(circle at top left, rgba(130, 71, 229, 0.5), rgba(18, 10, 35, 0.9));
}

.app-header__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.app-header__user:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(130, 71, 229, 0.5);
    transform: translateY(-1px);
}

.app-header__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
}

.app-header__user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-header__user-meta {
    display: flex;
    flex-direction: column;
}

.app-header__user-name {
    font-size: 0.85rem;
    font-weight: 500;
}

.app-header__user-role {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Bouton de logout dans le header (option pour mobile) */
.app-header__logout {
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, #8247E5, #4C7FF5);
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: 0 12px 30px rgba(130, 71, 229, 0.4);
    border: none;
    color: #ffffff;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.app-header__logout:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 18px 40px rgba(76, 127, 245, 0.6);
}

/* Bouton burger (mobile) */
.app-header__burger {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(11, 9, 26, 0.95);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.app-header__burger span,
.app-header__burger span::before,
.app-header__burger span::after {
    position: relative;
    width: 18px;
    height: 2px;
    background: #ffffff;
    border-radius: 999px;
    display: block;
    content: '';
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-header__burger span::before {
    position: absolute;
    top: -5px;
}
app-header__burger span::after {
    position: absolute;
    top: 5px;
}

/* Sidebar (menu vertical Dashboard) */

.sidebar {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar__top {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.sidebar__logo img {
    width: 36px;
}

.sidebar__title {
    font-size: 1rem;
    font-weight: 600;
}

.sidebar__section {
    margin-top: 14px;
}

.sidebar__section-title {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(179, 179, 194, 0.7);
    margin-bottom: 6px;
    padding: 0 6px;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.sidebar__link:hover {
    background: radial-gradient(circle at left, rgba(130, 71, 229, 0.5), transparent);
    color: #ffffff;
    transform: translateX(3px);
    box-shadow: 6px 0 18px rgba(130, 71, 229, 0.4);
}

.sidebar__link-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    flex-shrink: 0;
}

.sidebar__link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar__link-label {
    flex: 1;
}

.sidebar__link-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(76, 127, 245, 0.2);
    color: #cfd9ff;
}

.sidebar__link--active {
    background: linear-gradient(90deg, rgba(130, 71, 229, 0.9), rgba(76, 127, 245, 0.9));
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(130, 71, 229, 0.6);
}

.sidebar__link--active .sidebar__link-badge {
    background: rgba(15, 15, 28, 0.95);
}

.sidebar__bottom {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Contenu principal */

.page-wrapper {
    flex: 1;
    padding: 18px 24px 32px;
}

.page-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 18px;
}

.page-title__main {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.page-title__subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(90deg, #8247E5, #4C7FF5);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(130, 71, 229, 0.5);
}

.btn--primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 16px 40px rgba(76, 127, 245, 0.7);
}

.btn--secondary {
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn--secondary:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-radius: 999px;
}

.btn--danger {
    background: linear-gradient(90deg, #FF4C6A, #FF7A8C);
    color: #ffffff;
}

/* Cards */

.card {
    background: var(--color-bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    inset: -60%;
    background: radial-gradient(circle at top left, rgba(130, 71, 229, 0.12), transparent 55%);
    opacity: 0.7;
    pointer-events: none;
}

.card__header,
.card__body,
.card__footer {
    position: relative;
    z-index: 1;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card__title {
    font-size: 0.9rem;
    font-weight: 500;
}

.card__subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.card--highlight {
    background: linear-gradient(135deg, rgba(130, 71, 229, 0.85), rgba(76, 127, 245, 0.9));
    box-shadow: 0 14px 40px rgba(76, 127, 245, 0.9);
}

.card--highlight::before {
    display: none;
}

/* Grilles 12 colonnes (simple) */

.grid {
    display: grid;
    gap: 16px;
}

.grid--2cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Text helpers */

.text-muted {
    color: var(--color-text-muted);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

/* Badges */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
}

.badge--success {
    background: rgba(41, 220, 168, 0.16);
    color: var(--color-success);
}

.badge--warning {
    background: rgba(255, 200, 87, 0.16);
    color: var(--color-warning);
}

.badge--danger {
    background: rgba(255, 76, 106, 0.16);
    color: var(--color-danger);
}
