/* ----------------------------------------------------
   AtmaPajak - Premium CSS Design System & Layout
   ---------------------------------------------------- */

:root {
    /* Color Palette */
    --bg-main: #08090c;
    --bg-sidebar: #0f1118;
    --bg-card: rgba(20, 22, 31, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --income: #10b981;
    --income-bg: rgba(16, 185, 129, 0.08);
    --income-hover: #059669;
    
    --expense: #f43f5e;
    --expense-bg: rgba(244, 63, 94, 0.08);
    --expense-hover: #e11d48;
    
    --tax: #8b5cf6;
    --tax-bg: rgba(139, 92, 246, 0.08);
    
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    
    --text-main: #f3f4f6;
    --text-secondary: #e5e7eb;
    --text-muted: #9ca3af;
    --text-dark: #4b5563;
    
    /* System variables */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --font-heading: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html, body {
    overflow-x: hidden;
    touch-action: manipulation;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.04) 0%, transparent 40%);
    background-attachment: fixed;
}

/* Mobile Elements (Hidden on Desktop) */
.mobile-topbar {
    display: none;
}
.sidebar-backdrop {
    display: none;
}

/* Layout Wrapper */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition-smooth);
}

.brand {
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, var(--tax) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand-logo svg {
    width: 22px;
    height: 22px;
}

.brand-info h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-info span {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.nav-item svg {
    transition: var(--transition-fast);
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-item.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.02) 100%);
    border-left: 3px solid var(--primary);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    border-right: 1px solid rgba(99, 102, 241, 0.05);
}

.nav-item.active svg {
    color: var(--primary);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.1);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--font-heading);
    font-size: 14px;
    color: var(--primary);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Main Content Wrapper */
.main-content {
    margin-left: 280px;
    flex-grow: 1;
    min-height: 100vh;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.header-title h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.header-title p {
    font-size: 14px;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Typography utilities */
.text-muted { color: var(--text-muted); }
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }
.text-tax { color: var(--tax); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1.25rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1.25rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    outline: none;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    color: #fff;
}

.btn-danger {
    background-color: var(--expense);
    color: #fff;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.2);
}

.btn-danger:hover {
    background-color: var(--expense-hover);
    transform: translateY(-1px);
}

.btn-text {
    background: transparent;
    color: var(--primary);
    padding: 6px 12px;
}

.btn-text:hover {
    background-color: var(--primary-glow);
}

.btn-sm {
    padding: 8px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

/* Form Inputs & Selects */
.select-wrapper {
    position: relative;
    display: inline-block;
}

.select-wrapper::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 36px 10px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: var(--transition-fast);
}

select option {
    background-color: #12141c;
    color: #f3f4f6;
}

select:focus, input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background-color: rgba(255, 255, 255, 0.07);
}

input[type="text"], input[type="number"], input[type="date"], textarea {
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 11px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
    width: 100%;
}

label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 20px;
}

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

.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-label {
    position: absolute;
    left: 16px;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 14px;
}

.amount-input-wrapper input {
    padding-left: 42px;
}

.help-text {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.required {
    color: var(--expense);
}

/* Glass Panels & Cards */
.glass-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    transition: var(--transition-fast);
}

.glass-panel:hover {
    border-color: var(--border-hover);
}

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(14px) saturate(180%);
    transition: var(--transition-smooth);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    margin: 4px 0;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-change {
    font-size: 11px;
    color: var(--text-muted);
}

/* Specific Stat Card Colors */
.card-income { border-left: 4px solid var(--income); }
.card-income .stat-icon { background-color: var(--income-bg); color: var(--income); }

.card-expense { border-left: 4px solid var(--expense); }
.card-expense .stat-icon { background-color: var(--expense-bg); color: var(--expense); }

.card-net { border-left: 4px solid var(--primary); }
.card-net .stat-icon { background-color: var(--primary-glow); color: var(--primary); }

.card-tax { border-left: 4px solid var(--tax); }
.card-tax .stat-icon { background-color: var(--tax-bg); color: var(--tax); }

/* Charts Layout */
.charts-row {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 24px;
}

.chart-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-main);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    height: 380px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-header h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.bg-income { background-color: var(--income); }
.bg-expense { background-color: var(--expense); }

.chart-body {
    flex-grow: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

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

.canvas-pie-wrapper {
    position: relative;
    width: 230px;
    height: 230px;
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

/* Tax Info Box */
.tax-info-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-top: 4px solid var(--primary);
}

.tax-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tax-box-header h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-secondary);
}

