/* ==========================================================
   ERP OFICINA — VISUAL V3
   Aproxima o painel do mockup aprovado + tema claro/escuro.
   Carregado depois do visual-v2.css para preservar a V1.
   ========================================================== */

:root {
    --v3-blue: #3182f6;
    --v3-blue-strong: #1f6de0;
    --v3-green: #24c98a;
    --v3-amber: #f3a81f;
    --v3-red: #ff626c;
    --v3-purple: #8b5cf6;
}

html {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

/* ---------- estrutura principal ---------- */
html[data-theme="dark"] #app-view {
    --v3-page: #071221;
    --v3-page-soft: #09182a;
    --v3-sidebar: #081525;
    --v3-sidebar-border: rgba(148, 163, 184, .12);
    --v3-topbar: rgba(7, 18, 33, .94);
    --v3-card: #0f2035;
    --v3-card-2: #0c1b2e;
    --v3-card-soft: #12243a;
    --v3-text: #f5f8fc;
    --v3-text-2: #c8d5e6;
    --v3-muted: #8296b1;
    --v3-border: rgba(148, 163, 184, .14);
    --v3-hover: rgba(255,255,255,.055);
    --v3-input: #09182a;
    --v3-shadow: 0 18px 44px rgba(0, 0, 0, .18);
}

html[data-theme="light"] #app-view {
    --v3-page: #f3f6fb;
    --v3-page-soft: #edf2f8;
    --v3-sidebar: #ffffff;
    --v3-sidebar-border: #e3e9f1;
    --v3-topbar: rgba(255, 255, 255, .96);
    --v3-card: #ffffff;
    --v3-card-2: #f8fafc;
    --v3-card-soft: #f1f5f9;
    --v3-text: #142033;
    --v3-text-2: #334155;
    --v3-muted: #738096;
    --v3-border: #e2e8f0;
    --v3-hover: #f1f5f9;
    --v3-input: #ffffff;
    --v3-shadow: 0 14px 34px rgba(15, 23, 42, .07);
}

#app-view.app-shell {
    background: var(--v3-page);
}

#app-view .workspace {
    min-width: 0;
    background:
        radial-gradient(circle at 84% 6%, rgba(49, 130, 246, .065), transparent 29%),
        var(--v3-page);
    color: var(--v3-text);
}

/* ---------- sidebar ---------- */
#app-view .sidebar {
    width: var(--sidebar-width);
    background: var(--v3-sidebar) !important;
    border-right: 1px solid var(--v3-sidebar-border);
    box-shadow: 18px 0 38px rgba(0,0,0,.035);
}

#app-view .sidebar-brand {
    height: 86px;
    padding: 0 18px;
    border-bottom: 1px solid var(--v3-sidebar-border);
}

#app-view .sidebar-brand .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, #3889ff, #1767dd);
    box-shadow: 0 10px 24px rgba(27, 104, 226, .25);
}

#app-view .sidebar-brand strong {
    color: var(--v3-text) !important;
    font-size: 14px;
    letter-spacing: -.01em;
}

#app-view .sidebar-brand span {
    color: var(--v3-muted) !important;
}

#app-view .main-menu {
    padding: 15px 9px 16px;
    scrollbar-width: thin;
}

#app-view .menu-section-title {
    padding: 16px 11px 7px;
    color: var(--v3-muted) !important;
    font-size: 9px;
    letter-spacing: .16em;
}

#app-view .menu-item {
    min-height: 43px;
    margin: 3px 0;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--v3-text-2) !important;
    font-weight: 650;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

#app-view .menu-item:hover {
    background: var(--v3-hover) !important;
    color: var(--v3-text) !important;
    transform: translateX(1px);
}

#app-view .menu-item.active {
    border-color: rgba(72, 142, 255, .30);
    background: linear-gradient(90deg, rgba(45, 118, 237, .28), rgba(37, 99, 235, .16)) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 #4a91ff;
}

html[data-theme="light"] #app-view .menu-item.active {
    color: #1557b0 !important;
    border-color: #c7dbff;
    background: linear-gradient(90deg, #eaf2ff, #f5f8ff) !important;
    box-shadow: inset 3px 0 0 #2f7df4;
}

#app-view .menu-icon {
    width: 24px;
    height: 24px;
    padding: 2px;
    color: var(--v3-muted);
}

