/* ============================================================
   SPPG Management Control - Main Stylesheet
   ============================================================ */

:root {
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 70px;
    --sidebar-bg: #1a1f2e;
    --sidebar-hover: #2d3448;
    --sidebar-active: #3b82f6;
    --topbar-height: 60px;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
}

* { box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f1f5f9; color: #1e293b; margin: 0; }

/* ---- Wrapper ---- */
.wrapper { min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

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

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-toggle {
    color: rgba(255,255,255,0.5);
    border: none;
    background: transparent;
    padding: 4px 6px;
}
.sidebar-toggle:hover { color: #fff; }

.sidebar-menu { padding: 12px 0; }

.menu-section { margin-bottom: 4px; }

.menu-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 10px 18px 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13.5px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    color: #fff;
    border-left-color: var(--primary);
}

.menu-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 500;
}

.menu-item i { font-size: 16px; flex-shrink: 0; }

/* Collapsed sidebar */
.sidebar.collapsed .menu-label,
.sidebar.collapsed .menu-item span,
.sidebar.collapsed .logo-text { display: none; }
.sidebar.collapsed .menu-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .menu-item i { font-size: 18px; }

/* ---- Main Content ---- */
.main-content { min-width: 0; }

/* ---- Topbar ---- */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

/* ---- Content Area ---- */
.content-area { min-height: calc(100vh - var(--topbar-height)); }

/* ---- Page Header ---- */
.page-header { border-bottom: 1px solid #e2e8f0; padding-bottom: 16px; }

/* ---- Cards ---- */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

/* ---- Table ---- */
.table-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}
.table-card .table { margin-bottom: 0; }
.table-card .table thead th {
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
.table-card .table tbody td { vertical-align: middle; font-size: 13.5px; }

/* ---- Badges ---- */
.badge { font-weight: 500; font-size: 11px; }

/* ---- Forms ---- */
.form-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 24px;
}
.form-label { font-weight: 500; font-size: 13px; color: #374151; }
.form-control, .form-select { font-size: 13.5px; border-color: #d1d5db; }
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* ---- Buttons ---- */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.login-logo {
    width: 56px;
    height: 56px;
    background: var(--primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    margin: 0 auto 16px;
}

/* ---- Scrollbar ---- */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 1000; transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-content { width: 100%; }
}
