/* ============================================================
   STYLE • NousCard (PRODUÇÃO)
   ✅ IDENTIDADE VISUAL: PALETA OFICIAL FACEBOOK
   Compatível com acessibilidade, dark mode e performance
============================================================ */

/* ============================================================
   PREVENIR SCROLL HORIZONTAL (GLOBAL)
============================================================ */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    color-scheme: light dark;
}

*, *::before, *::after {
    box-sizing: border-box;
}

img, canvas, svg, video, embed, object, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

.nc-body, .nc-content, .nc-section {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.nc-topbar, .nc-footer {
    width: 100%;
    max-width: 100vw;
}

.table-container, .nc-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============================================================
   VARIÁVEIS GLOBAIS - ✅ PALETA OFICIAL FACEBOOK
============================================================ */
:root {
    /* ✅ Cores Primárias - Paleta Facebook */
    --primary: #1d3469;
    --primary-dark: #142652;
    --primary-light: #e8edf5;  /* ✅ Tom suave para não cansar */
    --primary-accent: #5e80bf;  /* ✅ Azul claro para destaques */
    
    /* Cores de Texto */
    --text: #1a1a2e;
    --text-muted: #6b7280;  /* ✅ Cinza neutro (melhor para leitura) */
    --text-disabled: #a0aec0;
    --white: #ffffff;
    
    /* ✅ Cores Neutras - Tons suaves para conforto visual */
    --gray: #dee2e6;
    --gray-light: #fafbfc;  /* ✅ Quase branco (reduz fadiga) */
    --gray-dark: #5a6275;
    --gray-border: #e5e7eb;
    
    /* Cores de Status/KPI */
    --kpi-red: #dc3545;
    --kpi-red-light: #f8d7da;
    --kpi-yellow: #ffc107;
    --kpi-yellow-light: #fff3cd;
    --kpi-green: #28a745;
    --kpi-green-light: #d4edda;
    --kpi-blue: #17a2b8;
    --kpi-blue-light: #d1ecf1;
    
    /* Cores de Feedback */
    --success: #28a745;
    --success-bg: #d4edda;
    --success-border: #c3e6cb;
    --error: #dc3545;
    --error-bg: #f8d7da;
    --error-border: #f5c6cb;
    --warning: #ffc107;
    --warning-bg: #fff3cd;
    --warning-border: #ffeaa7;
    --info: #17a2b8;
    --info-bg: #d1ecf1;
    --info-border: #b8daff;
    
    /* ✅ Sombras - Mais suaves para não pesar */
    --shadow-sm: 0 1px 2px rgba(29, 52, 105, 0.04);
    --shadow-md: 0 4px 12px rgba(29, 52, 105, 0.08);
    --shadow-lg: 0 10px 40px rgba(29, 52, 105, 0.12);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-width: 2px;
    
    /* Espaçamento */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Tipografia */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.25rem;
    --font-size-xl: 1.5rem;
    
    /* Touch targets mínimos para acessibilidade */
    --touch-target: 44px;
}

/* ============================================================
   DARK MODE GLOBAL
============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --text: #f7fafc;
        --text-muted: #a0aec0;
        --text-disabled: #718096;
        --white: #1a202c;
        --gray-light: #2d3748;
        --gray: #4a5568;
        --gray-dark: #cbd5e0;
        --gray-border: #4a5568;
        --primary-light: #2d3748;
        --kpi-red-light: #4a1a1a;
        --kpi-yellow-light: #4a3a1a;
        --kpi-green-light: #1a3a2a;
        --kpi-blue-light: #1a3a4a;
        --success-bg: #1a3a2a;
        --success-border: #2f855a;
        --error-bg: #4a1a1a;
        --error-border: #c53030;
        --warning-bg: #4a3a1a;
        --warning-border: #dd6b20;
        --info-bg: #1a3a4a;
        --info-border: #3182ce;
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
        --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
        --shadow-lg: 0 10px 40px rgba(0,0,0,0.4);
    }
    
    .nc-topbar, .nc-footer, .nc-section, .nc-modal-content {
        background: var(--white);
    }
    
    .nc-dropzone {
        background: #2d3748;
        border-color: var(--primary);
    }
    
    .nc-dropzone:hover,
    .nc-dropzone.dragging {
        background: #4a5568;
    }
}

/* ============================================================
   ACESSIBILIDADE
============================================================ */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 16px;
    z-index: 1000;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0 0 8px 0;
    transition: top 0.2s;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.skip-link:focus {
    top: 0;
}

.nc-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .nc-modal-content { animation: none !important; }
    .spinner {
        animation: none;
        border-top-color: transparent;
        border-right-color: var(--primary);
    }
}

