/* Modal Base */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--ap-bg-page);
    box-shadow: rgba(0, 0, 0, 0.5) 0px 20px 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    overflow: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--ap-border);
    position: relative;
}

.modal-title {
    color: var(--ap-text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding-right: 30px;
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--ap-text-muted);
    font-size: 20px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.close-btn:hover {
    color: var(--ap-text-primary);
}

.btn-danger {
    background: transparent;
    color: var(--ap-danger);
    border: 1px solid var(--ap-danger-border);
}

.btn-danger:hover {
    background: var(--ap-danger-light);
}

/* Modal Body */
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 24px;
    max-height: 300px;
    overflow: auto;
}

/* Modal Footer */
.modal-footer {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-footer.center {
    justify-content: center;
}

.modal-footer.space-between {
    justify-content: space-between;
}

/* Form Elements */
.form-input {
    width: 100%;
    background-color: var(--ap-bg-input);
    border: 1px solid var(--ap-border-muted);
    color: var(--ap-text-primary);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.invalid {
    border-color: var(--ap-danger);
}

.form-input:focus {
    border-color: var(--ap-accent);
}

.form-input.readonly {
    cursor: default;
}

.error-message {
    display: block;
    color: var(--ap-danger);
    font-size: 0.85em;
    margin-top: -10px;
    position: relative;
}

.error-message.hidden {
    display: none;
}


.form-label {
    color: var(--ap-text-secondary);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 8px;
    display: block;
}

.form-text {
    color: var(--ap-text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

.form-text strong {
    color: var(--ap-text-primary);
}

.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-actions .form-input {
    flex: 1;
    margin-bottom: 0;
}

.form-note {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    background-color: var(--ap-accent-light);
    border: 1px solid var(--ap-accent-muted);
    color: var(--ap-accent);
}

.note {
    font-size: 14px;
}

.form-hint {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
    line-height: 1.4;
}

.form-hint.hidden {
    display: none;
}

.note-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.note-icon svg {
    color: inherit;
}

.plus-notes svg {
    vertical-align: middle;
    margin-right: 4px;
    opacity: 0.7;
}

/* Share modal */
#sharePackageModal .modal-body {
    max-height: fit-content;
}

.renew-key-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.renew-key-btn:hover {
    color: var(--ap-text-primary);
}

.info-box {
    background: var(--ap-accent-light);
    border: 1px solid var(--ap-accent-muted);
    border-radius: 8px;
    padding: 12px;
}

.info-text {
    color: var(--ap-accent);
    font-size: 12px;
    line-height: 1.4;
}

/* Key Display */
.key-display {
    background-color: var(--ap-bg-input);
    border-radius: 8px;
    padding: 16px;
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.key-value {
    color: var(--ap-text-primary);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#keyValue {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toggle Switch */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background-color: var(--ap-bg-muted);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.toggle-switch.active {
    background: var(--ap-accent);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    width: fit-content;
    font-size: 11px;
    font-weight: 500;
}

.status-open {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.status-closed {
    background-color: var(--ap-danger-light);
    color: var(--ap-danger);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Modal Wide */
.modal-wide {
    max-width: 520px;
}

/* Warning Box */
.warning-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.warning-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.warning-full {
    background: var(--ap-warning-light);
    border: 1px solid var(--ap-warning-border);
    color: var(--ap-warning-text);
}

.warning-danger {
    background: var(--ap-danger-light);
    border: 1px solid var(--ap-danger-border);
    color: var(--ap-danger-text);
}

.warning-text strong {
    font-weight: 600;
}

/* Device List */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--ap-bg-input);
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.device-item:hover {
    border-color: var(--ap-accent);
    background: var(--ap-accent-subtle);
}

.device-item.selected {
    border-color: var(--ap-accent);
    background: var(--ap-accent-light);
}

.device-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.device-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--ap-accent-light);
    border-radius: 8px;
    color: var(--ap-accent);
    flex-shrink: 0;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-name {
    color: var(--ap-text-primary);
    font-size: 14px;
    font-weight: 500;
}

.device-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--ap-text-muted);
}

.device-version {
    padding: 2px 6px;
    background: var(--ap-bg-hover);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
}

.device-date {
    display: flex;
    align-items: center;
    gap: 4px;
}

.device-date::before {
    content: "•";
    color: var(--ap-border-muted);
}

/* Custom Radio Button */
.device-radio {
    position: relative;
}

.radio-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.radio-label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--ap-border-muted);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.radio-input:checked+.radio-label {
    border-color: var(--ap-accent);
}

.radio-input:checked+.radio-label::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ap-accent);
}

