/* assets/style.css - Premium Light Accounting Theme */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #64748b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
#sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    height: 100vh;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

#sidebar.collapsed {
    width: 80px;
    padding: 24px 12px;
}

.logo {
    font-weight: 800;
    font-size: 20px; /* Reduced from 24px */
    color: var(--primary);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.collapsed .logo {
    justify-content: center;
}

#sidebar.collapsed .logo span {
    display: none;
}

.nav-links {
    list-style: none;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--secondary);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 11.5px; /* Further reduced from 13px */
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

#sidebar.collapsed .nav-link span {
    display: none;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Sidebar Toggle Button - Modern Circular Style */
.sidebar-toggle {
    position: absolute;
    right: -15px; /* Hanging halfway off */
    top: 40px;
    width: 30px;
    height: 30px;
    background: var(--bg-card);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    z-index: 1005;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

#sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

#sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

/* Main Content */
main {
    margin-left: 260px;
    flex-grow: 1;
    padding: 40px;
    width: calc(100% - 260px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar.collapsed ~ main {
    margin-left: 80px;
    width: calc(100% - 80px);
}

.section {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.section.active {
    display: block;
}

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

/* Cards & Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

h1 { font-weight: 800; font-size: 32px; margin-bottom: 8px; color: var(--text-main); }
.subtitle { color: var(--text-muted); margin-bottom: 32px; font-weight: 500; }

/* Filter Bar */
.filter-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
}

th {
    text-align: left;
    color: var(--secondary);
    padding: 16px;
    border-bottom: 1.5px solid var(--border);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
    font-size: 14px;
}

tr:hover { background: #f8fafc; }

/* Forms */
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 700; font-size: 13px; color: var(--secondary); text-transform: uppercase; letter-spacing: 0.5px;}

input, select, textarea {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    color: var(--text-main);
    outline: none;
    font-family: inherit;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

input::placeholder { color: #cbd5e1; }

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

.btn-icon-danger {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1.5px solid rgba(220, 38, 38, 0.1);
    background: rgba(220, 38, 38, 0.05);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
}

.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-blue { background: rgba(37, 99, 235, 0.1); color: var(--primary); }
.badge-red { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.badge-green { background: rgba(5, 150, 105, 0.1); color: var(--success); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sidebar Sidebar Shadow */
#sidebar {
    box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

/* Responsive Grid Utilities (Replacing Inline Styles) */
.grid { display: grid; gap: 24px; margin-bottom: 32px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-setup { grid-template-columns: 1fr 1.5fr; }

/* Global Auto-Capitalization for Data */
td, .card h1, .card h2, .card h3, .badge, .nav-link, label, th, .nav-link span {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Table Containers */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    margin-top: 10px;
}

/* Responsive Mobile Improvements */
@media (max-width: 768px) {
    #sidebar { 
        width: 0; 
        padding: 0 !important; 
        overflow: hidden;
        border-right: none;
        box-shadow: 0 0 0 transparent;
    }
    #sidebar.mobile-active {
        width: 280px;
        padding: 24px !important;
        box-shadow: 20px 0 50px rgba(0,0,0,0.1);
    }
    #mobile-header { 
        display: flex !important; 
    }
    main { 
        margin-left: 0; 
        padding: 20px; 
        padding-top: 85px; 
        width: 100%; 
    }
    .grid, .grid-2, .grid-3, .grid-setup {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }
    h1 { font-size: 24px; }
    .card { padding: 16px; }
}
/* Setup UI Refinements */
.setup-item-hover:hover {
    background: #f8fafc !important;
}

/* Custom Scrollbar for Compact Lists */
#list-divisi::-webkit-scrollbar,
#list-katalog::-webkit-scrollbar {
    width: 5px;
}

#list-divisi::-webkit-scrollbar-track,
#list-katalog::-webkit-scrollbar-track {
    background: transparent;
}

#list-divisi::-webkit-scrollbar-thumb,
#list-katalog::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

#list-divisi::-webkit-scrollbar-thumb:hover,
#list-katalog::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}
