/* ══════════════════════════════════════════════════════════
     TOKENS
    ══════════════════════════════════════════════════════════ */
:root {
    --bg: #f0f4fa;
    --bg-2: #e8eef8;
    --surface: #ffffff;
    --surface-2: #f5f8fd;
    --border: #dde5f2;
    --border-h: #b8ccec;

    --txt: #0f1f3d;
    --txt-mid: #4a6080;
    --txt-faint: #92a5be;

    --blue: #1a56b0;
    --blue-md: #2468c8;
    --blue-lt: #e8f0fb;
    --blue-glow: rgba(26, 86, 176, .18);

    --gold: #d4a017;
    --gold-md: #f5bc2f;
    --gold-lt: #fef8e6;

    --green: #16803c;
    --green-lt: #dcfce7;
    --red: #c0152a;
    --red-lt: #ffe4e6;
    --orange: #c2570a;
    --orange-lt: #ffedd5;
    --teal: #0e7490;
    --teal-lt: #cffafe;

    --tb-bg: #0f2858;
    --tb-h: 62px;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;

    --shadow-sm: 0 1px 3px rgba(15, 31, 61, .06), 0 1px 2px rgba(15, 31, 61, .04);
    --shadow-md: 0 4px 16px rgba(15, 31, 61, .09), 0 1px 4px rgba(15, 31, 61, .05);

    --font: 'Plus Jakarta Sans', sans-serif;
    --mono: 'DM Mono', monospace;
}

/* ══════════════════════════════════════════════════════════
     BASE
    ══════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    background: var(--bg);
    color: var(--txt);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: var(--font);
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════
     TOPBAR
    ══════════════════════════════════════════════════════════ */
.topbar {
    height: var(--tb-h);
    background: var(--tb-bg);
    border-bottom: 3px solid var(--gold-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(15, 31, 61, .25);
}

.tb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.tb-logo {
    width: 38px;
    height: 38px;
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .12);
    border: 1.5px solid rgba(255, 255, 255, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.tb-logo img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.tb-logo .ico {
    font-size: 18px;
    color: var(--gold-md);
    display: none;
}

.tb-name {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-sub {
    font-size: 10.5px;
    color: rgba(255, 255, 255, .5);
    white-space: nowrap;
    margin-top: 1px;
}

.tb-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, .15);
    flex-shrink: 0;
}

.tb-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--r-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    border: 1.5px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .75);
    transition: all .17s ease;
    white-space: nowrap;
    cursor: pointer;
}

.nav-btn i {
    font-size: 13px;
    line-height: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, .16);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
    transform: translateY(-1px);
}

.nav-btn.primary {
    background: var(--blue-md);
    border-color: var(--blue-md);
    color: #fff;
}

.nav-btn.primary:hover {
    background: #5b50f5;
    border-color: #5b50f5;
    box-shadow: 0 4px 14px rgba(47, 123, 245, 0.4);
    transform: translateY(-1px);
}

.nav-btn.gold {
    background: var(--gold-md);
    border-color: var(--gold-md);
    color: var(--tb-bg);
    font-weight: 700;
}

.nav-btn.gold:hover {
    background: #f5cc50;
    border-color: #f5cc50;
    box-shadow: 0 4px 14px rgba(245, 188, 47, .4);
}

.nav-btn.green {
    background: rgba(22, 128, 60, .85);
    border-color: rgba(22, 128, 60, .7);
    color: #fff;
}

.nav-btn.green:hover {
    background: var(--green);
}

.nav-btn.silver {
    background: var(--surface);
    border-color: var(--border-h);
    color: var(--txt-mid);
}

.nav-btn.silver:hover {
    background: var(--red-lt);
    border-color: rgba(192, 21, 42, .3);
    color: var(--red);
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .topbar {
        padding: 0 14px;
        gap: 8px;
    }

    .tb-sep {
        display: none;
    }

    .nav-btn .btn-label {
        display: none;
    }

    .nav-btn {
        padding: 7px 10px;
    }

    .tb-sub {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
     PAGE BODY
    ══════════════════════════════════════════════════════════ */
.page-body {
    flex: 1;
    padding: 20px 24px 52px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 768px) {
    .page-body {
        padding: 14px 12px 48px;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .page-body {
        padding: 10px 10px 40px;
        gap: 10px;
    }
}

/* ══════════════════════════════════════════════════════════
     STAT STRIP  (mini counters above table)
    ══════════════════════════════════════════════════════════ */
.stat-strip {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    animation: fadeUp .4s ease both;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 100px;
    transition: transform .18s, box-shadow .18s;
}

.stat-chip:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.chip-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.chip-lbl {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--txt-faint);
    margin-bottom: 2px;
}

.chip-val {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--mono);
    letter-spacing: -1px;
    line-height: 1;
}

.c-all {
    color: var(--blue);
}

.bg-all {
    background: var(--blue-lt);
}

.c-open {
    color: var(--gold);
}

.bg-open {
    background: var(--gold-lt);
}

.c-prog {
    color: var(--blue-md);
}

.bg-prog {
    background: var(--blue-lt);
}

.c-res {
    color: var(--green);
}

.bg-res {
    background: var(--green-lt);
}

.c-esc {
    color: var(--red);
}

.bg-esc {
    background: var(--red-lt);
}

/* ══════════════════════════════════════════════════════════
     MAIN PANEL
    ══════════════════════════════════════════════════════════ */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeUp .4s .05s ease both;
}

