body {
    font-family: 'Montserrat', sans-serif !important;
    background: #f0f0f1;
}
.tms-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0 18px;
    gap: 12px;
}
.tms-page-header__left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.tms-page-icon {
    font-size: 32px;
    color: #4b0082;
}
.tms-page-title {
    margin: 0;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    line-height: 1.2 !important;
}
.tms-page-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: #64748b;
}

/* ── Stats strip ─────────────────────────────────────────────────────────── */
.tms-stats-strip {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}
.tms-stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.tms-stat-pill__num {
    font-size: 22px;
    font-weight: 700;
    color: #4b0082;
    line-height: 1;
}
.tms-stat-pill__label {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.tms-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.tms-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafafa;
}
.tms-card-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tms-card-count {
    font-size: 13px;
    color: #64748b;
}

/* ── Role badges ─────────────────────────────────────────────────────────── */
.tms-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tms-role-sub {
    background: #ede9fe;
    color: #4b0082;
}
.tms-role-group {
    background: #dcfce7;
    color: #15803d;
}

/* ── Table ───────────────────────────────────────────────────────────────── */
.tms-table-wrap {
    overflow-x: auto;
}
.tms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.tms-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.tms-table td {
    padding: 11px 14px;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.tms-table tbody tr:last-child td {
    border-bottom: none;
}
.tms-table tbody tr:hover td {
    background: #fafbff;
}
.tms-col-num {
    color: #94a3b8;
    font-size: 12px;
    width: 36px;
}
.tms-col-actions {
    width: 130px;
}

/* ── User cell (avatar + name) ───────────────────────────────────────────── */
.tms-user-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}
.tms-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.tms-username {
    background: #f1f5f9;
    color: #475569;
    padding: 2px 7px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

/* ── Status indicator ────────────────────────────────────────────────────── */
.tms-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
}
.tms-status-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.tms-status-active {
    color: #15803d;
}
.tms-status-active::before {
    background: #22c55e;
}

/* ── Group badge ─────────────────────────────────────────────────────────── */
.tms-group-badge {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.tms-muted {
    color: #94a3b8;
    font-size: 13px;
}

/* ── Row actions ─────────────────────────────────────────────────────────── */
.tms-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.tms-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #94a3b8;
}
.tms-empty-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 8px;
}
.tms-empty-state p {
    margin: 0 0 12px;
    font-size: 14px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.tms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1;
    transition:
        background 0.3s,
        box-shadow 0.15s,
        opacity 0.15s;
    white-space: nowrap;
    border: none;
    padding: 14px 32px;
    border-radius: 50px;
}
.tms-btn:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}
.tms-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tms-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #f4a304 0%, #f97316 100%);
}
.tms-btn-primary:hover,
.tms-btn:hover {
    background: #4b0082;
    color: #fff;
}

.tms-btn-outline {
    background: #fff !important;
    color: #94a3b8;
    border: 1px solid #cbd5e1 !important;
    padding: 12px 32px !important;
    border-radius: 50px !important;
    font-size: 16px !important;
}
.tms-btn-outline:hover {
    background: #f8fafc;
    color: #1e293b;
    border-color: #94a3b8;
}

.tms-btn-danger {
    background: #ef4444;
    color: #fff;
}
.tms-btn-danger:hover {
    background: #dc2626;
    color: #fff;
}

.tms-btn-ghost {
    background: transparent;
    color: #4b0082;
    border: 1px solid #c7d2fe;
}
.tms-btn-ghost:hover {
    background: #4b0082;
    border: none;
}

.tms-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.tms-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 7px;
    font-size: 13px;
    margin-bottom: 16px;
    font-weight: 500;
}
.tms-notice-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.tms-notice-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* ── Modal overlay ───────────────────────────────────────────────────────── */
.tms-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    backdrop-filter: blur(2px);
}
body.tms-modal-open {
    overflow: hidden;
}

/* ── Modal box ───────────────────────────────────────────────────────────── */
.tms-modal {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    animation: tmsModalIn 0.18s ease;
}
.tms-modal--sm {
    max-width: 420px;
}

@keyframes tmsModalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tms-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 12px 12px 0px 0px;
}
.tms-modal-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1e293b;
}
.tms-modal-header--danger {
    background: #fef2f2;
}
.tms-modal-header--danger h2 {
    color: #b91c1c;
}

.tms-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tms-modal-close:hover {
    color: #475569;
    background: #f1f5f9;
}

.tms-modal-body {
    padding: 20px 22px;
}

.tms-modal-notice {
    margin-bottom: 14px;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
}

/* ── Form grid ───────────────────────────────────────────────────────────── */
.tms-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
}
.tms-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.tms-form-group--full {
    grid-column: 1 / -1;
}

.tms-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
.tms-required {
    color: #ef4444;
}
.tms-field-note {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 4px;
}
.tms-field-hint {
    font-size: 11px;
    color: #94a3b8;
    min-height: 14px;
}

.tms-form-group input,
.tms-form-group select,
.tms-form-group textarea {
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
    max-width: 100%;
}
.tms-form-group input:focus,
.tms-form-group select:focus,
.tms-form-group textarea:focus {
    outline: none;
    border-color: #4b0082;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.tms-form-group input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* ── Password wrap ───────────────────────────────────────────────────────── */
.tms-password-wrap {
    position: relative;
}
.tms-password-wrap input {
    padding-right: 42px;
}
.tms-toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px;
    line-height: 1;
    display: flex;
}
.tms-toggle-pass:hover {
    color: #475569;
}

/* ── Modal footer ────────────────────────────────────────────────────────── */
.tms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 22px 18px;
    border-top: 1px solid #f1f5f9;
}

/* ── Confirm modal text ──────────────────────────────────────────────────── */
.tms-confirm-msg {
    margin: 0;
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
@keyframes tmsSpin {
    to {
        transform: rotate(360deg);
    }
}
.tms-spin {
    animation: tmsSpin 0.7s linear infinite;
    display: inline-block;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .tms-form-grid {
        grid-template-columns: 1fr;
    }
    .tms-stats-strip {
        gap: 8px;
    }
    .tms-page-header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    .tms-card-header {
        flex-direction: column;
        /* align-items: flex-start; */
        row-gap: 8px;
    }
    .tms-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: flex-start !important;
    }
}
@media (max-width: 1200px) {
    .tms-page-header {
        width: 90%;
    }
}
