:root{
  --brand:#ffd34d; --brand-600:#ffca29;
  --ink:#111; --muted:#666;
  --bg:#fffdfa; --card:#ffffff;
  --divider:#eee5c6;
  --shadow:0 10px 25px rgba(0,0,0,.08);
  --radius:18px;
}

html,body{height:100%}
body{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg) !important;
}

/* Bootstrap overrides */
.bg-light{ background: var(--bg) !important; }

.card{ border-radius: var(--radius) !important; border-color: var(--divider) !important; box-shadow: var(--shadow) !important; }

.btn-primary{
  --bs-btn-color: var(--ink);
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-600);
  --bs-btn-active-border-color: var(--brand-600);
  --bs-btn-focus-shadow-rgb: 255, 211, 77;
}

.btn-outline-secondary{
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: rgba(17,17,17,.25);
  --bs-btn-hover-bg: rgba(255,211,77,.25);
  --bs-btn-hover-border-color: rgba(17,17,17,.25);
  --bs-btn-hover-color: var(--ink);
}

.btn-outline-danger{ --bs-btn-border-color: rgba(220,53,69,.35); }

.badge.text-bg-secondary{ background-color: rgba(17,17,17,.12) !important; color: var(--ink) !important; }

/* Topbar */
.app-topbar{
  background: rgba(255,253,250,.85);
  border-bottom: 1px solid var(--divider);
  backdrop-filter: blur(10px);
}

.app-shell{ max-width: 1100px; }

.app-brand{ display:flex; align-items:center; gap:10px; text-decoration:none; color: var(--ink); }
.app-brand:hover{ color: var(--ink); }
.app-logo{
  width: 34px; height: 34px; border-radius: 10px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--divider);
}
.app-name{ font-weight: 800; letter-spacing: -0.02em; }

/* Avatars */
.avatar{
  width: 44px; height: 44px; border-radius: 999px;
  background: rgba(255,211,77,.25);
  border: 1px solid var(--divider);
  display:inline-flex; align-items:center; justify-content:center;
  font-weight: 800; color: var(--ink);
  overflow:hidden;
}
.avatar img{ width:100%; height:100%; object-fit:cover; display:block; }

.table a{ color: var(--ink); font-weight: 600; text-decoration: none; }
.table a:hover{ text-decoration: underline; }

/* Print helpers */
@media print{
  .no-print{ display:none !important; }
  body{ background: #fff !important; }
  .card{ box-shadow:none !important; }
}

.avatar.sm{ width:32px; height:32px; font-size:12px; }


/* Mobile-first touch targets */
.btn, .form-control, .form-select{
  border-radius: 14px;
}
.btn{
  min-height: 42px;
  font-weight: 700;
}
.btn-sm{ min-height: 34px; }
.btn-lg{ min-height: 48px; font-size: 1.05rem; }

@media (max-width: 576px){
  .app-shell{ padding-left: 12px !important; padding-right: 12px !important; }
  .table{ font-size: 0.95rem; }
  .card-body{ padding: 14px !important; }
}

/* TV Mode */
body.tv-mode{
  background: #fff !important;
}
body.tv-mode .app-topbar,
body.tv-mode .no-tv{
  display:none !important;
}
body.tv-mode .app-shell{
  max-width: 1600px;
}
body.tv-mode .match-card-live{
  padding: 18px;
}
body.tv-mode .tag{
  font-size: 14px;
  padding: 8px 12px;
}
body.tv-mode .teamline{
  padding: 12px 12px;
}
body.tv-mode h3, body.tv-mode h4, body.tv-mode h5{
  letter-spacing: -0.02em;
}

/* Mobile-first navigation */
@media (max-width: 768px){
  body{ padding-bottom: 74px; }
  .top-actions{ display:none !important; }
}

.bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(255,253,250,.92);
  border-top: 1px solid var(--divider);
  backdrop-filter: blur(10px);
  z-index: 1050;
}
.bottom-nav .bn{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  gap: 6px;
  padding: 8px 10px;
}
.bottom-nav a{
  flex: 1;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  padding: 10px 8px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid transparent;
}
.bottom-nav a.active{
  background: rgba(255,211,77,.35);
  border-color: rgba(17,17,17,.08);
}
.bottom-nav a.muted{ opacity: .55; }