@media (prefers-contrast: high) {
    :root {
        --gray: #ccc;
        --gray-dark: #333;
        --gray-border: #000;
    }
    .nc-kpi-card, .nc-section, .nc-table, .nc-form-input, .nc-btn {
        border-width: 2px;
        border-color: currentColor;
    }
}

@media (forced-colors: active) {
    .nc-btn-primary {
        background-color: ButtonFace;
        color: ButtonText;
        border: 2px solid ButtonText;
    }
    .nc-form-input {
        background-color: Canvas;
        color: CanvasText;
        border: 2px solid CanvasText;
    }
    .nc-kpi-card { border: 2px solid CanvasText; }
    .nc-modal-backdrop { background-color: rgba(0, 0, 0, 0.7); }
}

/* ============================================================
   FORMULÁRIOS
============================================================ */

.nc-form-group { margin-bottom: 1.5rem; }

.nc-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.nc-form-label .nc-required {
    color: var(--error);
    margin-left: 2px;
}

.nc-form-input,
.nc-form-select,
.nc-form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: var(--border-width) solid var(--gray-border);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
    color: var(--text);
    min-height: var(--touch-target);
    color-scheme: light dark;
}

.nc-form-input::placeholder,
.nc-form-textarea::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* ✅ Foco com azul Facebook */
.nc-form-input:focus-visible,
.nc-form-select:focus-visible,
.nc-form-textarea:focus-visible {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 52, 105, 0.15);
}

.nc-form-input:focus,
.nc-form-select:focus,
.nc-form-textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(29, 52, 105, 0.15);
}

.nc-form-input[aria-invalid="true"],
.nc-form-select[aria-invalid="true"],
.nc-form-textarea[aria-invalid="true"] {
    border-color: var(--error);
}

.nc-form-input[aria-invalid="true"]:focus-visible,
.nc-form-select[aria-invalid="true"]:focus-visible,
.nc-form-textarea[aria-invalid="true"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(217, 83, 79, 0.1);
}

.nc-field-error {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--error);
}

.nc-field-error::before {
    content: "⚠️";
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nc-form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.nc-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.nc-checkbox-wrapper input[type="checkbox"],
.nc-checkbox-wrapper input[type="radio"] {
    margin-top: 0.25rem;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--primary);
    min-width: var(--touch-target);
    min-height: var(--touch-target);
}

.nc-checkbox-label {
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

/* ============================================================
   BOTÕES - ✅ AZUL FACEBOOK
============================================================ */

.nc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    min-height: var(--touch-target);
    min-width: var(--touch-target);
    contain: layout style;
}

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

.nc-btn-primary {
    background: var(--primary);
    color: white !important;
}

/* ✅ Hover com azul mais claro (#5e80bf) */
.nc-btn-primary:hover:not(:disabled) {
    background: var(--primary-accent);
}

.nc-btn-primary:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(29, 52, 105, 0.2);
}

.nc-btn-secondary {
    background: var(--gray);
    color: var(--text) !important;
}

.nc-btn-secondary:hover:not(:disabled) {
    background: #c5cdd7;
}

.nc-btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary) !important;
}

.nc-btn-outline:hover:not(:disabled) {
    background: rgba(29, 52, 105, 0.05);
}

.nc-btn-danger {
    background: var(--error);
    color: white !important;
}

.nc-btn-danger:hover:not(:disabled) {
    background: #c9302c;
}

.nc-btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.nc-btn:disabled,
.nc-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.nc-btn .btn-loading {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

.nc-btn:disabled .btn-text { display: none; }
.nc-btn:disabled .btn-loading { display: inline-flex; }

/* ============================================================
   MENSAGENS DE FEEDBACK
============================================================ */

.nc-flash-messages { margin-bottom: 1.5rem; }

.nc-flash {
    padding: 1rem 1.25rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.4;
    contain: layout style;
}

.nc-flash [aria-hidden="true"] {
    font-size: 1.25rem;
    margin-top: -2px;
    flex-shrink: 0;
}

.nc-flash-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #155724;
}

.nc-flash-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #721c24;
}

.nc-flash-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: #856404;
}

.nc-flash-info {
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    color: #004085;
}

@media (prefers-color-scheme: dark) {
    .nc-flash-success, .nc-flash-error, .nc-flash-warning, .nc-flash-info {
        color: var(--text);
    }
}

.nc-error, .nc-warning, .nc-success {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    contain: layout style;
}

.nc-error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: #721c24;
}

