/* =========================================================
   NEW RIMAPS - APP CSS
   Main global style + login + dashboard card
========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #111827;
}

a {
    text-decoration: none;
    color: inherit;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* =========================================================
   LOGIN PAGE
========================================================= */

.login-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0ea5e9, #0f766e);
}

.login-box {
    width: 380px;
    background: #ffffff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.login-brand {
    text-align: center;
    margin-bottom: 26px;
}

.login-brand h1 {
    margin: 12px 0 4px;
    font-size: 26px;
    color: #111827;
}

.login-brand p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: #0ea5e9;
    color: #ffffff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.brand-icon.large {
    width: 54px;
    height: 54px;
    margin: 0 auto;
    font-size: 24px;
    border-radius: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #374151;
}

.form-group input {
    width: 100%;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
}

.form-group input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.btn-primary {
    width: 100%;
    height: 44px;
    background: #0ea5e9;
    border: none;
    border-radius: 10px;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background: #0284c7;
}

/* =========================================================
   PAGE HEADER
========================================================= */

.page-header {
    margin-bottom: 20px;
}

.page-header h2 {
    margin: 0;
    font-size: 24px;
    color: #111827;
}

.page-header p {
    margin: 6px 0 0;
    color: #6b7280;
}

/* =========================================================
   DASHBOARD CARD
========================================================= */

.card-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}

