/* ================================================
   PORTAL MAHASISWA — Design System & Styles
   STIT Mumtaz Karimun
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

/* ---- CSS Variables ---- */
:root {
    --portal-bg: #ffffff;
    --portal-surface: #ffffff;
    --portal-border: #f1f5f9;
    --portal-border-light: #f8fafc;
    --portal-text: #0f172a;
    --portal-text-secondary: #475569;
    --portal-text-muted: #94a3b8;
    --portal-accent: #1e293b;
    --portal-accent-hover: #0f172a;
    --portal-success: #059669;
    --portal-success-bg: #ecfdf5;
    --portal-warning: #d97706;
    --portal-warning-bg: #fffbeb;
    --portal-danger: #dc2626;
    --portal-danger-bg: #fef2f2;
    --portal-radius-sm: 6px;
    --portal-radius: 10px;
    --portal-radius-lg: 14px;
    --portal-radius-xl: 20px;
    --portal-shadow-sm: 0 1px 3px rgba(0,0,0,0.03);
    --portal-shadow: 0 2px 10px rgba(0,0,0,0.03);
    --portal-shadow-lg: 0 10px 30px rgba(0,0,0,0.04);
    --portal-transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.5);
    --focus-ring-dark: 0 0 0 3px rgba(96, 165, 250, 0.5);
}

/* Focus-visible ring for accessibility */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: var(--portal-radius);
    box-shadow: var(--focus-ring);
}
.dark :focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: var(--portal-radius);
    box-shadow: var(--focus-ring-dark);
}

/* Enhanced hover transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Skeleton loading styles */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--portal-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Enhanced empty state styling */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--portal-text-muted);
}
.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
    opacity: 0.5;
}
.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--portal-text);
}
.empty-state-description {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Enhanced form validation */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}
.input-error:focus {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4) !important;
}
.error-message {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
    min-height: 1.25rem;
}

/* Success states */
.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2) !important;
}
.input-success:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.4) !important;
}


body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--portal-bg);
    color: var(--portal-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

[v-cloak] { display: none; }

/* ---- Animations ---- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -16px) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.animate-fade { animation: fadeIn 0.35s ease-out both; }
.animate-slide-up { animation: slideUp 0.4s ease-out both; }
.animate-scale-in { animation: scaleIn 0.3s ease-out both; }

.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }

/* ---- Login Page ---- */
.login-bg {
    background: var(--portal-surface);
    position: relative;
    overflow: hidden;
}

.login-bg::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(51,65,85,0.04) 0%, transparent 70%);
    z-index: 0;
}

.login-bg::after {
    content: '';
    position: absolute;
    bottom: -30%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(51,65,85,0.03) 0%, transparent 70%);
    z-index: 0;
}

.login-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border-light);
    border-radius: var(--portal-radius-xl);
    box-shadow: none;
}

/* ---- OpenSea-Style Sidebar Rail ---- */
.portal-sidebar {
    background: #ffffff;
    border-right: 1px solid #eef2f6 !important;
    transition: width 240ms cubic-bezier(0.16, 1, 0.3, 1), transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
    width: 68px;
}

.portal-sidebar.expanded {
    width: 240px;
}

/* Nav Item */
.sidebar-rail-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    border-radius: 14px;
    color: #64748b;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    user-select: none;
}

/* Sembunyikan text saat collapsed */
.portal-sidebar:not(.expanded) .rail-label {
    display: none !important;
}

.sidebar-rail-item:hover {
    color: #0f172a;
}

.sidebar-rail-item:hover .rail-icon-box {
    background-color: #f1f5f9;
    color: #0f172a;
    transform: translateY(-1px);
}

.sidebar-rail-item.active {
    color: #0f172a;
    font-weight: 800;
}

.sidebar-rail-item.active .rail-icon-box {
    background-color: #0f172a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.rail-icon-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 20px;
    transition: all 0.18s ease;
    position: relative;
    color: #64748b;
}

.rail-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: #475569;
    white-space: nowrap;
    transition: color 0.18s ease;
}

.rail-badge {
    position: absolute;
    top: -2px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 8px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

/* Sidebar Nav Container (No overlay scroll, full visibility) */
.sidebar-nav-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    overflow: visible !important;
    max-height: none !important;
}

/* Expanded Sidebar Mode (Drawer Row Layout) */
.portal-sidebar.expanded {
    overflow: visible !important;
}

.portal-sidebar.expanded .sidebar-nav-container {
    overflow: visible !important;
    max-height: none !important;
}

.portal-sidebar.expanded .sidebar-rail-item {
    flex-direction: row;
    justify-content: flex-start;
    padding: 8px 12px;
    gap: 12px;
    border-radius: 12px;
}

.portal-sidebar.expanded .rail-label {
    display: block !important;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    max-width: none;
}

