* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #012c6d;
    --secondary: #db3441;
    --success: #1a6b3c;
    --warning: #856404;
    --light: #f4f6fb;
    --white: #ffffff;
    --dark: #1a1a2e;
    --grey: #6c757d;
    --border: #e0e6ed;
    --sidebar-width: 260px;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
}

body { font-family: 'Segoe UI', sans-serif; background: var(--light); color: var(--dark); }

/* ===========================
   Auth Pages
=========================== */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary) 0%, #024a99 100%); }

.auth-wrapper { width: 100%; max-width: 440px; padding: 20px; }

.auth-card { background: var(--white); border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }

.auth-logo { text-align: center; margin-bottom: 30px; }
.auth-logo img { height: 70px; margin-bottom: 12px; }
.auth-logo h2 { color: var(--primary); font-size: 22px; margin-bottom: 4px; }
.auth-logo p { color: var(--grey); font-size: 13px; }

.auth-form { display: flex; flex-direction: column; gap: 16px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--dark); }
.form-group label i { margin-right: 6px; color: var(--primary); }
.form-group input { padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; transition: all 0.2s; }
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(1,44,109,0.1); }

.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 44px; }
.toggle-password { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); cursor: pointer; color: var(--grey); }

.form-options { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.forgot-link { color: var(--secondary); text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }

.btn-login { background: var(--primary); color: var(--white); border: none; padding: 13px; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: all 0.2s; margin-top: 4px; }
.btn-login:hover { background: #024a99; transform: translateY(-1px); }

.auth-footer { text-align: center; margin-top: 24px; font-size: 13px; color: var(--grey); display: flex; flex-direction: column; gap: 6px; }
.auth-footer a { color: var(--primary); font-weight: 600; }

/* ===========================
   Alerts
=========================== */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-danger  { background: #fde8ea; color: #842029; border: 1px solid #f5c2c7; }
.alert-success { background: #d1e7dd; color: #0f5132; border: 1px solid #badbcc; }
.alert-warning { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }
.alert-info    { background: #cff4fc; color: #055160; border: 1px solid #b6effb; }

/* ===========================
   Portal Layout
=========================== */
.portal-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--primary); position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; display: flex; flex-direction: column; }

.sidebar-logo { padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; }
.sidebar-logo img { height: 50px; margin-bottom: 8px; filter: brightness(0) invert(1); }
.sidebar-logo span { color: rgba(255,255,255,0.85); font-size: 12px; display: block; }

.sidebar-user { padding: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; gap: 12px; }
.sidebar-user .user-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--secondary); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--white); font-weight: 700; }
.sidebar-user .user-info .name { color: var(--white); font-size: 14px; font-weight: 600; }
.sidebar-user .user-info .id { color: rgba(255,255,255,0.6); font-size: 12px; }

.sidebar-nav { padding: 16px 0; flex: 1; }
.sidebar-nav ul { list-style: none; }
.sidebar-nav li a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: rgba(255,255,255,0.75); font-size: 14px; text-decoration: none; transition: all 0.2s; border-left: 3px solid transparent; }
.sidebar-nav li a:hover, .sidebar-nav li a.active { background: rgba(255,255,255,0.1); color: var(--white); border-left-color: var(--secondary); }
.sidebar-nav li a i { width: 18px; text-align: center; }
.nav-section-title { padding: 12px 20px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.4); }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,0.6); font-size: 13px; text-decoration: none; }
.sidebar-footer a:hover { color: var(--white); }

/* Main Content */
.main-content { margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column; }

.topbar { background: var(--white); padding: 16px 28px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.topbar h1 { font-size: 20px; color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-right .btn-logout { background: var(--secondary); color: var(--white); border: none; padding: 8px 16px; border-radius: 6px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }

.page-content { padding: 28px; flex: 1; }

/* ===========================
   Dashboard Cards
=========================== */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }

.stat-card { background: var(--white); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px; border-left: 4px solid var(--primary); }
.stat-card.red { border-left-color: var(--secondary); }
.stat-card.green { border-left-color: var(--success); }
.stat-card.orange { border-left-color: #fd7e14; }

.stat-icon { width: 50px; height: 50px; border-radius: 10px; background: var(--light); display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--primary); }
.stat-card.red .stat-icon { color: var(--secondary); }
.stat-card.green .stat-icon { color: var(--success); }

.stat-info .value { font-size: 24px; font-weight: 800; color: var(--dark); line-height: 1; }
.stat-info .label { font-size: 12px; color: var(--grey); margin-top: 4px; }

/* Content Cards */
.content-card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden; }
.content-card-header { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.content-card-header h3 { font-size: 16px; color: var(--primary); }
.content-card-body { padding: 24px; }

/* Status Badges */
.badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-pending  { background: #fff3cd; color: #664d03; }
.badge-accepted { background: #d1e7dd; color: #0f5132; }
.badge-rejected { background: #fde8ea; color: #842029; }
.badge-review   { background: #cff4fc; color: #055160; }
.badge-paid     { background: #d1e7dd; color: #0f5132; }
.badge-unpaid   { background: #fde8ea; color: #842029; }
.badge-partial  { background: #fff3cd; color: #664d03; }
.badge-active   { background: #d1e7dd; color: #0f5132; }

/* Tables */
.portal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.portal-table th { background: var(--light); padding: 12px 16px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--grey); border-bottom: 1px solid var(--border); }
.portal-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.portal-table tr:last-child td { border-bottom: none; }
.portal-table tr:hover td { background: var(--light); }

/* Detail List */
.detail-list { display: flex; flex-direction: column; gap: 12px; }
.detail-item { display: flex; gap: 16px; font-size: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.detail-item:last-child { border-bottom: none; }
.detail-label { font-weight: 600; color: var(--grey); min-width: 160px; }
.detail-value { color: var(--dark); }

/* Buttons */
.btn { padding: 9px 18px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: all 0.2s; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: #024a99; }
.btn-secondary { background: var(--secondary); color: var(--white); }
.btn-success { background: var(--success); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

@media (max-width: 992px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { transform: translateX(-100%); }
    .main-content { margin-left: 0; }
}