.radio-label:hover {
    border-color: var(--ap-accent);
}

/* Desabilita clique direto no radio/label para usar o clique no item inteiro */
.radio-input,
.radio-label {
    pointer-events: none;
}

/* Button States */
.btn-remove.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ============================================
   Plus Subscribe Modal
   ============================================ */
.plus-modal {
    max-width: 720px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--ap-bg-card);
}

.plus-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: var(--ap-bg-hover);
    border: none;
    color: var(--ap-text-primary);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.plus-close-btn:hover {
    background: var(--ap-bg-muted);
}

.plus-modal-content {
    display: flex;
    min-height: 420px;
}

.plus-modal-left {
    flex: 1;
    padding: 36px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.plus-modal-right {
    width: 280px;
    flex-shrink: 0;
    background: var(--ap-bg-page);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.plus-modal-right img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.plus-modal-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--ap-text-primary);
    margin: 0;
}

.plus-highlight {
    background: linear-gradient(135deg, #7c3aed, #28b0d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plus-subtitle {
    font-size: 18px;
    color: var(--ap-text-secondary);
    margin-top: 4px;
    font-weight: 400;
}

.plus-description {
    font-size: 14px;
    color: var(--ap-text-muted);
    line-height: 1.5;
    margin: 0;
}

.plus-description strong {
    color: var(--ap-text-primary);
}

.plus-benefits {
    list-style: none;
    padding: 14px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    background: var(--ap-bg-page);
}

.plus-benefits li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--ap-text-secondary);
}

.plus-benefits li svg {
    color: #22c55e;
    flex-shrink: 0;
    background: rgba(34, 197, 94, 0.12);
    border-radius: 50%;
    padding: 2px;
}

.plus-benefits li strong {
    color: var(--ap-text-primary);
}

.plus-pricing {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.plus-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--ap-text-primary);
}

.plus-period {
    font-size: 16px;
    color: var(--ap-text-muted);
}

.plus-cancel {
    font-size: 13px;
    color: #6b7280;
    margin-left: 8px;
}

.plus-cta-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    background: var(--ap-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(96, 165, 250, 0.3);
}

.plus-cta-btn:hover {
    background: var(--ap-accent-hover);
    box-shadow: 0 6px 20px rgba(96, 165, 250, 0.4);
    transform: translateY(-1px);
}

.plus-notes {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.plus-notes span {
    font-size: 12px;
    color: var(--ap-text-muted);
}

@media (max-width: 700px) {
    .plus-modal {
        max-width: 95vw;
    }

    .plus-modal-right {
        display: none;
    }
}

/* ============================================
   Sales History Modal
   ============================================ */
.sales-history-modal {
    max-width: 900px;
    width: 100%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    background: var(--ap-bg-card);
}

.sales-history-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: none;
}

/* Year Section */
.sh-year-group {
    margin-bottom: 32px;
}

.sh-year-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
}

.sh-year-stats {
    display: flex;
    align-items: center;
    gap: 0;
}

.sh-year-stat {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sh-year-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ap-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sh-year-stat-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--ap-text-primary);
}

.sh-year-stat-value.highlight {
    color: #4ade80;
}

.sh-year-divider {
    width: 1px;
    height: 36px;
    background: var(--ap-border);
    margin: 0 20px;
}

.sh-year-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--ap-bg-hover);
    border: 1px solid var(--ap-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-secondary);
    flex-shrink: 0;
}

/* Month Dropdown */
.sh-month-group {
    margin-bottom: 4px;
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
    overflow: hidden;
}

