/* =========================================
   ADMIN DASHBOARD - PREMIUM UI KIT
========================================= */

:root {
    /* Brand Colors */
    --primary: #967259;
    --primary-hover: #755541;
    --primary-soft: rgba(150, 114, 89, 0.1);

    /* Neutrals */
    --bg-body: #F3F4F6;
    --bg-surface: #FFFFFF;
    --bg-sidebar: #111827;

    /* Text */
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --text-inverse: #FFFFFF;

    /* Borders & Shadows */
    --border: #E5E7EB;
    --radius-md: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    background: var(--bg-body);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    margin: 0;
    display: flex;
    min-height: 100vh;
}

/* Ensure login page is centered and not using the dashboard flex layout */
body.login-page {
    display: block;
}

/* =========================================
   SIDEBAR
========================================= */
.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    color: var(--text-inverse);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    box-sizing: border-box;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar .brand {
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
}

.sidebar .brand img {
    height: 48px;
    width: auto;
    filter: brightness(0) invert(1);
    /* Ensure logo is white */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: #9CA3AF;
    /* Slate-400 */
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 6px;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-inverse);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--primary);
    color: var(--text-inverse);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(150, 114, 89, 0.3);
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 12px;
    background: #FAFAFA;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.cat-tab {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.cat-tab:hover {
    background: white;
    color: var(--text-main);
}

.cat-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* chips container */
.chips-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0;
}

.filter-chip {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--bg-surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(150, 114, 89, 0.2);
}

.logout-btn {
    margin-top: auto;
    color: #ef4444;
    /* Red-500 */
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
    justify-content: center;
}

.logout-btn:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* =========================================
   MAIN CONTENT
========================================= */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px 60px;
    box-sizing: border-box;
}

/* Header */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.page-title {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    padding: 8px 16px;
    border-radius: 99px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.user-profile span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

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

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

.metric-card {
    background: var(--bg-surface);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.metric-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.metric-value {
    font-size: 42px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Data Table */
.table-container {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    /* For round corners */
    animation: fadeIn 0.4s ease;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: #FAFAFA;
    padding: 0 32px;
}

.tab {
    padding: 20px 4px;
    margin-right: 32px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 14px;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 16px 20px;
    background: var(--bg-surface);
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
    color: var(--text-main);
    transition: background 0.1s;
}

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

.data-table tr:hover td {
    background: #F9FAFB;
}

/* Status Badges */
.status-badge {
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    display: inline-block;
    white-space: nowrap;
}

.status-new {
    background: #EFF6FF;
    /* Blue-50 */
    color: #2563EB;
    /* Blue-600 */
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.status-read {
    background: #F3F4F6;
    color: #4B5563;
    box-shadow: 0 0 0 1px rgba(75, 85, 99, 0.1);
}

.status-contacted {
    background: #ECFDF5;
    color: #059669;
    box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.1);
}

/* Action Buttons Container */
.data-table td:last-child {
    white-space: nowrap;
}

/* Action Buttons */
.action-btn {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-surface);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    vertical-align: middle;
    margin-right: 6px;
}

.action-btn:last-child {
    margin-right: 0;
}

.action-btn:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.delete-btn {
    background: #EF4444;
    border-color: #EF4444;
    color: white;
    padding: 8px 10px;
    margin-left: 2px;
}

.delete-btn svg {
    display: block;
    stroke: white;
}

.delete-btn:hover {
    background: #DC2626;
    border-color: #DC2626;
}

/* Status action buttons */
.status-btn-lu {
    background: #3B82F6;
    border-color: #3B82F6;
    color: white;
}

.status-btn-lu:hover {
    background: #2563EB;
    border-color: #2563EB;
}

.status-btn-traiter {
    background: #F59E0B;
    border-color: #F59E0B;
    color: white;
}

.status-btn-traiter:hover {
    background: #D97706;
    border-color: #D97706;
}

.status-btn-done {
    background: #9CA3AF;
    border-color: #9CA3AF;
    color: white;
    cursor: not-allowed;
    opacity: 0.7;
}

.status-btn-done:hover {
    background: #9CA3AF;
    border-color: #9CA3AF;
    transform: none;
    box-shadow: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   LOGIN PAGE
========================================= */
.login-body {
    background-color: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, rgba(150, 114, 89, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(150, 114, 89, 0.05) 0px, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: var(--bg-surface);
    padding: 60px 48px;
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.login-logo {
    text-align: center;
    margin-bottom: 48px;
}

.login-logo img {
    height: 60px;
    width: auto;
}

.login-form .input-group {
    margin-bottom: 24px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 14px;
}

.login-form input {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 15px;
    background: #FAFAFA;
    transition: all 0.2s;
    color: var(--text-main);
    box-sizing: border-box;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.btn-primary {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
    margin-top: 12px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(150, 114, 89, 0.4);
}

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    display: none;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.alert-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FEE2E2;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 24px 12px;
    }

    .sidebar .brand img {
        width: 100%;
        height: auto;
    }

    .sidebar .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 80px;
        padding: 32px;
    }

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