/* =============================================================
   PLACAR CRAVADO — Design System
   Fonte: Poppins | Cores: verde escuro, verde vibrante
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Variables ── */
:root {
    --primary:       #16a34a;
    --primary-dark:  #15803d;
    --primary-light: #dcfce7;
    --green:         #22c55e;
    --green-dark:    #16a34a;
    --green-light:   #dcfce7;
    --gray-50:       #f8fafc;
    --gray-100:      #f1f5f9;
    --gray-200:      #e2e8f0;
    --gray-300:      #cbd5e1;
    --gray-400:      #94a3b8;
    --gray-500:      #64748b;
    --gray-600:      #475569;
    --gray-700:      #334155;
    --gray-800:      #1e293b;
    --gray-900:      #0f172a;
    --sidebar-w:     260px;
    --sidebar-bg:    #0a2817;
    --sidebar-hover: #14532d;
    --sidebar-text:  #c8e6d0;
    --sidebar-muted: #6aaa7e;
    --radius:        10px;
    --radius-lg:     16px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow:        0 4px 12px rgba(0,0,0,.08);
    --shadow-lg:     0 10px 30px rgba(0,0,0,.12);
    --transition:    .2s ease;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ── Layout ── */
.app-layout { display: flex; min-height: 100vh; overflow-x: hidden; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
    overflow: hidden;
}
.sidebar-logo {
    padding: 20px 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo-icon {
    width: 44px; height: 44px;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 5px;
}
.sidebar-logo-icon img {
    width: 100%; height: 100%;
    object-fit: contain;
}

/* Logo tipografico */
.brand-logo { display: inline-flex; flex-direction: column; gap: 1px; user-select: none; }
.brand-name { display: flex; align-items: baseline; gap: 5px; margin: 0; line-height: 1; font-family: 'Poppins', sans-serif; }
.brand-name-placar { font-size: 1.15rem; font-weight: 700; color: #ffffff; letter-spacing: -0.3px; }
.brand-name-cravado { font-size: 1.15rem; font-weight: 700; color: #22c55e; letter-spacing: -0.3px; }
.brand-tagline { font-size: 0.52rem; font-weight: 500; color: #6aaa7e; letter-spacing: 1.5px; text-transform: uppercase; margin: 0; padding-left: 1px; }

.sidebar-nav {
    padding: 16px 12px;
    flex: 1;
    overflow-y: auto; overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.nav-section { margin-bottom: 24px; }
.nav-section-title { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: #6aaa7e; padding: 0 10px; margin-bottom: 6px; }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    color: #c8e6d0; font-size: .82rem; font-weight: 500;
    cursor: pointer; transition: background var(--transition), color var(--transition);
    margin-bottom: 2px; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,.4); }
.nav-item .nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; opacity: .8; }
.nav-item.active .nav-icon, .nav-item:hover .nav-icon { opacity: 1; }

.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; margin-bottom: 4px; }
.sidebar-user-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--green));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name { font-size: .78rem; font-weight: 600; color: #e2f5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-email { font-size: .65rem; color: #6aaa7e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Main Content ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; width: 100%; max-width: 100vw; overflow-x: hidden; }
.topbar { background: #fff; border-bottom: 1px solid var(--gray-200); padding: 0 28px; height: 60px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; }
.topbar-title { font-size: 1rem; font-weight: 600; color: var(--gray-800); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; color: var(--gray-600); }

.page-content { padding: 28px; flex: 1; max-width: 100%; overflow-x: hidden; }
.page-header { margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.page-header-left h1 { font-size: 1.3rem; font-weight: 700; color: var(--gray-800); line-height: 1.3; }
.page-header-left p { font-size: .8rem; color: var(--gray-500); margin-top: 2px; }

/* ── Cards ── */
.card { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); overflow: hidden; }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--gray-100); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: .9rem; font-weight: 600; color: var(--gray-800); }
.card-body { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ── Stats Grid ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); padding: 18px 20px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; }
.stat-icon.blue  { background: var(--primary-light); color: var(--primary-dark); }
.stat-icon.green { background: var(--green-light); color: var(--green-dark); }
.stat-icon.gray  { background: var(--gray-100); color: var(--gray-600); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-800); line-height: 1; }
.stat-label { font-size: .72rem; color: var(--gray-500); margin-top: 3px; }

