/* Tirashi House · Painel */
:root {
  --th-red: #a51c24;
  --th-red-dark: #7f141b;
  --th-gold: #f2b21b;
  --th-ink: #17120f;
  --th-bg: #f6f3ee;
  --th-card: #ffffff;
  --th-line: #e9e3da;
  --th-muted: #7b7168;
  --th-radius: 16px;
  --bs-primary: #a51c24;
  --bs-primary-rgb: 165, 28, 36;
  --bs-link-color: #a51c24;
  --bs-link-color-rgb: 165, 28, 36;
  --bs-link-hover-color: #7f141b;
  --bs-link-hover-color-rgb: 127, 20, 27;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-bs-theme="dark"] {
  --th-bg: #14110f;
  --th-card: #1e1a17;
  --th-line: #322b26;
  --th-muted: #a59a90;
  --th-ink: #0d0a09;
  --bs-body-bg: #14110f;
  --bs-link-color: #ff8a8f;
  --bs-link-color-rgb: 255, 138, 143;
  --bs-link-hover-color: #ffb0b3;
  --bs-link-hover-color-rgb: 255, 176, 179;
}
html, body { height: 100%; }
body { background: var(--th-bg); font-size: 15px; -webkit-font-smoothing: antialiased; }
.th-boot { min-height: 100vh; display: flex; gap: 12px; align-items: center; justify-content: center; color: var(--th-muted); }
.th-boot .spinner-border { color: var(--th-red); width: 1.4rem; height: 1.4rem; border-width: 2px; }

/* botões e formulários */
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { --bs-btn-bg: var(--th-red); --bs-btn-border-color: var(--th-red); --bs-btn-hover-bg: var(--th-red-dark); --bs-btn-hover-border-color: var(--th-red-dark); --bs-btn-active-bg: var(--th-red-dark); --bs-btn-active-border-color: var(--th-red-dark); --bs-btn-disabled-bg: var(--th-red); --bs-btn-disabled-border-color: var(--th-red); }
.btn-outline-primary { --bs-btn-color: var(--th-red); --bs-btn-border-color: var(--th-red); --bs-btn-hover-bg: var(--th-red); --bs-btn-hover-border-color: var(--th-red); --bs-btn-active-bg: var(--th-red); --bs-btn-active-border-color: var(--th-red); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #ff8a8f; --bs-btn-border-color: #ff8a8f; }
.btn-light { --bs-btn-bg: var(--th-card); --bs-btn-border-color: var(--th-line); --bs-btn-hover-bg: var(--th-bg); --bs-btn-hover-border-color: var(--th-line); }
[data-bs-theme="dark"] .btn-light { --bs-btn-color: #e9e3da; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--th-line); --bs-btn-active-border-color: var(--th-line); }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--th-line); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--th-red); box-shadow: 0 0 0 .2rem rgba(165, 28, 36, .15); }
.form-check-input:checked { background-color: var(--th-red); border-color: var(--th-red); }
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .3rem; }
.form-text { color: var(--th-muted); }
.form-switch { padding-left: 3.1em; }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; margin-left: -3.1em; }
.th-table .form-switch { padding-left: 0; } .th-table .form-switch .form-check-input { margin-left: 0; float: none; }
.req::after { content: " *"; color: var(--th-red); }

/* login */
.th-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.th-login-art { background: radial-gradient(1200px 600px at 10% 10%, #c2262f 0%, var(--th-red) 35%, var(--th-red-dark) 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.th-login-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .07); }
.th-login-art h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.th-login-art p { opacity: .85; max-width: 420px; }
.th-login-form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.th-login-card { width: 100%; max-width: 380px; }
.th-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.th-logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--th-gold); color: var(--th-ink); display: grid; place-items: center; font-size: 1.2rem; }
@media (max-width: 860px) { .th-login { grid-template-columns: 1fr; } .th-login-art { padding: 32px; min-height: 220px; } .th-login-art h1 { font-size: 1.6rem; } }