.tax-box-body {
    flex-grow: 1;
    font-size: 13.5px;
    color: var(--text-muted);
}

.tax-box-body p {
    margin-bottom: 12px;
}

.tax-box-body ul {
    padding-left: 18px;
    margin-bottom: 12px;
}

.tax-box-body li {
    margin-bottom: 4px;
}

.tax-box-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.box-header h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-income { background-color: var(--income-bg); color: var(--income); }
.badge-expense { background-color: var(--expense-bg); color: var(--expense); }
.badge-primary { background-color: var(--primary-glow); color: var(--primary); }

/* Table Component */
.table-container {
    overflow-x: auto;
    width: 100%;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
}

.custom-table th {
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: rgba(0, 0, 0, 0.1);
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: var(--transition-fast);
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.table-total-row td {
    border-top: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    background-color: rgba(0, 0, 0, 0.2);
    font-weight: 700;
    color: var(--text-main) !important;
}

.btn-icon-table {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon-table:hover {
    color: #fff;
    border-color: var(--border-hover);
}

.btn-edit:hover {
    background-color: var(--primary-glow);
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
}

.btn-delete:hover {
    background-color: var(--expense-bg);
    color: var(--expense);
    border-color: rgba(244, 63, 94, 0.3);
}

.table-actions {
    display: flex;
    justify-content: center;
    gap: 6px;
}

/* Filter bar */
.filter-panel {
    margin-bottom: 24px;
}

.filter-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex-grow: 1;
    min-width: 250px;
}

.search-box svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box input {
    padding-left: 44px;
}

.panel-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.panel-header-actions h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.actions-group {
    display: flex;
    gap: 12px;
}

/* Tab Management */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

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

/* Tax Config Page */
.tax-config-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 24px;
}

.config-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.tax-educational-card {
    border-top: 4px solid var(--tax);
    display: flex;
    flex-direction: column;
}

.edu-content {
    font-size: 13px;
    line-height: 1.6;
}

.edu-content p {
    margin-bottom: 10px;
}

.edu-content ul {
    padding-left: 18px;
    margin: 8px 0;
}

.edu-content li {
    margin-bottom: 4px;
}

.tax-instruction-box {
    border-left: 4px solid var(--income);
}

/* NPPN summary style */
.nppn-calculation-summary {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.nppn-calc-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.border-total {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.border-grand-total {
    border-top: 2px dashed var(--tax);
    padding-top: 12px;
    font-size: 15px;
}

/* Settings and Portability Layout */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

.settings-actions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 20px;
}

.setting-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-radius: var(--radius-md);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    gap: 16px;
}

.setting-action-item.border-danger {
    border-color: rgba(244, 63, 94, 0.2);
    background-color: rgba(244, 63, 94, 0.02);
}

.action-desc h5 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}

.action-desc p {
    font-size: 12px;
}

/* Modals Overlay & Modals Content */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 4, 6, 0.85);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background-color: #12141c;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.confirm-modal {
    max-width: 420px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.btn-close-modal:hover {
    color: #fff;
}

#form-transaction {
    padding: 24px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* Animations */
.animate-slide-up {
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-fade-in {
    animation: fadeInModal 0.2s ease-out;
}

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

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: #1a1d28;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    animation: toastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.toast-success { border-left-color: var(--income); }
.toast.toast-danger { border-left-color: var(--expense); }
.toast.toast-warning { border-left-color: var(--warning); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.fade-out {
    animation: toastFadeOut 0.3s forwards ease-out;
}

@keyframes toastFadeOut {
    to { transform: translateY(10px); opacity: 0; }
}

/* Print Styles */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12px;
    }
    
    .sidebar, 
    .content-header, 
    .stats-grid,
    .charts-row, 
    .filter-panel, 
    .panel-header-actions .actions-group,
    .tax-config-grid,
    .tax-instruction-box,
    .settings-grid,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }
    
    .app-container {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    
    .tab-panel {
        display: none !important;
    }
    
    #tab-laporan-spt.tab-panel {
        display: block !important;
    }
    
    .glass-panel {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }
    
    .custom-table {
        font-size: 11px;
        border: 1px solid #ccc !important;
    }
    
    .custom-table th {
        background-color: #eaeaea !important;
        color: #000 !important;
        border: 1px solid #ccc !important;
        padding: 8px !important;
    }
    
    .custom-table td {
        color: #000 !important;
        border: 1px solid #ccc !important;
        padding: 8px !important;
    }
    
    .table-total-row td {
        background-color: #f2f2f2 !important;
        border-top: 2px solid #000 !important;
        color: #000 !important;
    }
    
    .nppn-calculation-summary {
        background: none !important;
        border: 1px solid #ccc !important;
        color: #000 !important;
    }
    
    .calc-row {
        color: #000 !important;
    }
    
    .border-grand-total {
        border-top: 2px solid #000 !important;
    }
}

