
/* =========================
   RESET & GLOBAL
========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #f59e0b;
    --secondary: #64748b;
    --light: #f8fafc;
    --white: #ffffff;
    --dark: #0f172a;
    --border: #e2e8f0;
    --text: #334155;
    --muted: #94a3b8;
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    --radius: 14px;
}

html,
body {
    overflow-x: hidden;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #f8fbff, #eef4ff);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* =========================
   CONTAINER
========================= */
.container {
    width: 98%;
    max-width: 1100px;
    margin: 30px auto;
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 35px 30px;
    border: 1px solid var(--border);
}

.page-card {
    background: var(--white);
    border-radius: 18px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 24px;
    margin-top: 20px;
    min-width: 0;
}

.report-card {
    background: var(--white);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-width: 0;
}

/* =========================
   TYPOGRAPHY
========================= */
h1,
h2,
h3,
h4 {
    color: var(--dark);
    margin-bottom: 12px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
}

.page-subtitle {
    color: var(--secondary);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--dark);
}

.card-subtitle {
    color: var(--secondary);
    margin-bottom: 14px;
    font-size: 14px;
}

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

.text-muted {
    color: var(--muted);
}

.text-end {
    text-align: right;
}

small.text-muted {
    display: inline-block;
    margin-top: 3px;
    line-height: 1.5;
}

/* =========================
   NAVBAR FINAL
========================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.navbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 72px;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-links a.active {
    background: rgba(37, 99, 235, 0.28);
    color: #ffffff;
}

.nav-logout {
    margin-left: 6px;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 999;
    background: linear-gradient(90deg, #0b1736 0%, #12356b 45%, #0a5674 100%);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.navbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.2px;
}

.brand-logo {
    height: 42px;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand-text {
    color: #fff;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 600;
    transition: 0.25s ease;
}

.nav-links a:hover {
    color: #fdba74;
}

.nav-toggle {
    display: none;
    border: 0;
    background: rgba(255,255,255,0.12);
    color: #fff;
    font-size: 1.3rem;
    line-height: 1;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.nav-toggle:hover {
    background: rgba(255,255,255,0.18);
}

.nav-logout {
    margin-left: 6px;
}

/* Mobile */
@media (max-width: 768px) {
    .navbar-wrap {
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 0 4px;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        display: block;
        padding: 10px 12px;
        border-radius: 10px;
        background: rgba(255,255,255,0.08);
    }

    .brand-logo {
        height: 36px;
    }

    .brand-text {
        font-size: 1rem;
    }
}

/* =========================
   BUTTONS
========================= */
.btn {
    display: inline-block;
    padding: 11px 18px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: 0.3s ease;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover {
    opacity: 0.92;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    opacity: 0.92;
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    opacity: 0.92;
}

.btn-warning {
    background: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    opacity: 0.92;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 13px;
}

/* =========================
   ACTIONS
========================= */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.actions form {
    margin: 0;
}

/* =========================
   FORM
========================= */
.form-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--dark);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    outline: none;
    font-size: 14px;
    background: #fff;
    transition: 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

input.rupiah-input,
.input-rupiah {
    text-align: right;
    font-weight: 600;
}

input[readonly] {
    background: #f8fafc;
    color: #64748b;
    cursor: not-allowed;
    text-align: right;
}

.hidden {
    display: none;
}

/* =========================
   ALERT
========================= */
.alert {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* =========================
   TABLE
========================= */
.table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
}

table thead {
    background: #eff6ff;
}

table th,
table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

table th {
    color: var(--dark);
    font-weight: 700;
}

table tbody tr:hover {
    background: #f8fafc;
}

.table-wrapper table td form button {
    margin: 0;
}

/* =========================
   DASHBOARD HERO
========================= */
.hero-dashboard {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 14px 34px rgba(37, 99, 235, 0.28);
    margin-bottom: 22px;
}

.hero-dashboard h1 {
    color: #fff;
    margin-bottom: 8px;
    font-size: 30px;
}

