/*
 * Igreja Pastoral — Design System v6.5.0
 * Camada visual global do PWA sem remover funcionalidades existentes.
 */

:root {
    --ip-bg: #f4f7fb;
    --ip-surface: #ffffff;
    --ip-surface-soft: #f8fafc;
    --ip-text: #0f172a;
    --ip-text-2: #334155;
    --ip-muted: #64748b;
    --ip-border: #e5eaf2;
    --ip-primary: #2563eb;
    --ip-primary-2: #1d4ed8;
    --ip-primary-soft: #eff6ff;
    --ip-success: #16a34a;
    --ip-warning: #f59e0b;
    --ip-danger: #dc2626;
    --ip-purple: #7c3aed;
    --ip-radius-sm: 10px;
    --ip-radius: 16px;
    --ip-radius-lg: 22px;
    --ip-shadow-sm: 0 6px 18px rgba(15, 23, 42, .06);
    --ip-shadow: 0 14px 36px rgba(15, 23, 42, .08);
    --ip-shadow-lg: 0 24px 70px rgba(15, 23, 42, .14);
    --ip-font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}

html, body {
    background: var(--ip-bg);
    color: var(--ip-text);
    font-family: var(--ip-font);
}

body {
    font-size: 15px;
    line-height: 1.55;
}

.app-shell,
.ip-app-shell,
.app-main,
.main-content {
    background:
        radial-gradient(circle at 0% 0%, rgba(37, 99, 235, .08), transparent 28%),
        radial-gradient(circle at 100% 0%, rgba(124, 58, 237, .06), transparent 24%),
        var(--ip-bg);
}

.app-header,
.topbar,
.ip-topbar {
    background: rgba(255, 255, 255, .88) !important;
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 8px 30px rgba(15, 23, 42, .04);
}

.sidebar,
.app-sidebar,
#app-sidebar {
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    border-right: 1px solid var(--ip-border);
    box-shadow: 10px 0 35px rgba(15, 23, 42, .04);
}

.sidebar a,
.app-sidebar a,
#app-sidebar a,
.nav-link,
.menu-link {
    border-radius: 14px !important;
    color: var(--ip-text-2) !important;
    font-weight: 750;
    letter-spacing: -.01em;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar a:hover,
.app-sidebar a:hover,
#app-sidebar a:hover,
.nav-link:hover,
.menu-link:hover {
    background: var(--ip-primary-soft) !important;
    color: var(--ip-primary-2) !important;
    transform: translateX(2px);
}

.sidebar a.active,
.app-sidebar a.active,
#app-sidebar a.active,
.nav-link.active,
.menu-link.active {
    background: linear-gradient(135deg, var(--ip-primary), var(--ip-primary-2)) !important;
    color: #fff !important;
    box-shadow: 0 12px 24px rgba(37, 99, 235, .24);
}

.card,
.ip-card,
.dashboard-card,
.stat-card,
.widget,
.panel {
    background: var(--ip-surface) !important;
    border: 1px solid var(--ip-border) !important;
    border-radius: var(--ip-radius-lg) !important;
    box-shadow: var(--ip-shadow) !important;
}

.card:hover,
.ip-card:hover,
.dashboard-card:hover,
.stat-card:hover {
    box-shadow: var(--ip-shadow-lg) !important;
}

h1, h2, h3 {
    color: var(--ip-text);
    letter-spacing: -.04em;
}

h1 {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
}

h2 {
    font-size: clamp(22px, 3vw, 30px);
    line-height: 1.15;
}

button,
.button,
.btn,
input[type="submit"],
.wp-core-ui .button {
    border-radius: 13px !important;
    font-weight: 800 !important;
}

.button-primary,
.btn-primary,
button.primary,
.wp-core-ui .button-primary {
    background: linear-gradient(135deg, var(--ip-primary), var(--ip-primary-2)) !important;
    border-color: var(--ip-primary) !important;
    color: #fff !important;
    box-shadow: 0 10px 22px rgba(37, 99, 235, .20) !important;
}

input,
select,
textarea {
    border-radius: 13px !important;
    border-color: #cbd5e1 !important;
    font-size: 15px !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ip-primary) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .11) !important;
    outline: none !important;
}

table,
.data-table,
.wp-list-table {
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--ip-border) !important;
    background: #fff;
}