/* Responsiveness */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
    
    .chart-card {
        height: 350px;
    }
    
    .tax-config-grid, .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile Topbar */
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        height: 60px;
        background-color: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-color);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 900;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .mobile-logo {
        width: 32px;
        height: 32px;
        background: linear-gradient(135deg, var(--primary), var(--primary-hover));
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 800;
        font-size: 16px;
        box-shadow: var(--shadow-neon);
    }
    
    .mobile-logo svg {
        width: 18px;
        height: 18px;
    }
    
    .mobile-info {
        display: flex;
        flex-direction: column;
    }
    
    .mobile-title {
        font-family: var(--font-heading);
        font-size: 15px;
        font-weight: 700;
        color: var(--text-main);
        line-height: 1.2;
    }
    
    .mobile-subtitle {
        font-size: 9px;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .btn-menu-toggle {
        background: none;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        transition: var(--transition-smooth);
    }
    
    .btn-menu-toggle:hover {
        background-color: var(--bg-card);
    }

    /* Sidebar Drawer Style */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        height: 100vh !important;
        width: 280px !important;
        z-index: 1000 !important;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: none;
        border-right: 1px solid var(--border-color);
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.3);
    }

    /* Navigation Menu on Mobile - restore vertical alignment! */
    .nav-menu {
        flex-direction: column !important;
        overflow-x: visible !important;
        padding: 24px 16px !important;
        gap: 8px !important;
    }
    
    .nav-item {
        padding: 12px 16px !important;
        font-size: 14px !important;
        white-space: normal !important;
    }
    
    .nav-item.active {
        border-left: 3px solid var(--primary) !important;
        border-bottom: none !important;
    }
    
    .sidebar-footer {
        display: flex !important; /* Restore sidebar footer on mobile drawer! */
    }

    /* Main Content adjustments */
    .main-content {
        margin-left: 0 !important;
        padding: 80px 16px 40px 16px !important; /* 80px top padding to clear the 60px mobile topbar */
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Anti-overflow for cards & glass panels on mobile */
    .glass-panel, .stat-card {
        max-width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    
    /* Backdrop Overlay */
    .sidebar-backdrop {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        z-index: 950;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .actions-group {
        width: 100%;
        justify-content: space-between;
    }
}

/* ----------------------------------------------------
   Light Theme Color System & Variable Overrides
   ---------------------------------------------------- */

body.light-theme {
    --bg-main: #f8fafc; /* premium slate gray background */
    --bg-sidebar: #ffffff; /* pure white sidebar */
    --bg-card: rgba(255, 255, 255, 0.85); /* translucent white glass */
    --border-color: rgba(15, 23, 42, 0.08); /* solid soft slate border */
    --border-hover: rgba(15, 23, 42, 0.15);
    
    --primary: #4f46e5; /* slightly darker indigo for contrast in light mode */
    --primary-hover: #4338ca;
    --primary-glow: rgba(79, 70, 229, 0.08);
    
    --income: #059669; /* darker green for text legibility */
    --income-bg: rgba(5, 150, 105, 0.08);
    --income-hover: #047857;
    
    --expense: #e11d48; /* darker rose for contrast */
    --expense-bg: rgba(225, 29, 72, 0.08);
    --expense-hover: #be123c;
    
    --tax: #7c3aed; /* darker violet for readability */
    --tax-bg: rgba(124, 58, 237, 0.08);
    
    --warning: #d97706; /* darker amber */
    --warning-bg: rgba(217, 119, 6, 0.08);
    
    --text-main: #0f172a; /* slate-900 main text */
    --text-secondary: #334155; /* slate-700 secondary text */
    --text-muted: #475569; /* slate-600 darker gray text for high contrast */
    --text-dark: #cbd5e1;
    
    --shadow-main: 0 10px 30px -10px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.03);
    
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(124, 58, 237, 0.03) 0%, transparent 40%);
}

/* Light Theme Structural Modifiers */
body.light-theme select,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme input[type="date"],
body.light-theme textarea {
    background-color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

body.light-theme select option {
    background-color: #ffffff;
    color: #0f172a;
}

body.light-theme select:focus,
body.light-theme input:focus,
body.light-theme textarea:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

/* Sidebar navigation styling corrections in Light Theme */
body.light-theme .nav-item.active {
    color: var(--primary) !important;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.01) 100%) !important;
    border-left: 3px solid var(--primary) !important;
    border-top: 1px solid rgba(79, 70, 229, 0.08) !important;
    border-bottom: 1px solid rgba(79, 70, 229, 0.08) !important;
}

