:root {
  --bg: #f5f5f5;
  --surface: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --tab-active-bg: #2563eb;
  --tab-active-text: #fff;
  --row-hover: #f0f4ff;
  --badge-active-bg: #dcfce7;
  --badge-active-text: #166534;
  --badge-inactive-bg: #fee2e2;
  --badge-inactive-text: #991b1b;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

/* Layout */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 52px;
  display: flex;
  align-items: center;
}

header h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

header h1 span {
  color: var(--accent);
}

main {
  padding: 28px 32px;
  max-width: 1200px;
}

/* Page header */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
}

/* Back button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Filter tabs */
.filter-tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 16px;
  gap: 2px;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 6px;
  border: none;
  background: none;
  font-size: 13px;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.filter-tab:hover {
  background: var(--row-hover);
  color: var(--text);
}

.filter-tab.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-text);
  font-weight: 500;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

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

thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: #fafafa;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr.clickable:hover {
  background: var(--row-hover);
}

td {
  padding: 10px 16px;
  color: var(--text);
}

td.muted {
  color: var(--text-muted);
}

td a {
  color: var(--accent);
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

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

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

/* User info card */
.user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info-main {
  flex: 1;
}

.user-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.user-meta {
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.user-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Theatre subscription sections */
.theatre-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 16px;
}

.theatre-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fafafa;
  display: flex;
  align-items: center;
  gap: 10px;
}

.theatre-name {
  font-weight: 600;
  font-size: 15px;
}

.theatre-name a {
  color: var(--text);
  text-decoration: none;
}

.theatre-name a:hover {
  color: var(--accent);
}

.sub-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--border);
  padding: 1px 7px;
  border-radius: 10px;
}

/* Subscriptions section title */
.section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* States */
.loading, .error, .empty {
  padding: 48px 32px;
  text-align: center;
  color: var(--text-muted);
}

.error {
  color: #dc2626;
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Count chip in page header */
.count-chip {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
