/* ============================================================
   ASYPECI — Dashboard Styles
   Charte : Bleu #0089D1 / Orange #ff8d02
   ============================================================ */

/* ---------- Reset & Base ---------- */
:root {
    --primary: #0089D1;
    --primary-dark: #005ba9;
    --primary-light: #e8f4fd;
    --accent: #ff8d02;
    --accent-light: #fff3e0;
    --success: #00c853;
    --danger: #e53935;
    --warning: #ffb300;
    --info: #00bcd4;
    --sidebar-bg: #0a1628;
    --sidebar-hover: #132240;
    --sidebar-active: #0089D1;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --body-bg: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --shadow: 0 4px 15px rgba(0,0,0,.08);
    --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
    --transition: .25s cubic-bezier(.4,0,.2,1);
}

* { box-sizing: border-box; }

body.dashboard-body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    background: var(--body-bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

a { text-decoration: none; color: var(--primary); }
a:hover { color: var(--primary-dark); }

/* ---------- Layout ---------- */
.dash-wrapper {
    display: flex;
    min-height: 100vh;
}

.dash-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition);
    display: flex;
    flex-direction: column;
}

.dash-content {
    flex: 1;
    padding: 24px;
}

/* ---------- Sidebar ---------- */
.dash-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--header-height);
}

.sidebar-brand img {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-text h5 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
}

.sidebar-brand-text small {
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 10px; }

.nav-label {
    display: block;
    padding: 20px 20px 8px;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.nav-item {
    list-style: none;
    margin: 2px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: rgba(255,255,255,.65);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition);
    position: relative;
}

.nav-link:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: 0 4px 12px rgba(0,137,209,.35);
}

.nav-link .icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.nav-link .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 10px;
    font-weight: 600;
}

/* Sub-menu */
.nav-sub {
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}

.nav-item.open > .nav-sub {
    max-height: 500px;
}

.nav-sub .nav-link {
    padding: 8px 12px;
    font-size: 13px;
}

.nav-sub .nav-link::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.3);
    flex-shrink: 0;
}

.nav-sub .nav-link.active::before,
.nav-sub .nav-link:hover::before {
    background: var(--accent);
}

.nav-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform .25s;
}

.nav-item.open > .nav-link .nav-arrow {
    transform: rotate(90deg);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.5);
    font-size: 13px;
    padding: 8px 4px;
    transition: color var(--transition);
}

.sidebar-footer a:hover { color: var(--danger); }

/* ---------- Header ---------- */
.dash-header {
    height: var(--header-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: var(--shadow-sm);
}

.header-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px;
}

.header-search {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.header-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 13px;
    background: var(--body-bg);
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,137,209,.15);
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.header-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: var(--body-bg);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.header-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.header-btn .notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: 50px;
    cursor: pointer;
    transition: background var(--transition);
}

.header-user:hover { background: var(--body-bg); }

.header-user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.header-user-info { display: block; }

.header-user-info .name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-user-info .role {
    font-size: 11px;
    color: var(--text-muted);
}

/* ---------- Page Title ---------- */
.page-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
}

.page-title-box h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.breadcrumb {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 6px;
    font-size: 13px;
}

