/* 
    BizNinja - Enterprise Admin Portal (Layout Stabilization)
    Fixing Row & Grid Alignment Issues
*/

:root {
    --side-bg: #0f172a;
    --side-active: #0189c5;
    --admin-accent: #0189c5;
    --admin-bg: #f1f5f9;
    --white: #ffffff;
    --border: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-w: 280px;
    --top-h: 85px;
    --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--admin-bg); color: var(--text-main); line-height: 1.6; }

.admin-layout { display: flex; min-height: 100vh; }

/* --- Sidebar --- */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--side-bg);
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    display: flex; flex-direction: column;
    z-index: 1000;
}

.sidebar-brand { height: var(--top-h); display: flex; align-items: center; padding: 0 35px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand span { color: #fff; font-family: 'Outfit'; font-size: 1.5rem; font-weight: 800; }

.sidebar-menu { flex-grow: 1; padding: 30px 15px; }
.nav-item {
    display: flex; align-items: center; gap: 15px; padding: 14px 20px; 
    color: #94a3b8; text-decoration: none; border-radius: 12px; 
    margin-bottom: 8px; font-weight: 600; transition: 0.3s;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: var(--side-active); color: #fff; box-shadow: 0 10px 25px rgba(1, 137, 197, 0.2); }

/* --- Main Content --- */
.admin-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; }

.top-bar {
    height: var(--top-h); background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; 
    padding: 0 40px; position: sticky; top: 0; z-index: 999;
}

.content-body { padding: 40px; }

/* --- Fixed Row Issues (Stats & Cards) --- */
.admin-stat-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); /* Force 4 in a row on desktop */
    gap: 25px; 
    margin-bottom: 40px; 
}

.stat-box { 
    background: #fff; padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); 
    display: flex; align-items: center; gap: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.stat-icon { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }

/* Dashboard Content Split Row */
.dashboard-row {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 30px;
}

.admin-card { 
    background: #fff; border-radius: var(--radius); border: 1px solid var(--border); 
    padding: 30px; margin-bottom: 30px; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* --- Table Rows --- */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: #f8fafc; padding: 18px 25px; text-align: left; font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); font-weight: 800; letter-spacing: 1px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table td { padding: 18px 25px; border-bottom: 1px solid var(--border); vertical-align: middle; }

.badge { padding: 6px 14px; border-radius: 50px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; font-weight: 600; border: none; cursor: pointer; transition: 0.2s; text-decoration: none; font-size: 0.9rem; }
.btn-primary { background: var(--admin-accent); color: white; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-main); }

@media (max-width: 1200px) {
    .admin-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-stat-grid { grid-template-columns: 1fr; }
    .admin-sidebar { width: 80px; }
    .admin-sidebar span { display: none; }
    .admin-main { margin-left: 80px; }
    .top-bar { padding: 0 20px; }
}
