body {
    background: #f4f6f9;
}

.sidebar {
    width: 250px;
}

@media (min-width: 992px) {
    .sidebar {
        min-height: 100vh;
        position: sticky;
        top: 0;
        flex-shrink: 0;
    }
}

.sidebar .nav-link {
    border-radius: .375rem;
    opacity: .85;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    opacity: 1;
}

.min-vw-0 {
    min-width: 0;
}

.stat-card .bi {
    font-size: 2rem;
    opacity: .35;
}

.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(rgba(255, 255, 255, .25), rgba(255, 255, 255, .1)), url('../img/login-bg.jpg') center / cover no-repeat fixed;
}

.login-wrapper .card {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(6px);
    border-radius: 1rem;
}

.branch-tile {
    transition: transform .1s ease-in-out;
}

.branch-tile:hover {
    transform: translateY(-2px);
}

/* Daftar tiket */
.tab-card {
    border: 1px solid #e3e7ee;
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease-in-out;
}

.tab-card:hover {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .06);
    transform: translateY(-1px);
}

.tab-card.is-active {
    box-shadow: 0 .35rem 1rem rgba(0, 0, 0, .08);
}

.tab-primary.is-active { border-color: var(--bs-primary); }
.tab-warning.is-active { border-color: var(--bs-warning); }
.tab-success.is-active { border-color: var(--bs-success); }