#app-view .menu-item:hover .menu-icon,
#app-view .menu-item.active .menu-icon {
    color: currentColor;
}

#app-view .sidebar-footer {
    margin: 8px 9px 10px;
    padding: 11px;
    border: 1px solid var(--v3-sidebar-border) !important;
    border-radius: 13px;
    background: var(--v3-card-2) !important;
    box-shadow: none !important;
}

#app-view .sidebar-user strong {
    color: var(--v3-text) !important;
}

#app-view .sidebar-user span {
    color: var(--v3-muted) !important;
}

#app-view .sidebar .avatar {
    background: var(--v3-card-soft) !important;
    border-color: var(--v3-border) !important;
    color: var(--v3-text-2) !important;
}

/* ---------- topbar ---------- */
#app-view .topbar {
    position: sticky;
    top: 0;
    z-index: 24;
    min-height: 76px;
    padding: 11px 26px;
    border-bottom: 1px solid var(--v3-border) !important;
    background: var(--v3-topbar) !important;
    box-shadow: 0 9px 26px rgba(0,0,0,.06);
    backdrop-filter: blur(18px);
}

#app-view .topbar h1 {
    color: var(--v3-text) !important;
    font-size: 21px;
    letter-spacing: -.025em;
}

#app-view .topbar .eyebrow {
    color: #5b9aff !important;
}

html[data-theme="light"] #app-view .topbar .eyebrow {
    color: #2f7df4 !important;
}

#app-view .topbar-actions {
    gap: 10px;
}

#app-view .notification-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--v3-border);
    border-radius: 12px;
    background: var(--v3-card-2);
    color: var(--v3-text-2);
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

#app-view .notification-button:hover {
    background: var(--v3-hover);
    color: var(--v3-text);
    transform: translateY(-1px);
}

#app-view .notification-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#app-view .user-menu {
    position: relative;
}

#app-view .user-chip {
    min-width: 200px;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--v3-border) !important;
    border-radius: 13px;
    background: var(--v3-card-2) !important;
    color: var(--v3-text-2) !important;
    text-align: left;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

#app-view .user-chip:hover,
#app-view .user-menu.open .user-chip {
    background: var(--v3-hover) !important;
    border-color: rgba(66, 133, 236, .34) !important;
}

#app-view .user-chip .avatar {
    flex: 0 0 auto;
    background: var(--v3-card-soft) !important;
    border: 1px solid var(--v3-border) !important;
    color: var(--v3-text-2) !important;
}

#app-view .user-chip-copy {
    min-width: 0;
    flex: 1;
}

#app-view .user-chip strong {
    display: block;
    overflow: hidden;
    color: var(--v3-text) !important;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#app-view .user-chip span {
    display: block;
    margin-top: 2px;
    color: var(--v3-muted) !important;
    font-size: 10px;
}

#app-view .user-chip-chevron {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--v3-muted);
    stroke-width: 1.8;
    transition: transform .18s ease;
}

#app-view .user-menu.open .user-chip-chevron {
    transform: rotate(180deg);
}

/* ---------- popover perfil / tema ---------- */
#app-view .user-menu-popover {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    width: 310px;
    padding: 11px;
    border: 1px solid var(--v3-border);
    border-radius: 16px;
    background: var(--v3-card) !important;
    color: var(--v3-text);
    box-shadow: 0 24px 60px rgba(0,0,0,.28);
    animation: v3PopoverIn .14s ease-out;
}

html[data-theme="light"] #app-view .user-menu-popover {
    box-shadow: 0 24px 60px rgba(15,23,42,.16);
}

@keyframes v3PopoverIn {
    from { opacity: 0; transform: translateY(-5px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#app-view .user-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 3px 7px;
}

#app-view .user-menu-head .avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(145deg, #2f7df4, #1f67d5) !important;
    border: 0 !important;
    color: #fff !important;
}

#app-view .user-menu-head strong {
    display: block;
    color: var(--v3-text);
    font-size: 13px;
}

#app-view .user-menu-head span {
    display: block;
    margin-top: 2px;
    color: var(--v3-muted);
    font-size: 10px;
}

#app-view .user-menu-divider {
    height: 1px;
    margin: 8px 0;
    background: var(--v3-border);
}