body.light-theme .nav-item.active svg {
    color: var(--primary) !important;
}

body.light-theme .nav-item:hover {
    color: var(--primary) !important;
    background-color: rgba(79, 70, 229, 0.04) !important;
}

body.light-theme .sidebar-footer {
    background-color: rgba(15, 23, 42, 0.02);
}

body.light-theme .avatar {
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

body.light-theme .custom-table th {
    background-color: rgba(15, 23, 42, 0.02);
    color: #475569;
    border-bottom: 2px solid rgba(15, 23, 42, 0.08);
}

body.light-theme .table-total-row td {
    background-color: rgba(15, 23, 42, 0.03);
    border-top: 2px solid rgba(15, 23, 42, 0.08);
    border-bottom: 2px solid rgba(15, 23, 42, 0.08);
}

body.light-theme .nppn-calculation-summary {
    background-color: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .setting-action-item {
    background-color: #ffffff;
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .setting-action-item.border-danger {
    background-color: rgba(225, 29, 72, 0.02);
    border-color: rgba(225, 29, 72, 0.1);
}

body.light-theme .toast {
    background-color: #ffffff;
    color: #0f172a;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
}

body.light-theme .modal-overlay {
    background-color: rgba(15, 23, 42, 0.3);
}

body.light-theme .modal-card {
    background-color: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.15);
}

body.light-theme .btn-outline {
    color: #334155;
    border-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .btn-outline:hover {
    background-color: rgba(15, 23, 42, 0.04);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.3);
}

body.light-theme .btn-text {
    color: var(--primary);
}

body.light-theme .btn-close-modal {
    color: #64748b;
}

body.light-theme .btn-close-modal:hover {
    color: #0f172a;
}

body.light-theme .custom-table tbody tr:hover {
    background-color: rgba(15, 23, 42, 0.01);
}

body.light-theme .nppn-calculation-summary .calc-row {
    color: #334155;
}

body.light-theme .nppn-calculation-summary .text-light {
    color: #0f172a !important;
}

body.light-theme .nppn-calculation-summary .border-total {
    border-color: rgba(15, 23, 42, 0.08);
}

/* ----------------------------------------------------
   Target Mimpi (Savings Planner) Checklist Card Styles
   ---------------------------------------------------- */
.dream-day-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    position: relative;
    user-select: none;
}

.dream-day-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.dream-day-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.dream-day-card-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.dream-day-card-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    background: rgba(255, 255, 255, 0.01);
}

.dream-day-card-checkbox svg {
    display: none;
    color: #fff;
}

.dream-day-card-amount {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Checked state */
.dream-day-card.checked {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.15);
}

.dream-day-card.checked:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.6);
}

.dream-day-card.checked .dream-day-card-checkbox {
    background-color: var(--income);
    border-color: var(--income);
}

.dream-day-card.checked .dream-day-card-checkbox svg {
    display: block;
}

.dream-day-card.checked .dream-day-card-label {
    color: #fff;
    text-decoration: line-through;
    opacity: 0.8;
}

.dream-day-card.checked .dream-day-card-amount {
    color: var(--income);
    font-weight: 600;
}

/* Light theme overrides for Dream Goal Planner */
body.light-theme .dream-day-card {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .dream-day-card:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .dream-day-card-label {
    color: #334155;
}

body.light-theme .dream-day-card-amount {
    color: #64748b;
}

body.light-theme .dream-day-card.checked {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.08);
}

body.light-theme .dream-day-card.checked .dream-day-card-label {
    color: #0f172a;
}

body.light-theme .dream-day-card.checked .dream-day-card-amount {
    color: #059669;
}

/* ----------------------------------------------------
   Keamanan Ganda (Double Security) PIN Login Overlay
   ---------------------------------------------------- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(8, 9, 12, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}

.login-overlay.active {
    opacity: 1;
    visibility: visible;
}

.login-card {
    width: 90%;
    max-width: 380px;
    padding: 40px 32px;
    border-radius: var(--radius-lg);
    background: rgba(20, 22, 31, 0.6);
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    box-sizing: border-box;
}

.login-card.shake {
    animation: shake 0.4s ease-in-out;
}

.login-title-area {
    margin-bottom: 24px;
}

.login-title-area h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.login-title-area p {
    font-size: 13px;
    margin: 0;
}

/* PIN bullets */
.pin-bullets-container {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 24px 0 32px 0;
}