.panel-hdr {
    padding: 14px 20px 12px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.panel-hdr-left {
    display: flex;
    align-items: center;
    gap: 9px;
    border-left: 3px solid var(--gold-md);
    padding-left: 10px;
}

.panel-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    background: var(--blue-lt);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--txt);
}

.panel-sub {
    font-size: 11px;
    color: var(--txt-mid);
    margin-top: 1px;
}

.panel-hdr-right {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

/* toolbar btn */
.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 13px;
    border-radius: var(--r-sm);
    font-size: 11.5px;
    font-weight: 700;
    font-family: var(--font);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .16s ease;
    white-space: nowrap;
}

.tb-btn i {
    font-size: 12px;
    line-height: 1;
}

.tb-btn-primary {
    background: var(--blue-md);
    border-color: var(--blue-md);
    color: #fff;
}

.tb-btn-primary:hover {
    background: var(--blue);
    box-shadow: 0 4px 14px var(--blue-glow);
    transform: translateY(-1px);
}

.tb-btn-gold {
    background: var(--gold-md);
    border-color: var(--gold-md);
    color: var(--tb-bg);
}

.tb-btn-gold:hover {
    background: #f5cc50;
    box-shadow: 0 4px 14px rgba(245, 188, 47, .35);
    transform: translateY(-1px);
}

.tb-btn-outline {
    background: var(--surface);
    border-color: var(--border-h);
    color: var(--txt-mid);
}

.tb-btn-outline:hover {
    background: var(--blue-lt);
    border-color: rgba(26, 86, 176, .3);
    color: var(--blue);
    transform: translateY(-1px);
}

.tb-btn-green {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.tb-btn-green:hover {
    background: #15703a;
    box-shadow: 0 4px 14px rgba(22, 128, 60, .3);
    transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════
     TABLE  — custom DataTables skin
    ══════════════════════════════════════════════════════════ */
.panel-body {
    padding: 0 20px 20px;
}

/* search + length wrapper override */
.dt-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 0 12px;
}

.dt-search-wrap {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.dt-search-wrap i {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--txt-faint);
    font-size: 13px;
    pointer-events: none;
}

#dtSearch {
    width: 100%;
    font-family: var(--font);
    font-size: 12px;
    color: var(--txt);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    padding: 7px 12px 7px 33px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

#dtSearch:focus {
    border-color: var(--blue-md);
    box-shadow: 0 0 0 3px rgba(36, 104, 200, .1);
    background: #fff;
}

.dt-length-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: var(--txt-mid);
    flex-shrink: 0;
}

.dt-length-wrap select {
    font-family: var(--font);
    font-size: 12px;
    color: var(--txt);
    background: var(--surface-2);
    border: 1.5px solid var(--border);
    border-radius: var(--r-sm);
    padding: 5px 26px 5px 10px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2392a5be'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    transition: border-color .15s;
}

.dt-length-wrap select:focus {
    border-color: var(--blue-md);
    outline: none;
}

/* table itself */
.data-tbl {
    width: 100% !important;
    border-collapse: collapse;
    font-size: 12.5px;
}

.data-tbl thead th {
    background: var(--surface-2);
    padding: 10px 14px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .45px;
    text-transform: uppercase;
    color: var(--txt-faint);
    border-bottom: 2px solid var(--border);
    border-top: 1px solid var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.data-tbl thead th:hover {
    color: var(--txt-mid);
    background: var(--blue-lt);
}

/* DataTables sort arrows override */
table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
    font-family: 'bootstrap-icons';
    margin-left: 5px;
    font-size: 10px;
    color: var(--txt-faint);
    opacity: 1;
}

table.dataTable thead th.sorting::after {
    content: '\F2F8';
}

table.dataTable thead th.sorting_asc::after {
    content: '\F235';
    color: var(--blue-md);
}

table.dataTable thead th.sorting_desc::after {
    content: '\F237';
    color: var(--blue-md);
}

.data-tbl tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    color: var(--txt);
}

.data-tbl tbody tr:hover td {
    background: var(--blue-lt);
}

.data-tbl tbody tr:last-child td {
    border-bottom: none;
}

.tc-no {
    width: 36px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--txt-faint);
}

.tc-date {
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--txt-mid);
}

.tc-ticket {
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--blue-md);
    font-weight: 600;
}

.tc-title {
    max-width: 220px;
}

.tc-title-txt {
    font-weight: 600;
    font-size: 12.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 220px;
}

.tc-cat {
    font-size: 11.5px;
    color: var(--txt-mid);
    white-space: nowrap;
}

