/* ===== BENFICA JUDO — Brand identity ===== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Benfica brand colors */
  --benfica-red: #C30000;
  --benfica-red-dark: #9F0000;
  --benfica-red-soft: rgba(195,0,0,0.08);
  --benfica-red-glow: rgba(195,0,0,0.14);
  --benfica-black: #2C2C2E;
  --benfica-black-soft: #1A1A1C;
  --benfica-cream: #FEFCF8;

  /* Backgrounds */
  --bg-primary: #F5F5F7;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #FAFAFB;
  --bg-input: #F5F5F7;
  --bg-soft: #F8F8F9;
  --border: #EDEDEE;
  --border-light: #DDDDDE;

  /* Primary = Benfica red */
  --primary: var(--benfica-red);
  --primary-dark: var(--benfica-red-dark);
  --primary-soft: var(--benfica-red-soft);
  --primary-glow: var(--benfica-red-glow);

  /* Secondary tones */
  --blue-primary: #1074BC;
  --blue-secondary: #085E9A;
  --blue-glow: rgba(16,116,188,0.08);
  --gold: #FFD432;
  --gold-dim: rgba(255,212,50,0.12);
  --red: #C30000;
  --red-dim: rgba(195,0,0,0.10);
  --green: #12814B;
  --green-dim: rgba(18,129,75,0.10);
  --orange: #E5502E;
  --orange-dim: rgba(229,80,46,0.10);
  --purple: #6B21A8;
  --purple-dim: rgba(107,33,168,0.10);
  --cyan: #0891B2;
  --cyan-dim: rgba(8,145,178,0.10);

  --text-primary: #2C2C2E;
  --text-secondary: #52525B;
  --text-muted: #8E8E93;

  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 68px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(44,44,46,0.04);
  --shadow: 0 4px 16px rgba(44,44,46,0.06);
  --shadow-lg: 0 20px 40px rgba(44,44,46,0.10);
  --shadow-card: 0 1px 3px rgba(44,44,46,0.05), 0 0 0 1px rgba(44,44,46,0.02);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -0.02em; }

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input, select, textarea {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
  transition: all var(--transition);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d4d4d6; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #b0b0b3; }

/* ===== LAYOUT ===== */
body { display: flex; overflow: hidden; padding: 12px; gap: 12px; }

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - 24px);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--shadow-card);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  min-width: var(--sidebar-collapsed);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  min-height: 76px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.logo-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0;
  background: none;
}
.logo-icon img { width: 100%; height: 100%; object-fit: contain; }

.logo-text { overflow: hidden; }
.logo-main {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 15px; font-weight: 900;
  color: var(--benfica-red);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  line-height: 1.1;
}
.logo-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 2px;
}

.sidebar-toggle {
  padding: 6px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-soft); color: var(--text-primary); }

/* ===== NAV ===== */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 12px 12px;
}

.nav-section { margin-bottom: 6px; }
.nav-section-label {
  display: block;
  padding: 14px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  margin: 1px 0;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  font-weight: 500;
  font-size: 13px;
}
.nav-item:hover { background: var(--bg-soft); color: var(--text-primary); }
.nav-item.active {
  background: var(--benfica-red);
  color: #fff;
  font-weight: 500;
}
.nav-item.active .nav-icon svg { stroke: #fff; }

.nav-icon {
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-label { font-size: 13px; font-weight: 500; overflow: hidden; }
.nav-badge {
  margin-left: auto;
  background: var(--benfica-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}
.nav-item.active .nav-badge { background: #fff; color: var(--benfica-red); }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label { display: none; }

/* ===== SIDEBAR FOOTER ===== */
.sidebar-footer {
  padding: 14px;
  margin-top: auto;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.user-avatar {
  width: 36px; height: 36px;
  background: var(--benfica-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}
.user-name { display: block; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--text-primary); }
.user-role { display: block; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.sidebar.collapsed .user-details { display: none; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 24px);
  overflow: hidden;
  min-width: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left { overflow: hidden; }
.page-title {
  font-family: 'Roboto', sans-serif;
  font-size: 22px; font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
.breadcrumb { font-size: 12px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; margin-top: 2px; }
.bc-current { color: var(--text-secondary); font-weight: 500; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: 22px;
  padding: 8px 16px;
  width: 280px;
  transition: all var(--transition);
}
.search-bar:focus-within {
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-bar input {
  border: none;
  background: none;
  outline: none;
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: none;
  padding: 0;
}
.search-bar input:focus { background: none; box-shadow: none; }
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon svg { stroke: var(--text-muted); width: 18px; height: 18px; fill: none; stroke-width: 1.5; }

.btn-icon {
  width: 40px; height: 40px;
  background: var(--bg-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  position: relative;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.btn-icon:hover { background: var(--bg-input); color: var(--text-primary); }
.btn-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.notif-dot {
  position: absolute;
  top: 8px; right: 8px;
  width: 8px; height: 8px;
  background: var(--benfica-red);
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--green-dim);
  border-radius: 22px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.05em;
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--bg-secondary);
}

/* ===== GRID LAYOUTS ===== */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

@media (max-width: 1400px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.section-title {
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.section-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(44,44,46,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--bg-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--red-dim); color: var(--red); }
.modal-body { padding: 24px; overflow-y: auto; flex: 1; }

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: fixed;
  top: 0; right: -380px;
  width: 360px;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  z-index: 200;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}
.notif-panel.open { right: 0; }
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}
.notif-header h3 { font-size: 15px; font-weight: 700; }
.notif-list { flex: 1; overflow-y: auto; padding: 14px; }