#app-view .theme-picker-label {
    display: block;
    padding: 2px 4px 7px;
    color: var(--v3-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

#app-view .theme-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#app-view .theme-option {
    position: relative;
    min-width: 0;
    padding: 9px;
    border: 1px solid var(--v3-border);
    border-radius: 12px;
    background: var(--v3-card-2);
    color: var(--v3-text-2);
    text-align: left;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

#app-view .theme-option:hover {
    transform: translateY(-1px);
    border-color: rgba(49,130,246,.38);
}

#app-view .theme-option.active {
    border-color: #3182f6;
    background: rgba(49,130,246,.10);
    box-shadow: 0 0 0 2px rgba(49,130,246,.08);
}

#app-view .theme-option > span:nth-child(2) {
    display: block;
    margin-top: 7px;
}

#app-view .theme-option strong {
    display: block;
    color: var(--v3-text);
    font-size: 11px;
}

#app-view .theme-option small {
    display: block;
    margin-top: 1px;
    color: var(--v3-muted);
    font-size: 9px;
}

#app-view .theme-check {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 18px;
    height: 18px;
    display: none;
    place-items: center;
    border-radius: 999px;
    background: #2f7df4;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

#app-view .theme-option.active .theme-check {
    display: grid;
}

#app-view .theme-preview {
    height: 48px;
    display: grid;
    grid-template-columns: 24% 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 3px;
    padding: 5px;
    border-radius: 8px;
    overflow: hidden;
}

#app-view .theme-preview i {
    display: block;
    border-radius: 3px;
}

#app-view .theme-preview i:first-child {
    grid-row: 1 / 3;
}

#app-view .theme-preview-dark {
    background: #071221;
    border: 1px solid #22334b;
}
#app-view .theme-preview-dark i:first-child { background: #0d1d31; }
#app-view .theme-preview-dark i:nth-child(2) { background: #142844; }
#app-view .theme-preview-dark i:nth-child(3) { background: #102139; }

#app-view .theme-preview-light {
    background: #eef3f8;
    border: 1px solid #d9e2ec;
}
#app-view .theme-preview-light i:first-child { background: #ffffff; }
#app-view .theme-preview-light i:nth-child(2) { background: #ffffff; }
#app-view .theme-preview-light i:nth-child(3) { background: #e5edf6; }

#app-view .user-menu-logout {
    width: 100%;
    min-height: 39px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--v3-text-2);
    font-weight: 700;
    text-align: left;
}

#app-view .user-menu-logout:hover {
    background: rgba(255,98,108,.09);
    color: #ff7079;
}

#app-view .user-menu-logout svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- conteúdo / dashboard ---------- */
#app-view .page-content {
    padding: 30px 28px 42px !important;
}

#app-view .dashboard-hero {
    align-items: center;
    margin-bottom: 22px;
}

#app-view .dashboard-kicker {
    display: block;
    margin-bottom: 7px;
    color: #4f93fa;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .15em;
}

#app-view .hero-row h2,
#app-view .dashboard-welcome h2 {
    margin: 0 0 6px;
    color: var(--v3-text) !important;
    font-size: clamp(27px, 2.3vw, 36px) !important;
    letter-spacing: -.04em;
}

#app-view .hero-row p,
#app-view .dashboard-welcome p {
    margin: 0;
    color: var(--v3-muted) !important;
}

#app-view .dashboard-date-card {
    min-width: 285px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--v3-border);
    border-radius: 13px;
    background: var(--v3-card-2);
    box-shadow: var(--v3-shadow);
}

#app-view .dashboard-date-icon {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    padding: 8px;
    border-radius: 10px;
    background: rgba(49,130,246,.12);
    color: #65a1ff;
}

#app-view .dashboard-date-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#app-view .dashboard-date-card strong {
    display: block;
    color: var(--v3-text);
    font-size: 12px;
}

#app-view .dashboard-date-card span:not(.dashboard-date-icon) {
    display: block;
    margin-top: 2px;
    color: var(--v3-muted);
    font-size: 10px;
}

#app-view .metrics-grid {
    gap: 15px !important;
    margin-bottom: 18px;
}

#app-view .metric-card {
    min-height: 142px !important;
    padding: 18px !important;
    border: 1px solid var(--v3-border) !important;
    border-radius: 15px !important;
    background: linear-gradient(145deg, var(--v3-card), var(--v3-card-2)) !important;
    box-shadow: var(--v3-shadow) !important;
    transition: transform .16s ease, border-color .16s ease;
}

