/* ==========================================================================
   Dompetku - Custom Styling (Financial Theme)
   Modern, Clean, Responsive, and Lightweight
   ========================================================================== */

:root {
    --primary: #059669;
    --primary-hover: #047857;
    --primary-light: #ecfdf5;
    --secondary: #475569;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0284c7;
    --dark: #0f172a;
    --light-bg: #f8fafc;
    --card-border: #e2e8f0;
    --text-muted: #64748b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--light-bg);
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar-dompetku {
    background-color: #ffffff;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--dark) !important;
    display: inline-flex;
    align-items: center;
    text-decoration: none !important;
}

.navbar-brand-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.navbar-brand:hover .navbar-brand-logo {
    transform: scale(1.08) rotate(-2deg);
}

.navbar-brand .brand-text {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    color: #0f172a;
}

.navbar-brand span.badge-brand {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.nav-link {
    font-weight: 500;
    color: #475569 !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background-color: var(--primary-light);
}

.nav-link i {
    margin-right: 5px;
}

/* Main Container */
.main-content {
    flex: 1 0 auto;
    padding: 1.75rem 0 3rem 0;
}

/* Cards */
.card-custom {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 6px -2px rgba(0,0,0,0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.card-header-custom {
    background-color: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    color: #ffffff;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

.stat-card.card-income {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-card.card-expense {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
}

.stat-card.card-balance {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.18;
}

.stat-card .stat-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.92;
}

.stat-card .stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.stat-card .stat-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* Badges */
.badge-custom {
    padding: 0.35em 0.65em;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
}

.badge-pemasukan {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-pengeluaran {
    background-color: #ffe4e6;
    color: #9f1239;
}

.badge-system {
    background-color: #e2e8f0;
    color: #475569;
}

.badge-user {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    font-weight: 500;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover, .btn-primary-custom:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-outline-custom {
    border: 1px solid var(--card-border);
    color: #334155;
    background-color: #ffffff;
    border-radius: 8px;
    font-weight: 500;
}

.btn-outline-custom:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

/* Forms */
.form-control, .custom-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.5rem 0.85rem;
    font-size: 0.95rem;
    line-height: 1.5;
    height: auto !important;
    min-height: 40px;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select.form-control, select.custom-select {
    height: auto !important;
    min-height: 40px;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    vertical-align: middle;
}

.form-control-sm, .custom-select-sm {
    min-height: 36px !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

select.form-control-sm, select.custom-select-sm {
    min-height: 36px !important;
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
}

.form-control:focus, .custom-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input-rupiah-wrapper {
    position: relative;
}

.input-rupiah-prefix {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #64748b;
    z-index: 4;
}

.input-rupiah {
    padding-left: 42px !important;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0f172a;
}

/* Type Toggle Buttons (Pemasukan / Pengeluaran) */
.type-toggle-btn {
    flex: 1;
    padding: 0.75rem;
    text-align: center;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    background: #ffffff;
}

.type-toggle-btn.active-pemasukan {
    border-color: #10b981;
    background-color: #ecfdf5;
    color: #065f46;
}

.type-toggle-btn.active-pengeluaran {
    border-color: #ef4444;
    background-color: #fef2f2;
    color: #991b1b;
}

/* Table */
.table-custom {
    margin-bottom: 0;
}

.table-custom thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--card-border);
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.85rem 1rem;
}

.table-custom tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-top: 1px solid var(--card-border);
    font-size: 0.95rem;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
}

/* Hero Section (Index/Landing) */
.hero-section {
    background: linear-gradient(135deg, #059669 0%, #0f766e 100%);
    color: #ffffff;
    padding: 4rem 0 3.5rem 0;
    border-radius: 0 0 24px 24px;
    margin-bottom: 2.5rem;
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.15rem;
    opacity: 0.92;
    margin-bottom: 1.75rem;
    line-height: 1.6;
}

.feature-box {
    padding: 1.75rem;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.feature-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px -3px rgba(0,0,0,0.07);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Footer */
.footer-dompetku {
    background-color: #ffffff;
    border-top: 1px solid var(--card-border);
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: auto;
}

/* Chart Canvas container */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 260px;
    max-height: 340px;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    .stat-card .stat-value {
        font-size: 1.35rem;
    }
    .main-content {
        padding: 1rem 0 2rem 0;
    }
}