.tab-icon {
    width: 44px;
    height: 44px;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.tab-primary .tab-icon { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.tab-warning .tab-icon { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.tab-success .tab-icon { background: var(--bs-success-bg-subtle); color: var(--bs-success); }

.tab-count {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.ticket-table thead th {
    background: #f8f9fb;
    border-bottom: 1px solid #e9ecf1;
    color: #6c757d;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ticket-table tbody td {
    padding-top: .85rem;
    padding-bottom: .85rem;
}

.ticket-table tbody tr.row-overdue td:first-child {
    box-shadow: inset 3px 0 0 var(--bs-danger);
}

.ticket-no {
    font-family: var(--bs-font-monospace);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.attachment-dropzone {
    border: 2px dashed #ced4da;
    border-radius: .75rem;
    background: #fbfcfe;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone.is-dragover {
    border-color: var(--bs-primary);
    background: var(--bs-primary-bg-subtle);
    outline: none;
}

.attachment-dropzone .bi {
    display: block;
    margin-bottom: .25rem;
    font-size: 1.75rem;
    color: var(--bs-primary);
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .6rem;
    border: 1px solid #e9ecf1;
    border-radius: .5rem;
    background: #fff;
}

.attachment-thumb {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: .375rem;
}

.attachment-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fde8e8;
    color: #dc3545;
    font-size: 1.1rem;
}

.attachment-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.attachment-tile {
    padding: 0;
    border: 1px solid #e3e7ee;
    border-radius: .5rem;
    background: #fff;
    overflow: hidden;
    cursor: zoom-in;
    transition: box-shadow .15s ease, transform .1s ease-in-out;
}

.attachment-tile:hover {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .1);
    transform: translateY(-1px);
}

.attachment-tile img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
}

/* Tombol: sudut, bayangan, dan respons hover yang konsisten. */
.btn {
    border-radius: .5rem;
    font-weight: 500;
    transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease-in-out, border-color .15s ease;
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    box-shadow: 0 .35rem .85rem rgba(11, 94, 215, .25);
}

.btn-primary:hover {
    box-shadow: 0 .5rem 1.1rem rgba(11, 94, 215, .32);
    transform: translateY(-1px);
}

.btn-light {
    border: 1px solid #e3e7ee;
}

.btn-sm {
    border-radius: .4rem;
}

.btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Kartu statistik dan daftar tiket pelapor. */
.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.stat-warning { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.stat-primary { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.stat-success { background: var(--bs-success-bg-subtle); color: var(--bs-success); }

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-filter {
    color: inherit;
    border: 2px solid transparent;
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease-in-out;
}

.stat-filter:hover {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .08);
    transform: translateY(-1px);
}

.stat-filter.is-active {
    border-color: var(--bs-primary);
    box-shadow: 0 .35rem 1rem rgba(11, 94, 215, .15);
}

.stat-check {
    color: var(--bs-secondary-color);
    font-size: 1.1rem;
    transition: color .15s ease;
}

.stat-filter.is-active .stat-check {
    color: var(--bs-primary);
}

.progress-steps {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.progress-steps li {
    flex: 1;
    position: relative;
    text-align: center;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.progress-steps li::before {
    content: '';
    position: absolute;
    top: 13px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: #e3e7ee;
    z-index: 0;
}

.progress-steps li:first-child::before {
    display: none;
}

.progress-steps li.is-done::before {
    background: var(--bs-primary);
}

.progress-steps .step-dot {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 2px solid #e3e7ee;
    border-radius: 50%;
    background: #fff;
    font-weight: 600;
}

.progress-steps li.is-done .step-dot {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

.progress-steps li.is-current .step-dot {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
    box-shadow: 0 0 0 4px var(--bs-primary-bg-subtle);
}

.progress-steps li.is-done,
.progress-steps li.is-current {
    color: var(--bs-body-color);
    font-weight: 600;
}

.progress-steps .step-label {
    display: block;
    margin-top: .4rem;
}

.progress-steps .step-detail {
    display: block;
    margin-top: .25rem;
    font-size: .75rem;
    font-weight: 500;
    color: var(--bs-body-color);
}

.progress-steps li.is-paused .step-dot {
    border-color: var(--bs-warning);
    color: var(--bs-warning-text-emphasis);
    box-shadow: 0 0 0 4px var(--bs-warning-bg-subtle);
}

.progress-steps .step-pause {
    color: var(--bs-warning-text-emphasis);
}

.progress-steps .step-note {
    font-style: italic;
    font-weight: 400;
    color: var(--bs-secondary-color);
    white-space: normal;
}

.progress-steps .step-time {
    display: block;
    margin-top: .15rem;
    font-size: .72rem;
    font-weight: 400;
    color: var(--bs-secondary-color);
}

.status-group-head {
    background: #f8f9fb;
    border-top: 1px solid #e9ecf1;
    border-bottom: 1px solid #e9ecf1;
}

.ticket-feed .list-group-item {
    border-left: 0;
    border-right: 0;
}

.ticket-feed .list-group-item .bi-chevron-right {
    transition: transform .15s ease, color .15s ease;
}

.ticket-feed .list-group-item:hover .bi-chevron-right {
    transform: translateX(3px);
    color: var(--bs-primary) !important;
}

.ticket-feed .badge {
    border-radius: 999px;
    padding: .4em .8em;
    font-weight: 600;
}

.section-title {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.section-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-size: .8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9ecf3;
    color: #495057;
    font-size: .7rem;
    font-weight: 600;
    flex-shrink: 0;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    color: #6c757d;
}

.empty-state .bi {
    font-size: 2.5rem;
    opacity: .4;
}

@media print {
    .sidebar, header.navbar, .no-print {
        display: none !important;
    }
}

/* Laporan tiket: daftar peringkat dengan batang */
.rank-list { display: grid; gap: .85rem; }
.rank-head { display: flex; justify-content: space-between; gap: .75rem; margin-bottom: .3rem; font-size: .875rem; }
.rank-label { min-width: 0; overflow-wrap: anywhere; }
.rank-value { white-space: nowrap; }
.rank-track { display: flex; gap: 2px; height: 10px; border-radius: 4px; background: #f1f3f5; overflow: hidden; }
.rank-seg { min-width: 4px; }
.rank-all { background: #0d6efd; border-radius: 0 4px 4px 0; }
.rank-active { background: #f59e0b; }
.rank-done { background: #198754; }
.rank-empty { color: var(--bs-secondary-color); }
.rank-legend { display: flex; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--bs-secondary-color); }
.rank-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; }
.report-trend { position: relative; height: 280px; }
.report-matrix td, .report-matrix th { white-space: nowrap; }
.report-matrix td.matrix-cell { text-align: center; min-width: 76px; }
.report-issue { min-width: 300px; max-width: 480px; white-space: normal; }
.report-issue-text { margin-top: .15rem; font-size: .875rem; overflow-wrap: anywhere; white-space: pre-line; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
#detail-tiket { scroll-margin-top: 80px; }

/* Laporan: satu baris filter, tombol export di kanan */
.report-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.report-filter, .report-dates, .report-actions { display: flex; align-items: center; gap: .5rem; }
.report-filter { flex-wrap: wrap; }
.report-dates .form-control { width: 160px; }
.report-filter .form-select { width: 220px; }
.report-actions .btn { white-space: nowrap; }

@media (max-width: 575.98px) {
    .report-filter, .report-dates, .report-actions { width: 100%; }
    .report-dates .form-control, .report-filter .form-select { flex: 1 1 0; width: auto; min-width: 0; }
    .report-actions .btn { flex: 1 1 0; }
}
.report-toolbar.mb-3 { margin-bottom: 1rem; }

@media (min-width: 576px) and (max-width: 1199.98px) {
    .report-dates .form-control { width: 145px; }
    .report-filter .form-select { width: 190px; }
}

/* Kategori tiket: geser untuk mengatur urutan */
.cat-grip { width: 36px; padding-right: 0; }
.cat-handle { display: inline-flex; padding: .25rem; color: var(--bs-secondary-color); cursor: grab; touch-action: none; }
.cat-handle:hover { color: var(--bs-body-color); }
.sortable-ghost td { background: #e7f1ff; }
.sortable-fallback { background: var(--bs-body-bg); box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); }

/* Dashboard pelapor: diagram donat */
.donut-chart { position: relative; height: 220px; margin-bottom: 1rem; }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.donut-legend { list-style: none; margin: 0; padding: 0; }
.donut-legend li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; font-size: .9rem; border-top: 1px solid var(--bs-border-color); }
.donut-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut-share { width: 3rem; text-align: right; color: var(--bs-secondary-color); }

/* Dashboard pelapor: pengumuman */
.announce-item { padding: .6rem 0; border-top: 1px solid var(--bs-border-color); }
.announce-item:first-of-type { border-top: 0; padding-top: 0; }
.announce-body { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
