/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0a0f1e;
  --surface:  #111827;
  --card:     #1e293b;
  --border:   #2d3748;
  --accent:   #3b82f6;
  --accent2:  #60a5fa;
  --success:  #22c55e;
  --warning:  #f59e0b;
  --danger:   #ef4444;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --sidebar-w: 260px;
}

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  direction: rtl;
}

/* ===== Layout ===== */
#app {
  display: flex;
  height: 100vh;
}

/* ===== Sidebar ===== */
#sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}
.logo-icon { font-size: 28px; }
.logo-title { font-size: 18px; font-weight: 700; color: var(--accent2); }
.logo-sub { font-size: 11px; color: var(--muted); }

.sidebar-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 16px 16px 8px;
}

#screens-nav { flex: 1; }

.screen-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 3px solid transparent;
}
.screen-nav-item:hover { background: rgba(59,130,246,0.08); }
.screen-nav-item.active {
  background: rgba(59,130,246,0.15);
  border-right-color: var(--accent);
}

.nav-icon { font-size: 20px; flex-shrink: 0; }
.nav-name { font-size: 13px; font-weight: 500; color: var(--text); }
.nav-dims { font-size: 10px; color: var(--muted); margin-top: 2px; }
.nav-type {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59,130,246,0.2);
  color: var(--accent2);
  margin-top: 4px;
  display: inline-block;
}
.nav-type.no-content { background: rgba(148,163,184,0.1); color: var(--muted); }

.connection-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.dot.connected { background: var(--success); box-shadow: 0 0 6px var(--success); }
.dot.error { background: var(--danger); }

/* ===== Main ===== */
#main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

/* ===== Welcome ===== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--muted);
}
.welcome-icon { font-size: 64px; margin-bottom: 20px; opacity: 0.5; }
.welcome-screen h2 { font-size: 22px; color: var(--text); margin-bottom: 8px; }

/* ===== Detail Header ===== */
.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}
.detail-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-blue { background: rgba(59,130,246,0.2); color: var(--accent2); }
.badge-gray { background: rgba(148,163,184,0.15); color: var(--muted); }
.badge-muted { background: transparent; color: var(--muted); font-size: 10px; }

.detail-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--success);
  letter-spacing: 1px;
}
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===== Sections ===== */
.section { margin-bottom: 32px; }
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* ===== Current Content Card ===== */
.current-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  gap: 0;
}

.current-preview {
  /* width & height set dynamically per screen ratio */
  background: #000;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  transition: width 0.25s ease, height 0.25s ease;
  min-width: 60px;
  min-height: 60px;
}
.current-preview iframe,
.current-preview img,
.current-preview video {
  width: 100%; height: 100%;
  object-fit: cover;
  border: none;
}
.no-content-icon { font-size: 32px; opacity: 0.3; }

.current-info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}
.current-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(59,130,246,0.2);
  color: var(--accent2);
  width: fit-content;
}
.current-type-badge.empty { background: rgba(148,163,184,0.1); color: var(--muted); }
.current-schedule-badge {
  font-size: 11px;
  color: var(--accent2);
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 6px;
  padding: 3px 8px;
  width: fit-content;
}

.current-url {
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
  width: fit-content;
}
.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent); color: #fff; }

.tab-panel.hidden { display: none; }

/* ===== Drop Zone ===== */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: rgba(59,130,246,0.05);
}
.drop-icon { font-size: 40px; margin-bottom: 12px; }
.drop-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.drop-sub { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.drop-types { font-size: 11px; color: var(--muted); opacity: 0.7; }

/* ===== Upload Preview ===== */
.upload-preview {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.preview-media { width: 80px; height: 60px; border-radius: 6px; overflow: hidden; background: #000; flex-shrink: 0; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: cover; }
.preview-info { flex: 1; min-width: 0; }
.preview-filename { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-filesize { font-size: 11px; color: var(--muted); margin-top: 4px; }
.btn-clear {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s;
}
.btn-clear:hover { border-color: var(--danger); color: var(--danger); }

/* ===== Progress ===== */
.progress-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
  width: 0%;
}
.progress-text { font-size: 12px; color: var(--muted); width: 36px; text-align: left; }

/* ===== URL Input ===== */
.url-input-wrap {
  position: relative;
  margin-bottom: 12px;
}
.url-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  direction: ltr;
  transition: border 0.2s;
}
.url-input:focus { outline: none; border-color: var(--accent); }
.url-input::placeholder { color: var(--muted); }

.url-type-indicator {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 6px;
  color: var(--accent2);
  min-height: 16px;
}

.url-preview {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  margin-bottom: 12px;
}
.url-preview iframe { width: 100%; height: 100%; border: none; }

.url-error {
  font-size: 12px;
  color: var(--danger);
  padding: 8px;
}

/* ===== Publish Button ===== */
.btn-publish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn-publish:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(59,130,246,0.4);
}
.btn-publish:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-publish.loading { opacity: 0.7; cursor: wait; }
.btn-publish.success { background: var(--success); }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  transition: opacity 0.3s;
}
.toast.hidden { opacity: 0; pointer-events: none; }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error { border-color: var(--danger); color: var(--danger); }

