/* ==========================================================================
   Motors Admin Panel - Light Muted Pastel Green Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@600;700&display=swap');

:root {
    --admin-bg: #f3f7f4;              /* Light pastel sage background */
    --admin-card: #ffffff;            /* Crisp white cards */
    --admin-card-hover: #f8faf8;
    --admin-sidebar: #2b3b31;         /* Deep forest slate sidebar */
    --admin-border: #d4e0d8;
    --admin-text: #1e2923;
    --admin-muted: #5a6e62;
    --admin-primary: #3a6b4c;        /* Muted Pastel Sage Green */
    --admin-success: #10b981;
    --admin-warning: #d97706;
    --admin-danger: #ef4444;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Admin Unified Top Header --- */
.admin-sidebar {
    width: calc(100% - 48px);
    max-width: 1400px;
    margin: 20px auto 16px auto;
    background-color: var(--admin-sidebar);
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 68px;
    position: sticky;
    top: 16px;
    z-index: 100;
    color: #e5ece7;
}

.admin-brand {
    height: 100%;
    display: flex;
    align-items: center;
    padding-right: 20px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    border-right: 1px solid rgba(255,255,255,0.12);
    gap: 10px;
    color: #ffffff;
    white-space: nowrap;
}

.admin-brand i {
    color: #88bd9a;
}

.admin-menu {
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-grow: 1;
    overflow-x: auto;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: #a8b8ad;
    font-weight: 500;
    font-size: 0.88rem;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
}

.admin-nav-item:hover, .admin-nav-item.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    border-left: none;
}

.admin-nav-item i {
    font-size: 1rem;
    width: auto;
    text-align: center;
}

.admin-top-right {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-left: 16px;
    border-left: 1px solid rgba(255,255,255,0.12);
}

.btn-site-link {
    color: #a8b8ad;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    transition: all 0.2s ease;
}

.btn-site-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.18);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.user-info {
    display: flex;
    flex-direction: column;
}

.btn-logout {
    color: #f87171;
    font-size: 1.05rem;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: color 0.2s ease;
}

.btn-logout:hover {
    color: #ef4444;
}

/* --- Admin Main Area & Page Header --- */
.admin-main {
    margin-left: 0;
    width: 100%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-page-header {
    max-width: 1400px;
    width: calc(100% - 48px);
    margin: 0 auto 20px auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.admin-page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--admin-text);
}

.admin-content {
    max-width: 1400px;
    width: calc(100% - 48px);
    margin: 0 auto 40px auto;
    padding: 0;
}

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

.stat-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--admin-primary);
}

.stat-number {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-top: 6px;
    color: var(--admin-text);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    background: rgba(58, 107, 76, 0.12);
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* --- Dashboard Charts --- */
.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.chart-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* --- Data Tables --- */
.table-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--admin-border);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th, .admin-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.9rem;
}

.admin-table th {
    background: #f8faf8;
    color: var(--admin-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.admin-table tr:hover {
    background: var(--admin-card-hover);
}

/* Status Badges */
.badge {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success { background: rgba(16, 185, 129, 0.15); color: #047857; }
.badge-warning { background: rgba(217, 119, 6, 0.15); color: #b45309; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #b91c1c; }
.badge-info { background: rgba(58, 107, 76, 0.15); color: #3a6b4c; }

/* Admin Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 30%, rgba(58, 107, 76, 0.15), var(--admin-bg) 70%);
    width: 100%;
    padding: 20px;
}

.login-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

@media (max-width: 992px) {
    .admin-sidebar { width: 80px; }
    .admin-brand span, .admin-nav-item span { display: none; }
    .admin-main { margin-left: 80px; }
    .charts-grid { grid-template-columns: 1fr; }
}
