* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: #f5f7fa;
    color: #17202a;
    font-family: Segoe UI,Arial,sans-serif
}

.topbar {
    height: 76px;
    background: #fff;
    border-bottom: 1px solid #e3e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 5
}

.brand {
    font-size: 23px;
    font-weight: 700
}

.sub {
    font-size: 12px;
    color: #7a858f;
    margin-top: 3px
}

.toolbar {
    display: flex;
    gap: 8px
}

    .toolbar input, .toolbar button, .search {
        height: 38px;
        border: 1px solid #ccd3da;
        border-radius: 7px;
        background: #fff;
        padding: 0 12px;
        font-size: 14px
    }

    .toolbar button {
        cursor: pointer;
        font-weight: 600
    }

        .toolbar button:hover {
            background: #f0f3f6
        }

main {
    max-width: 1450px;
    margin: auto;
    padding: 24px 30px
}

.error {
    background: #fff1f1;
    border: 1px solid #efb5b5;
    color: #a52a2a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px
}

.hidden {
    display: none
}

.cards {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 16px;
    margin-bottom: 20px
}

.card {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px #00000008
}

    .card span, .card small {
        display: block;
        color: #6d7780
    }

    .card strong {
        display: block;
        font-size: 30px;
        margin: 8px 0 4px
    }

    .card small {
        font-size: 12px
    }

.panel {
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 2px #00000008;
    margin-bottom: 20px
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px
}

    .panel-head h2 {
        margin: 0;
        font-size: 18px
    }

    .panel-head p {
        margin: 4px 0 0;
        color: #7a858f;
        font-size: 12px
    }

.search {
    width: 240px
}

.table-wrap {
    overflow: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px
}

th, td {
    padding: 12px 10px;
    border-bottom: 1px solid #edf0f2;
    text-align: left;
    white-space: nowrap
}

th {
    font-size: 12px;
    color: #6d7780;
    text-transform: uppercase
}

tbody tr {
    cursor: pointer
}

    tbody tr:hover {
        background: #f7f9fb
    }

.status {
    font-size: 12px;
    font-weight: 600
}

.online {
    color: #1b7f42
}

.offline {
    color: #9a5a00
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px
}

.bars {
    display: flex;
    flex-direction: column;
    gap: 12px
}

.bar-row {
    display: grid;
    grid-template-columns: 140px 1fr 60px;
    gap: 10px;
    align-items: center;
    font-size: 13px
}

.bar {
    height: 10px;
    background: #e9edf1;
    border-radius: 8px;
    overflow: hidden
}

    .bar > i {
        display: block;
        height: 100%;
        background: #4b78a8;
        border-radius: 8px
    }

.empty {
    color: #7a858f;
    padding: 30px 0
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px
}

.detail-item {
    padding: 10px;
    background: #f7f9fb;
    border-radius: 8px
}

    .detail-item label {
        display: block;
        font-size: 11px;
        color: #7a858f
    }

    .detail-item b {
        display: block;
        margin-top: 3px
    }

.loading {
    text-align: center;
    color: #7a858f;
    padding: 25px
}

@media(max-width:900px) {
    .cards {
        grid-template-columns: repeat(2,1fr)
    }

    .grid {
        grid-template-columns: 1fr
    }

    .topbar {
        height: auto;
        padding: 15px 20px;
        gap: 12px
    }

    .topbar, .panel-head {
        align-items: flex-start;
        flex-direction: column
    }

    main {
        padding: 18px 15px
    }

    .search {
        width: 100%
    }
}

@media(max-width:520px) {
    .cards {
        grid-template-columns: 1fr
    }
}
/* =========================================================
   SUPPORT TICKETS + DAILY DOCKET
========================================================= */

.dashboard-section {
    width: 100%;
    margin-top: 24px;
    padding: 0;
    overflow: hidden;
}

    /* ---------------------------------------------------------
   Section Header
--------------------------------------------------------- */

    .dashboard-section .panel-head {
        padding: 20px 20px 16px 20px;
        margin: 0;
        border-bottom: 1px solid #e5e7eb;
        background: #ffffff;
    }

        .dashboard-section .panel-head h2 {
            font-size: 19px;
            font-weight: 700;
            color: #17202a;
        }

        .dashboard-section .panel-head p {
            margin-top: 5px;
            color: #6b7280;
            font-size: 13px;
        }

