/* C:\Users\Administrator\.gemini\antigravity\scratch\kas-kecil-app\assets\css\style.css */

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

:root {
    /* Color Palette */
    --primary-color: #6366f1; /* Indigo */
    --primary-hover: #4f46e5;
    --secondary-color: #0f172a; /* Slate 900 */
    --accent-color: #06b6d4; /* Cyan */
    
    --success-color: #10b981; /* Emerald */
    --success-bg: rgba(16, 185, 129, 0.15);
    --warning-color: #f59e0b; /* Amber */
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger-color: #ef4444; /* Rose */
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info-color: #3b82f6; /* Blue */
    
    /* Light Mode Variables */
    --bg-app: #f8fafc; /* Slate 50 */
    --bg-sidebar: #0f172a; /* Slate 900 for high-contrast professional look */
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-active-bg: rgba(99, 102, 241, 0.2);
    
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(226, 232, 240, 0.8);
    --text-primary: #1e293b; /* Slate 800 */
    --text-secondary: #64748b; /* Slate 500 */
    --border-color: #e2e8f0; /* Slate 200 */
    --input-bg: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.05), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 0.9rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

/* Sidebar Styling */
.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    color: var(--sidebar-text);
    padding: 1.25rem 0.85rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    transition: var(--transition);
    z-index: 100;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.25rem;
}

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

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    font-weight: 400;
    display: block;
}

.menu-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid transparent;
}

.menu-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    transition: var(--transition);
}

.menu-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    color: var(--sidebar-text-active);
    background: linear-gradient(90deg, var(--primary-color), rgba(99, 102, 241, 0.8));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
    font-weight: 600;
}

.menu-item.active svg {
    stroke: #ffffff;
}

.user-profile-section {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.avatar {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    font-family: var(--font-heading);
    border: 1.5px solid var(--primary-color);
}

.profile-info {
    flex-grow: 1;
    min-width: 0;
}

.profile-name {
    font-size: 0.825rem;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-role {
    font-size: 0.75rem;
    color: var(--sidebar-text);
    display: block;
    text-transform: capitalize;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #f43f5e;
    background-color: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.15);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-logout svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.btn-logout:hover {
    background-color: #f43f5e;
    color: #ffffff;
}

/* Main Content Styling */
.main-content {
    flex-grow: 1;
    padding: 1.75rem 2.25rem;
    overflow-y: auto;
    max-width: calc(100% - 240px);
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.page-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 0.2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--primary-color);
}

.stat-card.income::before { background-color: var(--success-color); }
.stat-card.expense::before { background-color: var(--danger-color); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-card.income .stat-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-card.expense .stat-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.stat-info {
    flex-grow: 1;
}

.stat-label {
    font-size: 0.725rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 0.15rem;
    font-family: var(--font-heading);
}

/* Dashboard Visual Section */
.visual-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .visual-section {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(12px);
}

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

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    font-family: var(--font-body);
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

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

.btn-success:hover {
    background-color: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-secondary {
    background-color: var(--input-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

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

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

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Tables */
.table-container {
    overflow-x: auto;
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: #ffffff;
}

table.data-table th {
    background-color: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

table.data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

table.data-table tr:hover td {
    background-color: #f8fafc;
}

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

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

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

.badge-category {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.badge-role {
    background-color: var(--border-color);
    color: var(--text-secondary);
}

.badge-role.admin {
    background-color: rgba(6, 182, 212, 0.1);
    color: var(--accent-color);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

.form-control {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 3rem); /* Batasi tinggi modal agar muat di viewport */
    overflow-y: auto; /* Aktifkan scroll vertikal di dalam modal */
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

/* Custom scrollbar untuk modal-content */
.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-track {
    background: transparent;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}
.modal-content::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.modal-close-btn:hover {
    color: var(--danger-color);
}

/* Filter Bar for Rekap */
.filter-bar {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) auto;
    gap: 1.25rem;
    align-items: flex-end;
}

/* Login Screen Styling */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    width: 100%;
    padding: 1.5rem;
}

.login-container {
    width: 100%;
    max-width: 440px;
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    display: inline-flex;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--radius-lg);
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    margin-bottom: 1.25rem;
}

.login-logo svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.5rem;
}

.login-form .form-label {
    color: #cbd5e1;
}

.login-form .form-control {
    background-color: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.login-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* Alerts CSS */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: var(--danger-bg);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}

.alert-success {
    background-color: var(--success-bg);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background-color: var(--warning-bg);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

.sidebar-toggle-btn {
    display: none;
}

/* Responsive Styles for Mobile and Tablet */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 1rem 1.25rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .brand-section {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-sm);
        color: #ffffff;
        cursor: pointer;
        transition: var(--transition);
    }

    .sidebar-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Sembunyikan menu dan profil secara default di mobile */
    .sidebar .menu-section,
    .sidebar .user-profile-section {
        display: none;
    }

    /* Tampilkan menu dan profil saat kelas menu-open aktif */
    .sidebar.menu-open .menu-section {
        display: flex;
        margin-top: 1.5rem;
    }

    .sidebar.menu-open .user-profile-section {
        display: flex;
        margin-top: 1.5rem;
    }

    .main-content {
        max-width: 100%;
        padding: 1.25rem 1rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .filter-bar {
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .visual-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-content {
        padding: 1.5rem;
        margin: 0 1rem;
        max-height: calc(100vh - 2rem);
    }
}

/* Print Styling */
@media print {
    .sidebar, .header-actions, .filter-bar, .btn, .card-header .btn {
        display: none !important;
    }
    body {
        background-color: #ffffff !important;
        color: #000000 !important;
    }
    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    .dashboard-card {
        box-shadow: none !important;
        border: none !important;
        background: transparent !important;
    }
}