.nc-warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    color: #856404;
}

.nc-success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: #155724;
}

/* ============================================================
   LOADING STATES
============================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(29, 52, 105, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    vertical-align: middle;
    will-change: transform;
}

@keyframes spin { to { transform: rotate(360deg); } }

.nc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
    contain: layout style;
}

.nc-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    height: 1rem;
    margin: 0.5rem 0;
    will-change: background-position;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   PROGRESS BAR
============================================================ */

.nc-progress {
    margin: 1rem 0;
    contain: layout style;
}

.nc-progress-bar {
    height: 8px;
    background: var(--gray);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.nc-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--progress, 0%);
    background: var(--primary);
    transition: width 0.3s ease;
}

.nc-progress-text {
    display: block;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ============================================================
   MODAL
============================================================ */

.nc-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    contain: layout style;
}

.nc-modal[aria-hidden="true"] { display: none; }

.nc-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.nc-modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
    will-change: transform, opacity;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.nc-modal-header,
.nc-modal-footer {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-border);
    flex-shrink: 0;
}

.nc-modal-footer {
    border-top: 1px solid var(--gray-border);
    border-bottom: none;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.nc-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.nc-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem;
    border-radius: 4px;
    transition: background 0.2s;
    line-height: 1;
    min-width: var(--touch-target);
    min-height: var(--touch-target);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-modal-close:hover {
    background: var(--gray);
    color: var(--text);
}

.nc-modal-close:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ============================================================
   EMPTY STATES & DRAG DROP
============================================================ */

.nc-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
    contain: layout style;
}

.nc-empty-state [aria-hidden="true"] {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.nc-empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: var(--font-size-lg);
}

.nc-empty-state p {
    margin: 0 0 1.5rem 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.nc-dropzone {
    border: 2px dashed var(--primary);
    background: var(--primary-light);
    padding: 35px;
    text-align: center;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: 0.3s;
    color: var(--text);
    min-height: 200px;
    contain: layout style;
}

@media (prefers-color-scheme: dark) {
    .nc-dropzone {
        background: #2d3748;
        color: var(--text);
    }
}

.nc-dropzone:hover,
.nc-dropzone.dragging {
    background: #dce4f0;
    border-color: var(--primary-dark);
}

@media (prefers-color-scheme: dark) {
    .nc-dropzone:hover,
    .nc-dropzone.dragging {
        background: #4a5568;
    }
}

.nc-dropzone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.nc-dropzone-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.nc-dropzone-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.nc-file-list {
    margin-top: 1rem;
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.nc-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-border);
    font-size: 0.9rem;
}

.nc-file-item:last-child { border-bottom: none; }
.nc-file-item small { color: var(--text-muted); }

.nc-error-list {
    margin-top: 1rem;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: var(--border-radius);
    padding: 1rem;
    color: #721c24;
}

@media (prefers-color-scheme: dark) {
    .nc-error-list { color: var(--text); }
}

.nc-error-list div {
    margin: 0.25rem 0;
    font-size: var(--font-size-sm);
}

/* ============================================================
   TABELAS
============================================================ */

.nc-table {
    width: 100%;
    border-collapse: collapse;
    contain: layout style;
}

.nc-table th[aria-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.nc-table th[aria-sort]::after {
    content: ' ↕';
    opacity: 0.5;
    font-size: 0.8em;
}

.nc-table th[aria-sort="ascending"]::after { content: ' ↑'; opacity: 1; }
.nc-table th[aria-sort="descending"]::after { content: ' ↓'; opacity: 1; }

.nc-table th,
.nc-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-border);
}

.nc-table th {
    font-weight: 600;
    color: var(--text);
    background: var(--gray-light);
}

.nc-table tbody tr:hover {
    background: var(--gray-light);
}

.nc-table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.nc-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.nc-badge-current {
    background: var(--primary-light);
    color: var(--primary);
    margin-left: 0.5rem;
}

.nc-badge-locked {
    background: var(--gray);
    color: var(--text-muted);
}

.nc-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.nc-status-active { color: var(--success); }
.nc-status-inactive { color: var(--text-muted); }

/* ============================================================
   PAGINAÇÃO
============================================================ */

.nc-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding: 1rem;
}

.nc-page-info {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* ============================================================
   LAYOUT BASE & TOPBAR
============================================================ */

.nc-body {
    font-family: var(--font-family);
    background: var(--gray-light);
    color: var(--text);
    line-height: 1.5;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.nc-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--gray-border);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    contain: layout style;
}

.nc-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

/* Menu horizontal */
.nc-topbar-nav {
    display: flex;
    align-items: center;
}