.sh-month-btn {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.sh-month-btn:hover {
    background: var(--ap-bg-hover);
}

.sh-month-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.sh-month-title-wrap .toggle-icon {
    transition: transform 0.2s;
    color: var(--ap-text-muted);
}

.sh-month-group.open .toggle-icon {
    transform: rotate(180deg);
}

.sh-month-tag {
    font-size: 13px;
    font-weight: 400;
    color: var(--ap-text-muted);
}

.sh-month-val-green {
    font-size: 15px;
    font-weight: 500;
    color: #4ade80;
}

.sh-month-stats {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.sh-month-content {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border-top: 1px solid transparent;
    transition: max-height 0.22s ease, border-color 0.22s ease;
}

.sh-month-group.open .sh-month-content {
    max-height: 340px;
    overflow-y: auto;
    border-top-color: var(--ap-border);
    transition: max-height 0.28s ease, border-color 0.15s ease;
}

/* Sale Items using Flex Columns */
.sh-table-header {
    display: flex;
    align-items: center;
    padding: 16px 20px 10px;
    border-bottom: 1px solid var(--ap-border);
    gap: 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ap-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sh-sale-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ap-border);
    gap: 16px;
}

.sh-sale-item:last-child {
    border-bottom: none;
}

.sh-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sh-col-id {
    width: 65px;
    flex-shrink: 0;
    color: var(--ap-text-muted);
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    font-weight: 500;
}

.sh-col-date {
    width: 110px;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 400;
}

.sh-sale-item .sh-col-date {
    color: var(--ap-text-secondary);
}


.sh-col-prod {
    flex: 1.5;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sh-col-user {
    flex: 2;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sh-col-val {
    flex-shrink: 0;
    align-items: flex-end;
    min-width: 80px;
}

.sh-col-liq {
    flex-shrink: 0;
    align-items: flex-end;
    min-width: 80px;
}

.sh-col-pay {
    width: 82px;
    flex-shrink: 0;
    align-items: flex-start;
}

.sh-pay-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.sh-pay-pix {
    background: rgba(74, 222, 128, 0.12);
    color: #16a34a;
}

.sh-pay-card {
    background: rgba(96, 165, 250, 0.12);
    color: #2563eb;
}

[data-theme="dark"] .sh-pay-pix {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

[data-theme="dark"] .sh-pay-card {
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
}

/* Helpers */
.sh-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--ap-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}


.user-avatar {
    background: linear-gradient(135deg, #475569, #334155);
}

.sh-texts {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sh-title {
    color: var(--ap-text-primary);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sh-sub {
    color: var(--ap-text-muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.date-sub {
    font-size: 12px;
    opacity: 0.8;
}

.sh-sale-revenue {
    color: var(--ap-text-primary);
    font-size: 15px;
    font-weight: 600;
}

.sh-sale-net {
    color: #4ade80;
    font-size: 12px;
    font-weight: 500;
    margin-top: 2px;
}

.sh-sale-actions,
.sh-dots-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.sh-sale-actions:hover,
.sh-dots-btn:hover {
    background: var(--ap-bg-hover);
    color: var(--ap-text-primary);
}

.sh-load-more-wrap {
    padding: 0 16px 16px;
}

.sh-load-more {
    width: auto;
    padding: 10px 24px;
    background: var(--ap-bg-hover);
    color: var(--ap-text-secondary);
    border: 1px solid var(--ap-border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 16px auto;
    display: block;
}

.sh-load-more:hover {
    background: var(--ap-bg-muted);
    color: var(--ap-text-primary);
}

.sh-empty-state {
    text-align: center;
    padding: 32px 16px;
    color: var(--ap-text-muted);
    font-size: 14px;
}

/* ============================================
   Product Details Modal
   ============================================ */
.pd-section {
    margin-bottom: 28px;
}

.pd-section:last-child {
    margin-bottom: 0;
}

.pd-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.pd-top-grid .pd-section {
    margin-bottom: 0;
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
    padding: 18px;
    min-width: 0;
}

.pd-top-grid .pd-section-title {
    margin-top: 0;
}

.pd-top-grid .pd-info-grid {
    border: none;
    background: transparent;
    border-radius: 8px;
}

.pd-top-grid .pd-info-item {
    background: var(--ap-bg-hover);
    border-radius: 0;
}

/* Users section inside top grid: scrollable */
.pd-top-grid .pd-section:last-child {
    display: flex;
    flex-direction: column;
    max-height: 400px;
}

.pd-top-grid .pd-section:last-child .sh-table-header,
.pd-top-grid .pd-section:last-child>div:last-child {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

@media (max-width: 700px) {
    .pd-top-grid {
        grid-template-columns: 1fr;
    }
}

.pd-user-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.pd-user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    border-radius: 8px;
    transition: background 0.15s;
}

.pd-user-item:hover {
    background: var(--ap-bg-hover);
}

.pd-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.pd-user-info .sh-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-user-info .sh-sub {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-user-date {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
}

.pd-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ap-border);
}

.pd-section-title svg {
    color: #6b7280;
    flex-shrink: 0;
}

.pd-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--ap-text-muted);
    background: var(--ap-bg-hover);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 4px;
}

.pd-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: var(--ap-bg-hover);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
    overflow: hidden;
}

.pd-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    background: var(--ap-bg-card-alt);
}

.pd-info-item:nth-child(odd):last-child {
    grid-column: 1 / -1;
}

.pd-info-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ap-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pd-info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--ap-text-primary);
}

.pd-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.pd-status-active {
    color: #4ade80;
}

.pd-status-active .status-dot {
    background: #4ade80;
}

.pd-status-paused {
    color: #fbbf24;
}

.pd-status-paused .status-dot {
    background: #fbbf24;
}

/* ============================================
   Withdrawal Modal (Detalhes de Saque)
   ============================================ */

/* Balance summary grid */
.wd-summary {
    margin-bottom: 4px;
}

.wd-balance-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.wd-balance-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.wd-balance-card.available {
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.04);
}

.wd-balance-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    flex-shrink: 0;
}

