/* ============================================================
   Prakriti Mitra — Web Dashboard Styles
   Built on top of Bootstrap 5. Only overrides and custom components here.
   ============================================================ */

:root {
    --pm-green-50:  #f0fdf4;
    --pm-green-100: #dcfce7;
    --pm-green-200: #bbf7d0;
    --pm-green-500: #22c55e;
    --pm-green-600: #16a34a;
    --pm-green-700: #15803d;
    --pm-green-800: #166534;
    --pm-green-900: #14532d;
    --pm-sidebar-width: 260px;
    --pm-sidebar-collapsed: 70px;
    --pm-topbar-height: 60px;
}

/* ── Global ───────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ── Login Page ──────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pm-green-900) 0%, var(--pm-green-700) 50%, #2d8a50 100%);
    padding: 20px;
}

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

.login-card .logo-area {
    text-align: center;
    margin-bottom: 30px;
}

.login-card .logo-area .app-icon {
    width: 56px;
    height: 56px;
    background: var(--pm-green-600);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    margin-bottom: 12px;
}

.login-card .logo-area h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pm-green-900);
    margin-bottom: 4px;
}

.login-card .logo-area p {
    font-size: 0.82rem;
    color: #6b7280;
}

.login-card .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.login-card .form-control {
    padding: 10px 14px;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
}

.login-card .form-control:focus {
    border-color: var(--pm-green-500);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.login-card .btn-login {
    width: 100%;
    padding: 11px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--pm-green-600);
    border: none;
    color: white;
    transition: all 0.2s;
}

.login-card .btn-login:hover {
    background: var(--pm-green-700);
}

.login-card .btn-login:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ── Sidebar ─────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--pm-sidebar-width);
    height: 100vh;
    background: var(--pm-green-900);
    color: white;
    z-index: 1040;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar .sidebar-brand {
    height: var(--pm-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 18px;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar .sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: var(--pm-green-600);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar .sidebar-brand .brand-text {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.sidebar .nav-section {
    padding: 12px 0 4px;
}

.sidebar .nav-section-title {
    padding: 0 18px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 6px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px;
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.sidebar .nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.sidebar .nav-link.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: var(--pm-green-500);
}

.sidebar .nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ── Top Bar ─────────────────────────── */
.topbar {
    position: fixed;
    top: 0;
    left: var(--pm-sidebar-width);
    right: 0;
    height: var(--pm-topbar-height);
    background: white;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1030;
    transition: left 0.3s ease;
}

.topbar .page-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2937;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #6b7280;
}

.topbar .user-info .user-name {
    font-weight: 600;
    color: #374151;
}

.topbar .user-info .user-role {
    font-size: 0.72rem;
    background: var(--pm-green-100);
    color: var(--pm-green-700);
    padding: 2px 10px;
    border-radius: 50px;
    font-weight: 600;
}

/* ── Main Content ────────────────────── */
.main-content {
    margin-left: var(--pm-sidebar-width);
    padding-top: var(--pm-topbar-height);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.main-content .content-area {
    padding: 24px;
}

/* ── Page Header ─────────────────────── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

/* ── Stat Cards ──────────────────────── */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.stat-card .stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111827;
}

.stat-card .stat-label {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 2px;
}

/* ── Cards / Panels ──────────────────── */
.panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.panel .panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel .panel-header h5 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: #111827;
}

.panel .panel-body {
    padding: 20px;
}

/* ── Tables ───────────────────────────── */
.table-pm thead {
    background: #f9fafb;
}

.table-pm thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    border-bottom: 2px solid #e5e7eb;
    padding: 10px 14px;
}

.table-pm tbody td {
    padding: 10px 14px;
    font-size: 0.87rem;
    color: #374151;
    vertical-align: middle;
}

.table-pm tbody tr:hover {
    background: var(--pm-green-50);
}

/* ── Badges ───────────────────────────── */
.badge-status {
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 600;
}

.badge-status.completed  { background: #dcfce7; color: #166534; }
.badge-status.in_progress { background: #fef3c7; color: #92400e; }
.badge-status.not_started { background: #f3f4f6; color: #6b7280; }
.badge-status.good    { background: #dcfce7; color: #166534; }
.badge-status.average { background: #fef3c7; color: #92400e; }
.badge-status.poor    { background: #fee2e2; color: #991b1b; }

/* ── Buttons ──────────────────────────── */
.btn-pm {
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 8px 16px;
}

.btn-pm-primary {
    background: var(--pm-green-600);
    border-color: var(--pm-green-600);
    color: white;
}

.btn-pm-primary:hover {
    background: var(--pm-green-700);
    border-color: var(--pm-green-700);
    color: white;
}

/* ── Responsive ──────────────────────── */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #374151;
    cursor: pointer;
    padding: 4px 8px;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .topbar {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
    }
    .sidebar-overlay.show {
        display: block;
    }
}
