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

:root {
    --bg-primary: #f8fafc;
    /* Soft white/gray */
    --bg-secondary: #ffffff;
    /* pure white */
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(30, 41, 59, 0.08);

    --color-primary: #2563eb;
    /* Ocean Blue */
    --color-primary-hover: #1d4ed8;
    --color-accent: #60a5fa;
    /* Sky Blue */
    --color-success: #059669;
    /* Emerald/Teal */
    --color-warning: #d97706;
    /* Amber */
    --color-danger: #dc2626;
    /* Rose/Red */

    --text-main: #1e293b;
    /* Dark Slate */
    --text-muted: #000000;
    /* Hitam tebal */
    --text-inverse: #ffffff;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --glass-blur: 16px;
    --shadow-premium: 0 20px 40px -15px rgba(37, 99, 235, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    font-weight: 700;
    background-color: var(--bg-primary);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background animated glow orbs */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(96, 165, 250, 0.1) 0%, transparent 40%),
        var(--bg-primary);
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: orb-float 20s infinite alternate ease-in-out;
}

.glow-orb-1 {
    width: 400px;
    height: 400px;
    background: rgba(37, 99, 235, 0.15);
    top: -100px;
    left: -100px;
}

.glow-orb-2 {
    width: 350px;
    height: 350px;
    background: rgba(96, 165, 250, 0.15);
    bottom: -80px;
    right: -80px;
    animation-delay: -5s;
}

@keyframes orb-float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(80px, 50px) scale(1.15);
    }
}

/* Container & Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Form Card with Glassmorphism */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 460px;
    box-shadow: var(--shadow-premium);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 25px 50px -12px rgba(37, 99, 235, 0.18);
}

/* Premium card light sweep effect */
.glass-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 45%,
            rgba(37, 99, 235, 0.02) 50%,
            transparent 55%);
    transform: rotate(45deg);
    transition: transform 0.5s ease;
    pointer-events: none;
}

.glass-card:hover::before {
    transform: translate(50%, 50%) rotate(45deg);
}

/* Typography elements */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--text-main);
}

.card-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a 30%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* Forms & Fields */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.input-container {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(30, 41, 59, 0.15);
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-input:focus+.input-icon {
    color: var(--color-primary);
}

/* Checkbox */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-input {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid rgba(30, 41, 59, 0.2);
    border-radius: 4px;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: var(--transition-smooth);
}

.checkbox-input:checked {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-input:checked::before {
    content: "";
    width: 8px;
    height: 8px;
    background-color: white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
    color: var(--text-inverse);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-main);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07);
}

/* Alert Notification Banner */
.alert {
    padding: 0.875rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
}

.alert-success {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.15);
    color: #047857;
}

/* Dashboard Styling Layout */
.dashboard-wrapper {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--card-border);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #1e3a8a 40%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sidebar-item a,
.sidebar-dropdown .dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.sidebar-item.active a,
.sidebar-item a:hover,
.sidebar-dropdown.active .dropdown-trigger,
.sidebar-dropdown .dropdown-trigger:hover {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.05);
}

.sidebar-item.active a,
.sidebar-dropdown.active .dropdown-trigger {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(29, 78, 216, 0.05) 100%);
    color: var(--color-primary);
    border-left: 3px solid var(--color-primary);
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.main-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 2rem;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 1rem;
}

.page-title {
    font-size: 1.75rem;
    color: #1e3a8a;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--text-inverse);
}

/* Stat Grid Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.25rem 0;
    color: #1e3a8a;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-primary);
    font-size: 1.5rem;
}

/* Data Tables */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow-x: auto;
    margin-bottom: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.data-table {
    width: 100%;
    min-width: 650px;
    border-collapse: collapse;
    text-align: left;
}

.data-table th,
.data-table td {
    padding: 1rem 0.875rem;
    border-bottom: 1px solid var(--card-border);
}

.data-table th {
    background: rgba(37, 99, 235, 0.02);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.data-table tbody tr {
    background: #ffffff;
}

.data-table tbody tr:hover {
    background: rgba(37, 99, 235, 0.01);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.badge-info {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .main-content {
        padding: 1rem;
    }

    .glass-card {
        padding: 1.75rem;
    }
}

/* Sidebar Dropdowns */
.sidebar-dropdown {
    display: flex;
    flex-direction: column;
}

.sidebar-dropdown .dropdown-trigger {
    width: 100%;
    cursor: pointer;
}

.sidebar-dropdown .arrow-icon {
    margin-left: auto;
    font-size: 0.75rem;
    transition: var(--transition-smooth);
}

.sidebar-dropdown.active .arrow-icon {
    transform: rotate(180deg);
}

.sidebar-dropdown .dropdown-menu {
    list-style: none;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding-left: 0.5rem;
    margin-top: 0.25rem;
    margin-left: 1.5rem;
}

.sidebar-dropdown.active .dropdown-menu {
    display: flex;
}

.dropdown-menu li a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-smooth);
}

.dropdown-menu li a:hover,
.dropdown-menu li.active a {
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.05);
}

/* Animasi Teks Berganti Warna */
.animated-gradient-text {
    background: linear-gradient(90deg, #2563eb, #d97706, #059669, #9333ea, #2563eb);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 5s ease-in-out infinite;
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Print / PDF Export Styling */
@media print {
    /* Hide everything except main-panel */
    body * {
        visibility: hidden;
    }
    .main-panel, .main-panel * {
        visibility: visible;
    }
    
    body, html, .app-container, .main-panel, .content {
        display: block !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* Hide elements inside main-panel that are not needed */
    .topbar, .glass-card, .table-header, .alert, .sidebar {
        display: none !important;
    }

    .print-header {
        display: block !important;
        margin-bottom: 20px;
    }
    
    .table-container {
        box-shadow: none !important;
        border: none !important;
        width: 100%;
        margin: 0;
        overflow: visible !important; /* Prevent horizontal cut off */
    }

    .data-table {
        width: 100% !important;
        border-collapse: collapse !important;
        page-break-inside: auto;
    }
    
    .data-table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    /* Header font: Hitam Bold */
    .data-table th {
        border: 1px solid #000 !important;
        padding: 8px !important;
        color: #000 !important;
        font-weight: bold !important;
        background-color: transparent !important;
    }

    /* Isi tabel font: Hitam Biasa */
    .data-table td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        color: #000 !important;
        font-weight: normal !important;
    }

    .badge {
        border: none !important;
        color: #000 !important;
        background: transparent !important;
        font-weight: normal !important;
        padding: 0 !important;
    }
    
    @page {
        size: portrait;
        margin: 10mm;
    }
}