* {
    box-sizing: border-box;
}

:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --panel-2: #f8fbff;
    --text: #172033;
    --muted: #6b7280;
    --line: #e5e7eb;
    --primary: #2563eb;
    --primary-2: #1d4ed8;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #dc2626;
    --gray: #6b7280;
    --nav: #0f172a;
    --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Segoe UI, Arial, sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
}

.sidebar {
    background: linear-gradient(180deg, #0f172a, #0b1324);
    color: #f9fafb;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
}

.brand h1 {
    margin: 0;
    font-size: 22px;
}

.brand p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #cbd5e1;
}

.side-nav {
    display: grid;
    gap: 10px;
}

.nav-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border-radius: 14px;
    padding: 14px 12px;
    text-align: left;
    cursor: pointer;
    transition: 0.18s ease;
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(37, 99, 235, 0.28);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.18);
}

.token-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 18px;
    padding: 14px 12px;
    display: grid;
    gap: 10px;
}

.token-card label {
    font-size: 12px;
    color: #cbd5e1;
}

.token-card input {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    border-radius: 12px;
    padding: 11px 12px;
    outline: none;
}

.main-content {
    padding: 24px;
    display: grid;
    gap: 22px;
    align-content: start;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.topbar h2 {
    margin: 0;
    font-size: 24px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border-radius: 20px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
    padding: 18px 18px 16px;
    display: grid;
    gap: 8px;
    border: 1px solid #e4ecf7;
    border-top: 4px solid #dbe4f0;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.11);
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.stat-card strong {
    font-size: 34px;
    line-height: 1;
}

.stat-card.success {
    border-top-color: var(--success);
    box-shadow: 0 16px 34px rgba(22, 163, 74, 0.08);
}

.stat-card.warning {
    border-top-color: var(--warning);
    box-shadow: 0 16px 34px rgba(245, 158, 11, 0.09);
}

.stat-card.danger {
    border-top-color: var(--danger);
    box-shadow: 0 16px 34px rgba(220, 38, 38, 0.08);
}

.stat-card.gray {
    border-top-color: var(--gray);
}

.panel,
.inset-panel {
    background: var(--panel);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 16px;
    min-width: 0;
}

.panel-grid {
    display: grid;
    gap: 18px;
}

.triple-grid {
    grid-template-columns: 1fr 1fr 0.9fr;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-head.wrap {
    flex-wrap: wrap;
}

.panel h3,
.panel h4 {
    margin: 0;
}

.filters-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    row-gap: 12px;
}

.filters-row input,
.filters-row select {
    min-width: 180px;
    min-height: 42px;
}

.list-stack {
    display: grid;
    gap: 10px;
}

#partnersList {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.list-item {
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    border: 1px solid #e3ebf5;
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.list-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    border-color: #d5e2f2;
}

.summary-box {
    display: grid;
    gap: 10px;
}

.partners-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0 16px;
}

.summary-line {
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    border: 1px solid #e3ebf5;
    border-radius: 14px;
    padding: 12px 14px;
}

.partner-card {
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    border: 1px solid #e3ebf5;
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 10px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.partner-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
    border-color: #d5e2f2;
}

.partner-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.partner-card-title h4 {
    margin: 0 0 2px;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: -0.2px;
}

.partner-chip {
    padding: 7px 10px;
    border-radius: 11px;
    background: #ffffff;
    border: 1px solid #e3ebf5;
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
}

.partner-chip {
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e3ebf5;
    color: var(--text);
    font-size: 13px;
}

.partner-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.partner-stat {
    padding: 10px 12px;
    border-radius: 13px;
    background: #ffffff;
    border: 1px solid #e3ebf5;
    display: grid;
    gap: 4px;
}

.partner-stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.partner-stat strong {
    font-size: 18px;
    line-height: 1;
}

.partner-card-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 2px;
}

.table-wrap {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px 10px;
    border-bottom: 1px solid #e8edf5;
    text-align: left;
    vertical-align: top;
}

.data-table tbody tr {
    transition: background 0.16s ease;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 28px;
}

.pagination-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.pagination-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-chip {
    min-width: 40px;
    height: 34px;
    border-radius: 10px;
    background: #e8eefc;
    color: #1e3a8a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    padding: 0 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.95;
}