.hero-dashboard p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 18px;
    align-items: center;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.hero-pill {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.hero-side-card {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 18px;
}

.hero-side-card .label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.hero-side-card .value {
    font-size: 28px;
    font-weight: 800;
}

/* =========================
   DASHBOARD / REPORT CARDS
========================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 20px;
}

.stat-card {
    background: var(--white);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -18px;
    top: -18px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.08);
}

.stat-card h3 {
    font-size: 14px;
    color: var(--secondary);
    margin-bottom: 10px;
    font-weight: 700;
}

.stat-card .value {
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.stat-card .note {
    margin-top: 8px;
    font-size: 13px;
    color: var(--secondary);
}

.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 18px;
    margin-top: 22px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-top: 20px;
}

/* =========================
   INSIGHT / PROGRESS
========================= */
.insight-list {
    display: grid;
    gap: 12px;
}

.insight-item {
    border: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px;
}

.insight-item strong {
    display: block;
    color: var(--dark);
    margin-bottom: 4px;
}

.progress-soft {
    background: #e2e8f0;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}

.progress-soft > div {
    height: 10px;
    border-radius: 999px;
    background: var(--primary);
}

/* =========================
   BADGE
========================= */
.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-income,
.badge-expense {
    min-width: 96px;
    text-align: center;
}

.badge-income {
    background: #dcfce7;
    color: #166534;
}

.badge-expense {
    background: #fee2e2;
    color: #991b1b;
}

.badge-cash {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-bank {
    background: #ede9fe;
    color: #6d28d9;
}

.badge-ewallet {
    background: #fef3c7;
    color: #92400e;
}

.badge-investasi {
    background: #dcfce7;
    color: #166534;
}

.badge-deposito {
    background: #fee2e2;
    color: #991b1b;
}

.badge-credit-card {
    background: #e0e7ff;
    color: #3730a3;
}

/* =========================
   EMPTY STATE
========================= */
.empty-state {
    text-align: center;
    padding: 35px 20px;
    color: var(--secondary);
}

.empty-state h3 {
    margin-bottom: 8px;
}

/* =========================
   AUTH PAGE
========================= */
.auth-logo {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo h1 {
    color: var(--primary);
    margin-bottom: 6px;
}

.auth-logo p {
    color: var(--secondary);
    font-size: 14px;
}

.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 14px;
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-card .btn {
    margin-top: 5px;
}

.auth-card input,
.auth-card select {
    background: #f8fafc;
}

.auth-card input::placeholder {
    color: #94a3b8;
}

.auth-card .alert {
    margin-bottom: 20px;
}

.auth-links .btn {
    margin-top: 8px;
}

.auth-links span {
    display: inline-block;
    margin-top: 10px;
}

#code {
    text-align: center;
    font-size: 22px;
    letter-spacing: 6px;
    font-weight: bold;
}

/* =========================
   PAGE HEADER
========================= */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

/* =========================
   CODE / CHART
========================= */
code {
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.chart-card {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    max-width: 100%;
}

.chart-wrap canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

/* =========================
   FOOTER
========================= */
.footer {
    text-align: center;
    color: var(--secondary);
    padding: 24px 0;
    font-size: 14px;
}

/* =========================
   UTILITIES
========================= */
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.mb-4 { margin-bottom: 24px; }

.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mt-4 { margin-top: 24px; }

.w-100 { width: 100%; }

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 992px) {
    .stats-grid,
    .report-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        width: 94%;
        margin: 20px auto;
    }

    .navbar-wrap {
        flex-wrap: wrap;
        min-height: auto;
        padding: 12px 0;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 12px;
        padding: 14px;
        background: rgba(30, 41, 59, 0.98);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 18px;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
        animation: navSlideDown 0.2s ease;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a,
    .nav-links .btn,
    .nav-links .nav-logout {
        width: 100%;
        text-align: left;
    }

    .nav-links a {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .nav-logout {
        margin-left: 0;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .stats-grid,
    .report-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .hero-dashboard {
        padding: 22px;
    }

    .hero-dashboard h1 {
        font-size: 24px;
    }

    .auth-card {
        padding: 28px 22px;
    }

    .chart-wrap {
        height: 260px;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 24px;
    }

    table th,
    table td {
        font-size: 13px;
        padding: 10px 8px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .actions .btn,
    .actions a {
        width: 100%;
    }

    .chart-wrap {
        height: 220px;
    }
}

@media (max-width: 420px) {
    .brand {
        font-size: 20px;
    }

    .page-title {
        font-size: 22px;
    }
}

@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.badge-warning {
    background: #fef3c7;
    color: #92400e;
}