:root {
  --bg: #0f1115;
  --card: #171a21;
  --card2: #1e2230;
  --text: #e7e9ee;
  --muted: #a6adbb;
  --accent: #4c8dff;
  --danger: #ff5c7a;
  --ok: #3ddc97;
  --warning: #f5a623;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 12px;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 0 12px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

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

.search {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 32px 12px 14px;
  font-size: 16px;
  min-height: 48px;
}

.search-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-clear {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  color: var(--text);
}

.selectTop {
  max-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  min-height: 48px;
}

.filters {
  margin-bottom: 12px;
}

.filtersHeader {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.filtersRow {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  border-color: rgba(76, 141, 255, 0.7);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.tileImg {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #0b0d11;
}

.tileBody {
  padding: 10px;
}

.tileTitle {
  font-size: 15px;
  line-height: 1.3;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.error {
  background: rgba(255, 92, 122, 0.12);
  border: 1px solid rgba(255, 92, 122, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.success {
  background: rgba(61, 220, 151, 0.12);
  border: 1px solid rgba(61, 220, 151, 0.35);
  padding: 10px 12px;
  border-radius: 10px;
  margin-top: 10px;
}

/* .warning-widget simplified */
.warning-widget {
  color: var(--warning);
  font-size: 13px;
  text-align: center;
  margin: 8px 0 12px;
  opacity: 0.8;
}



.details {
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.link {
  background: transparent;
  border: none;
  color: var(--accent);
  padding: 10px 0;
  cursor: pointer;
  font-size: 16px;
}

.detailsHead {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.detailsImg {
  width: 86px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  background: #0b0d11;
  border: 1px solid var(--border);
}

.detailsTitle {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 6px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

label {
  font-size: 14px;
  color: var(--muted);
  margin-left: 2px;
}

select,
input[type="date"],
input[type="text"],
input[type="time"],
textarea {
  background: var(--card2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview {
  background: #0b0d11;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
}

.previewTitle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.previewText {
  margin: 0;
  white-space: pre-wrap;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.4;
}

.primary {
  width: 100%;
  background: var(--accent);
  border: none;
  color: white;
  padding: 14px 20px;
  border-radius: 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  min-height: 48px;
}

.primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.primarySmall {
  background: var(--accent);
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 15px;
}

.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 9999;
}

.modalCard {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.calTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.calTitle {
  font-weight: 700;
  font-size: 16px;
}

.iconBtn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 24px;
  padding: 8px 12px;
  cursor: pointer;
}

.calMonth {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 8px;
}

.calMonthLabel {
  text-align: center;
  font-weight: 600;
}

.calDow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 6px 2px;
  color: var(--muted);
  font-size: 12px;
}

.calDow .weekend {
  color: #ff6b6b;
}

.calGrid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 4px 2px 10px;
}

.day {
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
}

.day.muted {
  color: rgba(255, 255, 255, 0.25);
  cursor: default;
}

.day.weekend {
  color: #ff6b6b;
}

.day.inRange {
  background: rgba(255, 0, 0, 0.14);
}

.day.edge {
  background: #b31217;
  color: #fff;
  border-radius: 999px;
}

.day.edge.weekend {
  color: #fff;
}

.calActions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

@media (max-width: 520px) {
  .row {
    grid-template-columns: 1fr;
  }

  .filtersRow {
    flex-direction: column;
    align-items: stretch;
  }

  .selectTop {
    max-width: 100%;
  }
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  padding: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
}

.tab.active {
  background: var(--card2);
  color: var(--text);
  border-color: var(--accent);
}

.emptyState {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.requestsList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reqRow {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.reqTop {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.reqTitle {
  font-weight: 600;
  font-size: 14px;
}

.reqStatus {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  height: fit-content;
}

.reqStatus.sent {
  border-color: rgba(61, 220, 151, 0.5);
  color: var(--ok);
}

.reqStatus.other {
  border-color: var(--muted);
  color: var(--muted);
}

.reqMeta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.reqBottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.reqLink {
  color: var(--accent);
  cursor: pointer;
}

.fullscreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 100;
  overflow-y: auto;
}

.center-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  max-width: 400px;
  margin: 0 auto;
}

.center-content h3 {
  margin-top: 0;
  margin-bottom: 24px;
}

.vertical-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-item-title {
  font-weight: 600;
  font-size: 15px;
}

.list-item-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.footer-link-container {
  margin-top: 40px;
  text-align: center;
  padding-bottom: 20px;
}

.footer-link {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.5;
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.hidden {
  display: none !important;
}

.pasteArea {
  border: 2px dashed #303440;
  border-radius: 12px;
  padding: 12px;
  font-size: 14px;
  color: #889;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.pasteArea:hover {
  border-color: #58a6ff;
  color: #c9d1d9;
}

.pasteArea.uploading {
  opacity: 0.5;
  pointer-events: none;
}

.airdate-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  /* blue */
  color: #60a5fa;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.field .hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: -2px;
}

/* Program List Styles */
.program-list-container {
  padding: 16px;
  max-width: 600px;
  margin: 0 auto;
}

.program-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.program-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.1s ease, background 0.2s;
}

.program-card:active {
  transform: scale(0.98);
  background: var(--card2);
}

.program-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.program-card-meta {
  font-size: 14px;
  color: var(--muted);
}

/* Loading Spinner */
.fullscreen-spinner {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.8);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(76, 141, 255, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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