/* Catat Uang - Responsive Styles (Mobile & Tablet) */

/* Large Tablets & Small Laptops */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }

    .sidebar-logo {
        max-width: 85%;
    }

    .main-content {
        margin-left: 240px;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .charts-section {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
}

/* Tablets Landscape */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .sidebar-logo {
        max-width: 85%;
    }

    .main-content {
        margin-left: 220px;
    }

    .content {
        padding: 35px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .top-header {
        padding: 20px 30px;
    }

    .top-header h1 {
        font-size: 28px;
    }
}

/* Tablets Portrait & Large Mobile */
@media (max-width: 768px) {
    .container-main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: fixed;
        top: 0;
        bottom: 0;
        height: 100% !important;
        height: 100dvh !important;
        min-height: -webkit-fill-available;
        left: -100%;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        transition: left 0.3s ease;
        box-shadow: -2px 0 20px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .sidebar-logo {
        max-width: 85%;
    }

    .sidebar-menu {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        padding: 15px 0;
    }

    .sidebar-menu a {
        flex: none;
        min-width: auto;
        text-align: left;
        padding: 15px 20px;
        border-radius: 0;
        justify-content: flex-start;
        border-left: 4px solid transparent;
        gap: 15px;
        font-size: 14px;
    }

    .sidebar-menu a:hover {
        background: rgba(255, 255, 255, 0.08);
        padding-left: 25px;
    }

    .sidebar-menu a.active {
        border-left: 4px solid #FCD34D;
        background: rgba(255, 255, 255, 0.1);
        padding-left: 16px;
    }

    .sidebar-menu a.active::before {
        display: none;
    }

    .sidebar-menu i {
        width: auto;
        font-size: 18px;
    }

    .sidebar-footer {
        display: block;
        padding: 15px 15px 25px 15px;
        /* Tambahan padding bawah 25px */
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: auto;
        flex-shrink: 0;
    }

    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: var(--primary-color);
        border: none;
        color: white;
        width: 48px;
        height: 48px;
        border-radius: 10px;
        font-size: 20px;
        cursor: pointer;
        box-shadow: var(--shadow-md);
        transition: all 0.3s ease;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .mobile-menu-toggle.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mobile-menu-toggle:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .mobile-menu-toggle:active {
        transform: scale(0.95);
    }

    .sidebar.active~.mobile-menu-toggle,
    .sidebar.active+.mobile-menu-toggle {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .main-content {
        margin-left: 0;
        padding-top: 78px;
    }

    .top-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        background: white;
        z-index: 998;
        flex-direction: column;
        gap: 5px;
        padding: 15px 20px;
        align-items: center;
        justify-content: center;
        height: auto;
        min-height: 65px;
        border-bottom: 1px solid var(--border-color);
        text-align: center;
    }

    .header-left {
        max-width: 65%;
        flex: 1;
        margin-left: 0;
    }

    .header-left h1 {
        font-size: 18px;
        margin: 0;
        font-weight: 700;
    }

    .header-right {
        width: 100%;
        justify-content: center;
        font-size: 11px;
        gap: 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .header-right h4 {
        display: block;
        margin: 0;
        font-size: 11px;
        font-weight: 500;
        color: var(--text-muted);
    }

    .top-header h1 {
        font-size: 18px;
        margin: 0;
    }

    .content {
        padding: 20px;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .stat-card {
        flex-direction: column;
        text-align: left;
        padding: 15px;
    }

    .stat-icon {
        min-width: 50px;
        min-height: 50px;
        font-size: 28px;
        margin-right: 15px;
        margin-bottom: 0;
    }

    .stat-info h3 {
        font-size: 12px;
    }

    .stat-value {
        font-size: 20px;
    }

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

    .data-table,
    .report-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td,
    .report-table th,
    .report-table td {
        padding: 10px 8px;
    }

    .grid-2 {
        gap: 15px;
    }

    .charts-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .chart-container {
        height: 400px;
        min-height: 400px;
    }

    .btn-primary,
    .btn-submit {
        padding: 12px 16px;
        font-size: 13px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .budget-table {
        font-size: 12px;
    }

    .budget-table th,
    .budget-table td {
        padding: 8px 10px;
    }

    .progress-cell {
        min-width: 150px;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .mobile-menu-toggle {
        display: flex;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 1001;
        width: 48px;
        height: 48px;
    }

    .main-content {
        padding-top: 80px;
    }

    .top-header {
        padding: 12px 15px;
        min-height: 70px;
        flex-direction: column;
        gap: 3px;
    }

    .top-header h1 {
        font-size: 16px;
    }

    .header-right {
        font-size: 10px;
    }

    .header-right h4 {
        font-size: 10px;
    }

    .content {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-icon {
        min-width: 45px;
        min-height: 45px;
        font-size: 24px;
        margin-right: 12px;
    }

    .stat-info h3 {
        font-size: 11px;
        margin-bottom: 5px;
    }

    .stat-value {
        font-size: 18px;
    }

    .card {
        padding: 15px;
        border-radius: 10px;
    }

    .card h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-row {
        gap: 12px;
    }

    .data-table,
    .report-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td,
    .report-table th,
    .report-table td {
        padding: 8px 6px;
    }

    .btn-primary,
    .btn-small,
    .btn-submit {
        padding: 10px 14px;
        font-size: 12px;
    }

    .chart-container {
        height: 350px;
        min-height: 350px;
    }

    .sidebar-logo {
        max-width: 85%;
    }

    .sidebar-header h2 {
        font-size: 18px;
        flex-shrink: 0;
    }

    .sidebar-header p {
        font-size: 11px;
    }

    .sidebar-menu a {
        padding: 12px 20px;
        font-size: 14px;
    }

    .sidebar-menu a i {
        width: auto;
        font-size: 16px;
    }

    .period-card {
        text-align: left;
    }

    .period-card p {
        font-size: 14px;
    }

    .modal-content {
        padding: 25px 20px;
        max-width: 95%;
    }

    .modal-content h3 {
        font-size: 18px;
    }
}