/* ============================================
   CRM WiFi Manager - Styles personnalisés
   Couleurs: #0068b9, #0f253a, #2d2c2c, #8f9192
   ============================================ */

:root {
    --primary: #0068b9;
    --primary-dark: #0f253a;
    --dark: #2d2c2c;
    --gray: #8f9192;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --footer-height: 40px;
}

* {
    font-family: 'Google Sans Flex', 'Segoe UI', system-ui, sans-serif;
}

body {
    background-color: #f5f6fa;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--dark) 100%);
    z-index: 1040;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

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

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

.sidebar-brand img,
.sidebar-brand i {
    font-size: 1.5rem;
    color: #fff;
}

.sidebar-brand span {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 0.75rem;
    white-space: nowrap;
    transition: opacity 0.3s;
}

.sidebar-collapsed .sidebar-brand span {
    opacity: 0;
    pointer-events: none;
}

.nav-menu {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--primary);
}

.nav-link i {
    font-size: 1.25rem;
    min-width: 28px;
    text-align: center;
}

.nav-link span {
    margin-left: 0.75rem;
    white-space: nowrap;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.sidebar-collapsed .nav-link span {
    opacity: 0;
    pointer-events: none;
}

.nav-section {
    padding: 0.5rem 1.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-top: 0.5rem;
}

.sidebar-collapsed .nav-section {
    opacity: 0;
}

/* ===== HEADER ===== */
.main-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    transition: left 0.3s ease;
}

.sidebar-collapsed .main-header {
    left: var(--sidebar-collapsed);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--dark);
    cursor: pointer;
    padding: 0.25rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--dark);
    font-weight: 500;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    padding: 1.5rem;
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* ===== FOOTER ===== */
.main-footer {
    margin-left: var(--sidebar-width);
    height: var(--footer-height);
    background: #fff;
    border-top: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--gray);
    transition: margin-left 0.3s ease;
}

.sidebar-collapsed .main-footer {
    margin-left: var(--sidebar-collapsed);
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    border-left: 4px solid var(--primary);
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== TABLES ===== */
.table thead th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
    color: var(--dark);
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

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

/* ===== BUTTONS ===== */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: #005a9e;
    border-color: #005a9e;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===== BADGES ===== */
.badge-status {
    padding: 0.4em 0.75em;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.375rem;
}

/* ===== FORMS ===== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(0,104,185,0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--dark);
}

/* ===== PAGE TITLE ===== */
.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    color: var(--gray);
    font-size: 0.9rem;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    font-size: 0.85rem;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }

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

    .main-header,
    .main-content,
    .main-footer {
        left: 0 !important;
        margin-left: 0 !important;
    }

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

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

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo i {
    font-size: 3rem;
    color: var(--primary);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-top: 0.75rem;
}

/* ===== UTILS ===== */
.text-primary { color: var(--primary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }

.cursor-pointer { cursor: pointer; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