.card-grid .card {
    flex: 1 1 220px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.card-title {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.card-value {
    font-size: 34px;
    font-weight: bold;
    color: #0f766e;
    margin-bottom: 6px;
}

.card-desc {
    font-size: 13px;
    color: #6b7280;
}

/* =========================================================
   PANEL
========================================================= */

.panel {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
    overflow: hidden;
}

.panel-header {
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header h3 {
    margin: 0;
    font-size: 18px;
    color: #111827;
}

.flow-wrapper {
    display: flex;
    gap: 10px;
    padding: 18px;
    overflow-x: auto;
}

.flow-item {
    min-width: 170px;
    background: #e5e7eb;
    color: #374151;
    padding: 14px;
    border-radius: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
}

.flow-item.active {
    background: #0ea5e9;
    color: #ffffff;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media screen and (max-width: 700px) {
    .login-box {
        width: 92%;
    }

    .card-grid .card {
        flex: 1 1 100%;
    }
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.panel-body {
    padding: 18px;
    color: #374151;
    font-size: 14px;
}

.panel-body p {
    margin: 0;
}

.panel-header-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.panel-subtitle {
    margin: 4px 0 0;
    color: #6b7280;
    font-size: 13px;
}

.btn-small-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    background: #0ea5e9;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.btn-small-primary:hover {
    background: #0284c7;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: 12px;
    font-weight: 600;
}

.btn-action:hover {
    background: #e5e7eb;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.text-center {
    text-align: center;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.app-form {
    max-width: 900px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-group select {
    width: 100%;
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
}

.form-group select:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.required {
    color: #dc2626;
}

.checkbox-label {
    height: 42px;
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #374151;
}

.checkbox-label input {
    width: auto;
    height: auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    background: #f3f4f6;
    color: #374151;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

@media screen and (max-width: 800px) {
    .form-row {
        flex-direction: column;
    }
}

.badge-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.form-group textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 10px 12px;
    outline: none;
    font-size: 14px;
    color: #111827;
    background: #ffffff;
    resize: vertical;
}

.form-group textarea:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

.form-group input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 16px;
}

.permission-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.permission-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.permission-grid .permission-card {
    flex: 1 1 420px;
}

.permission-card {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
    overflow: hidden;
}

.permission-card-header {
    padding: 14px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.permission-card-header h4 {
    margin: 0;
    color: #111827;
    font-size: 15px;
}

.permission-card-header span {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.permission-list {
    padding: 10px 14px;
}

.permission-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
}

.permission-item:last-child {
    border-bottom: none;
}

.permission-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.permission-item span {
    display: block;
}

.permission-item strong {
    display: block;
    color: #111827;
    font-size: 13px;
    margin-bottom: 3px;
}

.permission-item small {
    display: block;
    color: #6b7280;
    font-size: 12px;
}

.permission-actions {
    margin-top: 18px;
}

button:disabled,
input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

@media screen and (max-width: 1000px) {
    .permission-grid .permission-card {
        flex: 1 1 100%;
    }
}

.permission-module-block {
    margin-bottom: 22px;
}

.permission-module-block:last-child {
    margin-bottom: 0;
}

.permission-module-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.permission-module-title h4 {
    margin: 0;
    font-size: 16px;
    color: #111827;
}

.permission-module-title span {
    font-size: 12px;
    color: #6b7280;
}

.permission-table-wrapper {
    margin-bottom: 8px;
}

.card-value.card-success {
    color: #166534;
}

.card-value.card-warning {
    color: #b45309;
}

.card-value.card-danger {
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.integration-panel {
    margin-top: 20px;
}

.btn-action-danger {
    background: #fee2e2;
    color: #991b1b;
    border: none;
    cursor: pointer;
}

.btn-action-danger:hover {
    background: #fecaca;
}

.operation-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.small-input {
    width: 95px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
}

.pasca-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.small-select {
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
    background: #ffffff;
}

.small-input-wide {
    width: 120px;
    height: 30px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 0 8px;
    font-size: 12px;
}

/* =========================================================
   SIDEBAR SCROLL
   Membuat menu kiri bisa scroll jika tinggi menu melebihi layar
========================================================= */

.sidebar {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

/* scrollbar sidebar */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.fleet-setup-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.fleet-unit-select {
    min-width: 170px;
}

.fleet-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 12px;
    font-weight: 600;
    margin: 2px 4px 2px 0;
}

.chip-remove {
    border: none;
    background: #c7d2fe;
    color: #3730a3;
    border-radius: 999px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    font-size: 11px;
    cursor: pointer;
    font-weight: bold;
}

.chip-remove:hover {
    background: #a5b4fc;
}

.operator-planning-inline-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.operator-select {
    min-width: 210px;
}

/* =========================================================
   COMPACT MODE
   Mengecilkan spacing tabel, panel, button, badge agar muat banyak baris
========================================================= */

.panel-header {
    padding: 11px 14px;
}

.panel-header h3 {
    font-size: 15px;
}

.panel-subtitle {
    font-size: 12px;
}

.panel-body {
    padding: 12px 14px;
    font-size: 13px;
}

.page-header {
    margin-bottom: 12px;
}

.page-header h2 {
    font-size: 20px;
}

.page-header p {
    font-size: 13px;
}

.app-table {
    font-size: 12px;
}

.app-table th,
.app-table td {
    padding: 6px 8px;
    line-height: 1.25;
    vertical-align: middle;
}

.badge {
    min-height: 20px;
    padding: 0 7px;
    font-size: 11px;
}

.btn-action {
    min-height: 24px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
}

.btn-small-primary,
.btn-secondary {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12px;
}

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    font-size: 12px;
    margin-bottom: 4px;
}

.form-group input,
.form-group select {
    height: 34px;
    font-size: 12px;
    border-radius: 8px;
    padding: 0 9px;
}

.form-group textarea {
    font-size: 12px;
    border-radius: 8px;
    padding: 8px 9px;
}

.form-row {
    gap: 10px;
    margin-bottom: 10px;
}

.alert-info,
.alert-success,
.alert-error {
    padding: 8px 10px;
    font-size: 12px;
    margin-bottom: 10px;
}

.integration-panel {
    margin-top: 12px;
}

.fleet-chip {
    padding: 3px 7px;
    font-size: 11px;
}

.small-select,
.small-input,
.small-input-wide {
    height: 26px;
    font-size: 11px;
    border-radius: 6px;
}