/* ============================================
   CRM WiFi - Dashboard Styles
   Couleurs : #0068b9, #0f253a, #2d2c2c, #8f9192
   ============================================ */

:root {
    --color-primary:   #0068b9;
    --color-dark:      #0f253a;
    --color-text:      #2d2c2c;
    --color-muted:     #8f9192;
    --color-bg:        #f4f6f9;
    --color-white:     #ffffff;
    --color-sidebar:   #0f253a;
    --color-sidebar-hover: rgba(0, 104, 185, 0.15);
    --color-border:    #e2e5e8;
    --sidebar-width:   260px;
    --sidebar-collapsed: 70px;
    --header-height:   60px;
    --footer-height:   45px;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* ============================================
   SIDEBAR
   ============================================ */

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--color-sidebar);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1040;
    transition: width 0.25s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand a {
    color: var(--color-white);
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    white-space: nowrap;
    overflow: hidden;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon i {
    font-size: 1.1rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    margin: 0.15rem 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.nav-link:hover,
.nav-link.active {
    background: var(--color-sidebar-hover);
    color: var(--color-white);
}

.nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 0.75rem 1rem;
}

/* ============================================
   PAGE CONTENT WRAPPER
   ============================================ */

#page-content-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

/* ============================================
   TOP HEADER
   ============================================ */

.top-header {
    height: var(--header-height);
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.top-header .btn-link {
    color: var(--color-white);
    font-size: 1.4rem;
    padding: 0;
    text-decoration: none;
}

.top-header .btn-link:hover {
    color: rgba(255,255,255,0.85);
}

.page-title {
    font-size: 1.05rem;
    font-weight: 500;
}

.search-box {
    position: relative;
    width: 260px;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.search-box input {
    width: 100%;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.75rem 0.4rem 2.2rem;
    color: var(--color-white);
    font-size: 0.875rem;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.6);
}

.search-box input:focus {
    outline: none;
    background: rgba(255,255,255,0.25);
}

.avatar {
    width: 34px;
    height: 34px;
    background: var(--color-dark);
    color: var(--color-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.dropdown-toggle::after {
    border-top-color: rgba(255,255,255,0.7);
    margin-left: 0.4rem;
}

.badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    position: relative;
    top: -8px;
    left: -6px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

.dashboard-footer {
    height: var(--footer-height);
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ============================================
   CARDS & WIDGETS
   ============================================ */

.card {
    border: 1px solid var(--color-border);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    background: var(--color-white);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.stat-card {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-icon.bg-primary-soft { background: rgba(0,104,185,0.1); color: var(--color-primary); }
.stat-icon.bg-success-soft { background: rgba(25,135,84,0.1); color: #198754; }
.stat-icon.bg-warning-soft { background: rgba(255,193,7,0.1); color: #ffc107; }
.stat-icon.bg-danger-soft  { background: rgba(220,53,69,0.1); color: #dc3545; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-muted);
}

/* ============================================
   TABLES
   ============================================ */

.table thead th {
    background: var(--color-bg);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-muted);
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

.table tbody tr:hover {
    background: rgba(0,104,185,0.03);
}

/* ============================================
   BADGES & STATUS
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

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

.status-active { background: rgba(25,135,84,0.1); color: #198754; }
.status-active::before { background: #198754; }

.status-inactive { background: rgba(143,145,146,0.1); color: var(--color-muted); }
.status-inactive::before { background: var(--color-muted); }

.status-pending { background: rgba(255,193,7,0.1); color: #b38600; }
.status-pending::before { background: #ffc107; }

.status-danger { background: rgba(220,53,69,0.1); color: #dc3545; }
.status-danger::before { background: #dc3545; }

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    #page-content-wrapper {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }

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

/* ============================================
   SIDEBAR COLLAPSED (desktop)
   ============================================ */

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed);
}

body.sidebar-collapsed .sidebar .brand-text,
body.sidebar-collapsed .sidebar .nav-link span {
    display: none;
}

body.sidebar-collapsed .sidebar .nav-item {
    margin: 0.15rem 0.5rem;
}

body.sidebar-collapsed .sidebar .nav-link {
    justify-content: center;
    padding: 0.65rem;
}

body.sidebar-collapsed #page-content-wrapper {
    margin-left: var(--sidebar-collapsed);
}

/* ============================================
   BOOTSTRAP ICONS (local)
   ============================================ */

@import url("bootstrap-icons.css");
