/* Style untuk aplikasi Cashflow RS - Desktop Oriented */
* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f5f7fb;
    color: #333;
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Sidebar Styling */
.sidebar {
    width: 260px;
    height: 100vh;
    background-color: #1e293b;
    color: #e2e8f0;
    position: fixed;
    left: 0;
    top: 0;
    /* transition: all 0.3s ease; DISABLED FOR INSTANT LOAD */
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar-header {
    padding: 1.2rem 1rem;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background-color: #0f172a;
}

.logo-icon {
    font-size: 1.5rem;
    color: #38bdf8;
    margin-right: 0.8rem;
}

.sidebar-title {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-title {
    display: none;
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: #e2e8f0;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.3rem;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.menu-item.active {
    background-color: #0369a1;
    color: white;
}

.menu-item i {
    font-size: 1.2rem;
    min-width: 30px;
    margin-right: 0.8rem;
}

.sidebar.collapsed .menu-item span {
    display: none;
}

/* Menu Group */
.menu-group {
    margin-bottom: 0.5rem;
}

.menu-group-header {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.2s ease;
}

.menu-group-header:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

.menu-group-header i:first-child {
    font-size: 1.2rem;
    min-width: 30px;
    margin-right: 0.8rem;
}

.menu-group-header span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

.toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

.sidebar.collapsed .menu-group-header span,
.sidebar.collapsed .toggle-icon {
    display: none;
}

.menu-group-items {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.menu-group-items.expanded {
    max-height: 500px;
}

.submenu-item {
    padding-left: 3rem;
}

.sidebar.collapsed .submenu-item {
    padding-left: 1rem;
}

/* Content Wrapper */
.content-wrapper {
    flex: 1;
    margin-left: 260px;
    /* transition: margin-left 0.3s ease; DISABLED FOR INSTANT LOAD */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: calc(100% - 260px);
}

.content-wrapper.expanded {
    margin-left: 60px;
    width: calc(100% - 60px);
}

/* Header Styling */
header {
    background-color: #ffffff;
    color: #1e293b;
    padding: 0.7rem 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #0f172a;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-btn {
    display: flex;
    align-items: center;
    background-color: #1A2E44;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.profile-btn i {
    margin-right: 0.5rem;
}

.profile-btn:hover {
    background-color: #2A4D6E;
    color: white;
}

.logout-btn {
    display: flex;
    align-items: center;
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.logout-btn i {
    margin-right: 0.5rem;
}

.logout-btn:hover {
    background-color: #dc2626;
    color: white;
}

/* Main Content */
main {
    padding: 1.5rem;
    flex: 1;
    background-color: #f8fafc;
}

/* Alert Styling */
.alert {
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border: none;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background-color: #fef9c3;
    color: #854d0e;
    border-left: 4px solid #eab308;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

main {
    padding: 1.5rem 1rem;
    flex: 1;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #f0f0f0;
    font-size: 0.8rem;
    color: #666;
}

/* Tabels */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

table th {
    background-color: #f1f5f9;
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
}

table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:nth-child(even) {
    background-color: #f8fafc;
}

table tr:hover {
    background-color: #f1f5f9;
}

/* Form Elements */
form {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #334155;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="file"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

button, .btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

button:hover, .btn:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: #64748b;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Responsive untuk tablet dan mobile */
@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }
    
    .content-wrapper {
        margin-left: 220px;
        width: calc(100% - 220px);
    }
    
    .content-wrapper.expanded {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed {
        width: 60px;
        transform: translateX(0);
    }
    
    .content-wrapper {
        margin-left: 0;
        width: 100%;
    }
    
    .content-wrapper.expanded {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters select, .filters input {
        max-width: 100%;
    }
}

/* Filter dan Pencarian */
.filters {
    background-color: white;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

.filters select, .filters input {
    max-width: 200px;
}

.filters label {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: #64748b;
}

/* Cards Dashboard */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    border: none;
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-title {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
}

.card-title i {
    margin-right: 0.5rem;
    color: #3b82f6;
}

.card-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #64748b;
}

/* Grid layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Utilitas */
.text-right { text-align: right; }
.text-center { text-align: center; }
.amount-in { color: #16a34a; font-weight: 600; }
.amount-out { color: #dc2626; font-weight: 600; }

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #0a6aa1;
    animation: fadeIn 0.8s ease-in-out;
}

.login-logo h1 {
    font-size: 2.2rem;
    margin: 0;
    font-weight: 600;
}

.login-container .card {
    width: 100%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    animation: slideUp 0.5s ease-out;
}

.login-container .card-header {
    background-color: #0a6aa1;
    color: white;
    text-align: center;
    padding: 1.2rem 1rem;
}

.login-container .card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.login-container .card-body {
    padding: 2rem;
}

.login-container input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 1rem;
}

.login-container input:focus {
    border-color: #0a6aa1;
    box-shadow: 0 0 0 0.2rem rgba(10, 106, 161, 0.25);
    outline: none;
}

.login-container button {
    padding: 0.8rem;
    background-color: #0a6aa1;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: background-color 0.3s, transform 0.2s;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.login-container button:hover {
    background-color: #085483;
    transform: translateY(-2px);
}

.login-container button:active {
    transform: translateY(0);
}

.login-container .card-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 1rem;
}

/* Alert styling */
.alert {
    width: 100%;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    animation: fadeIn 0.3s ease-out;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(20px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsif untuk layar lebih kecil */
@media (max-width: 768px) {
    .filters {
        flex-direction: column;
    }
    
    .filters select, .filters input {
        max-width: 100%;
    }
}