/* Segmented tabs (Home) */
.seg-tabs{
  display:flex;
  background: rgba(17,17,17,.06);
  border: 1px solid rgba(17,17,17,.08);
  border-radius: 16px;
  padding: 4px;
  gap: 6px;
}
.seg-tabs button{
  flex:1;
  border: 0;
  background: transparent;
  padding: 10px 10px;
  border-radius: 14px;
  font-weight: 900;
}
.seg-tabs button.active{
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

/* News list */
.news-item{
  display:flex;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(17,17,17,.08);
  text-decoration:none;
  color: var(--ink);
}
.news-item:first-child{ border-top: 0; padding-top: 6px; }
.news-thumb{
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(17,17,17,.06);
  overflow:hidden;
  flex: 0 0 52px;
}
.news-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.news-title{
  font-weight: 900;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-meta{
  margin-top: 6px;
  font-size: 12px;
  color: rgba(17,17,17,.62);
}

/* Home news card - v3 */
.news-card{
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(255,211,77,.35), transparent 34%),
    #fff;
}
.news-card .card-body{ padding: 18px !important; }
.news-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.news-kicker{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:2px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(17,17,17,.55);
}
.news-kicker::before{ content:'🎾'; font-size:13px; letter-spacing:0; }
.news-heading{
  font-size:1.25rem;
  font-weight:900;
  letter-spacing:-.04em;
}
.news-refresh{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  background:rgba(17,17,17,.08);
  color:var(--ink);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}
.news-subtitle{
  margin-top:8px;
  color:rgba(17,17,17,.62);
  font-size:14px;
  line-height:1.35;
}
.news-list{ margin-top:14px; }
.news-loading{
  padding:14px;
  border-radius:16px;
  background:rgba(17,17,17,.04);
  color:rgba(17,17,17,.62);
  font-size:14px;
}
.news-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px;
  margin-top:8px;
  border:1px solid rgba(17,17,17,.07);
  border-radius:16px;
  background:rgba(255,255,255,.72);
  text-decoration:none !important;
  color:var(--ink) !important;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.news-item:first-child{ margin-top:0; padding-top:10px; border-top:1px solid rgba(17,17,17,.07); }
.news-item:hover{
  transform:translateY(-1px);
  border-color:rgba(17,17,17,.14);
  background:#fff;
  box-shadow:0 10px 20px rgba(0,0,0,.06);
}
.news-item-featured{
  align-items:flex-end;
  min-height:150px;
  position:relative;
  padding:12px;
  background:linear-gradient(135deg, rgba(255,211,77,.22), rgba(255,255,255,.78));
}
.news-item-featured .news-thumb{
  width:120px;
  height:96px;
  flex-basis:120px;
  border-radius:18px;
}
.news-thumb{
  width:62px;
  height:62px;
  border-radius:16px;
  background:rgba(17,17,17,.06);
  overflow:hidden;
  flex:0 0 62px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.news-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.news-thumb-fallback{
  background:linear-gradient(135deg, rgba(255,211,77,.55), rgba(17,17,17,.06));
  font-size:24px;
}
.news-body{ min-width:0; flex:1; }
.news-title{
  font-weight:900;
  line-height:1.16;
  letter-spacing:-.02em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.news-item-featured .news-title{
  font-size:1.02rem;
  -webkit-line-clamp:3;
}
.news-meta{
  margin-top:7px;
  font-size:12px;
  font-weight:800;
  color:rgba(17,17,17,.56);
}
.news-actions{ margin-top:10px; }
.news-more-btn{
  width:100%;
  min-height:42px;
  border:1px solid rgba(17,17,17,.12);
  border-radius:14px;
  background:#fff;
  color:var(--ink);
  font-weight:900;
  transition:background .16s ease, transform .16s ease;
}
.news-more-btn:hover{
  background:rgba(255,211,77,.25);
  transform:translateY(-1px);
}
.news-footer{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid rgba(17,17,17,.07);
  color:rgba(17,17,17,.55);
  font-size:12px;
  line-height:1.35;
}

@media (max-width: 991.98px){
  .news-card{ margin-top:4px; }
}
@media (max-width: 576px){
  .news-card .card-body{ padding:14px !important; }
  .news-item-featured{
    display:block;
    min-height:auto;
  }
  .news-item-featured .news-thumb{
    width:100%;
    height:150px;
    margin-bottom:10px;
  }
}

/* Home news card - v4 overflow/crop fix
   Coloque este bloco no FINAL do theme.css para garantir precedência. */
.news-card,
.news-card *{
  box-sizing:border-box;
}
.news-card{
  width:100%;
  max-width:100%;
  overflow:hidden !important;
}
.news-card .card-body{
  overflow:hidden;
}
.news-card a,
.news-card a:hover,
.news-card a:focus{
  color:var(--ink) !important;
  text-decoration:none !important;
}
.news-card .news-list{
  width:100%;
  max-width:100%;
  overflow:hidden;
}
.news-card .news-item{
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  display:grid !important;
  grid-template-columns:64px minmax(0, 1fr);
  align-items:center;
}
.news-card .news-item-featured{
  display:block !important;
  min-height:0;
  padding:12px;
}
.news-card .news-item-featured .news-thumb{
  width:100% !important;
  max-width:100% !important;
  height:155px !important;
  min-width:0 !important;
  flex:none !important;
  flex-basis:auto !important;
  margin:0 0 10px 0;
  border-radius:18px;
}
.news-card .news-thumb{
  width:64px !important;
  height:64px !important;
  min-width:64px !important;
  max-width:64px !important;
  flex:0 0 64px !important;
  overflow:hidden !important;
  border-radius:16px;
  position:relative;
}
.news-card .news-thumb img{
  display:block !important;
  width:100% !important;
  height:100% !important;
  min-width:100% !important;
  max-width:100% !important;
  object-fit:cover !important;
  object-position:center center;
}
.news-card .news-body{
  min-width:0 !important;
  max-width:100%;
  overflow:hidden;
}
.news-card .news-title,
.news-card .news-meta{
  max-width:100%;
  overflow:hidden;
}
.news-card .news-actions{
  width:100%;
  max-width:100%;
}
.news-card .news-more-btn{
  display:block;
  width:100%;
  max-width:100%;
}
@media (max-width: 576px){
  .news-card .news-item{
    grid-template-columns:58px minmax(0, 1fr);
  }
  .news-card .news-thumb{
    width:58px !important;
    height:58px !important;
    min-width:58px !important;
    max-width:58px !important;
  }
  .news-card .news-item-featured .news-thumb{
    width:100% !important;
    max-width:100% !important;
    height:145px !important;
  }
}


/* Bottom nav tweaks for admin mobile (supports Operação) */
.bottom-nav .bn{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.bottom-nav .bn::-webkit-scrollbar{ display:none; }
.bottom-nav a{
  white-space: nowrap;
  min-width: 64px;
  line-height: 1.1;
}
@media (max-width: 390px){
  .bottom-nav a{
    font-size: 11px;
    padding: 10px 6px;
    min-width: 60px;
  }
}