#app-view .metric-card:hover {
    transform: translateY(-2px);
    border-color: rgba(90, 151, 248, .24) !important;
}

#app-view .metric-card::after {
    right: -31px !important;
    top: -38px !important;
    width: 122px !important;
    height: 122px !important;
    opacity: .75;
}

#app-view .metric-card .metric-card-head {
    gap: 11px;
}

#app-view .metric-card .metric-icon {
    width: 48px !important;
    height: 48px !important;
    padding: 11px !important;
    border-radius: 13px !important;
}

#app-view .metric-card .metric-label {
    color: var(--v3-text-2) !important;
    font-size: 12px !important;
    font-weight: 750;
}

#app-view .metric-card .metric-value {
    margin: 12px 0 4px !important;
    color: var(--v3-text) !important;
    font-size: 28px !important;
    line-height: 1;
}

#app-view .metric-card .metric-detail {
    color: var(--v3-muted) !important;
    font-size: 10px;
}

#app-view .metric-card.tone-blue .metric-icon {
    color: #79b0ff;
    background: rgba(49,130,246,.17) !important;
    border-color: rgba(91,155,255,.24) !important;
}
#app-view .metric-card.tone-blue::after { background: rgba(49,130,246,.11) !important; }

#app-view .metric-card.tone-green .metric-icon {
    color: #65e0ad;
    background: rgba(36,201,138,.14) !important;
    border-color: rgba(36,201,138,.22) !important;
}
#app-view .metric-card.tone-green::after { background: rgba(36,201,138,.095) !important; }
#app-view .metric-card.tone-green .metric-value { color: #5edaa7 !important; }

#app-view .metric-card.tone-amber .metric-icon {
    color: #ffc35f;
    background: rgba(243,168,31,.14) !important;
    border-color: rgba(243,168,31,.22) !important;
}
#app-view .metric-card.tone-amber::after { background: rgba(243,168,31,.095) !important; }
#app-view .metric-card.tone-amber .metric-value { color: #ffc25a !important; }

#app-view .metric-card.tone-purple .metric-icon {
    color: #b38cff;
    background: rgba(139,92,246,.15) !important;
    border-color: rgba(139,92,246,.24) !important;
}
#app-view .metric-card.tone-purple::after { background: rgba(139,92,246,.095) !important; }
#app-view .metric-card.tone-purple .metric-value { color: #b99aff !important; }

#app-view .metric-card.tone-red .metric-icon {
    color: #ff8a92;
    background: rgba(255,98,108,.13) !important;
    border-color: rgba(255,98,108,.22) !important;
}
#app-view .metric-card.tone-red::after { background: rgba(255,98,108,.085) !important; }
#app-view .metric-card.tone-red .metric-value { color: #ff7f87 !important; }

#app-view .content-grid {
    gap: 16px !important;
}

#app-view .panel,
#app-view .data-panel,
#app-view .quick-card,
#app-view .finance-kpi,
#app-view .finance-card,
#app-view .finance-caixa-filter,
#app-view .finance-period-kpis > div,
#app-view .report-kpis article,
#app-view .report-card,
#app-view .report-table-wrap,
#app-view .reports-filter,
#app-view .audit-info-card,
#app-view .profile-card,
#app-view .office-config-intro,
#app-view .office-config-card,
#app-view .office-logo-card,
#app-view .office-document-card {
    border-color: var(--v3-border) !important;
    background: linear-gradient(145deg, var(--v3-card), var(--v3-card-2)) !important;
    color: var(--v3-text-2) !important;
    box-shadow: var(--v3-shadow) !important;
}

#app-view .panel {
    padding: 18px !important;
    border-radius: 15px !important;
}

#app-view .panel-header h3,
#app-view .module-header h2,
#app-view .report-section-head h3,
#app-view .report-card-head h4,
#app-view .finance-card-head h3,
#app-view .office-config-card h3,
#app-view .office-logo-card h3,
#app-view .office-document-card h3 {
    color: var(--v3-text) !important;
}

#app-view .panel-header span,
#app-view .module-header p,
#app-view .table-sub,
#app-view .report-card p,
#app-view .office-config-card p,
#app-view .office-logo-card p,
#app-view .office-document-card p {
    color: var(--v3-muted) !important;
}

#app-view .status-row span,
#app-view .alert-item strong,
#app-view .quick-card strong {
    color: var(--v3-text-2) !important;
}

