/* GT Smart — camada visual moderna aplicada depois do CSS de cada pagina.
   Somente apresentacao: nao contem regras de negocio, calculos ou dados. */

html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

html body {
    background: var(--gt-bg);
    color: var(--gt-text);
    font-family: var(--gts-font-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html body .container {
    background: var(--gt-surface);
    color: var(--gt-text);
    border: 1px solid var(--gt-border);
    border-radius: var(--gts-radius-xl);
    box-shadow: var(--gts-shadow-lg);
}

html body .header {
    background: linear-gradient(135deg, var(--gts-blue-dark), var(--gts-blue));
    color: var(--gts-white);
    padding: 16px 20px;
}

html body .content { padding: 20px 22px; }

html body button,
html body input,
html body select,
html body textarea { font-family: inherit; }

html body button,
html body .btn,
html body [class^="btn-"],
html body [class*=" btn-"] {
    border-radius: var(--gts-radius-md);
    min-height: var(--gt-touch);
}

html body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
html body select,
html body textarea {
    min-height: var(--gt-touch);
    border-radius: var(--gts-radius-md);
    background: var(--gt-input-bg);
    color: var(--gt-text);
    border-color: var(--gt-border-strong);
}

html body textarea { min-height: 96px; }

html body :is(button, a, input, select, textarea, [role="button"]):focus-visible {
    outline: 3px solid rgba(59, 91, 217, .32);
    outline-offset: 2px;
}

html body :is(.theme-toggle-header, .theme-toggle) svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

html body :is(.card, .loan-item, .empresa-card, .client-card, .debt-item, .card-item,
.panel, .section, .form-section, .summary-card, .stat-card, .detail-card, .modal-content) {
    border-radius: var(--gts-radius-lg);
}

html body :is(.card, .loan-item, .empresa-card, .client-card, .debt-item, .card-item,
.panel, .summary-card, .stat-card, .detail-card) {
    border-color: var(--gt-border);
    box-shadow: var(--gts-shadow-sm);
}

html body :is(.card, .loan-item, .empresa-card, .client-card, .debt-item, .card-item):hover {
    box-shadow: var(--gts-shadow-md);
}

html body :is(.card-value, .amount, .money, .valor, .value, [class*="-amount"], [class*="-value"]) {
    font-variant-numeric: tabular-nums;
}

html body table { border-collapse: separate; border-spacing: 0; }
html body table th {
    background: var(--gt-bg-subtle);
    color: var(--gt-text-muted);
    border-color: var(--gt-border);
}
html body table td { border-color: var(--gt-border); }

html[data-theme="dark"] body :is(.card, .loan-item, .empresa-card, .client-card, .debt-item,
.card-item, .panel, .section, .form-section, .summary-card, .stat-card, .detail-card, .modal-content) {
    background-color: var(--gt-surface);
    color: var(--gt-text);
    border-color: var(--gt-border);
}

html[data-theme="dark"] body :is(.header, .portfolio-section) {
    background: linear-gradient(135deg, #111B35, #172554 62%, #1E3A8A);
}

@media (max-width: 768px) {
    html body { padding: 8px; }
    html body .container { width: 100%; margin: 0 auto; border-radius: var(--gts-radius-lg); }
    html body .content { padding: 14px; }
    html body :is(.dashboard-grid, .summary-grid, .stats-grid, .kpi-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    html body table { min-width: 100%; }
}

@media (max-width: 480px) {
    html body { padding: 5px; }
    html body .header { padding: 12px 14px; }
    html body .content { padding: 12px; }
    html body :is(.dashboard-grid, .summary-grid, .stats-grid, .kpi-grid) {
        grid-template-columns: minmax(0, 1fr);
    }
    html body :is(.form-row, .form-grid, .two-col, .two-columns) {
        grid-template-columns: minmax(0, 1fr);
    }
    html body .floating-menu,
    html body .floating-add { right: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    html body *, html body *::before, html body *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    html body .container { border: 0; box-shadow: none; }
}
