@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Inter:wght@400;500;600&display=swap');

body {
    background: linear-gradient(-45deg, #667eea, #764ba2, #6a82fb, #b18cf5);
    background-size: 400% 400%;
    animation: gradientShift 12s ease infinite;
    min-height: 100vh;
    font-family: 'Segoe UI', Arial, sans-serif;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

:root {
    --brand-primary: #667eea;
    --brand-secondary: #764ba2;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-width: 440px;
    width: 100%;
    padding: 40px 35px;
    animation: fadeSlideUp 0.6s ease;
}

@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card h3 {
    font-weight: 700;
    margin-bottom: 5px;
}

.auth-card p.subtitle {
    color: #777;
    margin-bottom: 25px;
}

.btn-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 10px;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.4);
    color: #fff;
}

.form-control {
    border-radius: 8px;
    padding: 10px 14px;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.15);
    border-color: #764ba2;
}

.auth-link {
    color: #764ba2;
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Dashboard */
.navbar-brand {
    font-weight: 700;
}

.dash-card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
    animation: fadeSlideUp 0.5s ease;
}

.dash-card:hover {
    transform: translateY(-4px);
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.table-hover tbody tr {
    transition: background 0.2s ease;
}

.btn-brand {
    background: linear-gradient(135deg, var(--brand-primary, #667eea) 0%, var(--brand-secondary, #764ba2) 100%) !important;
}

/* ===== App shell: navy sidebar + light topbar ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--brand-primary, #0b3d91) 0%, var(--brand-secondary, #082a66) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    transition: margin-left 0.25s ease;
    z-index: 1030;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-logo img { height: 42px; width: auto; max-width: 42px; object-fit: contain; }
.sidebar-logo-fallback {
    width: 42px; height: 42px;
    background: #e0264d;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 1.1rem;
    flex-shrink: 0;
}
.sidebar-app-name { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.sidebar-app-sub { font-size: 0.65rem; letter-spacing: 1px; opacity: 0.65; }

.sidebar-nav {
    flex: 1;
    padding: 14px 0;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: 0.2s;
}
.sidebar-nav a i { font-size: 1.05rem; width: 18px; text-align: center; }
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.sidebar-nav a.active {
    background: rgba(224,38,77,0.15);
    border-left-color: #e0264d;
    color: #fff;
    font-weight: 600;
}

.sidebar-footer { padding: 18px 22px; }
.sidebar-status-box {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
}
.status-label { font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; opacity: 0.65; }
.status-value { font-size: 0.9rem; font-weight: 600; color: #4ade80; margin-top: 2px; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: #fff;
    border-bottom: 1px solid #edeff2;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.topbar-search {
    background: #f4f5f7;
    border-radius: 8px;
    padding: 8px 14px;
    align-items: center;
    gap: 10px;
    width: 280px;
    color: #9aa1ac;
}
.topbar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}
.topbar-user { display: flex; align-items: center; }
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--brand-primary, #0b3d91);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}
.topbar-user-name { font-size: 0.88rem; font-weight: 600; color: var(--brand-primary, #0b3d91); line-height: 1.1; }
.topbar-user-role { font-size: 0.75rem; color: #9aa1ac; }

.app-content {
    padding: 28px;
    flex: 1;
}

/* Mobile: sidebar becomes an off-canvas drawer */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        margin-left: -260px;
        z-index: 1040;
    }
    .app-sidebar.show { margin-left: 0; }
    .app-content { padding: 18px; }
}

.auth-link, a.auth-link { color: var(--brand-secondary, #764ba2); }

/* ===== Dashboard stat cards & tables (PRG-style) ===== */
.page-title { color: var(--brand-primary, #0b3d91); font-family: 'Playfair Display', serif; font-weight: 700; }
.page-subtitle { color: #6b7280; font-size: 0.92rem; }

.stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    height: 100%;
}
.stat-icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: #fdeee7;
    color: #e0264d;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 12px;
}
.stat-label { font-size: 0.82rem; color: #6b7280; }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--brand-primary, #0b3d91); line-height: 1.2; }
.stat-sub { font-size: 0.78rem; color: #16a34a; }
.stat-sub.warn { color: #d97706; }

.panel-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
    padding: 22px;
}
.panel-title { color: var(--brand-primary, #0b3d91); font-weight: 700; font-size: 1.05rem; }

.prg-table thead th { background: var(--brand-primary, #0b3d91); color: #fff; font-weight: 500; font-size: 0.82rem; padding: 10px 14px; border: none; }
.prg-table tbody td { padding: 12px 14px; font-size: 0.88rem; vertical-align: middle; }
.prg-table tbody tr:not(:last-child) { border-bottom: 1px solid #f0f1f3; }

.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f5f5f7; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #e0264d; margin-top: 6px; flex-shrink: 0; }
.activity-title { font-size: 0.88rem; font-weight: 600; color: #333; }
.activity-sub { font-size: 0.78rem; color: #9aa1ac; }

.status-progress {
    height: 5px;
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
    margin: 8px 0 6px;
    overflow: hidden;
}
.status-progress span {
    display: block;
    height: 100%;
    background: #e0264d;
    border-radius: 4px;
}
.status-sub { font-size: 0.72rem; opacity: 0.6; }

.sidebar-contact { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.12); }
.contact-name { color: #fff; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.contact-line { color: rgba(255,255,255,0.7); font-size: 0.78rem; line-height: 1.5; }

.empty-state { text-align: center; padding: 50px 20px; color: #999; }