.portal-sidebar.expanded .rail-icon-box {
    width: 32px;
    height: 32px;
    font-size: 18px;
}

.portal-sidebar.expanded .sidebar-rail-item.active .rail-icon-box {
    background-color: transparent;
    color: #0f172a;
    box-shadow: none;
}

.portal-sidebar.expanded .sidebar-rail-item.active {
    background-color: #f1f5f9;
    color: #0f172a;
}

.portal-sidebar.expanded .sidebar-rail-item.active .rail-label {
    font-weight: 800;
    color: #0f172a;
}

/* Bottom Utility Rail Button */
.bottom-utility-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 16px;
    transition: all 0.18s ease;
    cursor: pointer;
}

.bottom-utility-btn:hover {
    background: #f8fafc;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.bottom-utility-btn.danger:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #fecaca;
}

/* Floating Tooltip for Compact Rail (Never Clipped) */
.has-rail-tooltip {
    position: relative;
}

.has-rail-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    background: #0f172a;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 11px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.15s ease;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.3), 0 8px 10px -6px rgba(15, 23, 42, 0.2);
    z-index: 99999 !important;
}

/* Tooltip Little Arrow Pointer */
.has-rail-tooltip::before {
    content: '';
    position: absolute;
    left: calc(100% + 5px);
    top: 50%;
    transform: translateY(-50%) scale(0.92);
    border-width: 5px 7px 5px 0;
    border-style: solid;
    border-color: transparent #0f172a transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.15s ease;
    z-index: 99999 !important;
}

.portal-sidebar:not(.expanded) .has-rail-tooltip:hover::after,
.portal-sidebar:not(.expanded) .has-rail-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
}

.portal-sidebar.expanded .has-rail-tooltip::after,
.portal-sidebar.expanded .has-rail-tooltip::before {
    display: none !important;
}

/* ---- Mobile Bottom Nav ---- */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--portal-border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: 50;
    box-shadow: none;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    border-radius: var(--portal-radius);
    transition: all var(--portal-transition);
    color: var(--portal-text-muted);
    border: none;
    background: none;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mobile-nav-item.active {
    color: var(--portal-text);
}

.mobile-nav-item iconify-icon {
    font-size: 22px;
    transition: transform var(--portal-transition);
}

.mobile-nav-item.active iconify-icon {
    transform: scale(1.1);
}

/* ---- Topbar ---- */
.portal-topbar {
    background: #ffffff;
    border-bottom: none !important;
    padding: 14px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
}

@media (min-width: 768px) {
    .portal-topbar { padding: 16px 32px; }
}

/* ---- Stat Cards ---- */
.stat-card {
    background: #ffffff;
    border: none !important;
    border-radius: var(--portal-radius-lg);
    padding: 20px;
    box-shadow: none;
    transition: all var(--portal-transition);
}

.stat-card:hover {
    box-shadow: none;
}


.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--portal-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.stat-card-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--portal-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-top: 12px;
}

.stat-card-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--portal-border-light);
}

.section-header h3 {
    font-size: 13px;
    font-weight: 800;
    color: var(--portal-text);
}

.section-header iconify-icon {
    font-size: 16px;
    color: var(--portal-text-secondary);
}

/* ---- Data Tables (Admin Standard) ---- */
.portal-table {
    width: 100%;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    border-collapse: collapse;
}

.portal-table thead {
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e4e4e7;
    user-select: none;
}

.portal-table th {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    background: transparent;
}

.portal-table td {
    padding: 12px 16px;
    color: #52525b;
    font-weight: 600;
    border-bottom: 1px solid #f4f4f5;
    vertical-align: middle;
    transition: background var(--portal-transition);
}

.portal-table tbody tr:last-child td {
    border-bottom: none;
}

.portal-table tbody tr:hover td {
    background: #fafafa;
}

.portal-table .td-primary {
    color: #18181b;
    font-weight: 700;
}

.portal-table .td-mono {
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 11px;
    color: #71717a;
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--portal-radius-sm);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.badge-success { background: var(--portal-success-bg); color: var(--portal-success); }
.badge-warning { background: var(--portal-warning-bg); color: var(--portal-warning); }
.badge-danger { background: var(--portal-danger-bg); color: var(--portal-danger); }
.badge-neutral { background: var(--portal-bg); color: var(--portal-text-secondary); }

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--portal-accent);
    color: white;
    border: none;
    border-radius: var(--portal-radius);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--portal-transition);
}

.btn-primary:hover { background: var(--portal-accent-hover); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    color: var(--portal-text-secondary);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--portal-transition);
}

.btn-ghost:hover {
    background: var(--portal-bg);
    color: var(--portal-text);
    border-color: var(--portal-text-secondary);
}

