@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #10B981;
    --bg-color: #F3F4F6;
    --sidebar-bg: #1F2937;
    --sidebar-hover: #374151;
    --text-main: #111827;
    --text-muted: #6B7280;
    --card-bg: #FFFFFF;
    --danger: #EF4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background-color: var(--sidebar-bg);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sidebar .brand {
    padding: 14px 16px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    letter-spacing: 0.5px;
}

.sidebar ul {
    list-style: none;
    margin-top: 10px;
    flex: 1;
}

.sidebar ul li {
    width: 100%;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    color: #D1D5DB;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.86rem;
    transition: all 0.2s ease;
}

.sidebar ul li a:hover, .sidebar ul li a.active {
    background-color: var(--sidebar-hover);
    color: #fff;
    border-left: 3px solid var(--primary-color);
}

.sidebar ul li a i {
    margin-right: 8px;
    font-size: 1rem;
    width: 18px;
    text-align: center;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 18px 24px;
    overflow-y: auto;
    min-width: 0;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-top h1 {
    font-size: 1.4rem;
    font-weight: 700;
}

/* Cards / Dashboard Widgets */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.card {
    background: var(--card-bg);
    padding: 14px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-right: 12px;
}

.card-info h3 {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.card-info p {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Tables (Ramping & Padat) */
.table-container {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 16px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}

table tr {
    height: 24px;
}

table th, table td {
    padding: 2px 6px !important;
    text-align: left;
    border-bottom: 1px solid #EEF2F6;
    vertical-align: middle;
    line-height: 1.15;
}

table th {
    background-color: #F8FAFC;
    font-weight: 600;
    color: #475569;
    font-size: 0.72rem;
    padding: 3px 6px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: inset 0 -1px 0 #CBD5E1;
    white-space: nowrap;
}

tr:nth-child(even) td {
    background-color: #FAFAFC;
}

tr:hover td {
    background-color: #F1F5F9;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-nowrap { white-space: nowrap; }

.badge, .badge-sm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    white-space: nowrap !important;
    padding: 1px 5px !important;
    font-size: 0.67rem !important;
    font-weight: 600 !important;
    border-radius: 3px !important;
    line-height: 1 !important;
    height: 18px !important;
}

.badge i, .badge-sm i {
    font-size: 0.65rem !important;
    line-height: 1 !important;
}

.badge-info {
    background: #E0E7FF;
    color: #4338CA;
}

/* Buttons */
.btn {
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.78rem;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
}
.btn i { margin-right: 3px; font-size: 0.75rem; }

.btn-sm {
    padding: 1px 5px !important;
    font-size: 0.70rem !important;
    border-radius: 3px !important;
    line-height: 1 !important;
    height: 20px !important;
    min-height: 20px !important;
}
.btn-sm i { margin-right: 2px !important; font-size: 0.68rem !important; }

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

.btn-secondary {
    background-color: #E5E7EB;
    color: var(--text-main);
}
.btn-secondary:hover {
    background-color: #D1D5DB;
}

.btn-success {
    background-color: var(--secondary-color);
    color: #fff;
}
.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

/* Forms */
.form-group {
    margin-bottom: 10px;
}
.form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    font-size: 0.82rem;
    color: #374151;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    outline: none;
    font-size: 0.85rem;
    transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal {
    background: var(--card-bg);
    width: 100%;
    max-width: 500px;
    border-radius: 12px;
    padding: 25px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}
.modal.modal-lg {
    max-width: 800px;
}
.modal-overlay.active .modal {
    transform: translateY(0);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.close-modal {
    background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--text-muted);
}

/* Print Styles */
@media print {
    .sidebar, .btn, .header-top { display: none !important; }
    .main-content { padding: 0; }
    .slip-container {
        width: 100%; border: none; box-shadow: none; padding: 0;
    }
}
