/* User add/edit modals — dark chrome aligned with panel theme */

@media screen and (min-width: 640px) {
    .tw-user-modal .modal-width {
        width: 920px !important;
        max-width: calc(100% - 24px);
    }
}

.tw-user-modal .modal-dialog {
    margin: 4vh auto;
}

.tw-user-modal.fade .modal-dialog {
    transform: translate(0, 14px) scale(0.985);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
    opacity: 0;
}

.tw-user-modal.in .modal-dialog {
    transform: translate(0, 0) scale(1);
    opacity: 1;
}

.tw-user-modal__card {
    border: 1px solid var(--tw-line, #3a3a3a);
    border-radius: 14px;
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(194, 65, 12, 0.12), transparent 50%),
        linear-gradient(165deg, #2c2c2c 0%, #222 50%, #1c1c1c 100%);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    color: var(--tw-ink, #f3f4f6);
    overflow: hidden;
}

.tw-user-modal__header {
    position: relative;
    border: 0;
    border-bottom: 1px solid var(--tw-line, #3a3a3a);
    background: transparent;
    padding: 18px 52px 16px 22px;
}

.tw-user-modal__close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tw-muted, #9ca3af);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.tw-user-modal__close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.tw-user-modal__identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tw-user-modal__avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--tw-accent-soft, rgba(194, 65, 12, 0.18));
    border: 1px solid rgba(194, 65, 12, 0.35);
    color: #fdba74;
    font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.tw-user-modal__avatar--add {
    font-size: 18px;
    color: #fdba74;
}

.tw-user-modal__eyebrow {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tw-muted, #9ca3af);
    margin-bottom: 2px;
}

.tw-user-modal__title {
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', 'Outfit', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    line-height: 1.25;
}

.tw-user-modal__id {
    margin-left: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--tw-muted, #9ca3af);
}

.tw-user-modal__alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(127, 29, 29, 0.35);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: #fca5a5;
    font-size: 13px;
}

.tw-user-modal__body {
    padding: 16px 18px 8px;
    max-height: min(68vh, 720px);
    overflow-y: auto;
}

.tw-user-modal__tabs {
    margin: 0;
}

/* Primary tab strip as segmented control */
.tw-user-modal .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    border: 0;
    margin: 0 0 16px;
    padding: 4px;
    border-radius: 12px;
    background: #1a1a1a;
}

.tw-user-modal .nav-tabs > li {
    float: none;
    flex: 1 1 auto;
    margin: 0;
}