.nc-nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nc-nav-list li {
    display: inline-block;
    margin: 0;
    padding: 0;
}

.nc-topbar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    min-height: var(--touch-target);
}

/* ✅ Hover com azul Facebook suave */
.nc-topbar-item:hover,
.nc-topbar-item.active {
    background: var(--primary-light);
    color: var(--primary);
}

.nc-topbar-item.logout {
    color: var(--error);
}

/* Conteúdo Principal */
.nc-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
    overflow-x: visible;
}

.nc-section {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    contain: layout style;
}

.nc-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text);
}

.nc-subtitle {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text);
}

/* Grid de KPIs */
.nc-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
    width: 100%;
}

.nc-kpi-card {
    background: var(--white);
    border: 1px solid var(--gray-border);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    min-width: 0;
    contain: layout style;
    min-height: var(--touch-target);
}

.nc-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

@media (prefers-reduced-motion: reduce) {
    .nc-kpi-card:hover { transform: none; }
}

.kpi-icon {
    font-size: 1.75rem;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.kpi-blue { background: var(--primary-light); }
.kpi-green { background: var(--kpi-green-light); }
.kpi-yellow { background: var(--kpi-yellow-light); }
.kpi-red { background: var(--kpi-red-light); }

.kpi-info {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    word-break: break-word;
}

.kpi-value[data-loading="true"] {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Grid de Adquirentes */
.nc-acq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.nc-acq-card {
    width: 100%;
    min-width: 0;
}

/* Gráficos */
.nc-graphs-container {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 300px;
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow: hidden;
    contain: layout style;
}

.nc-graphs-container canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
}

/* Footer */
.nc-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-border);
    padding: 1rem 2rem;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.nc-footer a {
    color: var(--primary);
    text-decoration: none;
    min-height: var(--touch-target);
    display: inline-flex;
    align-items: center;
}

.nc-footer a:hover { text-decoration: underline; }

/* ============================================================
   BARRA DE STATUS DO USUÁRIO
============================================================ */

.nc-user-status-bar {
    background: var(--gray-light);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    width: 100%;
    max-width: 100%;
}

.nc-user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nc-user-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.nc-badge-master {
    background: var(--primary);
    color: white;
}

.nc-badge-admin {
    background: var(--success);
    color: white;
}

.nc-badge-user {
    background: var(--gray);
    color: var(--text);
}

.nc-user-company {
    border-left: 1px solid var(--gray-border);
    padding-left: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nc-label { color: var(--text-muted); }
.nc-value { font-weight: 600; }

.nc-user-last-login {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVIDADE
============================================================ */

@media (max-width: 1024px) {
    .nc-content { padding: 1.5rem; }
    .nc-section { padding: 1.25rem; }
    .nc-kpis { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .nc-topbar {
        padding: 0.5rem 1rem;
        height: auto;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nc-topbar-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.25rem;
        padding: 0.5rem 0;
    }
    
    .nc-nav-list {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nc-topbar-item {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .nc-content { padding: 1rem; }
    .nc-section { padding: 1rem; }
    
    .nc-user-status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .nc-user-company {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid var(--gray-border);
        padding-top: 0.5rem;
        width: 100%;
    }
    
    .nc-user-last-login {
        margin-left: 0;
        width: 100%;
        text-align: right;
        font-size: 0.8rem;
    }
    
    .nc-kpis {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .nc-kpi-card { padding: 1rem; }
    .kpi-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .kpi-value { font-size: 1.25rem; }
    
    .nc-acq-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .nc-graphs-container {
        min-height: 280px;
        padding: 0.75rem;
    }
    
    .nc-modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }
    .nc-modal-body { padding: 1rem; }
    
    .nc-table { font-size: 0.85rem; }
    .nc-table th, .nc-table td { padding: 0.5rem; }
}

@media (max-width: 480px) {
    .nc-kpis { grid-template-columns: 1fr; }
    .nc-graphs-container { min-height: 250px; }
    .nc-topbar-item {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    .nc-section { padding: 0.75rem; }
}

/* ============================================================
   IMPRESSÃO
============================================================ */

@media print {
    .nc-topbar, .nc-footer, .nc-btn, .nc-modal-backdrop,
    .nc-dropzone, .nc-file-list {
        display: none !important;
    }
    
    .nc-content {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .nc-section {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .nc-table { font-size: 10pt; }
    .nc-kpis { grid-template-columns: repeat(2, 1fr); }
    
    a {
        text-decoration: none;
        color: #000;
    }
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.9em;
        color: #666;
    }
}
