/* LeadFacili - Dashboard Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #007bff;
    --primary-hover: #0056b3;
    --secondary: #6c757d;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --border-radius: 12px;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--light);
    color: var(--dark);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* --- Utilities --- */
.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.w-100 {
    width: 100%;
}

.text-center {
    text-align: center;
}

.mb-3 {
    margin-bottom: 1rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

/* --- Authentication Layout --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.auth-card {
    background: var(--white);
    padding: 3rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-logo {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.auth-title {
    font-size: 1.1rem;
    color: var(--secondary);
    font-weight: 500;
    margin-top: 0.5rem;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: #495057;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-align: center;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.15s;
    gap: 0.5rem;
}

.btn-primary {
    color: #fff;
    background-color: var(--primary);
    border-color: var(--primary);
}

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

.btn-success {
    color: #fff;
    background-color: var(--success);
}

.btn-danger {
    color: #fff;
    background-color: var(--danger);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

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

.sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid #e9ecef;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-section {
    font-size: 0.7rem;
    font-weight: 700;
    color: #adb5bd;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
}

.nav-item {
    padding: 0.75rem 1rem;
    color: var(--secondary);
    text-decoration: none;
    border-radius: var(--border-radius);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-item:hover,
.nav-item.active {
    background-color: rgba(0, 123, 255, 0.1);
    color: var(--primary);
}

.nav-icon {
    width: 20px;
    height: 20px;
}

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    background-color: var(--light);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.search-bar {
    background: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid #e9ecef;
    width: 300px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.search-input {
    border: none;
    outline: none;
    width: 100%;
    margin-left: 10px;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.card-title {
    font-size: 0.85rem;
    color: var(--secondary);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0;
}

/* --- Admin Header --- */
.admin-header {
    background: linear-gradient(135deg, var(--primary), #0056b3);
    color: white;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.admin-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

/* --- Admin Navigation --- */
.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: var(--white);
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 1rem;
    background: transparent;
    border-radius: 8px;
    text-decoration: none;
    color: var(--secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-nav a:hover {
    background: var(--light);
    color: var(--primary);
}

.admin-nav a.active {
    background: var(--primary);
    color: white;
}

/* --- Tables --- */
.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table thead {
    background: var(--light);
}

.user-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e9ecef;
}

.user-table td {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.95rem;
    vertical-align: middle;
}

.user-table tbody tr:hover {
    background: rgba(0, 123, 255, 0.03);
}

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

/* --- Action Buttons --- */
.action-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: var(--light);
}

/* --- Status Badges --- */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
}

.status-active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.status-disabled {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 50px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked+.toggle-slider {
    background-color: var(--success);
}

input:checked+.toggle-slider:before {
    transform: translateX(20px);
}

input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Quick Actions --- */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.quick-action {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid #eee;
}

.quick-action:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-action i {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
}

.quick-action h4 {
    margin: 0;
    font-size: 0.95rem;
}

/* --- Modals --- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-nav {
        flex-direction: column;
    }
}