.tw-user-modal .nav-tabs > li > a {
    margin: 0;
    padding: 9px 10px;
    border: 0 !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: var(--tw-muted, #9ca3af) !important;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    line-height: 1.25;
    white-space: nowrap;
}

.tw-user-modal .nav-tabs > li > a:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.tw-user-modal .nav-tabs > li.active > a,
.tw-user-modal .nav-tabs > li.active > a:hover,
.tw-user-modal .nav-tabs > li.active > a:focus {
    color: #fff !important;
    background: var(--tw-accent, #c2410c) !important;
    box-shadow: 0 6px 16px rgba(194, 65, 12, 0.28);
}

.tw-user-modal .tab-content {
    background: transparent;
    border: 0;
    padding: 0;
}

.tw-user-modal .tab-pane {
    padding-top: 4px;
}

/* Nested country tabs inside commission section */
.tw-user-modal .tab-pane .nav-tabs {
    background: #222;
    margin-bottom: 12px;
}

.tw-user-modal .tab-pane .nav-tabs > li.active > a,
.tw-user-modal .tab-pane .nav-tabs > li.active > a:hover,
.tw-user-modal .tab-pane .nav-tabs > li.active > a:focus {
    background: #3a3a3a !important;
    box-shadow: none;
}

/* Field density */
.tw-user-modal__body label {
    display: block;
    margin: 10px 0 5px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--tw-muted, #9ca3af);
}

.tw-user-modal__body .label-middle label,
.tw-user-modal__body .col-lg-3.label-middle label {
    margin-top: 14px;
    text-align: right;
}

.tw-user-modal__body .form-control,
.tw-user-modal__body select.form-control,
.tw-user-modal__body .input-dialog {
    height: 36px;
    border-radius: 9px;
    border-color: var(--tw-line, #3a3a3a) !important;
    background: #1f1f1f !important;
    color: var(--tw-ink, #f3f4f6) !important;
    box-shadow: none;
}

.tw-user-modal__body textarea.form-control {
    height: auto;
    min-height: 72px;
}

.tw-user-modal__body .form-control:focus {
    border-color: var(--tw-accent, #c2410c) !important;
    box-shadow: 0 0 0 3px var(--tw-accent-ring, rgba(194, 65, 12, 0.25));
}

.tw-user-modal__body .form-control:disabled,
.tw-user-modal__body .form-control[disabled] {
    opacity: 0.65;
    background: #2a2a2a !important;
}

.tw-user-modal__body .ng-invalid.ng-dirty,
.tw-user-modal__body .ng-invalid.submitted,
.tw-user-modal form.ng-submitted .ng-invalid {
    border-color: #ef4444 !important;
}

.tw-user-modal__body .form_error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #f87171;
}

.tw-user-modal__body .checkbox,
.tw-user-modal__body .checkbox label {
    color: var(--tw-ink, #f3f4f6);
}

.tw-user-modal__body hr {
    border-top-color: var(--tw-line, #3a3a3a);
    margin: 16px 0;
}

.tw-user-modal__body .table {
    background: transparent;
    color: var(--tw-ink, #f3f4f6);
}

.tw-user-modal__body .table > thead > tr > th {
    border-bottom-color: var(--tw-line, #3a3a3a);
    color: var(--tw-muted, #9ca3af);
    font-size: 12px;
    font-weight: 600;
}

.tw-user-modal__body .table > tbody > tr > td {
    border-top-color: var(--tw-line, #3a3a3a);
    vertical-align: middle;
}

/* Sticky footer */
.tw-user-modal__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--tw-line, #3a3a3a);
    background: rgba(0, 0, 0, 0.2);
    padding: 14px 18px;
    text-align: left;
}

.tw-user-modal__accept {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
    color: var(--tw-muted, #9ca3af);
    cursor: pointer;
}

.tw-user-modal__accept input {
    margin: 0;
}

.tw-user-modal__actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.tw-user-modal__footer .btn {
    border-radius: 9px;
    font-family: 'Outfit', system-ui, sans-serif;
    font-weight: 600;
    padding: 8px 14px;
}

.tw-user-modal__footer .btn-default {
    background: transparent;
    border-color: var(--tw-line, #3a3a3a);
    color: var(--tw-ink, #f3f4f6);
}

.tw-user-modal__footer .btn-default:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555;
    color: #fff;
}

.tw-user-modal__footer .btn-primary {
    background: var(--tw-accent, #c2410c);
    border-color: var(--tw-accent, #c2410c);
    box-shadow: 0 8px 20px rgba(194, 65, 12, 0.28);
}

.tw-user-modal__footer .btn-primary:hover,
.tw-user-modal__footer .btn-primary:focus {
    background: var(--tw-accent-hover, #ea580c);
    border-color: var(--tw-accent-hover, #ea580c);
    color: #fff;
}

.tw-user-modal__footer .btn-primary i {
    margin-right: 6px;
}

@media (max-width: 767px) {
    .tw-user-modal .modal-dialog {
        margin: 8px;
        width: auto !important;
    }

    .tw-user-modal__body {
        max-height: 62vh;
    }

    .tw-user-modal .nav-tabs > li {
        flex: 1 1 48%;
    }

    .tw-user-modal__body .label-middle label,
    .tw-user-modal__body .col-lg-3.label-middle label {
        text-align: left;
        margin-top: 8px;
    }

    .tw-user-modal__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .tw-user-modal__actions {
        margin-left: 0;
        width: 100%;
    }

    .tw-user-modal__actions .btn {
        flex: 1;
    }
}

/* ========== Light theme — user add/edit modals ========== */
html.tw-theme-light .tw-user-modal__card {
    border-color: var(--tw-line);
    background:
        radial-gradient(ellipse 70% 50% at 0% 0%, rgba(194, 65, 12, 0.08), transparent 50%),
        linear-gradient(165deg, #ffffff 0%, #f8fafc 50%, #f1f5f9 100%);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.14);
    color: var(--tw-ink);
}

html.tw-theme-light .tw-user-modal__header {
    border-bottom-color: var(--tw-line);
}

html.tw-theme-light .tw-user-modal__close {
    color: var(--tw-muted);
}

html.tw-theme-light .tw-user-modal__close:hover {
    color: #111;
    background: rgba(15, 23, 42, 0.06);
}

html.tw-theme-light .tw-user-modal__title {
    color: #111827;
}

html.tw-theme-light .tw-user-modal__id {
    color: var(--tw-muted);
}

html.tw-theme-light .tw-user-modal .nav-tabs {
    background: #f3f4f6;
}

html.tw-theme-light .tw-user-modal .nav-tabs > li > a {
    color: var(--tw-muted) !important;
}

html.tw-theme-light .tw-user-modal .nav-tabs > li > a:hover {
    color: #111827 !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

html.tw-theme-light .tw-user-modal .tab-pane .nav-tabs {
    background: #eef2f7;
}

html.tw-theme-light .tw-user-modal .tab-pane .nav-tabs > li.active > a,
html.tw-theme-light .tw-user-modal .tab-pane .nav-tabs > li.active > a:hover,
html.tw-theme-light .tw-user-modal .tab-pane .nav-tabs > li.active > a:focus {
    background: #ffffff !important;
    color: #111827 !important;
}

html.tw-theme-light .tw-user-modal__body label {
    color: var(--tw-muted);
}

html.tw-theme-light .tw-user-modal__body .form-control,
html.tw-theme-light .tw-user-modal__body select.form-control,
html.tw-theme-light .tw-user-modal__body .input-dialog {
    background: #ffffff !important;
    border-color: var(--tw-line) !important;
    color: var(--tw-ink) !important;
}

html.tw-theme-light .tw-user-modal__body .form-control:disabled,
html.tw-theme-light .tw-user-modal__body .form-control[disabled] {
    background: #f3f4f6 !important;
    color: var(--tw-muted) !important;
}

html.tw-theme-light .tw-user-modal__body .checkbox,
html.tw-theme-light .tw-user-modal__body .checkbox label {
    color: var(--tw-ink);
}

html.tw-theme-light .tw-user-modal__body hr {
    border-top-color: var(--tw-line);
}

html.tw-theme-light .tw-user-modal__body .table {
    color: var(--tw-ink);
}

html.tw-theme-light .tw-user-modal__body .table > thead > tr > th {
    border-bottom-color: var(--tw-line);
    color: var(--tw-muted);
    background: transparent;
}

html.tw-theme-light .tw-user-modal__body .table > tbody > tr > td {
    border-top-color: var(--tw-line);
}

html.tw-theme-light .tw-user-modal__footer {
    border-top-color: var(--tw-line);
    background: rgba(15, 23, 42, 0.03);
}

html.tw-theme-light .tw-user-modal__accept {
    color: var(--tw-muted);
}

html.tw-theme-light .tw-user-modal__footer .btn-default {
    background: #ffffff;
    border-color: var(--tw-line);
    color: var(--tw-ink);
}

html.tw-theme-light .tw-user-modal__footer .btn-default:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #111827;
}

