/* ==========================================================================
   Central do Assinante — Daki Net Telecom
   Design System: Tailored to Daki Net official brand colors (Deep Forest & Emerald).
   Follows design-taste-frontend / app-screens anti-slop guidelines.
   ========================================================================== */

:root {
    /* Color Palette derived from Daki Net Logo */
    --brand-primary: #144230;        /* Deep Forest Green (NET) */
    --brand-primary-hover: #0e3023;  /* Dark Forest */
    --brand-accent: #059669;         /* Vibrant Emerald Green (DAKI & Wi-Fi) */
    --brand-accent-hover: #047857;   /* Emerald Dark */
    --brand-light: #eaf5ef;          /* Fresh Sage/Emerald tint */
    --brand-light-border: #bce3cf;   /* Soft Emerald border */
    
    /* Surfaces & Backgrounds */
    --ground: #f4f7f5;               /* Clean neutral canvas with sage warmth */
    --surface: #ffffff;              /* Pure white card surface */
    --surface-subtle: #edf3f0;       /* Muted slate-sage surface */
    --border: #dbe5e0;               /* 1px quiet divider */
    --border-strong: #b8c9c1;        /* Active border */
    
    /* Typography Inks */
    --ink: #0f1f17;                  /* Slate-forest primary high-contrast */
    --ink-secondary: #3b5247;        /* Forest-slate secondary */
    --ink-muted: #5e756b;            /* Muted metadata */
    
    /* Semantic Status (quiet, low-saturation backgrounds) */
    --status-pending-text: #b45309;
    --status-pending-bg: #fffbeb;
    --status-pending-border: #fde68a;
    
    --status-paid-text: #14532d;
    --status-paid-bg: #f0fdf4;
    --status-paid-border: #bbf7d0;

    --status-overdue-text: #b91c1c;
    --status-overdue-bg: #fef2f2;
    --status-overdue-border: #fecaca;

    /* Metrics & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 9999px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-tabular: 'Inter', -apple-system, BlinkMacSystemFont, monospace;
}

/* Base Reset & Foundation */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--ground);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container Layout */
.app-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top App Bar */
.app-header {
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-container {
    max-width: 640px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-sub {
    font-size: 13px;
    color: var(--ink-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background-color: var(--brand-light);
    border: 1px solid var(--brand-light-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--brand-primary);
}

.header-badge svg {
    color: var(--brand-accent);
}

/* Main Canvas */
.app-main {
    flex: 1;
    max-width: 640px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* Cards & View States */
.screen-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.view-hidden {
    display: none !important;
}

.view-active {
    display: block;
}

/* Hero Content */
.hero-block {
    margin-bottom: 24px;
}

.main-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-primary);
    margin-bottom: 8px;
    line-height: 1.25;
}

.subtitle {
    font-size: 14px;
    color: var(--ink-secondary);
    line-height: 1.5;
}

/* Search Form */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    height: 52px;
    padding: 0 46px 0 16px;
    font-size: 18px;
    font-weight: 500;
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.form-input:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.clear-btn {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--ink-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.clear-btn:hover {
    color: var(--ink);
    background-color: var(--surface-subtle);
}

.input-error-msg {
    display: none;
    font-size: 13px;
    color: var(--status-overdue-text);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.12s ease, transform 0.08s ease, border-color 0.12s ease;
    user-select: none;
}

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

.btn-primary {
    background-color: var(--brand-primary);
    color: #ffffff;
    height: 50px;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
}

.btn-block {
    width: 100%;
}

.btn-subtle {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    background-color: var(--surface-subtle);
    border-color: var(--border);
    color: var(--ink-secondary);
}

.btn-subtle:hover {
    background-color: #dbe6e0;
    color: var(--brand-primary);
}

.btn-download {
    background-color: var(--brand-primary);
    color: #ffffff;
    height: 46px;
    padding: 0 18px;
    font-size: 14px;
}

.btn-download:hover {
    background-color: var(--brand-primary-hover);
}

.btn-pix {
    background-color: var(--brand-accent);
    color: #ffffff;
    height: 46px;
    padding: 0 18px;
    font-size: 14px;
}

.btn-pix:hover {
    background-color: var(--brand-accent-hover);
}

.btn-secondary {
    background-color: #ffffff;
    border: 1.5px solid var(--border-strong);
    color: var(--ink);
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
}

.btn-secondary:hover {
    background-color: var(--surface-subtle);
}

/* Security Note */
.security-footer-note {
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.4;
}

.security-footer-note svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--brand-accent);
}

/* Custom Logo Loading State */
.loading-state {
    text-align: center;
    padding: 44px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loading-logo-wrap {
    width: 120px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoBreath 1.5s ease-in-out infinite;
}

.loading-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes logoBreath {
    0%, 100% {
        transform: scale(0.96);
        opacity: 0.65;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
        filter: drop-shadow(0 4px 12px rgba(5, 150, 105, 0.25));
    }
}

.loading-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-primary);
}