/* ===== Location photo ===== */
.detail-header-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.location-wrap {
  width: 110px;
  height: 110px;
  border-radius: 10px;
  overflow: visible;
  border: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}
.location-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: top left;
}
.location-wrap:hover .location-img {
  transform: scale(2.8);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

/* ===== Nav thumbnail ===== */
.nav-thumb {
  width: 40px; height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--border);
}
.nav-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* ===== Playlist ===== */
.pl-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
}

.pl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
}
.pl-item-num {
  font-size: 12px;
  color: var(--muted);
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.pl-item-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(59,130,246,0.2);
  color: var(--accent2);
  flex-shrink: 0;
}
.pl-item-name {
  font-size: 12px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pl-item-dur {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.pl-item-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.pl-item-remove:hover { color: var(--danger); }

.duration-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
  color: var(--muted);
}
.duration-input {
  width: 70px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}
.duration-input:focus { outline: none; border-color: var(--accent); }

.btn-add-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: rgba(59,130,246,0.12);
  color: var(--accent2);
  border: 1px solid rgba(59,130,246,0.25);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.15s;
}
.btn-add-item:hover:not(:disabled) { background: rgba(59,130,246,0.22); }
.btn-add-item:disabled { opacity: 0.4; cursor: not-allowed; }

.pl-tab-panel.hidden { display: none; }

.playlist-add-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 10px;
}

.pl-mini-tabs { margin-bottom: 12px; }

/* ===== Library nav ===== */
.library-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
  border-right: 3px solid transparent;
  margin-bottom: 8px;
}
.library-nav-item:hover { background: rgba(59,130,246,0.08); }
.library-nav-item.active {
  background: rgba(59,130,246,0.15);
  border-right-color: var(--accent);
}

/* ===== Library grid ===== */
.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}
.lib-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.15s;
}
.lib-card.selectable { cursor: pointer; }
.lib-card.selectable:hover { border-color: var(--accent2); }
.lib-card.selectable.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.25);
}

.lib-thumb {
  width: 100%;
  height: 108px;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lib-thumb img,
.lib-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lib-type-icon { font-size: 36px; opacity: 0.35; }

.lib-info { padding: 8px 10px; }
.lib-desc {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 3px;
}
.lib-meta { font-size: 10px; color: var(--muted); }

.lib-btn-delete {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.72);
  border: none;
  color: var(--danger);
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.lib-card:hover .lib-btn-delete { opacity: 1; }

/* Description input */
.lib-desc-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 6px;
  direction: rtl;
  transition: border 0.2s;
}
.lib-desc-input:focus { outline: none; border-color: var(--accent); }
.lib-desc-input::placeholder { color: var(--muted); }