#app-view .status-row strong,
#app-view .quick-card strong {
    color: var(--v3-text) !important;
}

#app-view .progress,
#app-view .report-bar-track {
    background: var(--v3-card-soft) !important;
}

#app-view .alert-item,
#app-view .quick-card,
#app-view .finance-list-row,
#app-view .finance-daily-row,
#app-view .finance-extrato-row,
#app-view .finance-balance-strip,
#app-view .finance-bar-line {
    border-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
}

#app-view .alert-item span,
#app-view .quick-card span,
#app-view .finance-bar-line small {
    color: var(--v3-muted) !important;
}

/* ---------- formulários, tabelas e abas ---------- */
#app-view .search-box input,
#app-view .field input,
#app-view .field select,
#app-view .field textarea,
#app-view input:not([type="checkbox"]):not([type="radio"]),
#app-view select,
#app-view textarea,
#app-view .toolbar-select {
    border-color: var(--v3-border) !important;
    background: var(--v3-input) !important;
    color: var(--v3-text) !important;
}

#app-view input::placeholder,
#app-view textarea::placeholder {
    color: var(--v3-muted) !important;
}

#app-view .field > span,
#app-view .field label {
    color: var(--v3-text-2) !important;
}

#app-view .data-table th {
    border-bottom-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
    color: var(--v3-muted) !important;
}

#app-view .data-table td {
    border-bottom-color: var(--v3-border) !important;
    color: var(--v3-text-2) !important;
}

#app-view .data-table tr:hover td {
    background: rgba(49,130,246,.045) !important;
}

#app-view .table-main,
#app-view .finance-kpi strong,
#app-view .finance-card-head > strong,
#app-view .finance-balance-strip strong,
#app-view .finance-period-kpis strong,
#app-view .report-kpis article > strong {
    color: var(--v3-text) !important;
}

#app-view .table-footer {
    border-top-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
    color: var(--v3-muted) !important;
}

#app-view .finance-tabs,
#app-view .reports-tabs {
    border-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
}

#app-view .finance-tab,
#app-view .reports-tab {
    color: var(--v3-muted) !important;
}

#app-view .finance-tab.active,
#app-view .reports-tab.active {
    background: rgba(49,130,246,.13) !important;
    color: #5d9cff !important;
}

/* ---------- modais ---------- */
#app-view .modal-card,
#app-view .modal-content {
    border-color: var(--v3-border) !important;
    background: var(--v3-card) !important;
    color: var(--v3-text-2) !important;
    box-shadow: 0 30px 80px rgba(0,0,0,.35) !important;
}

html[data-theme="light"] #app-view .modal-card,
html[data-theme="light"] #app-view .modal-content {
    box-shadow: 0 30px 80px rgba(15,23,42,.18) !important;
}

#app-view .modal-card h2,
#app-view .modal-card h3,
#app-view .modal-content h2,
#app-view .modal-content h3 {
    color: var(--v3-text) !important;
}

#app-view .modal-header,
#app-view .modal-footer {
    border-color: var(--v3-border) !important;
}

#app-view .action-button.secondary,
#app-view .secondary-button,
#app-view .row-action,
#app-view .modal-close {
    border-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
    color: var(--v3-text-2) !important;
}

#app-view .action-button.secondary:hover,
#app-view .secondary-button:hover,
#app-view .row-action:hover,
#app-view .modal-close:hover {
    background: var(--v3-hover) !important;
    color: var(--v3-text) !important;
}

/* ---------- tema claro: correções específicas ---------- */
html[data-theme="light"] body {
    background: #f3f6fb;
    color: #142033;
}

html[data-theme="light"] #app-view .metric-card.tone-blue .metric-value,
html[data-theme="light"] #app-view .metric-card.tone-green .metric-value,
html[data-theme="light"] #app-view .metric-card.tone-amber .metric-value,
html[data-theme="light"] #app-view .metric-card.tone-purple .metric-value,
html[data-theme="light"] #app-view .metric-card.tone-red .metric-value {
    filter: saturate(.93) brightness(.82);
}

html[data-theme="light"] #app-view .status-badge {
    background: #ecfdf5 !important;
    color: #15803d !important;
    border-color: #bbf7d0 !important;
}

html[data-theme="light"] #app-view .status-badge.inactive {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] #app-view .management-note {
    border-color: #cfe0ff !important;
    background: #eef5ff !important;
    color: #475569 !important;
}