.badge.active {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.badge.suspended {
    background: rgba(107, 114, 128, 0.14);
    color: var(--gray);
}

.badge.expired {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.badge.expiring {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quick-renew {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.quick-renew .btn {
    padding: 6px 8px;
    font-size: 12px;
}

.btn {
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    cursor: pointer;
    font-weight: 700;
    transition: 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 10px;
    font-size: 13px;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-2);
}

.btn-secondary {
    background: #e8eefc;
    color: #26418f;
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
}

.icon-btn {
    border: 0;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.status-ok {
    color: #cfe7ff;
}

.status-error {
    color: #fecaca;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
}

#paymentProofsModal {
    z-index: 1100;
}

#confirmModal {
    z-index: 1300;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-card {
    position: relative;
    z-index: 2;
    width: min(720px, calc(100vw - 24px));
    margin: 38px auto;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(2, 6, 23, 0.22);
    overflow: hidden;
}

#confirmModal .modal-card {
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.32);
}

#rejectProofModal .modal-card {
    max-width: 560px;
}

#rejectProofModal textarea {
    resize: vertical;
    min-height: 110px;
}

.modal-sm {
    width: min(520px, calc(100vw - 24px));
}

.modal-xl {
    width: min(1100px, calc(100vw - 24px));
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.modal-body {
    padding: 20px;
}

.partner-modal-body {
    max-height: 82vh;
    overflow-y: auto;
    padding-right: 6px;
}

.partner-modal-body::-webkit-scrollbar {
    width: 10px;
}

.partner-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.form-grid,
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.filters-row input,
.filters-row select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    outline: none;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

#pAccessToken {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.2px;
}

.detail-item {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.detail-item span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 6px;
}

.detail-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.events-box {
    display: grid;
    gap: 10px;
}

#partnerAssignForm {
    margin-top: 4px;
}

.event-item {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
}

.partner-client-item {
    display: grid;
    gap: 14px;
}

.partner-client-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.partner-client-actions-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.partner-client-commission-box {
    min-width: 220px;
    display: grid;
    gap: 6px;
}

.partner-client-commission-input {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
}

.partner-client-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.partner-earnings-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.partner-earnings-toolbar>div:first-child {
    min-width: 220px;
    display: grid;
    gap: 6px;
}

.partner-earnings-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.partner-earning-item {
    display: grid;
    gap: 6px;
}

.partner-tabs {
    display: flex;
    gap: 10px;
    margin: 8px 0 16px;
    flex-wrap: wrap;
}

.partner-tab-btn {
    border: 1px solid var(--line);
    background: #eef4ff;
    color: #26418f;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 700;
}

.partner-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.section-hidden {
    display: none;
}

.partner-earnings-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.partner-earnings-toolbar>div:first-child {
    min-width: 220px;
    display: grid;
    gap: 6px;
}

.partner-earnings-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.partner-clients-panel-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.partner-clients-search-wrap {
    min-width: 260px;
    width: min(360px, 100%);
}

.partner-clients-search {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    outline: none;
}

#partnerClientsBox {
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 6px;
}

#partnerClientsBox::-webkit-scrollbar {
    width: 10px;
}

#partnerClientsBox::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#partnerClientsBox::-webkit-scrollbar-track {
    background: transparent;
}

.confirm-message {
    margin: 0 0 10px;
    color: var(--text);
    line-height: 1.5;
}

.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: grid;
    gap: 10px;
    z-index: 1200;
}

.toast {
    min-width: 260px;
    max-width: 360px;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);
    animation: toastIn 0.18s ease;
}

.toast.success {
    background: #16a34a;
}

.toast.error {
    background: #dc2626;
}

.toast.info {
    background: #2563eb;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1450px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .triple-grid {
        grid-template-columns: 1fr;
    }

    #partnersList {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        padding: 18px;
        min-width: 0;
    }

    .main-content {
        padding: 18px;
        min-width: 0;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid,
    .detail-grid,
    .partners-summary-grid,
    .partner-card-stats {
        grid-template-columns: 1fr;
    }

    #partnersList {
        grid-template-columns: 1fr;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row>* {
        width: 100%;
        min-width: 0;
    }

    .filters-row input,
    .filters-row select {
        min-width: 0;
        width: 100%;
    }

    .check-inline {
        width: 100%;
        justify-content: space-between;
    }

    .table-wrap {
        overflow-x: auto;
        overflow-y: visible;
        width: 100%;
        max-width: 100%;
    }

    .data-table {
        min-width: 980px;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .actions-cell {
        min-width: 260px;
    }
}

.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #e4e9f2;
    background: #f9fbff;
    border-radius: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
}

.check-inline input {
    width: 15px;
    height: 15px;
    margin: 0;
}

.bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.bulk-actions.hidden {
    display: none;
}

.bulk-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.client-select-cell {
    width: 42px;
}

.client-select {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

#selectAllClients {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.proof-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.proof-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.proof-badge.pending {
    background: rgba(245, 158, 11, 0.14);
    color: var(--warning);
}

.proof-badge.none {
    background: rgba(107, 114, 128, 0.12);
    color: var(--gray);
}

.proof-badge.approved {
    background: rgba(22, 163, 74, 0.12);
    color: var(--success);
}

.proof-card {
    background: var(--panel-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.proof-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.proof-meta {
    display: grid;
    gap: 4px;
}

.proof-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.payment-proofs-modal-body {
    max-height: 75vh;
    overflow: hidden;
}

.payment-proofs-list-scroll {
    max-height: 62vh;
    overflow-y: auto;
    padding-right: 6px;
}

.payment-proofs-list-scroll::-webkit-scrollbar {
    width: 10px;
}

.payment-proofs-list-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.payment-proofs-list-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.proof-section {
    margin-bottom: 18px;
}

.proof-section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.pricing-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.pricing-card {
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    border: 1px solid #e3ebf5;
    border-radius: 20px;
    padding: 18px;
    display: grid;
    gap: 14px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.pricing-card-highlight {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.08);
}

.pricing-card-annual {
    border-color: rgba(22, 163, 74, 0.2);
}

.pricing-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.pricing-form-grid {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 12px;
}

.pricing-form-grid .full {
    grid-column: 1 / -1;
}

.pricing-form-grid label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.pricing-form-grid input {
    width: 100%;
}

.pricing-preview {
    display: grid;
    gap: 4px;
    padding: 14px 14px;
    background: #ffffff;
    border: 1px dashed #d8e1ee;
    border-radius: 14px;
}

.pricing-preview strong {
    font-size: 18px;
}

.pricing-preview span:last-child {
    color: var(--muted);
    font-size: 13px;
}

.pricing-active-toggle {
    align-self: center;
}

.pending-proofs-dashboard-list {
    max-height: 430px;
    overflow-y: auto;
    padding-right: 6px;
}

.pending-proofs-dashboard-list::-webkit-scrollbar {
    width: 10px;
}

.pending-proofs-dashboard-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

.pending-proofs-dashboard-list::-webkit-scrollbar-track {
    background: transparent;
}

.pending-proof-item {
    align-items: center;
}

.proof-badge-dashboard {
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.dashboard-item-expiring {
    border-left: 4px solid rgba(245, 158, 11, 0.75);
}

.dashboard-item-expired {
    border-left: 4px solid rgba(220, 38, 38, 0.75);
}

.alert-item {
    border-left: 4px solid rgba(245, 158, 11, 0.75);
}

.empty-state {
    display: grid;
    gap: 6px;
    padding: 22px 18px;
    border-radius: 16px;
    border: 1px dashed #d7e1ef;
    background: linear-gradient(180deg, #fbfdff, #f7faff);
    color: var(--muted);
}

.empty-state strong {
    color: var(--text);
    font-size: 15px;
}

.empty-state span {
    font-size: 13px;
    line-height: 1.45;
}

.empty-state.compact {
    padding: 16px 14px;
}

.panel {
    border-radius: 14px;
    background: #ffffff;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 6px 18px rgba(0, 0, 0, 0.06);
}

.pending-proofs-panel {
    border: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow:
        0 4px 14px rgba(59, 130, 246, 0.08),
        inset 0 0 0 1px rgba(59, 130, 246, 0.03);
}

.sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.btn {
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.table tbody tr {
    transition: background 0.15s ease, transform 0.1s ease;
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
    transform: scale(1.002);
}

.partner-access-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.partner-access-inline input {
    flex: 1 1 260px;
    min-width: 0;
    font-family: Consolas, "Courier New", monospace;
}

.detail-item-access {
    display: block;
}

.partner-access-card {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: 1px solid #dbe6f6;
    background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.partner-access-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.partner-access-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid rgba(22, 163, 74, 0.18);
}

.partner-access-meta {
    display: grid;
    gap: 4px;
}

.partner-access-line {
    font-size: 13px;
    color: #334155;
}

.partner-access-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.partner-access-inline input {
    flex: 1 1 280px;
    min-width: 0;
    font-family: Consolas, "Courier New", monospace;
}

.partner-access-help {
    font-size: 12px;
    color: #64748b;
}

@media (max-width: 980px) {

    .partner-access-head,
    .partner-access-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .partner-access-inline .btn {
        width: 100%;
    }

    .filters-row input,
    .filters-row select {
        min-width: 0;
        width: 100%;
    }

    .filters-row {
        flex-direction: column;
    }

    .check-inline {
        width: 100%;
        justify-content: space-between;
    }

    .table-wrap {
        overflow-x: auto;
        overflow-y: visible;
    }

    .data-table {
        min-width: 980px;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }

    .actions-cell {
        min-width: 260px;
    }
}

.partner-access-badge.pending {
    background: rgba(148, 163, 184, 0.15);
    color: #64748b;
    border-color: rgba(148, 163, 184, 0.25);
}

.clients-mobile-list {
    display: none;
}

.client-mobile-card {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #e3ebf5;
    background: linear-gradient(180deg, #fbfdff, #f6faff);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.client-mobile-head {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}

.client-mobile-title {
    display: grid;
    gap: 4px;
}

.client-mobile-title strong {
    font-size: 16px;
    line-height: 1.15;
}

.client-mobile-badge {
    grid-column: 1 / -1;
}

.client-mobile-meta {
    display: grid;
    gap: 8px;
}

.client-mobile-meta .summary-line {
    padding: 10px 12px;
}

.client-mobile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-mobile-renew {
    margin-top: 0;
}

.client-mobile-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

@media (max-width: 980px) {
    .clients-desktop-wrap {
        display: none;
    }

    .clients-mobile-list {
        display: grid;
        gap: 12px;
    }

    .client-mobile-actions .btn,
    .client-mobile-renew .btn {
        flex: 1 1 calc(50% - 4px);
    }
}

/* PARTNER_COMMISSION_RULES_001:BEGIN */
.partner-rule-stat strong {
    font-size: 13px;
    line-height: 1.25;
}

.partner-client-rule-card {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #dbeafe;
    background: linear-gradient(180deg, #eff6ff, #f8fbff);
}

.partner-client-rule-card span,
.partner-client-rule-card small {
    display: block;
}

.partner-client-rule-card strong {
    display: block;
    margin: 4px 0 2px;
    font-size: 20px;
    color: #1d4ed8;
    line-height: 1;
}
/* PARTNER_COMMISSION_RULES_001:END */

/* CLIENTES_CRM_PRO_001:BEGIN */

#clientsView.clients-view-pro,
#clientsView {
    --clients-blue: #2563eb;
    --clients-blue-soft: #eff6ff;
    --clients-line: #e2e8f0;
    --clients-text: #0f172a;
    --clients-muted: #64748b;
}

#clientsView .clients-panel-pro {
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.08);
}

.clients-pro-shell {
    display: grid;
    gap: 16px;
    padding: 18px 18px 0;
}

.clients-hero-pro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border-radius: 20px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #172554 56%, #0f172a 100%);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.clients-eyebrow {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.16);
    border: 1px solid rgba(147, 197, 253, 0.22);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}

.clients-hero-pro h3 {
    margin: 10px 0 5px;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -0.4px;
}

.clients-hero-pro p {
    margin: 0;
    color: #cbd5e1;
    font-size: 14px;
    line-height: 1.45;
    max-width: 760px;
}

.clients-hero-actions {
    flex-shrink: 0;
}

.clients-hero-actions .btn {
    background: rgba(255,255,255,0.1);
    color: #e0f2fe;
    border: 1px solid rgba(147, 197, 253, 0.22);
}

.clients-insight-bar {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.client-insight-card {
    display: grid;
    gap: 8px;
    min-height: 86px;
    padding: 14px;
    border-radius: 17px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #e4ecf7;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.05);
    border-top: 4px solid #93c5fd;
}

.client-insight-card span {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.client-insight-card strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
    letter-spacing: -0.4px;
}

.client-insight-card.success {
    border-top-color: #22c55e;
}

.client-insight-card.warning {
    border-top-color: #f59e0b;
}

.client-insight-card.danger {
    border-top-color: #ef4444;
}

.client-insight-card.gray {
    border-top-color: #64748b;
}

.client-insight-card.proof {
    border-top-color: #8b5cf6;
}

.clients-filter-card {
    margin: 16px 18px 0;
    padding: 14px;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff, #f8fbff);
    border: 1px solid #e4ecf7;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.clients-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.clients-filter-head strong {
    display: block;
    font-size: 15px;
    letter-spacing: -0.1px;
}

.clients-filter-head span {
    display: block;
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

#clientsView .clients-filters-pro {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(170px, .75fr));
    gap: 10px;
    align-items: center;
}

#clientsView .clients-filters-pro input,
#clientsView .clients-filters-pro select {
    min-width: 0;
    width: 100%;
    min-height: 42px;
    border-radius: 13px;
    border-color: #dbe5f2;
    background: #ffffff;
    box-shadow: inset 0 1px 0 rgba(15,23,42,0.02);
}

#clientsView .check-inline {
    width: 100%;
    min-width: 0;
    justify-content: space-between;
    border-color: #dbe5f2;
    background: #f8fbff;
    font-weight: 800;
    color: #334155;
}

#clientsView .check-inline input {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    padding: 0 !important;
    flex: 0 0 16px;
    accent-color: #2563eb;
}

#clientsView .bulk-actions {
    margin: 14px 18px 0;
}

#clientsView .clients-desktop-wrap {
    margin: 16px 18px 0;
    border-radius: 18px;
    border: 1px solid #e5edf7;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.05);
}