/* ===== Library multi-select ===== */
.lib-sel-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lib-order-num {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.lib-order-num.visible { opacity: 1; }

.lib-selectable-grid .lib-card { cursor: pointer; }

/* ===== Schedule section ===== */
/* ===== 24h Timeline ===== */
.timeline-24h {
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.timeline-hours {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 10px;
  color: var(--muted);
  font-family: monospace;
  direction: ltr;
}
.timeline-bar-wrap {
  position: relative;
  height: 30px;
  background: var(--card);
  border-radius: 4px;
  overflow: visible;
  direction: ltr;
}
.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 4px;
  border-radius: 3px;
  box-sizing: border-box;
}
.timeline-now-line {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--danger);
  z-index: 10;
  border-radius: 2px;
}
.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  direction: rtl;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ===== Current schedule summary ===== */
.schedule-summary {
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.sched-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
}
.sched-row:last-child { border-bottom: none; }
.sched-row.sched-active { background: rgba(59,130,246,0.1); }
.sched-time {
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  min-width: 110px;
  flex-shrink: 0;
}
.sched-type {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.sched-desc {
  flex: 1;
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sched-now-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--success);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

/* ===== Schedule section ===== */
.schedule-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.schedule-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.schedule-toggle-label { font-size: 14px; font-weight: 600; color: var(--text); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 24px;
  transition: .25s;
}
.toggle-slider::before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: .25s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.schedule-list {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 12px; min-height: 4px;
}
.schedule-entry {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}
.schedule-time-badge {
  font-family: monospace; font-size: 15px; font-weight: 700;
  color: var(--accent2); min-width: 50px; flex-shrink: 0;
}
.schedule-entry-desc {
  flex: 1; font-size: 13px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.schedule-entry-del {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 15px; padding: 2px 6px;
  border-radius: 4px; transition: color 0.15s; flex-shrink: 0;
}
.schedule-entry-del:hover { color: var(--danger); }

.schedule-add-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}
.schedule-time-input {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: 6px;
  font-size: 14px; font-family: monospace;
  width: 110px; flex-shrink: 0; direction: ltr;
  transition: border 0.2s;
}
.schedule-time-input:focus { outline: none; border-color: var(--accent); }
.schedule-sel-preview {
  flex: 1; font-size: 13px; color: var(--muted);
  padding: 7px 10px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.schedule-sel-preview.has-items { color: var(--accent2); border-color: rgba(59,130,246,0.35); }
.btn-add-entry {
  background: rgba(59,130,246,0.15);
  color: var(--accent2);
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  transition: all 0.15s;
}
.btn-add-entry:hover:not(:disabled) { background: rgba(59,130,246,0.25); }
.btn-add-entry:disabled { opacity: 0.4; cursor: not-allowed; }
.schedule-range-label { font-size: 13px; color: var(--muted); flex-shrink: 0; }

/* ===== Utils ===== */
.hidden { display: none !important; }

/* ===== Auth overlay ===== */
.auth-overlay {
  position: fixed; inset: 0;
  background: rgba(10,15,30,0.96);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(6px);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 52px 44px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  min-width: 340px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.auth-logo { font-size: 52px; line-height: 1; }
.auth-title { font-size: 24px; font-weight: 700; color: var(--text); }
.auth-sub   { font-size: 14px; color: var(--muted); }
.btn-google-signin {
  display: flex; align-items: center; gap: 10px;
  background: #fff; color: #333;
  border: 1px solid #d1d5db;
  border-radius: 10px; padding: 11px 22px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  margin-top: 10px;
  transition: box-shadow 0.2s, transform 0.1s;
}
.btn-google-signin:hover  { box-shadow: 0 4px 14px rgba(0,0,0,0.25); transform: translateY(-1px); }
.btn-google-signin:active { transform: translateY(0); }
.btn-google-signin:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-google-signin img { width: 18px; height: 18px; }
.auth-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.btn-signout-btn {
  background: var(--card); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 22px; font-size: 13px; cursor: pointer; margin-top: 8px;
}
.btn-signout-btn:hover { background: var(--border); }

/* ===== User bar in sidebar ===== */
.user-bar {
  margin-top: auto;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; overflow: hidden; }
.user-name  { font-size: 11px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-user-action {
  background: none; border: none; cursor: pointer;
  font-size: 15px; padding: 3px 4px; border-radius: 4px;
  opacity: 0.6; transition: opacity 0.15s;
  flex-shrink: 0;
}
.btn-user-action:hover { opacity: 1; }

/* ===== Admin modal ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 1500;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  min-width: 380px; max-width: 460px; width: 90%;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; font-size: 15px; font-weight: 600; color: var(--text);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.admin-list {
  margin-bottom: 16px; max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 8px; padding: 4px 0;
}
.admin-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; font-size: 13px; direction: ltr;
}
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-del-btn {
  background: none; border: none; cursor: pointer;
  font-size: 14px; opacity: 0.6; transition: opacity 0.15s;
}
.admin-del-btn:hover { opacity: 1; }
.admin-super-badge {
  font-size: 10px; color: var(--success); font-weight: 700;
  background: rgba(34,197,94,0.1); border-radius: 4px; padding: 2px 6px;
}
.admin-add-row { display: flex; gap: 8px; margin-top: 4px; }

/* ===== Saved schedule templates ===== */
.saved-templates-section {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.saved-templates-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.template-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.template-card:hover { border-color: var(--accent); }
.template-info { flex: 1; min-width: 0; }
.template-name    { font-size: 13px; font-weight: 600; color: var(--text); }
.template-summary { font-size: 11px; color: var(--muted); margin-top: 3px; }
.template-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-apply-template {
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px;
  padding: 5px 14px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-apply-template:hover { opacity: 0.85; }
.btn-del-template {
  background: none; border: none; cursor: pointer;
  font-size: 15px; opacity: 0.5; transition: opacity 0.15s;
  padding: 4px;
}
.btn-del-template:hover { opacity: 1; }