/* ── Tables ── */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
thead th { background: var(--gray-50); color: var(--gray-500); font-weight: 600; font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; padding: 10px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); }
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: .68rem; font-weight: 600; }
.badge-green  { background: var(--green-light); color: var(--green-dark); }
.badge-blue   { background: var(--primary-light); color: var(--primary-dark); }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red    { background: #fee2e2; color: #991b1b; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: .8rem; font-weight: 600; cursor: pointer; border: 1.5px solid transparent; transition: all var(--transition); white-space: nowrap; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-800); }
.btn-danger { background: #fff; color: #dc2626; border-color: #fca5a5; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: var(--green-dark); color: #fff; border-color: var(--green-dark); }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 6px 12px; font-size: .75rem; }
.btn-lg { padding: 12px 24px; font-size: .9rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .78rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control { width: 100%; padding: 9px 13px; border: 1.5px solid var(--gray-300); border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: .82rem; color: var(--gray-800); background: #fff; transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.form-control::placeholder { color: var(--gray-400); }
.form-control.error { border-color: #dc2626; }
.form-hint { font-size: .7rem; color: var(--gray-500); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }

/* ── Alerts ── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: .8rem; font-weight: 500; margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #bbf7d0; }

/* ── Match Card ── */
.match-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); }
.match-card:hover { box-shadow: var(--shadow); }
.match-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: .7rem; color: var(--gray-500); }
.match-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.match-team { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.match-team.right { align-items: center; }
.match-team-flag { width: 42px; height: 28px; border-radius: 4px; object-fit: cover; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); }
.match-team-logo { width: 36px; height: 36px; border-radius: 6px; object-fit: contain; box-shadow: var(--shadow-sm); border: 1px solid var(--gray-200); background: #fff; padding: 2px; }
.match-team-flag-placeholder { width: 42px; height: 28px; border-radius: 4px; background: var(--gray-100); border: 1px solid var(--gray-200); display: flex; align-items: center; justify-content: center; font-size: .6rem; color: var(--gray-400); }
.match-team-name { font-size: .75rem; font-weight: 600; color: var(--gray-800); }
.match-vs { text-align: center; }
.match-score { display: flex; align-items: center; gap: 4px; justify-content: center; }
.score-box { width: 38px; height: 38px; background: var(--gray-100); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 700; color: var(--gray-800); border: 1.5px solid var(--gray-200); }
.score-box.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); }
.score-sep { font-weight: 700; color: var(--gray-500); font-size: .9rem; }
.score-input { width: 46px; height: 42px; text-align: center; border: 1.5px solid var(--gray-300); border-radius: 8px; font-family: 'Poppins', sans-serif; font-size: 1rem; font-weight: 700; color: var(--gray-800); padding: 0; outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
.score-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
.vs-text { font-size: .7rem; color: var(--gray-400); font-weight: 600; letter-spacing: 1px; }

/* ── Grid match cards ── */
.matches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

/* ── Points badge ── */
.points-badge { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; font-size: .8rem; font-weight: 700; }
.points-10 { background: #dcfce7; color: #14532d; border: 1.5px solid #86efac; }
.points-7  { background: #bbf7d0; color: #166534; border: 1.5px solid #4ade80; }
.points-5  { background: #fef9c3; color: #854d0e; border: 1.5px solid #fde047; }
.points-2  { background: #fed7aa; color: #9a3412; border: 1.5px solid #fb923c; }
.points-0  { background: #fee2e2; color: #991b1b; border: 1.5px solid #fca5a5; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; display:flex; align-items:center; justify-content:center; }
.empty-state h3 { font-size: .9rem; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.empty-state p  { font-size: .78rem; }

/* ── Auth pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-100); padding: 20px; }
.auth-box { background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-img { width: 80px; height: 80px; object-fit: contain; display: block; margin: 0 auto 4px; }
.auth-logo .brand-name { justify-content: center; }
.auth-logo .brand-name-placar { font-size: 1.6rem; font-weight: 700; color: var(--gray-800); letter-spacing: -0.3px; }
.auth-logo .brand-name-cravado { font-size: 1.6rem; font-weight: 700; color: var(--primary); letter-spacing: -0.3px; }
.auth-logo .brand-tagline { color: var(--gray-400); letter-spacing: 2px; }
.auth-logo p { font-size: .78rem; color: var(--gray-500); margin-top: 4px; }
.auth-divider { text-align: center; font-size: .75rem; color: var(--gray-500); margin: 16px 0; }

/* ── Overlay sidebar mobile ── */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }

/* ── Tooltip ── */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--gray-800); color: #fff; font-size: .68rem; padding: 4px 10px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
[data-tooltip]:hover::after { opacity: 1; }

/* ── Datetime-local ── */
input[type="datetime-local"].form-control { color-scheme: light; }
input[type="datetime-local"].form-control::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; filter: invert(35%) sepia(80%) saturate(500%) hue-rotate(110deg); }

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: .75rem; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.mt-4        { margin-top: 4px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.flex-wrap   { flex-wrap: wrap; }
.flex-1      { flex: 1; }
.separator { border: none; border-top: 1px solid var(--gray-200); margin: 20px 0; }
.flag-img { width: 24px; height: 16px; border-radius: 3px; object-fit: cover; display: inline-block; vertical-align: middle; border: 1px solid var(--gray-200); }

/* ── Responsivo ── */
@media (max-width: 768px) {
    html { font-size: 14px; }
    .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-content { margin-left: 0; max-width: 100vw; overflow-x: hidden; }
    .hamburger { display: flex; }
    .page-content { padding: 16px; max-width: 100%; overflow-x: hidden; }
    .topbar { padding: 0 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .matches-grid { grid-template-columns: 1fr; gap: 12px; }
    .form-row { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .auth-box { padding: 28px 20px; }
    .match-card { padding: 14px 16px; }
    .match-body { gap: 8px; }
    .match-team-name { font-size: .7rem; }
    .score-input { width: 42px; height: 38px; font-size: .9rem; }
}
@media (max-width: 480px) {
    html { font-size: 13px; }
    .stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: 12px; }
    .topbar { padding: 0 12px; height: 56px; }
    .match-card { padding: 12px 14px; }
    .match-team-flag { width: 36px; height: 24px; }
    .match-team-logo { width: 32px; height: 32px; }
    .score-input { width: 38px; height: 36px; }
    .btn { padding: 8px 14px; font-size: .75rem; }
}