.breadcrumb li + li::before {
    content: '/';
    color: var(--text-muted);
    margin-right: 6px;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb .active { color: var(--primary); font-weight: 600; }

/* ---------- Stat Cards ---------- */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.blue::before { background: var(--primary); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.green::before { background: var(--success); }
.stat-card.red::before { background: var(--danger); }
.stat-card.purple::before { background: #7c3aed; }

.stat-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-info p {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.stat-info h3 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-info .trend {
    font-size: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-info .trend.up { color: var(--success); }
.stat-info .trend.down { color: var(--danger); }

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.orange { background: var(--accent-light); color: var(--accent); }
.stat-icon.green { background: #e8f5e9; color: var(--success); }
.stat-icon.red { background: #ffebee; color: var(--danger); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }

/* ---------- Cards ---------- */
.dash-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.dash-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.dash-card-header h6 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-card-body {
    padding: 20px;
}

.dash-card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: #fafbfc;
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- Tables ---------- */
.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dash-table thead th {
    background: var(--body-bg);
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.dash-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}

.dash-table tbody tr:last-child td { border-bottom: none; }

.dash-table tbody tr:hover {
    background: var(--primary-light);
}

.dash-table .user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-table .user-cell img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.dash-table .user-cell .user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dash-table .user-cell .user-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Badges ---------- */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.badge-status.pending { background: #fff3e0; color: #e65100; }
.badge-status.pending::before { background: #e65100; }

.badge-status.validated { background: #e8f5e9; color: #2e7d32; }
.badge-status.validated::before { background: #2e7d32; }

.badge-status.rejected { background: #ffebee; color: #c62828; }
.badge-status.rejected::before { background: #c62828; }

.badge-status.active { background: #e8f5e9; color: #2e7d32; }
.badge-status.active::before { background: #2e7d32; }

.badge-status.open { background: var(--primary-light); color: var(--primary); }
.badge-status.open::before { background: var(--primary); }

.badge-status.closed { background: #f5f5f5; color: #616161; }
.badge-status.closed::before { background: #616161; }

/* ---------- Buttons ---------- */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-custom:hover {
    background: var(--primary-dark);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,137,209,.3);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-accent:hover {
    background: #e67e00;
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 7px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: #fff;
}

.btn-sm-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
}

.btn-sm-action.view { background: var(--primary-light); color: var(--primary); }
.btn-sm-action.view:hover { background: var(--primary); color: #fff; }

.btn-sm-action.edit { background: var(--accent-light); color: var(--accent); }
.btn-sm-action.edit:hover { background: var(--accent); color: #fff; }

.btn-sm-action.delete { background: #ffebee; color: var(--danger); }
.btn-sm-action.delete:hover { background: var(--danger); color: #fff; }

/* ---------- Welcome Banner ---------- */
.welcome-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius);
    padding: 28px 32px;
    color: #fff;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
}

.welcome-banner::before {
    content: '';
    position: absolute;
    right: 40px;
    bottom: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,.05);
}

.welcome-banner h3 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.welcome-banner p {
    margin: 0;
    opacity: .85;
    font-size: 14px;
}

.welcome-banner .date {
    margin-top: 12px;
    font-size: 13px;
    opacity: .7;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Activity Feed ---------- */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.activity-dot.blue { background: var(--primary); }
.activity-dot.green { background: var(--success); }
.activity-dot.orange { background: var(--accent); }
.activity-dot.red { background: var(--danger); }

.activity-text h6 {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
}

.activity-text p {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h6 {
    margin: 0 0 6px;
    font-weight: 600;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* ---------- Footer ---------- */
.dash-footer {
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    background: var(--card-bg);
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.anim-fade-in {
    animation: fadeInUp .4s ease forwards;
}

.anim-delay-1 { animation-delay: .05s; }
.anim-delay-2 { animation-delay: .1s; }
.anim-delay-3 { animation-delay: .15s; }
.anim-delay-4 { animation-delay: .2s; }

/* ---------- Profile Card ---------- */
.profile-card {
    text-align: center;
    padding: 30px 20px;
}

.profile-card img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    margin-bottom: 16px;
}

.profile-card h5 {
    margin: 0 0 4px;
    font-weight: 700;
}

.profile-card .role-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
}

.profile-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.profile-info-list li:last-child { border-bottom: none; }

.profile-info-list .label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* ---------- Form Styles ---------- */
.form-label-custom {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control-custom {
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    transition: all var(--transition);
}

.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,137,209,.12);
    outline: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
    .dash-sidebar {
        transform: translateX(-100%);
    }

    .dash-sidebar.show {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .dash-main {
        margin-left: 0;
    }

    .header-toggle {
        display: flex;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.45);
        z-index: 1035;
        display: none;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 767.98px) {
    .dash-content {
        padding: 16px;
    }

    .dash-header {
        padding: 0 16px;
    }

    .header-search {
        display: none;
    }

    .header-user-info {
        display: none;
    }

    .stat-info h3 {
        font-size: 22px;
    }

    .welcome-banner {
        padding: 20px;
    }

    .welcome-banner h3 {
        font-size: 18px;
    }

    .page-title-box {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}
