
.ewtm-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.ewtm-head h1 {
    margin: 6px 0 8px;
}

.ewtm-head p {
    margin: 0;
    color: #64748b;
    line-height: 1.5;
}

.ewtm-kicker {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ewtm-head > button {
    min-height: 44px;
    margin: 0;
    padding: 10px 15px;
    border: 0;
    border-radius: 11px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.ewtm-toolbar {
    display: grid;
    grid-template-columns:
        minmax(190px, 240px)
        minmax(260px, 1fr)
        minmax(190px, 250px);
    gap: 10px;
    align-items: end;
    margin-bottom: 13px;
    padding: 14px;
    border: 1px solid #dbe3ef;
    border-radius: 15px;
    background: #ffffff;
}

.ewtm-toolbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ewtm-toolbar label > span {
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ewtm-toolbar input,
.ewtm-toolbar select {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    font: inherit;
}

.ewtm-toolbar label input,
.ewtm-toolbar select {
    padding: 9px 11px;
}

.ewtm-search {
    position: relative;
}

.ewtm-search i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: #94a3b8;
    transform: translateY(-50%);
}

.ewtm-search input {
    padding: 9px 11px 9px 39px;
}

.ewtm-message {
    min-height: 22px;
    margin: 8px 0;
    font-weight: 800;
}

.ewtm-message.loading {
    color: #475569;
}

.ewtm-message.success {
    color: #166534;
}

.ewtm-message.error {
    color: #b91c1c;
}

.ewtm-summary {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 11px;
    margin-bottom: 11px;
}

.ewtm-summary-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid #dbe3ef;
    border-radius: 15px;
    background: #ffffff;
    cursor: pointer;
}

.ewtm-summary-card > i {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: #e2e8f0;
    color: #334155;
}

.ewtm-summary-card span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.ewtm-summary-card strong {
    display: block;
    margin-top: 4px;
    font-size: 25px;
}

.ewtm-summary-card.review {
    background: #fffbeb;
}

.ewtm-summary-card.review > i {
    background: #fef3c7;
    color: #92400e;
}

.ewtm-summary-card.approved {
    background: #f0fdf4;
}

.ewtm-summary-card.approved > i {
    background: #dcfce7;
    color: #166534;
}

.ewtm-summary-card.closed {
    background: #f1f5f9;
}

.ewtm-summary-card.closed > i {
    background: #cbd5e1;
    color: #0f172a;
}

.ewtm-totals {
    display: grid;
    grid-template-columns:
        repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.ewtm-totals article {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.ewtm-totals span {
    display: block;
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.ewtm-totals strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.ewtm-table-card {
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 16px;
    background: #ffffff;
    box-shadow:
        0 5px 15px
        rgba(15, 23, 42, .05);
}

.ewtm-table-wrap {
    overflow: auto;
}

.ewtm-table {
    width: 100%;
    border-collapse: collapse;
}

.ewtm-table th,
.ewtm-table td {
    padding: 12px;
    border-bottom:
        1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}

.ewtm-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 10px;
    text-transform: uppercase;
}

.ewtm-table td small {
    display: block;
    margin-top: 4px;
    color: #64748b;
}

.ewtm-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 10px;
    font-weight: 900;
}

.ewtm-badge.review {
    background: #fef3c7;
    color: #92400e;
}

.ewtm-badge.approved {
    background: #dcfce7;
    color: #166534;
}

.ewtm-badge.closed {
    background: #cbd5e1;
    color: #0f172a;
}

.ewtm-data-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.ewtm-data-state.ok {
    background: #dcfce7;
    color: #166534;
}

.ewtm-data-state.danger {
    background: #fee2e2;
    color: #991b1b;
}

.ewtm-actions {
    display: flex;
    min-width: 210px;
    flex-wrap: wrap;
    gap: 6px;
}

.ewtm-actions button {
    min-height: 34px;
    margin: 0;
    padding: 7px 9px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.ewtm-actions button.success {
    background: #16a34a;
}

.ewtm-actions button.danger {
    background: #dc2626;
}

.ewtm-actions button.warning {
    background: #f59e0b;
    color: #451a03;
}

.ewtm-actions button.secondary {
    background: #e2e8f0;
    color: #334155;
}

.ewtm-empty,
.ewtm-error {
    display: flex;
    min-height: 125px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 20px;
    color: #64748b;
    text-align: center;
}

.ewtm-empty i,
.ewtm-error i {
    font-size: 25px;
    color: #94a3b8;
}

.ewtm-error,
.ewtm-error i,
.ewtm-error strong {
    color: #991b1b;
}

.ewtm-modal {
    z-index: 101200;
}

.ewtm-modal-box {
    width: 670px;
    max-width: 95vw;
    max-height: 93vh;
    padding: 0;
    overflow: hidden;
}

.ewtm-history-box {
    width: 820px;
}

.ewtm-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom:
        1px solid #e2e8f0;
}

.ewtm-modal-head h2 {
    margin: 0 0 5px;
}

.ewtm-modal-head p {
    margin: 0;
    color: #64748b;
}

.ewtm-modal-head > button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: #e2e8f0;
    color: #334155;
    cursor: pointer;
}

.ewtm-modal-body {
    max-height:
        calc(93vh - 82px);
    overflow: auto;
    padding: 18px 20px;
}

.ewtm-transition {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 12px;
    background: #f8fafc;
}

.ewtm-transition.compact {
    justify-content: flex-start;
    padding: 0;
    background: transparent;
}

.ewtm-transition > i {
    color: #94a3b8;
}

.ewtm-warning-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 12px;
    padding: 11px;
    border-radius: 10px;
    background: #fff7ed;
    color: #9a3412;
    line-height: 1.45;
}