/* estrutura */
.th-shell { display: flex; min-height: 100vh; }
.th-side { width: 256px; flex: 0 0 256px; background: var(--th-ink); color: #cfc6bd; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.th-side-head { padding: 18px 20px 8px; color: #fff; }
.th-side-head small { display: block; color: #9a8f85; font-weight: 500; letter-spacing: 0; font-size: .74rem; }
.th-nav { flex: 1; overflow-y: auto; padding: 6px 12px 16px; }
.th-nav-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: #7d7269; padding: 12px 10px 4px; }
.th-nav a { display: flex; align-items: center; gap: 11px; padding: 7px 12px; border-radius: 10px; color: #cfc6bd; text-decoration: none; font-weight: 500; font-size: .92rem; transition: background .15s, color .15s; }
.th-nav a i { font-size: 1.05rem; width: 20px; text-align: center; }
.th-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.th-nav a.active { background: var(--th-red); color: #fff; box-shadow: 0 6px 18px rgba(165, 28, 36, .35); }
.th-nav a .badge { margin-left: auto; background: var(--th-gold); color: var(--th-ink); font-weight: 700; }
.th-side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; align-items: center; gap: 10px; }
.th-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--th-gold); color: var(--th-ink); display: grid; place-items: center; font-weight: 800; flex: 0 0 34px; }
.th-side-foot .nome { color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.1; }
.th-side-foot .papel { font-size: .72rem; color: #9a8f85; }
.th-side-foot .btn { color: #cfc6bd; }
.th-side-foot .btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.th-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.th-top { display: none; align-items: center; gap: 10px; padding: 10px 14px; background: var(--th-ink); color: #fff; position: sticky; top: 0; z-index: 1020; }
.th-view { padding: 28px 32px 56px; max-width: 1280px; width: 100%; margin: 0 auto; }
.th-backdrop { display: none; }
@media (max-width: 991px) {
  .th-side { position: fixed; z-index: 1045; transform: translateX(-100%); transition: transform .25s ease; }
  .th-shell.menu-aberto .th-side { transform: none; }
  .th-shell.menu-aberto .th-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 1040; }
  .th-top { display: flex; }
  .th-view { padding: 18px 14px 48px; }
}

/* cabeçalho de página */
.th-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.th-head h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.th-head p { margin: 4px 0 0; color: var(--th-muted); max-width: 720px; }
.th-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.th-search { position: relative; }
.th-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--th-muted); }
.th-search input { padding-left: 34px; min-width: 270px; }

/* cartões */
.th-card { background: var(--th-card); border: 1px solid var(--th-line); border-radius: var(--th-radius); box-shadow: 0 1px 2px rgba(23, 18, 15, .04); }
.th-card-body { padding: 20px; }
.th-card-title { font-weight: 700; font-size: 1rem; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; }
.th-card-sub { color: var(--th-muted); font-size: .86rem; margin-bottom: 14px; }
.th-stat { padding: 18px 20px; display: flex; gap: 14px; align-items: center; height: 100%; }
.th-stat .ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.25rem; background: rgba(165, 28, 36, .1); color: var(--th-red); flex: 0 0 46px; }
.th-stat .ico.gold { background: rgba(242, 178, 27, .18); color: #9a6b00; }
.th-stat .ico.green { background: rgba(25, 135, 84, .12); color: #198754; }
.th-stat .ico.gray { background: rgba(123, 113, 104, .14); color: var(--th-muted); }
[data-bs-theme="dark"] .th-stat .ico { color: #ff8a8f; }
[data-bs-theme="dark"] .th-stat .ico.gold { color: var(--th-gold); }
.th-stat .num { font-size: 1.7rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.th-stat .lbl { color: var(--th-muted); font-size: .82rem; margin-top: 4px; }
.th-hero { background: linear-gradient(120deg, var(--th-red) 0%, var(--th-red-dark) 100%); color: #fff; border-radius: var(--th-radius); padding: 24px 26px; position: relative; overflow: hidden; }
.th-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; border: 34px solid rgba(255, 255, 255, .08); }
.th-hero h2 { font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; font-size: 1.5rem; }
.th-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: rgba(255, 255, 255, .16); }
.th-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: #7bf0a8; box-shadow: 0 0 0 4px rgba(123, 240, 168, .22); }
.th-pill .dot.off { background: #ffd08a; box-shadow: 0 0 0 4px rgba(255, 208, 138, .22); }
.th-pend { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--th-line); }
.th-pend:last-child { border-bottom: 0; }
.th-pend i { font-size: 1.1rem; margin-top: 1px; }
.th-pend .erro { color: #dc3545; } .th-pend .atencao { color: #d98a00; } .th-pend .info { color: #2a7de1; }

/* tabelas */
.th-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.th-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--th-muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--th-line); white-space: nowrap; }
.th-table td { padding: 12px 16px; border-bottom: 1px solid var(--th-line); vertical-align: middle; }
.th-table tr:last-child td { border-bottom: 0; }
.th-table tbody tr { transition: background .12s; }
.th-table tbody tr:hover { background: rgba(165, 28, 36, .035); }
.th-table .acoes { white-space: nowrap; text-align: right; }
.th-table .acoes .btn { margin-left: 2px; }
.th-nome { font-weight: 600; }
.th-sub { color: var(--th-muted); font-size: .84rem; }
.th-thumb { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; background: var(--th-bg); display: grid; place-items: center; color: var(--th-muted); flex: 0 0 44px; }
.th-grupo td { background: var(--th-bg); font-weight: 700; font-size: .8rem; letter-spacing: .04em; padding: 9px 16px; }
.th-vazio { text-align: center; padding: 48px 20px; color: var(--th-muted); }
.th-vazio i { font-size: 2.4rem; display: block; margin-bottom: 8px; opacity: .5; }
.badge-soft { background: rgba(165, 28, 36, .1); color: var(--th-red); font-weight: 600; }
.badge-gold { background: rgba(242, 178, 27, .2); color: #8a5f00; font-weight: 600; }
.badge-gray { background: rgba(123, 113, 104, .14); color: var(--th-muted); font-weight: 600; }
.badge-green { background: rgba(25, 135, 84, .13); color: #157347; font-weight: 600; }
[data-bs-theme="dark"] .badge-soft { color: #ff8a8f; } [data-bs-theme="dark"] .badge-gold { color: var(--th-gold); } [data-bs-theme="dark"] .badge-green { color: #6fdca5; }
@media (max-width: 767px) {
  .th-table thead { display: none; }
  .th-table, .th-table tbody, .th-table tr, .th-table td { display: block; width: 100%; }
  .th-table tr { padding: 10px 4px; border-bottom: 1px solid var(--th-line); }
  .th-table td { border: 0; padding: 4px 14px; }
  .th-table td[data-l]::before { content: attr(data-l) ": "; color: var(--th-muted); font-size: .78rem; }
  .th-table .acoes { text-align: left; padding-top: 8px; }
  .th-grupo td { padding: 8px 14px; }
  .th-search input { min-width: 0; width: 100%; }
}

/* chips, variações, upload */
.th-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th-chip { border: 1px solid var(--th-line); background: var(--th-card); border-radius: 999px; padding: 5px 12px; font-size: .84rem; cursor: pointer; user-select: none; transition: all .12s; color: inherit; }
.th-chip:hover { border-color: var(--th-red); }
.th-chip.on { background: var(--th-red); border-color: var(--th-red); color: #fff; }
.th-var { display: grid; grid-template-columns: 1fr 130px 36px; gap: 8px; margin-bottom: 8px; }
.th-drop { border: 2px dashed var(--th-line); border-radius: var(--th-radius); padding: 30px 20px; text-align: center; color: var(--th-muted); cursor: pointer; transition: all .15s; }
.th-drop:hover, .th-drop.sobre { border-color: var(--th-red); background: rgba(165, 28, 36, .04); color: inherit; }
.th-drop i { font-size: 2rem; color: var(--th-red); }
.th-pre { white-space: pre-wrap; background: var(--th-bg); border: 1px solid var(--th-line); border-radius: 12px; padding: 16px; font-size: .86rem; line-height: 1.55; max-height: 520px; overflow: auto; }
.th-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; background: var(--th-bg); border: 1px solid var(--th-line); border-radius: 8px; padding: 2px 7px; word-break: break-all; }
.th-endpoint { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; padding: 10px 0; border-bottom: 1px dashed var(--th-line); }
.th-endpoint:last-child { border-bottom: 0; }
.th-get { font-weight: 800; font-size: .7rem; color: #157347; background: rgba(25, 135, 84, .13); border-radius: 6px; padding: 2px 7px; }
.modal-content { border-radius: 18px; border: 0; }
.modal-header, .modal-footer { border-color: var(--th-line); }
.modal-title { font-weight: 800; }
.swal2-popup { border-radius: 18px !important; font-family: var(--bs-body-font-family) !important; }
.swal2-styled.swal2-confirm { background-color: var(--th-red) !important; border-radius: 10px !important; }
.swal2-styled.swal2-cancel { border-radius: 10px !important; }
.th-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--th-muted); font-weight: 700; margin: 6px 0 2px; }
.sticky-save { position: sticky; bottom: 14px; z-index: 5; display: flex; justify-content: flex-end; pointer-events: none; }
.sticky-save .btn { pointer-events: auto; box-shadow: 0 10px 24px rgba(165, 28, 36, .3); }