html[data-theme="light"] #app-view .action-button.danger {
    background: #fff1f2 !important;
    color: #be123c !important;
    border-color: #fecdd3 !important;
}

html[data-theme="light"] #app-view .finance-overdue-row td,
html[data-theme="light"] #app-view .finance-overdue-row:hover td {
    background: #fff7f7 !important;
}

/* ---------- login acompanha preferência sem perder identidade ---------- */
html[data-theme="light"] .login-view {
    background: #ffffff;
    color: #172033;
}

html[data-theme="light"] .login-card input,
html[data-theme="light"] .password-field {
    background: #ffffff;
    color: #172033;
    border-color: #dfe5ed;
}

html[data-theme="dark"] .login-view {
    background: #ffffff;
    color: #172033;
}

/* ---------- responsividade ---------- */
@media (max-width: 980px) {
    #app-view .user-chip {
        min-width: 0;
    }

    #app-view .user-chip-copy,
    #app-view .user-chip-chevron {
        display: none;
    }

    #app-view .user-menu-popover {
        right: 0;
    }

    #app-view .dashboard-date-card {
        min-width: 0;
    }
}

@media (max-width: 760px) {
    #app-view .topbar {
        padding: 10px 14px;
    }

    #app-view .notification-button {
        display: none;
    }

    #app-view .user-menu-popover {
        position: fixed;
        top: 72px;
        right: 12px;
        left: 12px;
        width: auto;
    }

    #app-view .page-content {
        padding: 20px 14px 30px !important;
    }

    #app-view .dashboard-hero {
        align-items: stretch;
        gap: 12px;
    }

    #app-view .dashboard-date-card {
        width: 100%;
    }
}

/* ---------- cobertura adicional de componentes herdados ---------- */
#app-view .permission-list > span,
#app-view .permission-pill,
#app-view .audit-module,
#app-view .self-badge,
#app-view .office-config-state,
#app-view .office-readonly-note,
#app-view .office-document-hint,
#app-view .office-switch-card {
    border-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
    color: var(--v3-text-2) !important;
}

#app-view .audit-description,
#app-view .office-switch-card span,
#app-view .modal-header p,
#app-view .empty-state p,
#app-view .table-empty,
#app-view .page-loading {
    color: var(--v3-muted) !important;
}

#app-view .office-section-heading.divided,
#app-view .office-form-actions,
#app-view .office-document-card dl > div {
    border-color: var(--v3-border) !important;
}

#app-view .office-logo-preview {
    border-color: var(--v3-border) !important;
    background: var(--v3-card-2) !important;
}

#app-view .office-logo-preview.has-image {
    background: #ffffff !important;
}

#app-view .office-logo-placeholder strong {
    background: var(--v3-card-soft) !important;
    color: var(--v3-text-2) !important;
}

#app-view .office-document-card dd,
#app-view .office-switch-card strong {
    color: var(--v3-text) !important;
}

#app-view .modal-backdrop {
    background: rgba(3, 10, 20, .58) !important;
    backdrop-filter: blur(7px);
}

#app-view .modal {
    border-color: var(--v3-border) !important;
    background: var(--v3-card) !important;
    color: var(--v3-text-2) !important;
    box-shadow: 0 30px 90px rgba(0,0,0,.40) !important;
}

#app-view .modal-header {
    border-bottom-color: var(--v3-border) !important;
    background: var(--v3-card) !important;
}

#app-view .modal-header h3,
#app-view .empty-state h2 {
    color: var(--v3-text) !important;
}

#app-view .empty-state-icon {
    background: rgba(49,130,246,.12) !important;
    color: #5d9cff !important;
}

#app-view .toast {
    border-color: var(--v3-border) !important;
    background: var(--v3-card) !important;
    color: var(--v3-text-2) !important;
    box-shadow: var(--v3-shadow) !important;
}

html[data-theme="light"] #app-view .modal-backdrop {
    background: rgba(15, 23, 42, .32) !important;
}

html[data-theme="light"] #app-view .audit-module,
html[data-theme="light"] #app-view .self-badge {
    background: #eef5ff !important;
    color: #2368c4 !important;
}

html[data-theme="light"] #app-view .permission-list > span,
html[data-theme="light"] #app-view .permission-pill {
    background: #f1f5f9 !important;
    color: #526173 !important;
}