.ewtm-reason {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
}

.ewtm-reason span {
    color: #475569;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.ewtm-reason textarea {
    width: 100%;
    min-height: 125px;
    box-sizing: border-box;
    padding: 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    resize: vertical;
    font: inherit;
}

.ewtm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 14px;
}

.ewtm-modal-actions button {
    min-height: 43px;
    margin: 0;
    padding: 10px 15px;
    border: 0;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 900;
    cursor: pointer;
}

.ewtm-modal-actions button.secondary {
    background: #e2e8f0;
    color: #334155;
}

.ewtm-modal-actions button:disabled {
    cursor: wait;
    opacity: .65;
}

.ewtm-history-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.ewtm-history-list article {
    padding: 13px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    background: #ffffff;
}

.ewtm-history-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ewtm-history-head time {
    color: #64748b;
    font-size: 12px;
}

.ewtm-history-list p {
    margin: 10px 0;
    padding: 9px 10px;
    border-radius: 9px;
    background: #f8fafc;
    color: #334155;
    line-height: 1.45;
}

.ewtm-history-list small {
    color: #64748b;
}

@media (max-width: 1050px) {
    .ewtm-toolbar {
        grid-template-columns:
            1fr 1fr;
    }

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

@media (max-width: 760px) {
    .ewtm-head {
        flex-direction: column;
    }

    .ewtm-head > button {
        width: 100%;
    }

    .ewtm-toolbar,
    .ewtm-summary,
    .ewtm-totals {
        grid-template-columns: 1fr;
    }

    .ewtm-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ewtm-modal-box {
        width: 100%;
        max-width: 100vw;
        max-height: 95dvh;
        border-radius:
            22px 22px 0 0;
    }

    .ewtm-modal-body {
        max-height:
            calc(95dvh - 82px);
        padding: 14px;
    }

    .ewtm-modal-actions {
        flex-direction:
            column-reverse;
    }

    .ewtm-modal-actions button {
        width: 100%;
    }

    .ewtm-history-head {
        flex-direction: column;
    }

    .ewtm-transition.compact {
        flex-wrap: wrap;
    }
}