#clientsView .data-table {
    border-collapse: separate;
    border-spacing: 0;
}

#clientsView .data-table th {
    padding: 14px 12px;
    background: #f8fbff;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid #e5edf7;
}

#clientsView .data-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

#clientsView .client-row-pro {
    transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

#clientsView .client-row-pro:hover {
    background: #fbfdff;
}

.client-main-cell {
    min-width: 220px;
}

.client-name-pro {
    color: #0f172a;
    font-weight: 900;
    letter-spacing: -0.15px;
    line-height: 1.15;
}

.client-email-pro {
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
}

.license-chip,
.machine-chip,
.last-check-chip,
.date-pill,
.days-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: 180px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.license-chip {
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    font-family: Consolas, "Courier New", monospace;
}

.machine-chip {
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-family: Consolas, "Courier New", monospace;
}

.machine-chip.empty,
.muted-chip {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-family: inherit;
}

.last-check-chip,
.date-pill {
    color: #334155;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.days-pill.success {
    color: #15803d;
    background: rgba(22, 163, 74, 0.10);
    border: 1px solid rgba(22, 163, 74, 0.18);
}

.days-pill.warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.13);
    border: 1px solid rgba(245, 158, 11, 0.24);
}

.days-pill.danger {
    color: #b91c1c;
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.22);
}

