* {
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f4f6f9;
    color: #111;
    font-size: 12px;
}

.top-nav {
    background: #1e293b;
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links a {
    color: #cbd5e1;
    text-decoration: none;
    margin-right: 10px;
    padding: 6px 12px;
    border-radius: 4px;
}

.nav-links a.active, .nav-links a:hover {
    background: #334155;
    color: #fff;
}

.container {
    padding: 15px 20px;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.header-section h2, .header-section h3 {
    margin: 2px 0;
    font-size: 15px;
}

.table-responsive {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #999;
    max-height: 78vh;
}

.excel-table {
    border-collapse: collapse;
    width: 100%;
    white-space: nowrap;
}

.excel-table th, .excel-table td {
    border: 1px solid #777;
    padding: 5px 8px;
}

.excel-table thead th {
    background-color: #fdf2e9;
    font-weight: 600;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
}

.sticky-col {
    position: sticky;
    left: 0;
    background-color: #fff;
    z-index: 1;
    min-width: 170px;
}

.row-cabang td {
    background-color: #d99594 !important;
    color: #000;
}

.row-subtotal td {
    background-color: #e9edf4 !important;
}

.row-grandtotal td {
    background-color: #ffff00 !important;
    font-size: 13px;
}

.bg-grey {
    background-color: #e6e6e6 !important;
}

.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: #d00000; }

.btn-primary, .btn-secondary, .btn-success {
    border: none;
    padding: 7px 12px;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    margin-left: 5px;
}

.btn-primary { background: #2563eb; }
.btn-secondary { background: #475569; }
.btn-success { background: #16a34a; }
.btn-block { width: 100%; padding: 10px; margin-left: 0; }

.btn-xs {
    padding: 3px 6px;
    font-size: 11px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    display: inline-block;
    margin: 1px;
}
.btn-edit { background-color: #0284c7; }
.btn-user { background-color: #64748b; }
.btn-pdf { background-color: #7c3aed; }
.btn-del { background-color: #dc2626; }
.btn-del-user { background-color: #7f1d1d; font-weight: bold; }

.cell-clickable { cursor: pointer; }
.cell-clickable:hover { background-color: #e0f2fe !important; }

.modal {
    display: none;
    position: fixed;
    z-index: 99;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.55);
}

.modal-content {
    background: #fff;
    margin: 3% auto;
    padding: 20px;
    width: 550px;
    border-radius: 6px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg { width: 850px; }

.close {
    float: right;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.preview-box {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 12px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 22px;
}

.login-header h2 {
    margin: 0 0 6px 0;
    color: #1e293b;
    font-size: 18px;
}

.login-header p {
    margin: 0;
    color: #64748b;
    font-size: 12px;
}

.alert-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #f87171;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}

.badge-company {
    background: #f59e0b;
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    font-size: 12px;
}

.btn-logout {
    background: #dc2626 !important;
    color: #fff !important;
    font-weight: 600;
    margin-left: 8px;
}