.tms-inbox-page {
    position: relative;
    overflow: hidden;
    background: #ffffff;
    min-height: calc(100vh - 60px);
}

.tms-inbox-wrap {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    text-align: left;
    padding-top: 40px;
    padding-bottom: 60px;
}

.tms-inbox-title {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, #126082 0%, #769d49 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.tms-inbox-subtitle {
    color: #495057;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 28px;
}

.tms-inbox-subtitle code {
    color: #126082;
    font-size: 13px;
}

.tms-inbox-card,
.tms-list-card {
    background: #fff;
    border: 1px solid rgba(18, 96, 130, 0.12);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(18, 96, 130, 0.08);
    padding: 24px;
    margin-bottom: 24px;
}

.tms-label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
}

.tms-id-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    margin-bottom: 12px;
}

.tms-id-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.04em;
    background: #f1f3f5 !important;
    border: 1px solid #dee2e6 !important;
    padding: 10px 12px !important;
}

.tms-btn {
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 14px;
    white-space: nowrap;
}

.tms-btn-primary {
    background: #126082;
    color: #fff;
}

.tms-btn-primary:hover {
    background: #0e4e69;
    color: #fff;
}

.tms-btn-secondary {
    background: #769d49;
    color: #fff;
}

.tms-btn-secondary:hover {
    background: #62853c;
    color: #fff;
}

.tms-btn-copy {
    background: #e9ecef;
    color: #495057;
    min-width: 46px;
}

.tms-btn-stop {
    background: #dc3545;
    color: #fff;
}

.tms-btn-stop:hover {
    background: #bb2d3b;
    color: #fff;
}

.tms-header-hint {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 18px;
}

.tms-header-hint code {
    display: inline-block;
    margin-top: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    color: #126082;
    word-break: break-all;
}

.tms-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.tms-status {
    font-size: 13px;
    color: #6c757d;
}

.tms-status.is-error {
    color: #dc3545;
}

.tms-status.is-live {
    color: #198754;
}

.tms-list-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 16px;
    gap: 12px;
}

.tms-list-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #212529;
    margin: 0;
}

.tms-poll-hint {
    font-size: 12px;
    color: #6c757d;
}

.tms-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.tms-badge.ok {
    color: #198754;
}

.tms-badge.bad {
    color: #dc3545;
}

.tms-report-link {
    color: #126082;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.tms-report-link:hover {
    text-decoration: underline;
}

/* DataTable layout */
.tms-list-card .dataTables_wrapper {
    width: 100%;
}

.tms-dt-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.tms-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #eef1f4;
}

.tms-dt-length label,
.tms-dt-search label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #6c757d;
}

.tms-dt-length select {
    appearance: auto;
    -webkit-appearance: auto;
    min-width: 90px;
    height: 40px;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    color: #212529;
    padding: 0 10px !important;
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.tms-dt-length select:focus {
    border-color: #126082 !important;
    box-shadow: 0 0 0 3px rgba(18, 96, 130, 0.12);
}

.tms-dt-search input {
    width: min(280px, 70vw) !important;
    height: 40px;
    margin: 0 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    background: #f8f9fa !important;
    color: #212529;
    padding: 0 14px !important;
    font-size: 14px;
    outline: none;
}

.tms-dt-search input:focus {
    border-color: #126082 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(18, 96, 130, 0.12);
}

.tms-dt-info {
    font-size: 13px;
    color: #6c757d;
    padding: 0 !important;
}

/* Pagination */
.tms-dt-paginate .pagination {
    margin: 0;
    gap: 4px;
    flex-wrap: wrap;
}

.tms-dt-paginate .page-item .page-link {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dee2e6;
    border-radius: 8px !important;
    color: #495057;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 0 10px;
    margin: 0 !important;
}

.tms-dt-paginate .page-item .page-link:hover {
    background: #f1f3f5;
    border-color: #ced4da;
    color: #126082;
}

.tms-dt-paginate .page-item.active .page-link {
    background: #126082;
    border-color: #126082;
    color: #fff;
}

.tms-dt-paginate .page-item.disabled .page-link {
    background: #f8f9fa;
    color: #adb5bd;
    border-color: #e9ecef;
}

/* Table body */
#tms_arrivals_table {
    font-size: 14px;
    color: #495057;
    margin-bottom: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

#tms_arrivals_table thead th {
    white-space: nowrap;
    color: #212529;
    font-weight: 700;
    font-size: 13px;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef !important;
    padding: 12px 14px !important;
    vertical-align: middle;
}

#tms_arrivals_table thead th.sorting,
#tms_arrivals_table thead th.sorting_asc,
#tms_arrivals_table thead th.sorting_desc {
    cursor: pointer;
}

#tms_arrivals_table tbody td {
    padding: 12px 14px !important;
    vertical-align: middle;
    border-color: #eef1f4 !important;
}

#tms_arrivals_table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: rgba(18, 96, 130, 0.03);
}

#tms_arrivals_table.dataTable > thead > tr > th:not(.sorting_disabled)::before,
#tms_arrivals_table.dataTable > thead > tr > th:not(.sorting_disabled)::after {
    opacity: 0.35;
}

@media (max-width: 768px) {
    .tms-inbox-title {
        font-size: 32px;
    }

    .tms-id-row {
        grid-template-columns: 1fr auto;
    }

    .tms-btn-copy {
        grid-column: 2;
    }

    .tms-dt-toolbar,
    .tms-dt-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tms-dt-search input {
        width: 100% !important;
    }

    .tms-dt-paginate .pagination {
        justify-content: center;
    }
}