.loading-subtitle {
    font-size: 13px;
    color: var(--ink-muted);
}

/* Subscriber Header in Results */
.subscriber-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

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

.avatar-tag {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--brand-light);
    border: 1.5px solid var(--brand-light-border);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.subscriber-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.subscriber-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--brand-accent);
    background-color: var(--brand-light);
    border: 1px solid var(--brand-light-border);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
}

.subscriber-doc {
    font-size: 13px;
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    color: var(--ink-muted);
}

/* Contracts & Invoices Feed */
.contracts-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contract-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contract-header {
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contract-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contract-plan-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-primary);
}

.contract-status-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    background-color: var(--brand-light);
    color: var(--brand-accent);
    border: 1px solid var(--brand-light-border);
}

.status-badge-active {
    background-color: var(--status-paid-bg);
    color: var(--status-paid-text);
    border-color: var(--status-paid-border);
}

.status-badge-blocked {
    background-color: var(--status-overdue-bg);
    color: var(--status-overdue-text);
    border-color: var(--status-overdue-border);
    font-weight: 700;
}

.contract-header-blocked {
    border-color: #fca5a5;
    background: #fffafa;
}

.contract-actions-blocked {
    background-color: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-top: 10px;
}

.text-blocked {
    color: #9f1239;
    font-size: 12px;
}

.text-blocked svg {
    stroke: #e11d48;
}

.contract-address {
    font-size: 12px;
    color: var(--ink-muted);
}