.wd-balance-icon.muted {
    background: var(--ap-bg-muted);
    color: var(--ap-text-secondary);
}

.wd-balance-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.wd-balance-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--ap-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.wd-balance-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--ap-text-primary);
    white-space: nowrap;
}

.wd-balance-value.available {
    color: #4ade80;
}

/* Withdraw steps */
.wd-step {
    margin-bottom: 24px;
}

.wd-step-1 {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Confirmation panel */
.wd-confirm-panel {
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 0;
}

.wd-confirm-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
    border-bottom: 1px solid var(--ap-border);
    background: var(--ap-bg-hover);
}

.wd-confirm-header svg {
    color: #facc15;
}

.wd-confirm-breakdown {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wd-confirm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wd-confirm-label {
    font-size: 13px;
    color: var(--ap-text-muted);
}

.wd-confirm-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.wd-confirm-fee .wd-confirm-label {
    color: var(--ap-text-secondary);
}

.wd-fee {
    color: var(--ap-danger-text);
}

.wd-confirm-divider {
    height: 1px;
    background: var(--ap-border);
    margin: 2px 0;
}

.wd-confirm-total .wd-confirm-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.wd-net {
    font-size: 20px;
    font-weight: 700;
    color: #4ade80;
}

.wd-confirm-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--ap-border);
    background: var(--ap-bg-card-alt);
}