.days-pill.neutral {
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.client-actions-pro {
    display: grid;
    gap: 8px;
    min-width: 360px;
}

.client-primary-actions,
.client-renew-actions,
.client-secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.client-renew-actions {
    padding: 7px;
    border-radius: 13px;
    background: #f8fbff;
    border: 1px solid #e5edf7;
}

.client-secondary-actions .btn {
    opacity: .92;
}

#clientsView .pagination-bar {
    margin: 12px 18px 18px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid #e5edf7;
}

.clients-empty-pro {
    margin: 16px 18px 18px;
}

.client-mobile-card-pro {
    border-radius: 18px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
}

.client-mobile-license-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.client-mobile-card-pro .summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.client-mobile-card-pro .summary-line span {
    text-align: right;
}

@media (max-width: 1500px) {
    .clients-insight-bar {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    #clientsView .clients-filters-pro {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .clients-pro-shell {
        padding: 14px 14px 0;
    }

    .clients-hero-pro {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .clients-hero-pro h3 {
        font-size: 23px;
    }

    .clients-insight-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .clients-filter-card {
        margin: 14px 14px 0;
    }

    #clientsView .clients-filters-pro {
        grid-template-columns: 1fr;
    }

    #clientsView .bulk-actions {
        margin: 14px 14px 0;
    }

    #clientsView .clientsMobileList,
    #clientsView .clients-mobile-list {
        margin: 14px;
    }

    #clientsView .pagination-bar {
        margin: 12px 14px 14px;
    }

    .client-mobile-card-pro .client-mobile-actions .btn,
    .client-mobile-card-pro .client-mobile-renew .btn {
        flex: 1 1 calc(50% - 4px);
    }
}

@media (max-width: 560px) {
    .clients-insight-bar {
        grid-template-columns: 1fr;
    }

    .client-mobile-card-pro .summary-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-mobile-card-pro .summary-line span {
        text-align: left;
    }

    .client-mobile-card-pro .client-mobile-actions .btn,
    .client-mobile-card-pro .client-mobile-renew .btn {
        flex: 1 1 100%;
    }
}

/* CLIENTES_CRM_PRO_001:END */

