/* Movie Of The Day – Backoffice UI */
:root {
  --bo-bg: #0f1419;
  --bo-surface: #1a2332;
  --bo-surface-hover: #243044;
  --bo-border: #2d3a4d;
  --bo-text: #e6edf3;
  --bo-text-muted: #8b9cb3;
  --bo-accent: #3b82f6;
  --bo-accent-hover: #2563eb;
  --bo-success-bg: #052e16;
  --bo-success-text: #22c55e;
  --bo-error-bg: #450a0a;
  --bo-error-text: #ef4444;
  --bo-warning-bg: #422006;
  --bo-warning-text: #f59e0b;
  --bo-sidebar-width: 220px;
  --bo-header-height: 50px;
  --bo-radius: 8px;
  --bo-radius-sm: 6px;
  --bo-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --bo-font: 'DM Sans', system-ui, -apple-system, sans-serif;
}

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

body.bo {
  margin: 0;
  min-height: 100vh;
  background: var(--bo-bg);
  color: var(--bo-text);
  font-family: var(--bo-font);
  font-size: 15px;
  line-height: 1.5;
}

/* Layout: sidebar + main */
.bo-layout {
  display: flex;
  min-height: 100vh;
}

.bo-sidebar {
  width: var(--bo-sidebar-width);
  background: var(--bo-surface);
  border-right: 1px solid var(--bo-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.bo-sidebar-brand {
  height: 50px;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--bo-border);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.bo-sidebar-brand a {
  color: var(--bo-text);
  text-decoration: none;
}

.bo-sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.bo-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  color: var(--bo-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.15s, background 0.15s;
}

.bo-sidebar-nav a:hover {
  color: var(--bo-text);
  background: var(--bo-surface-hover);
}

.bo-sidebar-nav a.bo-nav-active {
  color: var(--bo-accent);
  background: rgba(59, 130, 246, 0.1);
  font-weight: 500;
}

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

.bo-header {
  height: var(--bo-header-height);
  padding: 0 1.5rem;
  background: var(--bo-surface);
  border-bottom: 1px solid var(--bo-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.bo-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.bo-user-name {
  color: var(--bo-text-muted);
}

.bo-user-name strong {
  color: var(--bo-text);
  font-weight: 500;
}

.bo-header a.bo-logout {
  color: var(--bo-text-muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: var(--bo-radius-sm);
  font-size: 0.8125rem;
  transition: color 0.15s, background 0.15s;
}

.bo-header a.bo-logout:hover {
  color: var(--bo-error-text);
  background: var(--bo-error-bg);
}

.bo-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow: auto;
}

/* Page title & actions */
.bo-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bo-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Buttons */
.bo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: var(--bo-radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.bo-btn-primary {
  background: var(--bo-accent);
  color: #fff;
}

.bo-btn-primary:hover {
  background: var(--bo-accent-hover);
}

.bo-btn-secondary {
  background: var(--bo-surface-hover);
  color: var(--bo-text);
  border: 1px solid var(--bo-border);
}

.bo-btn-secondary:hover {
  background: var(--bo-border);
}

.bo-btn-ghost {
  background: transparent;
  color: var(--bo-text-muted);
}

.bo-btn-ghost:hover {
  color: var(--bo-text);
  background: var(--bo-surface-hover);
}

/* Cards & panels */
.bo-card {
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.bo-card-body {
  padding: 1.25rem 1.5rem;
}

.bo-card-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.bo-card-desc {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--bo-text-muted);
}

/* Alerts / flashes */
.bo-alerts {
  margin-bottom: 1.25rem;
}

.bo-alert {
  padding: 0.75rem 1rem;
  border-radius: var(--bo-radius-sm);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.bo-alert:last-child {
  margin-bottom: 0;
}

.bo-alert-success {
  background: var(--bo-success-bg);
  color: var(--bo-success-text);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.bo-alert-error {
  background: var(--bo-error-bg);
  color: var(--bo-error-text);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.bo-alert-warning {
  background: var(--bo-warning-bg);
  color: var(--bo-warning-text);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Tables */
.bo-table-wrap {
  overflow-x: auto;
}

.bo-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.bo-table.movie-days tbody tr td:nth-child(1) {
  min-width: 150px;
}

.bo-table.movie-days tbody tr td:nth-child(2),
.bo-table.movie-days tbody tr td:nth-child(3) {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.bo-table.movie-catalog tbody tr td:nth-child(1),
.bo-table.movie-catalog tbody tr td:nth-child(2) {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bo-table th,
.bo-table td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--bo-border);
}

.bo-table th {
  font-weight: 600;
  color: var(--bo-text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bo-table tbody tr:hover {
  background: var(--bo-surface-hover);
}

.bo-table tbody tr:last-child td {
  border-bottom: none;
}

.bo-table .bo-cell-actions {
  white-space: nowrap;
}

.bo-table .bo-cell-actions a,
.bo-table .bo-cell-actions button.bo-link {
  margin-right: 0.75rem;
  color: var(--bo-accent);
  text-decoration: none;
  font-size: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.bo-table .bo-cell-actions a:hover,
.bo-table .bo-cell-actions button.bo-link:hover {
  text-decoration: underline;
}

.bo-table .bo-cell-actions button.bo-link-danger:hover {
  color: var(--bo-error-text);
}

.bo-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--bo-text-muted);
  font-size: 0.9375rem;
}

.bo-empty code {
  background: var(--bo-surface-hover);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Badges & tags */
.bo-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  background: var(--bo-surface-hover);
  color: var(--bo-text-muted);
}

.bo-badge-success {
  background: var(--bo-success-bg);
  color: var(--bo-success-text);
}

.bo-badge-neutral {
  background: var(--bo-border);
  color: var(--bo-text-muted);
}

/* Forms (base) */
.bo-form-group {
  margin-bottom: 1rem;
}

.bo-form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

.bo-form-group input:not([type=checkbox]):not([type=radio]),
.bo-form-group textarea,
.bo-form-group select {
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--bo-text);
  background: var(--bo-bg);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
  box-sizing: border-box;
}

.bo-form-group input:focus,
.bo-form-group textarea:focus,
.bo-form-group select:focus {
  outline: none;
  border-color: var(--bo-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.bo-form-group ul {
  color: var(--bo-error-text);
  font-size: 0.8125rem;
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.bo-fieldset {
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.bo-fieldset legend {
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0 0.5rem;
  color: var(--bo-text-muted);
}

.bo-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* Login page (no sidebar) */
.bo-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.bo-login-card {
  width: 100%;
  max-width: 400px;
  background: var(--bo-surface);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius);
  box-shadow: var(--bo-shadow);
  padding: 2rem;
}

.bo-login-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}

.bo-login-card .bo-alert {
  margin-bottom: 1rem;
}

.bo-login-card .bo-form-group {
  margin-bottom: 1.25rem;
}

.bo-login-card .bo-btn-primary {
  width: 100%;
  padding: 0.65rem;
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Filter bar (e.g. leaderboard date) */
.bo-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.bo-filter-bar label {
  font-weight: 500;
  font-size: 0.9375rem;
}

.bo-filter-bar input[type=date] {
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--bo-text);
  background: var(--bo-bg);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
}

/* Section titles on page */
.bo-section {
  margin-bottom: 2rem;
}

.bo-section-title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 600;
}

/* Responsive: collapse sidebar on small screens */
/* Catalog search (movie new) */
.bo-catalog-choice {
  margin-bottom: 1.5rem;
}

.bo-catalog-choice label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.bo-catalog-search {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--bo-text);
  background: var(--bo-bg);
  border: 1px solid var(--bo-border);
  border-radius: var(--bo-radius-sm);
}

.bo-catalog-results {
  position: relative;
  display: none;
  border: 1px solid var(--bo-border);
  border-top: none;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bo-surface);
  border-radius: 0 0 var(--bo-radius-sm) var(--bo-radius-sm);
}

.bo-catalog-results-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--bo-border);
  font-size: 0.9375rem;
}

.bo-catalog-results-item:hover {
  background: var(--bo-surface-hover);
}

.bo-catalog-results-item:last-child {
  border-bottom: none;
}

.bo-catalog-results-empty {
  padding: 0.5rem 0.75rem;
  color: var(--bo-text-muted);
  font-size: 0.875rem;
}

.bo-catalog-actions {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .bo-layout {
    flex-direction: column;
  }

  .bo-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .bo-sidebar-brand {
    width: 100%;
    border-bottom: none;
    padding: 0.5rem 0.75rem;
  }

  .bo-sidebar-nav {
    width: 100%;
    padding: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .bo-sidebar-nav a {
    padding: 0.4rem 0.75rem;
    font-size: 0.875rem;
  }

  .bo-content {
    padding: 1rem;
  }

  .bo-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .bo-table th,
  .bo-table td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}