/* ---- Quick Action Cards ---- */
.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border-light);
    border-radius: var(--portal-radius-lg);
    cursor: pointer;
    transition: all var(--portal-transition);
    text-align: left;
    width: 100%;
}

.quick-action:hover {
    border-color: var(--portal-border);
    box-shadow: none;
    transform: translateY(-1px);
}

.quick-action-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--portal-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

/* ---- Biodata Card ---- */
.biodata-section {
    background: #ffffff;
    border: 1px solid var(--portal-border-light);
    border-radius: var(--portal-radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: none;
    transition: all var(--portal-transition);
}

.biodata-section:hover {
    box-shadow: none;
}


.biodata-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--portal-border-light);
}

.biodata-field {
    margin-bottom: 16px;
    border-bottom: 1px solid var(--portal-border-light);
    padding-bottom: 8px;
}

.biodata-field:last-child { margin-bottom: 0; border-bottom: none; padding-bottom: 0; }

.biodata-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.biodata-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--portal-text);
    word-break: break-word;
}

.edit-field-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--portal-radius-sm);
    color: var(--portal-text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--portal-transition);
    font-size: 12px;
}

.edit-field-btn:hover {
    color: var(--portal-accent);
    background: var(--portal-bg);
}

/* ---- Biodata Tabs (per section) ---- */
.biodata-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.biodata-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
    background: #ffffff;
    border: 1px solid var(--portal-border-light);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--portal-transition);
}

.biodata-tab:hover {
    color: var(--portal-accent);
    border-color: var(--portal-accent);
}

.biodata-tab.active {
    color: #ffffff;
    background: var(--portal-accent);
    border-color: var(--portal-accent);
}

.biodata-tab-icon {
    font-size: 14px;
}

.biodata-empty-note {
    font-size: 10.5px;
    font-style: italic;
    color: var(--portal-text-muted);
    opacity: 0.75;
    margin-top: 2px;
}

/* ---- Finance Tabs ---- */
.finance-tabs {
    display: flex;
    gap: 2px;
    background: var(--portal-bg);
    border-radius: var(--portal-radius);
    padding: 3px;
    border: 1px solid var(--portal-border-light);
}

.finance-tab {
    flex: 1;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
    border: none;
    background: transparent;
    border-radius: calc(var(--portal-radius) - 3px);
    cursor: pointer;
    transition: all var(--portal-transition);
    text-align: center;
}

.finance-tab:hover { color: var(--portal-text-secondary); }

.finance-tab.active {
    background: var(--portal-surface);
    color: var(--portal-text);
    box-shadow: none;
}

/* ---- Summary Bar ---- */
.summary-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--portal-border-light);
}

.summary-item { text-align: center; }

.summary-value {
    font-size: 18px;
    font-weight: 900;
    color: var(--portal-text);
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    letter-spacing: -0.02em;
}

.summary-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: var(--portal-surface);
    border-radius: var(--portal-radius-xl);
    width: 100%;
    max-width: 640px;
    padding: 32px;
    box-shadow: none;
    animation: scaleIn 0.25s ease-out;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-bg);
    border: none;
    border-radius: 50%;
    color: var(--portal-text-muted);
    cursor: pointer;
    transition: all var(--portal-transition);
}

.modal-close:hover {
    background: var(--portal-border-light);
    color: var(--portal-text);
}

/* ---- Form Elements ---- */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--portal-bg);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--portal-text);
    outline: none;
    transition: all var(--portal-transition);
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--portal-accent);
    box-shadow: none;
    background: var(--portal-surface);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--portal-text-muted);
    font-weight: 500;
}

/* ---- Toast ---- */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--portal-radius);
    font-size: 13px;
    font-weight: 700;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    animation: toastIn 0.3s ease-out;
    max-width: 90vw;
}

.toast-success { background: var(--portal-accent); color: white; }
.toast-error { background: var(--portal-danger); color: white; }

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state iconify-icon {
    font-size: 40px;
    color: var(--portal-text-muted);
    opacity: 0.4;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 12px;
    font-weight: 700;
    color: var(--portal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- Skeleton Loader ---- */
.skeleton {
    background: linear-gradient(90deg, var(--portal-bg) 25%, var(--portal-border-light) 50%, var(--portal-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--portal-radius-sm);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text-sm { height: 10px; margin-bottom: 6px; width: 60%; }
.skeleton-avatar { width: 80px; height: 80px; border-radius: var(--portal-radius-lg); }
.skeleton-card { height: 80px; border-radius: var(--portal-radius-lg); }

/* ---- Activity Feed ---- */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--portal-border-light);
    animation: slideInRight 0.3s ease-out both;
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.activity-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--portal-text);
    line-height: 1.5;
}

.activity-time {
    font-size: 10px;
    font-weight: 600;
    color: var(--portal-text-muted);
    margin-top: 2px;
}

/* ---- Welcome Banner ---- */
.welcome-banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--portal-radius-xl);
    padding: 28px;
    color: white;
    position: relative;
    overflow: hidden;
}