table th,
.data-table th,
.wp-list-table th {
    background: #f8fafc !important;
    color: #334155 !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 900 !important;
}

table td,
.data-table td,
.wp-list-table td {
    border-bottom: 1px solid #edf2f7 !important;
}

.badge,
.status,
.tag,
.label {
    border-radius: 999px !important;
    padding: 5px 10px !important;
    font-weight: 850 !important;
}

.alert,
.notice,
.ip-notice {
    border-radius: 16px !important;
    border-width: 1px !important;
}

.empty-state,
.ip-empty,
.no-results {
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 22px;
    padding: 34px 18px;
    text-align: center;
    color: var(--ip-muted);
}

.ip-page-hero {
    background: linear-gradient(135deg, #0f172a, #1d4ed8 58%, #7c3aed);
    color: #fff;
    border-radius: 26px;
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: var(--ip-shadow-lg);
}

.ip-page-hero h1,
.ip-page-hero h2 {
    color: #fff;
    margin: 0;
}

.ip-page-hero p {
    color: rgba(255, 255, 255, .78);
    margin: 8px 0 0;
    max-width: 780px;
}

.ip-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.ip-kpi {
    background: #fff;
    border: 1px solid var(--ip-border);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--ip-shadow-sm);
}

.ip-kpi small {
    display: block;
    color: var(--ip-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.ip-kpi strong {
    display: block;
    color: var(--ip-text);
    font-size: 30px;
    letter-spacing: -.05em;
    margin-top: 5px;
}

.loading,
.ip-loading {
    animation: ipPulse 1.2s ease-in-out infinite;
}

@keyframes ipPulse {
    0%,100% { opacity: .55; }
    50% { opacity: 1; }
}

/* Biblioteca pode permanecer premium/dark */
body.ip-biblioteca-dark,
.ip-bib-v544,
.ip-r-netflix {
    --ip-bg: #07111f;
}

/* Modo confortável para pessoas mais velhas */
.ip-readable,
.ip-readable body {
    font-size: 17px;
}

.ip-readable .card,
.ip-readable .ip-card,
.ip-readable input,
.ip-readable select,
.ip-readable textarea,
.ip-readable button {
    font-size: 16px !important;
}

@media (max-width: 760px) {
    body {
        font-size: 16px;
    }

    .card,
    .ip-card,
    .dashboard-card,
    .stat-card,
    .widget,
    .panel {
        border-radius: 18px !important;
    }

    .ip-page-hero {
        padding: 22px;
        border-radius: 22px;
    }
}


/* ==========================================================================
   v6.5.6 — FORCE REAL PREMIUM UI
   Aplicado diretamente no app.css real do PWA.
   ========================================================================== */

:root{
  --force-bg:#f4f7fb;
  --force-card:#ffffff;
  --force-text:#0f172a;
  --force-muted:#64748b;
  --force-border:#e5eaf2;
  --force-blue:#2563eb;
  --force-blue2:#1d4ed8;
  --force-purple:#7c3aed;
  --force-green:#16a34a;
  --force-red:#dc2626;
  --force-orange:#f97316;
  --force-sidebar:#07111f;
  --force-sidebar2:#0f172a;
  --force-shadow:0 14px 38px rgba(15,23,42,.075);
  --force-shadow-lg:0 24px 70px rgba(15,23,42,.14);
}

html body,
body.ip-app,
body{
  background:
    radial-gradient(circle at 8% 0%,rgba(37,99,235,.08),transparent 30%),
    radial-gradient(circle at 94% 0%,rgba(124,58,237,.06),transparent 28%),
    linear-gradient(180deg,#f8fbff,#f4f7fb) !important;
  color:var(--force-text) !important;
}

/* containers reais possíveis */
.app, .app-shell, .ip-app-shell, .main, main, .app-main, .main-content, #app-content, .content, .ip-content, .page-content, .pwa-content{
  background:
    radial-gradient(circle at 8% 0%,rgba(37,99,235,.07),transparent 30%),
    radial-gradient(circle at 94% 0%,rgba(124,58,237,.05),transparent 28%),
    linear-gradient(180deg,#f8fbff,#f4f7fb) !important;
  color:var(--force-text) !important;
}

/* Sidebar */
#app-sidebar, .app-sidebar, aside.sidebar, .sidebar, .menu-lateral, .side-menu{
  background:linear-gradient(180deg,var(--force-sidebar),var(--force-sidebar2)) !important;
  color:#e5e7eb !important;
  border-right:1px solid rgba(255,255,255,.08) !important;
  box-shadow:16px 0 44px rgba(15,23,42,.15) !important;
}

#app-sidebar *, .app-sidebar *, aside.sidebar *, .sidebar *, .menu-lateral *, .side-menu *{
  color:inherit;
}

#app-sidebar a, .app-sidebar a, aside.sidebar a, .sidebar a, .menu-lateral a, .side-menu a, .nav-link, .menu-link{
  color:#cbd5e1 !important;
  border-radius:16px !important;
  font-weight:850 !important;
}