.tc-act {
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════════
     BADGES
    ══════════════════════════════════════════════════════════ */
.bdg {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .15px;
    white-space: nowrap;
}

.bdg-open {
    background: var(--gold-lt);
    color: var(--gold);
    border: 1px solid rgba(212, 160, 23, .25);
}

.bdg-assigned {
    background: var(--teal-lt);
    color: var(--teal);
    border: 1px solid rgba(14, 116, 144, .2);
}

.bdg-progress {
    background: var(--blue-lt);
    color: var(--blue-md);
    border: 1px solid rgba(36, 104, 200, .2);
}

.bdg-resolved {
    background: var(--green-lt);
    color: var(--green);
    border: 1px solid rgba(22, 128, 60, .2);
}

.bdg-closed {
    background: var(--bg-2);
    color: var(--txt-mid);
    border: 1px solid var(--border);
}

.bdg-escalated {
    background: var(--red-lt);
    color: var(--red);
    border: 1px solid rgba(192, 21, 42, .2);
}

.bdg-default {
    background: var(--bg-2);
    color: var(--txt-mid);
    border: 1px solid var(--border);
}

.bdg-low {
    background: var(--green-lt);
    color: var(--green);
    border: 1px solid rgba(22, 128, 60, .2);
}

.bdg-medium {
    background: var(--blue-lt);
    color: var(--blue-md);
    border: 1px solid rgba(36, 104, 200, .2);
}

.bdg-high {
    background: var(--gold-lt);
    color: var(--gold);
    border: 1px solid rgba(212, 160, 23, .25);
}

.bdg-critical {
    background: var(--red-lt);
    color: var(--red);
    border: 1px solid rgba(192, 21, 42, .2);
}

/* ══════════════════════════════════════════════════════════
     ACTION BUTTONS
    ══════════════════════════════════════════════════════════ */
.act-wrap {
    display: flex;
    gap: 4px;
}

.ico-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--txt-mid);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all .14s ease;
}

.ico-btn:hover {
    transform: translateY(-1px);
}

.ico-btn.e:hover {
    background: var(--gold-lt);
    border-color: rgba(212, 160, 23, .4);
    color: var(--gold);
}

.ico-btn.d:hover {
    background: var(--red-lt);
    border-color: rgba(192, 21, 42, .3);
    color: var(--red);
}

.ico-btn.v:hover {
    background: var(--blue-lt);
    border-color: rgba(26, 86, 176, .3);
    color: var(--blue);
}

.ico-btn.p:hover {
    background: var(--green-lt);
    border-color: rgba(22, 128, 60, .3);
    color: var(--green);
}

/* ══════════════════════════════════════════════════════════
     DATATABLE BOTTOM  (info + pagination)
    ══════════════════════════════════════════════════════════ */
.dt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    margin-top: 2px;
}

.dt-info {
    font-size: 11.5px;
    color: var(--txt-faint);
}

/* pagination */
.dt-paging {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.dt-paging button,
.dt-paging span {
    min-width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--txt-mid);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .14s ease;
    padding: 0 8px;
}

.dt-paging button:hover {
    background: var(--blue-lt);
    border-color: rgba(26, 86, 176, .3);
    color: var(--blue);
}

.dt-paging button.active {
    background: var(--blue-md);
    border-color: var(--blue-md);
    color: #fff;
}

.dt-paging button:disabled,
.dt-paging button.disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* empty */
.empty-row td {
    text-align: center;
    padding: 40px !important;
    color: var(--txt-faint);
    font-size: 13px;
}

.empty-row i {
    display: block;
    font-size: 30px;
    margin-bottom: 8px;
    opacity: .35;
}

/* ══════════════════════════════════════════════════════════
     ANIMATIONS
    ══════════════════════════════════════════════════════════ */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =====================================================
      SLA WIDGET
    ===================================================== */

.sla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.sla-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 100px;
    transition: transform .18s, box-shadow .18s;
}

.sla-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.sla-card h3 {
    font-size: 9px;
    font-weight: 700;
    color: var(--txt-faint);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.sla-card div {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--mono);
    color: var(--txt);
    line-height: 1;
}

/* status color */

.sla-card.success {
    border-left-color: var(--green);
}

.sla-card.warning {
    border-left-color: var(--gold);
}

.sla-card.danger {
    border-left-color: var(--red);
}

.sla-card.primary {
    border-left-color: var(--blue);
}

/* tablet */

@media (max-width: 992px) {

    .sla-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

/* mobile */

@media (max-width: 768px) {

    .sla-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .sla-card {
        min-height: 82px;
        padding: 12px;
    }

    .sla-card h3 {
        font-size: 10px;
    }

    .sla-card div {
        font-size: 24px;
    }

}

/* mobile kecil */

@media (max-width: 480px) {

    .sla-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .sla-card {
        padding: 10px;
        min-height: 76px;
    }

    .sla-card h3 {
        font-size: 9px;
        margin-bottom: 6px;
    }

    .sla-card div {
        font-size: 20px;
    }

}