.welcome-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 60%);
    border-radius: 50%;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
    border-radius: 50%;
}

/* ---- Custom Scrollbar ---- */
.custom-scroll::-webkit-scrollbar { height: 4px; width: 4px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb { background: var(--portal-border); border-radius: 10px; }
.custom-scroll::-webkit-scrollbar-thumb:hover { background: var(--portal-text-muted); }

/* ---- Profile Photo ---- */
.profile-photo-portal {
    width: 80px;
    height: 80px;
    border-radius: var(--portal-radius-lg);
    object-fit: cover;
    border: 3px solid var(--portal-surface);
    box-shadow: none;
}

@media (min-width: 768px) {
    .profile-photo-portal { width: 100px; height: 100px; }
}

/* ---- Responsive & Mobile Drawer Sidebar ---- */
@media (max-width: 767px) {
    .portal-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 50;
        width: 270px !important;
        transform: translateX(-100%);
        transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
    }

    .portal-sidebar.mobile-open {
        transform: translateX(0) !important;
    }

    .portal-sidebar.mobile-open .sidebar-title,
    .portal-sidebar.mobile-open .sidebar-text {
        display: block !important;
    }

    .portal-sidebar.mobile-open .sidebar-nav-item {
        justify-content: flex-start !important;
        padding: 10px 16px !important;
    }

    .content-area { padding-bottom: 80px !important; }
}

@media (min-width: 768px) {
    .mobile-bottom-nav { display: none; }
    .mobile-backdrop { display: none !important; }
}

/* ---- Layout Grid System (Prevents Sidebar Drop) ---- */
.portal-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    max-width: 100%;
}

/* Anak grid tidak boleh memaksa kolom melebar (konten tabel/KTM lebar). */
.portal-layout-grid > * {
    min-width: 0;
    max-width: 100%;
}

@media (min-width: 992px) {
    .portal-layout-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 280px;
        align-items: start;
        gap: 1.75rem;
    }
    .portal-right-sidebar {
        width: 100% !important;
        position: sticky;
        top: 1rem;
    }
}

@media (min-width: 1280px) {
    .portal-layout-grid {
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 2rem;
    }
}

/* ---- Right Sidebar Widget Panel ---- */
.right-sidebar-card {
    background: #ffffff;
    border: none !important;
    border-radius: var(--portal-radius-lg);
    padding: 18px;
    box-shadow: none;
    transition: var(--portal-transition);
}

.right-sidebar-card:hover {
    box-shadow: none;
}


.right-sidebar-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--portal-text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- OpenSea Style Search Input ---- */
.topbar-search-box {
    position: relative;
    max-width: 420px;
    width: 100%;
}

.topbar-search-input {
    width: 100%;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    padding: 8px 36px 8px 36px;
    font-size: 13px;
    font-weight: 500;
    color: #0f172a;
    transition: all var(--portal-transition);
}

.topbar-search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: none;
}

.topbar-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 16px;
    pointer-events: none;
}

.topbar-search-shortcut {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
}

/* ---- OpenSea Style Horizontal Nav Tabs ---- */
.opensea-tabs {
    display: flex;
    align-items: center;
    gap: 24px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0;
    margin-bottom: 24px;
    overflow-x: auto;
}

.opensea-tab-item {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    padding: 10px 2px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--portal-transition);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}

.opensea-tab-item:hover {
    color: #0f172a;
}

.opensea-tab-item.active {
    color: #0f172a;
    font-weight: 800;
    border-bottom-color: #0f172a;
}

/* ---- Verified Checkmark Badge ---- */
.verified-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 50%;
    font-size: 8px;
}



/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    width: 240px;
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    z-index: 50;
    overflow: hidden;
    animation: dropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: top right;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: scale(0.95) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.user-dropdown-item iconify-icon {
    font-size: 1rem;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.user-dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.user-dropdown-item:hover iconify-icon {
    color: #6366f1;
}

.user-dropdown-item.danger:hover {
    background: #fff1f2;
    color: #e11d48;
}

.user-dropdown-item.danger:hover iconify-icon {
    color: #e11d48;
}

/* Custom Select Arrow Matching Tailwind Datepicker */
select {
  appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m19 9-7 7-7-7'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 1rem center !important;
  background-size: 1rem !important;
  padding-right: 2.5rem !important;
}

/* Print Media Styles for Official Documents (Kartu Ujian) */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
    }
    .portal-sidebar,
    .portal-header,
    .portal-right-sidebar,
    .mobile-bottom-nav,
    .toast-container,
    .print\:hidden {
        display: none !important;
    }
    .modal-overlay {
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        display: block !important;
    }
    .modal-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}


