:root {
  --primary: #f26822;
  /* Laranja eXPTV */
  --primary-hover: #e05c1d;
  --dark-bg: #1e1e1e;
  --dark-card: #2a2a2a;
  --dark-border: #333333;
  --light-bg: #f8f9fa;
  /* Branco cinzento */
  --light-card: #ffffff;
  --text-main: #333333;
  --text-muted: #6c757d;
  --sidebar-w: 260px;
  --header-h: 60px;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  margin: 0;
  padding: 0;
}

/* Authentication Page */
.auth-body {
  background: var(--dark-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.auth-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  z-index: 2;
}

.auth-bg-shapes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.auth-card {
  background: var(--light-card);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: slideUpFade 0.6s ease-out;
}

@keyframes slideUpFade {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-logo {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 10px;
}

.auth-brand {
  font-size: 2rem;
  font-weight: 300;
  margin: 0;
  color: var(--dark-bg);
}

.auth-brand strong {
  font-weight: 700;
  color: var(--primary);
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 5px;
}

.auth-input-group {
  margin-bottom: 20px;
}

.auth-input-group label {
  display: block;
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--dark-bg);
}

.auth-input-wrap {
  position: relative;
}

.auth-input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.auth-input:focus {
  outline: none;
  border-color: var(--primary);
}

.toggle-pw {
  position: absolute;
  right: 10px;
  top: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-auth-submit {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-auth-submit:hover {
  background: var(--primary-hover);
}

/* Layout App */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--dark-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 1.5rem;
  font-weight: 300;
}

.sidebar-brand strong {
  font-weight: 700;
  color: var(--primary);
}

.brand-icon {
  color: var(--primary);
  margin-right: 10px;
}

.sidebar-divider {
  height: 1px;
  background: var(--dark-border);
  margin: 0 20px;
}

.sidebar-nav {
  list-style: none;
  padding: 20px 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #888;
  margin: 15px 20px 5px;
  font-weight: 600;
  letter-spacing: 1px;
}

.nav-item {
  margin-bottom: 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  color: #bbb;
  padding: 10px 20px;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.nav-link i {
  width: 25px;
  font-size: 1.1rem;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-left-color: var(--primary);
}

.sidebar-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 10px;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.user-role {
  font-size: 0.75rem;
  color: #888;
}

.btn-logout {
  color: #888;
  text-decoration: none;
  transition: color 0.2s;
}

.btn-logout:hover {
  color: #fff;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: var(--header-h);
  background: var(--light-card);
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
}

.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-main);
  margin-right: 15px;
  display: none;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.page-container {
  padding: 20px;
  flex-grow: 1;
  overflow-y: auto;
}

.app-footer {
  background: var(--light-card);
  padding: 15px 20px;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Dashboard */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  color: #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-orange {
  background: linear-gradient(135deg, var(--primary), #fb8c00);
}

.stat-dark {
  background: linear-gradient(135deg, var(--dark-bg), #3a3a3a);
}

.stat-icon {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-right: 20px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Dashboard top-10 lists */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.dashboard-panel {
  background: var(--light-card);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  border: 1px solid #eee;
}

.panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.panel-header i {
  font-size: 1.2rem;
  color: var(--primary);
  margin-right: 10px;
}

.panel-header h2 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}

.top-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.top-list-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
}

.top-list-item:last-child {
  border-bottom: none;
}

.top-rank {
  font-weight: 700;
  color: #ccc;
  width: 25px;
  font-size: 1.1rem;
}

.top-thumb {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 15px;
  background: #eee;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-thumb-placeholder i {
  color: #aaa;
  font-size: 1.5rem;
}

.top-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-nome {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-grupo {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.top-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Shared Modules */
.module-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
}

.module-title-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.module-title-area h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-title-area h2 i {
  color: var(--primary);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 35px;
  height: 35px;
  background: #eee;
  color: #333;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-back:hover {
  background: #e0e0e0;
}

.module-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.filter-form {
  display: flex;
  gap: 10px;
}

.filter-input-wrap {
  position: relative;
}

.filter-input-wrap i {
  position: absolute;
  left: 10px;
  top: 10px;
  color: #aaa;
}

.filter-input {
  padding: 8px 15px 8px 35px;
  border: 1px solid #ddd;
  border-radius: 6px;
  outline: none;
}

.btn-filter,
.btn-primary-action {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.btn-primary-action:hover,
.btn-filter:hover {
  background: var(--primary-hover);
  color: #fff;
}

.btn-clear-filter {
  background: #eee;
  color: #333;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
}

.btn-secondary-action {
  background: #eee;
  color: #333;
  padding: 8px 15px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Groups Grid */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.group-card {
  background: var(--light-card);
  border-radius: 8px;
  border: 1px solid #eee;
  padding: 20px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.2s, box-shadow 0.2s;
}

.group-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
  border-color: #ddd;
}

.group-card-icon {
  width: 50px;
  height: 50px;
  background: rgba(242, 104, 34, 0.1);
  color: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 15px;
}

.group-card-body {
  flex-grow: 1;
}

.group-title {
  margin: 0 0 5px;
  font-size: 1.1rem;
  font-weight: 600;
}

.group-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.group-card-arrow {
  color: #ccc;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.media-card {
  background: var(--light-card);
  border-radius: 8px;
  border: 1px solid #eee;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.media-poster {
  position: relative;
  padding-top: 150%;
  background: #eee;
}

.media-poster img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #ccc;
}

.media-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-card:hover .media-overlay {
  opacity: 1;
}

.btn-play {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  text-decoration: none;
  transform: scale(0.8);
  transition: transform 0.2s;
}

.media-card:hover .btn-play {
  transform: scale(1);
}

.media-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.media-nome {
  font-size: 1rem;
  margin: 0 0 10px;
  font-weight: 600;
  line-height: 1.3;
}

.media-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 15px;
  flex-grow: 1;
}

.media-actions {
  display: flex;
  gap: 5px;
}

.btn-watch {
  flex-grow: 1;
  background: var(--dark-bg);
  color: #fff;
  text-align: center;
  padding: 8px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.btn-watch:hover {
  background: #000;
  color: #fff;
}

.btn-edit-sm,
.btn-delete-sm {
  background: #eee;
  color: #333;
  padding: 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-edit-sm:hover {
  background: #ddd;
}

.btn-delete-sm {
  color: #dc3545;
}

.btn-delete-sm:hover {
  background: #f8d7da;
}

/* Table */
.table-wrap {
  background: var(--light-card);
  border-radius: 8px;
  border: 1px solid #eee;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th {
  background: #fafafa;
  font-weight: 600;
  color: #555;
}

.badge-role,
.badge-status {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-admin {
  background: #e0f2fe;
  color: #0284c7;
}

.badge-user {
  background: #f3f4f6;
  color: #4b5563;
}

.badge-status-1 {
  background: #dcfce7;
  color: #16a34a;
}

.badge-status-0 {
  background: #fee2e2;
  color: #dc2626;
}

.badge-status-2 {
  background: #fef9c3;
  color: #ca8a04;
}

/* Player Page */
.player-wrapper {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.player-container {
  flex-grow: 1;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.main-player {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}

.player-sidebar {
  width: 350px;
  flex-shrink: 0;
}

.player-info-card {
  background: var(--light-card);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #eee;
}

.player-poster {
  width: 100px;
  border-radius: 6px;
  float: left;
  margin: 0 15px 15px 0;
}

.player-info-card h3 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.player-meta {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.player-description {
  font-size: 0.9rem;
  color: #555;
  clear: both;
  margin-bottom: 15px;
}

.player-counter {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.player-btn-group {
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.btn-fav {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-fav:hover {
  background: #fee2e2;
}

.btn-download {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #e0f2fe;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-download:hover {
  background: #e0f2fe;
}

/* Flash Toasts */
.alert-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 9999;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.alert-toast-success i:first-child {
  color: #16a34a;
  font-size: 1.5rem;
}

.alert-toast-danger i:first-child {
  color: #dc2626;
  font-size: 1.5rem;
}

.toast-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0;
}

/* Forms */
.form-card {
  background: var(--light-card);
  padding: 30px;
  border-radius: 8px;
  border: 1px solid #eee;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 200px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-control {
  width: 100%;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.required {
  color: #dc2626;
}

.form-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

/* Series Tabs */
.series-tabs {
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.series-tab-btn {
  background: none;
  border: none;
  padding: 10px 20px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.series-tab-btn.active,
.series-tab-btn:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.episode-item {
  display: flex;
  background: var(--light-card);
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  align-items: center;
  gap: 15px;
}

.episode-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ccc;
  width: 50px;
  text-align: center;
}

.episode-thumb {
  width: 120px;
  height: 68px;
  background: #eee;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-info {
  flex-grow: 1;
}

.episode-title {
  display: block;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.episode-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}

.episode-actions {
  display: flex;
  gap: 5px;
}

/* Responsive */
@media (max-width: 992px) {
  .player-wrapper {
    flex-direction: column;
  }

  .player-sidebar {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 1000;
    transform: translateX(-100%);
    height: 100vh;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }
}