.pin-bullet {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    transition: var(--transition-fast);
    background: transparent;
}

.pin-bullet.filled {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary);
}

.pin-bullet.error {
    background-color: var(--expense);
    border-color: var(--expense);
    box-shadow: 0 0 12px var(--expense);
    animation: pulseError 0.2s 2 ease-in-out;
}

/* Keypad numeric */
.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    justify-items: center;
    max-width: 270px;
    margin: 0 auto;
}

.keypad-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    font-size: 22px;
    font-weight: 600;
    font-family: var(--font-heading);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    user-select: none;
}

.keypad-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
    color: #fff;
    transform: scale(1.06);
}

.keypad-btn:active {
    transform: scale(0.94);
    background: var(--primary-glow);
}

.keypad-btn.btn-danger {
    font-size: 18px;
}

.keypad-btn.btn-secondary {
    font-size: 18px;
    color: var(--text-muted);
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-8px); }
    30%, 60%, 90% { transform: translateX(8px); }
}

@keyframes pulseError {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Light Theme Overrides for Login Overlay */
body.light-theme .login-overlay {
    background-color: rgba(241, 245, 249, 0.97);
}

body.light-theme .login-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

body.light-theme .login-title-area h4 {
    color: #0f172a;
}

body.light-theme .pin-bullet {
    border-color: rgba(15, 23, 42, 0.15);
}

body.light-theme .keypad-btn {
    border-color: rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.02);
    color: #334155;
}

body.light-theme .keypad-btn:hover {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.18);
    color: #0f172a;
}

body.light-theme .keypad-btn:active {
    background: rgba(79, 70, 229, 0.08);
}

body.light-theme .keypad-btn.btn-secondary {
    color: #64748b;
}

/* Responsive adjustments for smaller screens (Mobile Mode) */
@media (max-width: 480px) {
    .login-card {
        width: 92%;
        max-width: 340px;
        padding: 32px 20px;
    }
    
    .login-title-area {
        margin-bottom: 16px;
    }
    
    .login-title-area h4 {
        font-size: 16px;
    }
    
    .pin-bullets-container {
        gap: 12px;
        margin: 16px 0 24px 0;
    }
    
    .pin-bullet {
        width: 12px;
        height: 12px;
    }
    
    .keypad-grid {
        gap: 12px;
        max-width: 240px;
    }
    
    .keypad-btn {
        width: 56px;
        height: 56px;
        font-size: 18px;
    }
}

/* ----------------------------------------------------
   Print Stylesheet (@media print) - Premium Formatting
   ---------------------------------------------------- */
@media print {
    /* Sembunyikan semua elemen layar interaktif */
    .app-container,
    .modal-overlay,
    .toast-container,
    aside,
    header,
    button,
    .btn,
    .modal-card {
        display: none !important;
    }

    /* Paksa pengaturan cetak tinta hitam putih bersih */
    html, body {
        background-color: #ffffff !important;
        background-image: none !important;
        color: #000000 !important;
        font-family: 'Inter', -apple-system, sans-serif !important;
        font-size: 10pt !important;
        line-height: 1.4 !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #spt-print-area {
        display: block !important;
        background: #ffffff !important;
        color: #000000 !important;
        width: 100% !important;
    }

    /* Page break untuk lembar dokumen terpisah */
    .print-page {
        page-break-after: always !important;
        page-break-inside: avoid !important;
        display: block !important;
        clear: both !important;
        padding: 10mm 5mm !important;
    }

    .print-page:last-of-type {
        page-break-after: avoid !important;
    }

    /* Pengaturan tabel cetak */
    .print-table {
        width: 100% !important;
        border-collapse: collapse !important;
        margin: 12px 0 !important;
    }

    .print-table th, 
    .print-table td {
        border: 1px solid #000000 !important;
        padding: 5px 8px !important;
        font-size: 9pt !important;
        color: #000000 !important;
        background: transparent !important;
    }

    .print-table th {
        background-color: #eaeaea !important;
        font-weight: bold !important;
    }

    /* Elemen Kop Surat & Pembatas Ganda */
    .print-header {
        border-bottom: 3px double #000000 !important;
        margin-bottom: 20px !important;
        padding-bottom: 10px !important;
    }

    h2, h3, h4, h5 {
        color: #000000 !important;
        page-break-after: avoid !important;
        margin-top: 10px;
    }

    /* Nonaktifkan efek bayangan & filter kaca saat cetak */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        filter: none !important;
        -webkit-filter: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}