#app-sidebar a:hover, .app-sidebar a:hover, aside.sidebar a:hover, .sidebar a:hover, .nav-link:hover, .menu-link:hover{
  background:rgba(255,255,255,.08) !important;
  color:#fff !important;
}

#app-sidebar a.active, .app-sidebar a.active, aside.sidebar a.active, .sidebar a.active, .nav-link.active, .menu-link.active{
  background:linear-gradient(135deg,var(--force-blue),var(--force-purple)) !important;
  color:#fff !important;
  box-shadow:0 14px 34px rgba(37,99,235,.30) !important;
}

/* Topbar */
.app-header, .topbar, .ip-topbar, header, .header{
  background:rgba(255,255,255,.96) !important;
  backdrop-filter:blur(6px);
  border-bottom:1px solid rgba(226,232,240,.96) !important;
  box-shadow:0 8px 28px rgba(15,23,42,.045) !important;
  color:var(--force-text) !important;
}

/* Hero criado/injetado */
.force-premium-hero,
.ip-react-hero, .ip-page-hero, .ip-bib-hero, .ip-module-hero, .page-hero, .module-hero, .pwa-hero, .dashboard-hero{
  background:linear-gradient(135deg,#0f172a 0%,#1d4ed8 54%,#7c3aed 100%) !important;
  color:#fff !important;
  border-radius:30px !important;
  padding:30px !important;
  box-shadow:var(--force-shadow-lg) !important;
  border:1px solid rgba(255,255,255,.15) !important;
  overflow:hidden;
  position:relative;
  margin:0 0 22px !important;
}

.force-premium-hero:after,
.ip-react-hero:after, .ip-page-hero:after, .ip-bib-hero:after, .ip-module-hero:after, .page-hero:after, .module-hero:after, .pwa-hero:after, .dashboard-hero:after{
  content:"";
  position:absolute;
  right:34px;
  top:16px;
  width:190px;
  height:150px;
  border-radius:34px;
  background:rgba(255,255,255,.13);
  transform:rotate(-12deg);
  pointer-events:none;
}

.force-premium-hero h1, .force-premium-hero h2,
.ip-react-hero h1,.ip-react-hero h2,.ip-page-hero h1,.ip-page-hero h2,.ip-bib-hero h1,.ip-bib-hero h2,.ip-module-hero h1,.ip-module-hero h2,.page-hero h1,.page-hero h2,.module-hero h1,.module-hero h2{
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
  margin:0 !important;
  position:relative;
  z-index:1;
}

.force-premium-hero p,
.ip-react-hero p,.ip-page-hero p,.ip-bib-hero p,.ip-module-hero p,.page-hero p,.module-hero p{
  color:rgba(255,255,255,.84) !important;
  -webkit-text-fill-color:rgba(255,255,255,.84) !important;
  position:relative;
  z-index:1;
}

/* cards */
.card, .ip-card, .dashboard-card, .stat-card, .panel, .widget, .box, .msg-card, .form-card, .content-card, .data-card, .ip-bi-card, .ip-bi-panel{
  background:#fff !important;
  color:var(--force-text) !important;
  border:1px solid var(--force-border) !important;
  border-radius:24px !important;
  box-shadow:var(--force-shadow) !important;
}

.card *, .ip-card *, .dashboard-card *, .stat-card *, .panel *, .widget *, .box *, .msg-card *, .form-card *{
  color:inherit;
}

h1,h2,h3,h4,h5,h6,
.card h1,.card h2,.card h3,.ip-card h1,.ip-card h2,.ip-card h3,.panel h1,.panel h2,.panel h3{
  color:var(--force-text) !important;
  -webkit-text-fill-color:var(--force-text) !important;
}

small,.muted,.text-muted,.description,.help{
  color:var(--force-muted) !important;
  -webkit-text-fill-color:var(--force-muted) !important;
}

/* Formulários: regra mais forte */
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.form-control,
.regular-text,
.search-input{
  background:#fff !important;
  color:#0f172a !important;
  -webkit-text-fill-color:#0f172a !important;
  border:1px solid #cbd5e1 !important;
  border-radius:15px !important;
  padding:12px 14px !important;
  font-weight:650 !important;
  box-shadow:none !important;
}

input::placeholder, textarea::placeholder{
  color:#94a3b8 !important;
  -webkit-text-fill-color:#94a3b8 !important;
}

form label, .form-label, fieldset label, .field-label{
  color:#1f2937 !important;
  -webkit-text-fill-color:#1f2937 !important;
  font-weight:800 !important;
}

/* Tabelas */
table, .data-table, .wp-list-table{
  background:#fff !important;
  color:#0f172a !important;
  border:1px solid var(--force-border) !important;
  border-radius:22px !important;
  overflow:hidden !important;
  box-shadow:var(--force-shadow) !important;
}

table th, .data-table th, .wp-list-table th{
  background:#f8fafc !important;
  color:#334155 !important;
  -webkit-text-fill-color:#334155 !important;
  font-size:12px !important;
  text-transform:uppercase;
  letter-spacing:.06em;
  font-weight:900 !important;
}

table td, .data-table td, .wp-list-table td{
  color:#1f2937 !important;
  -webkit-text-fill-color:#1f2937 !important;
  border-bottom:1px solid #edf2f7 !important;
}

/* Botões */
.btn, .button, button, input[type="submit"], a.button{
  border-radius:15px !important;
  font-weight:900 !important;
  text-decoration:none !important;
}

.btn-primary, .button-primary, button.primary, input[type="submit"].primary, input[type="submit"].button-primary{
  background:linear-gradient(135deg,var(--force-blue),var(--force-blue2)) !important;
  border-color:var(--force-blue) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

/* default não invisível */
.button:not(.button-primary):not(.btn-whatsapp):not(.btn-wa-send):not(.btn-delete):not(.btn-excluir):not(.btn-edit):not(.btn-editar),
.btn:not(.btn-primary):not(.btn-whatsapp):not(.btn-wa-send):not(.btn-delete):not(.btn-excluir):not(.btn-edit):not(.btn-editar),
button:not(.primary):not(.button-primary):not([data-action*="delete"]):not([data-action*="excluir"]):not([data-action*="edit"]):not([data-action*="editar"]){
  background:#fff !important;
  border:1px solid var(--force-border) !important;
  color:#334155 !important;
  -webkit-text-fill-color:#334155 !important;
}

.btn-wa-send,.btn-whatsapp,a[href*="wa.me"],a[href*="whatsapp"]{
  background:var(--force-green) !important;
  border-color:var(--force-green) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

.btn-excluir,.btn-delete,.button-delete,.delete,button[data-action*="excluir"],button[data-action*="delete"],a[href*="excluir"],a[href*="delete"]{
  background:var(--force-red) !important;
  border-color:var(--force-red) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

.btn-editar,.btn-edit,button[data-action*="editar"],button[data-action*="edit"],.ip-editar-livro-tab,.ip-force-edit{
  background:var(--force-blue) !important;
  border-color:var(--force-blue) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

.btn-warning,.warning,button[data-action*="alerta"],button[data-action*="warning"]{
  background:var(--force-orange) !important;
  border-color:var(--force-orange) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

.empty-state,.ip-empty,.no-results,.ip-bib-empty{
  background:#fff !important;
  border:1px dashed #cbd5e1 !important;
  border-radius:24px !important;
  color:var(--force-muted) !important;
  padding:38px 22px !important;
  text-align:center;
}

@media(max-width:800px){
  .force-premium-hero,.ip-react-hero,.ip-page-hero,.ip-bib-hero,.ip-module-hero,.page-hero,.module-hero{
    padding:23px !important;
    border-radius:24px !important;
  }
}