/* Invoices Cards */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.invoice-card {
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.invoice-card:hover {
    border-color: var(--border-strong);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.invoice-paid-card {
    opacity: 0.9;
    background-color: var(--surface-subtle);
}

.invoice-top-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.invoice-meta-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invoice-label {
    font-size: 11px;
    color: var(--ink-muted);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.invoice-due-date {
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.invoice-status-tag {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
}

.status-pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
    border-color: var(--status-pending-border);
}

.status-overdue {
    background-color: var(--status-overdue-bg);
    color: var(--status-overdue-text);
    border-color: var(--status-overdue-border);
}

.status-paid {
    background-color: var(--status-paid-bg);
    color: var(--status-paid-text);
    border-color: var(--status-paid-border);
}

.invoice-amount-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.currency-sym {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-secondary);
}

.invoice-amount-val {
    font-size: 32px;
    font-weight: 800;
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    color: var(--brand-primary);
}

.invoice-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

@media (min-width: 480px) {
    .invoice-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* Empty State: Zero Invoices */
.empty-invoices-card {
    background-color: var(--brand-light);
    border: 1px solid var(--brand-light-border);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #d1fae5;
    color: var(--brand-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-primary);
}

.empty-desc {
    font-size: 14px;
    color: var(--ink-secondary);
    max-width: 380px;
    line-height: 1.4;
}

/* History Accordion */
.history-accordion {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: #ffffff;
    overflow: hidden;
}

.history-summary {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    user-select: none;
    background-color: var(--surface-subtle);
    transition: background-color 0.12s ease;
}

.history-summary::-webkit-details-marker {
    display: none;
}

.history-summary:hover {
    background-color: #dbe6e0;
    color: var(--brand-primary);
}

.history-summary .chevron-icon {
    transition: transform 0.2s ease;
}

.history-accordion[open] .chevron-icon {
    transform: rotate(180deg);
}

.history-list {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--ground);
}

/* PIX Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 31, 23, 0.65);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.18s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pix-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background-color: var(--brand-light);
    color: var(--brand-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-primary);
}

.modal-subtitle {
    font-size: 12px;
    color: var(--ink-muted);
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-close-btn:hover {
    background-color: var(--surface-subtle);
    color: var(--ink);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pix-qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.pix-qr-frame {
    padding: 12px;
    background-color: #ffffff;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pix-qr-code {
    width: 190px;
    height: 190px;
    display: block;
    object-fit: contain;
}

.pix-val-tag {
    font-size: 14px;
    color: var(--ink-secondary);
}

.pix-val-tag strong {
    font-size: 18px;
    color: var(--brand-primary);
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    margin-left: 4px;
}

.pix-copy-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pix-copy-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pix-code-field {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    background-color: var(--surface-subtle);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-tabular);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    color: var(--ink-secondary);
    outline: none;
}

.btn-copy-pix {
    height: 46px;
    background-color: var(--brand-accent);
}

.btn-copy-pix:hover {
    background-color: var(--brand-accent-hover);
}

.pix-instructions {
    background-color: var(--surface-subtle);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
    color: var(--ink-secondary);
    line-height: 1.4;
}

.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--brand-primary);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 200;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 90vw;
    text-align: center;
}

.toast-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    padding: 20px 16px;
    font-size: 13px;
    color: var(--ink-muted);
}

.footer-container {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

@media (min-width: 480px) {
    .footer-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.support-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-secondary);
    text-decoration: none;
    font-weight: 500;
}

.support-link:hover {
    color: var(--brand-primary);
}

/* ========================================================
   Desbloqueio de Confiança Component & Modal
   ======================================================== */
.contract-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
    flex-wrap: wrap;
}

.desbloq-callout-text {
    font-size: 12px;
    color: var(--ink-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-desbloq-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-desbloq-trigger:hover {
    background-color: #fef3c7;
    border-color: #fcd34d;
    transform: translateY(-1px);
}

.btn-desbloq-trigger.btn-desbloq-used {
    background-color: var(--surface-subtle);
    color: var(--ink-muted);
    border-color: var(--border);
    cursor: default;
    pointer-events: none;
    transform: none;
}

/* Modal Internal Elements */
.desbloq-badge-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background-color: #fffbeb;
    color: #d97706;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.desbloq-contract-badge {
    background-color: var(--surface-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.desbloq-lbl {
    color: var(--ink-muted);
    font-weight: 500;
}

.desbloq-info-box {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #1e40af;
    font-size: 13px;
    line-height: 1.45;
}

.desbloq-info-box svg {
    flex-shrink: 0;
    margin-top: 1px;
    stroke: #2563eb;
}

.desbloq-notice {
    font-size: 12px;
    color: var(--ink-muted);
    line-height: 1.4;
    margin: 0;
}

.desbloq-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 8px;
}

.desbloq-actions .btn {
    min-height: 42px;
    padding: 0 18px;
}

/* Result Modal Body */
.desbloq-result-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px auto 4px auto;
}

.desbloq-result-success {
    background-color: #ecfdf5;
    color: #059669;
}

.desbloq-result-warning {
    background-color: #fffbeb;
    color: #d97706;
}

.desbloq-result-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    margin: 0;
}

.desbloq-result-message {
    font-size: 13.5px;
    color: var(--ink-secondary);
    line-height: 1.5;
    text-align: center;
    margin: 0;
    background-color: var(--surface-subtle);
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

/* Header Actions & Admin Link */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    background-color: #0f172a;
    border: 1px solid #1e293b;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.header-admin-btn:hover {
    background-color: #1e293b;
}

/* Footer & Discrete Admin Access */
.app-footer {
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    padding: 16px 20px;
    font-size: 12px;
    color: var(--ink-muted);
}

.footer-container {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-divider {
    color: var(--border-strong);
}

.admin-footer-link {
    color: var(--ink-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.admin-footer-link:hover {
    color: var(--brand-primary);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS & TOUCH ERGONOMICS (Max-Width 540px / Smartphone)
   ========================================================================== */
@media (max-width: 540px) {
    /* Header layout */
    .header-container {
        padding: 10px 14px;
        gap: 8px;
    }

    .brand {
        gap: 8px;
    }

    .brand-logo-img {
        height: 32px;
    }

    .brand-sub {
        font-size: 11px;
        white-space: nowrap;
    }

    .header-actions {
        gap: 6px;
    }

    .header-badge {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .header-admin-btn {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }

    /* Main Container & View Cards */
    .app-main {
        padding: 14px 12px 36px;
    }

    .screen-card {
        padding: 20px 14px;
        border-radius: var(--radius-md);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    }

    .hero-block {
        margin-bottom: 18px;
    }

    .main-title {
        font-size: 21px;
        line-height: 1.25;
        margin-bottom: 6px;
    }

    .subtitle {
        font-size: 13px;
        line-height: 1.45;
    }

    /* Input & Search Form */
    .search-form {
        gap: 16px;
    }

    .form-group {
        gap: 6px;
    }

    .form-label {
        font-size: 12.5px;
    }

    .form-input {
        height: 48px;
        font-size: 16px; /* Prevents auto-zoom on iOS Safari */
        padding: 0 42px 0 14px;
        border-radius: var(--radius-md);
    }

    .clear-btn {
        width: 32px;
        height: 32px;
        right: 8px;
    }

    .btn-primary {
        height: 48px;
        font-size: 15px;
        border-radius: var(--radius-md);
    }

    .security-footer-note {
        margin-top: 18px;
        font-size: 11.5px;
        line-height: 1.4;
    }

    /* Loading State */
    .loading-state {
        padding: 36px 12px;
        gap: 12px;
    }

    .loading-logo-wrap {
        width: 100px;
        height: 56px;
    }

    .loading-title {
        font-size: 16px;
    }

    .loading-subtitle {
        font-size: 12.5px;
    }

    /* Subscriber Bar (Clean Stacking for Mobile) */
    .subscriber-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 16px;
        margin-bottom: 18px;
    }

    .subscriber-info {
        gap: 10px;
    }

    .avatar-tag {
        width: 40px;
        height: 40px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .subscriber-name-row {
        gap: 6px;
    }

    .subscriber-name {
        font-size: 15px;
        word-break: break-word;
    }

    .verified-pill {
        font-size: 10px;
        padding: 2px 6px;
    }

    .subscriber-doc {
        font-size: 12px;
    }

    .subscriber-bar .btn-subtle {
        width: 100%;
        height: 38px;
        justify-content: center;
        font-size: 13px;
        border-radius: var(--radius-sm);
    }

    /* Contracts & Badges */
    .contracts-feed {
        gap: 18px;
    }

    .contract-group {
        gap: 12px;
    }

    .contract-header {
        padding: 12px 14px;
        border-radius: var(--radius-md);
    }

    .contract-title-row {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
        justify-content: space-between;
    }

    .contract-plan-name {
        font-size: 13.5px;
        word-break: break-word;
    }

    .contract-status-badge {
        font-size: 10.5px;
        padding: 2px 8px;
    }

    .contract-address {
        font-size: 11.5px;
        line-height: 1.35;
    }

    .contract-actions-blocked {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
        margin-top: 8px;
    }

    .desbloq-callout-text {
        font-size: 11.5px;
        line-height: 1.35;
    }

    .btn-desbloq-trigger {
        width: 100%;
        justify-content: center;
        height: 38px;
        font-size: 12px;
    }

    /* Invoices Cards */
    .invoices-list {
        gap: 12px;
    }

    .invoice-card {
        padding: 16px 14px;
        gap: 14px;
        border-radius: var(--radius-md);
    }

    .invoice-top-row {
        gap: 8px;
        align-items: flex-start;
    }

    .invoice-label {
        font-size: 10px;
    }

    .invoice-due-date {
        font-size: 15.5px;
    }

    .invoice-status-tag {
        font-size: 11px;
        padding: 3px 8px;
        white-space: nowrap;
    }

    .invoice-amount-row {
        gap: 3px;
        align-items: baseline;
    }

    .currency-sym {
        font-size: 15px;
    }

    .invoice-amount-val {
        font-size: 26px;
    }

    .invoice-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .invoice-actions .btn {
        width: 100%;
        min-height: 46px;
        font-size: 14px;
        border-radius: var(--radius-md);
    }

    /* Empty State */
    .empty-invoices-card {
        padding: 24px 14px;
        gap: 10px;
    }

    .empty-icon-wrap {
        width: 42px;
        height: 42px;
    }

    .empty-title {
        font-size: 15px;
    }

    .empty-desc {
        font-size: 12.5px;
        line-height: 1.4;
    }

    /* History Accordion */
    .history-summary {
        padding: 12px 14px;
        font-size: 12.5px;
    }

    .history-list {
        padding: 10px 8px;
        gap: 8px;
    }

    /* PIX Modal (Smartphone Sheet Layout) */
    .modal-overlay {
        padding: 10px;
        align-items: center;
    }

    .modal-card {
        width: 100%;
        max-width: 100%;
        max-height: 94vh;
        border-radius: var(--radius-lg);
        margin: 0;
    }

    .modal-header {
        padding: 12px 14px;
    }

    .modal-title-wrap {
        gap: 10px;
    }

    .pix-badge-icon {
        width: 32px;
        height: 32px;
        border-radius: var(--radius-sm);
    }

    .pix-badge-icon svg {
        width: 18px;
        height: 18px;
    }

    .modal-title {
        font-size: 15px;
    }

    .modal-subtitle {
        font-size: 11px;
    }

    .modal-body {
        padding: 14px;
        gap: 14px;
    }

    .pix-qr-container {
        gap: 10px;
    }

    .pix-qr-frame {
        padding: 8px;
        border-radius: var(--radius-md);
    }

    .pix-qr-code {
        width: 160px;
        height: 160px;
        max-width: 100%;
    }

    .pix-val-tag {
        font-size: 12.5px;
    }

    .pix-val-tag strong {
        font-size: 17px;
    }

    .pix-copy-section {
        gap: 6px;
    }

    .pix-code-field {
        height: 40px;
        font-size: 11.5px;
        padding: 0 10px;
    }

    .btn-copy-pix {
        height: 46px;
        font-size: 14px;
        width: 100%;
        border-radius: var(--radius-md);
    }

    .pix-instructions {
        padding: 10px 12px;
        gap: 6px;
        border-radius: var(--radius-md);
    }

    .instruction-step {
        font-size: 11.5px;
        gap: 8px;
        line-height: 1.35;
    }

    .step-num {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* Desbloqueio Modal */
    .desbloq-contract-badge {
        padding: 8px 12px;
        font-size: 12px;
    }

    .desbloq-info-box {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
    }

    .desbloq-notice {
        font-size: 11.5px;
    }

    .desbloq-actions {
        flex-direction: column-reverse;
        gap: 8px;
        width: 100%;
        margin-top: 4px;
    }

    .desbloq-actions .btn {
        width: 100%;
        height: 44px;
        font-size: 14px;
        border-radius: var(--radius-md);
    }

    /* Toast */
    .toast {
        width: calc(100% - 24px);
        max-width: 380px;
        bottom: 16px;
        font-size: 13px;
        padding: 10px 16px;
    }

    /* Footer */
    .app-footer {
        padding: 16px 14px;
        font-size: 11.5px;
    }

    .footer-container {
        gap: 10px;
    }

    .footer-links {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .support-link {
        padding: 6px 12px;
        background-color: var(--surface-subtle);
        border: 1px solid var(--border);
        border-radius: var(--radius-pill);
        font-size: 12px;
    }
}

/* Extra small devices (<= 380px screen width) */
@media (max-width: 380px) {
    .header-badge span {
        display: none;
    }
    .header-badge {
        padding: 4px 6px;
    }
    .brand-sub {
        display: none;
    }
    .main-title {
        font-size: 19px;
    }
    .pix-qr-code {
        width: 140px;
        height: 140px;
    }
    .invoice-amount-val {
        font-size: 24px;
    }
}