.wd-cancel-btn {
    flex: 0 0 auto;
    padding: 0 20px;
    height: 40px;
    background: var(--ap-bg-hover);
    border: 1px solid var(--ap-border);
    border-radius: 8px;
    color: var(--ap-text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wd-cancel-btn:hover {
    background: var(--ap-bg-muted);
    color: var(--ap-text-primary);
}

.wd-confirm-btn-wrap {
    flex: 1;
}

.wd-withdraw-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.wd-withdraw-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.wd-no-balance-note {
    font-size: 12px;
    color: var(--ap-text-secondary);
    margin: 4px 0 0;
}

/* History section */
.wd-history-section {
    padding-top: 4px;
}

.wd-transfer-list {
    display: flex;
    flex-direction: column;
    overflow: auto;
    max-height: 400px;
}

.wd-transfer-row {
    border-bottom: 1px solid var(--ap-border);
}

.wd-transfer-row:last-child {
    border-bottom: none;
}

.wd-transfer-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

/* Status badges */
.wd-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.wd-status-success {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
}

.wd-status-pending {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
}

.wd-status-failed {
    background: rgba(248, 113, 113, 0.12);
    color: var(--ap-danger-text);
}

@media (max-width: 600px) {
    .wd-balance-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Recebíveis agendados ── */
.wd-payables-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--ap-bg-card-alt);
    border: 1px solid var(--ap-border);
    border-radius: 10px;
}

.wd-payables-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ap-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
}

.wd-payables-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 4px;
}

.wd-payable-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wd-payable-date {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--ap-text-secondary);
}

.wd-payable-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
}

.wd-payable-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.wd-payable-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
}

.wd-payable-count {
    font-size: 11px;
    color: var(--ap-text-muted);
    background: var(--ap-bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
}

/* ── Withdraw Confirm Modal ── */
.wc-modal {
    position: relative;
    max-width: 400px;
    width: 100%;
    padding: 0;
    border-radius: var(--ap-radius-xl);
    overflow: hidden;
}

.wc-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--ap-bg-hover);
    border: none;
    color: var(--ap-text-muted);
    font-size: 18px;
    line-height: 1;
    width: 30px;
    height: 30px;
    border-radius: var(--ap-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    z-index: 1;
}

.wc-close-btn:hover {
    background: var(--ap-bg-muted);
    color: var(--ap-text-primary);
}

.wc-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--ap-radius-full);
    background: var(--ap-accent-muted);
    color: var(--ap-accent);
    margin: 32px auto 0;
}

.wc-header {
    text-align: center;
    padding: 16px 28px 0;
}

.wc-title {
    font-family: var(--ap-font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--ap-text-primary);
    margin: 0 0 6px;
}

.wc-subtitle {
    font-size: 13px;
    color: var(--ap-text-muted);
    margin: 0;
}

.wc-body {
    padding: 24px 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--ap-radius-md);
}

.wc-row:hover {
    background: var(--ap-bg-hover);
}

.wc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--ap-text-secondary);
}

.wc-fee-badge {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--ap-text-muted);
    background: var(--ap-bg-muted);
    padding: 2px 7px;
    border-radius: var(--ap-radius-full);
    letter-spacing: 0.01em;
}

.wc-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-text-primary);
    font-variant-numeric: tabular-nums;
}

.wc-value-fee {
    font-size: 14px;
    font-weight: 600;
    color: var(--ap-danger);
    font-variant-numeric: tabular-nums;
}

.wc-separator {
    height: 1px;
    background: var(--ap-border);
    margin: 8px 14px;
}

.wc-row-net {
    margin-top: 4px;
    background: var(--ap-success-light);
    border-radius: var(--ap-radius-md);
    padding: 14px;
}

.wc-row-net:hover {
    background: var(--ap-success-light);
}

.wc-label-net {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ap-success-text);
}

.wc-value-net {
    font-size: 22px;
    font-weight: 700;
    color: var(--ap-success);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

.wc-footer {
    display: flex;
    gap: 10px;
    padding: 0 28px 28px;
}

.wc-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    border-radius: var(--ap-radius-md);
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, transform 0.1s;
}

.wc-btn:active {
    transform: scale(0.98);
}

.wc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wc-btn-cancel {
    background: var(--ap-bg-input);
    color: var(--ap-text-secondary);
    border: 1px solid var(--ap-border);
}

.wc-btn-cancel:hover:not(:disabled) {
    background: var(--ap-bg-hover);
}

.wc-btn-confirm {
    background: var(--ap-accent);
    color: #fff;
    flex: 1.6;
}

.wc-btn-confirm:hover:not(:disabled) {
    background: var(--ap-accent-hover);
}