.section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

    .section-actions select {
        height: 38px;
        min-width: 140px;
        padding: 0 12px;
        border: 1px solid #ccd3da;
        border-radius: 7px;
        background: #fff;
        color: #17202a;
        font-size: 14px;
    }

    .section-actions button {
        height: 38px;
        padding: 0 16px;
        border: 1px solid #17202a;
        border-radius: 7px;
        background: #17202a;
        color: #fff;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
    }

        .section-actions button:hover {
            background: #303942;
        }


/* =========================================================
   SUMMARY CARDS
========================================================= */

.support-summary,
.docket-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 20px;
    margin: 0;
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.support-card {
    min-width: 0;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #dfe4e8;
    border-radius: 9px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

    .support-card span {
        display: block;
        color: #6b7280;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .3px;
    }

    .support-card b {
        display: block;
        margin-top: 6px;
        color: #17202a;
        font-size: 24px;
        line-height: 1.1;
    }


/* =========================================================
   TABLE AREA
========================================================= */

.dashboard-section .table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
}

.dashboard-section table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    font-size: 13px;
}

.dashboard-section th {
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #dfe4e8;
    color: #66717b;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    text-align: left;
    white-space: nowrap;
}

.dashboard-section td {
    padding: 13px 14px;
    border-bottom: 1px solid #edf0f2;
    color: #303942;
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.dashboard-section tbody tr {
    cursor: pointer;
    transition: background .15s ease;
}

    .dashboard-section tbody tr:hover {
        background: #f8fafc;
    }

    .dashboard-section tbody tr:last-child td {
        border-bottom: 0;
    }


/* =========================================================
   TICKET STATUS BADGE
========================================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    background: #eef2f6;
    color: #374151;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}


/* =========================================================
   LOADING / EMPTY
========================================================= */

.dashboard-section .loading {
    padding: 35px 20px;
    text-align: center;
    color: #7a858f;
}

.dashboard-section td[colspan] {
    text-align: center;
    color: #7a858f;
    padding: 30px 15px;
}


/* =========================================================
   MODAL
========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .45);
}

    .modal.hidden {
        display: none;
    }

.modal-box {
    width: 760px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

    .modal-header h2 {
        margin: 0;
        font-size: 20px;
    }

    .modal-header button {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 5px;
        background: transparent;
        font-size: 25px;
        cursor: pointer;
    }

        .modal-header button:hover {
            background: #f1f1f1;
        }


/* =========================================================
   FORM
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    padding: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

    .form-group label {
        font-size: 13px;
        font-weight: 600;
        color: #374151;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
        padding: 9px 10px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #fff;
        color: #17202a;
        font-family: inherit;
        font-size: 14px;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #64748b;
            box-shadow: 0 0 0 2px rgba(100,116,139,.12);
        }

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #e5e7eb;
}

    .form-actions button {
        padding: 9px 18px;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        background: #fff;
        cursor: pointer;
        font-size: 14px;
    }

        .form-actions button[type="submit"] {
            border-color: #17202a;
            background: #17202a;
            color: #fff;
            font-weight: 600;
        }

            .form-actions button[type="submit"]:hover {
                background: #303942;
            }


/* =========================================================
   DETAIL
========================================================= */

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 20px;
}

.detail-item {
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    background: #fafafa;
}

    .detail-item label {
        display: block;
        margin-bottom: 4px;
        font-size: 12px;
        color: #6b7280;
    }

    .detail-item b {
        font-size: 14px;
    }


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1100px) {

    .support-summary,
    .docket-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-section .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-actions {
        width: 100%;
        justify-content: flex-start;
    }
}


@media (max-width: 700px) {

    .support-summary,
    .docket-summary {
        grid-template-columns: 1fr;
    }

    .section-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .section-actions select,
        .section-actions button {
            width: 100%;
        }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full {
        grid-column: auto;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 10px;
    }

    .modal-box {
        max-height: 95vh;
    }
}

.grid-hide {
    display: none !important;
}