/* Dentirad Admin — custom styles */

:root {
  --sidebar-w: 240px;
  --brand:     #0b2652;
  --brand-lt:  #1a4a96;
  --accent:    #2563eb;
  --bg:        #f1f5f9;
  --card-bg:   #ffffff;
  --border:    #e2e8f0;
  --text:      #1e293b;
  --muted:     #64748b;
  --online:    #22c55e;
  --idle:      #f59e0b;
  --offline:   #ef4444;
  --unknown:   #94a3b8;
}

*, *::before, *::after { box-sizing: border-box; }
body { font-family: 'Inter', 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-lt) 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-logo {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
  text-align: center;
  margin-bottom: 4px;
}
.login-logo span { color: var(--accent); }
.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

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

/* ── Sidebar ────────────────────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--brand);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.brand-text {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}
.brand-accent { color: #60a5fa; }

.sidebar-nav {
  list-style: none;
  padding: 12px 0;
  margin: 0;
  flex: 1;
}
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}
.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.sidebar-nav li a i { font-size: 16px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user-name {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-footer .btn-outline-secondary {
  border-color: rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.7);
  font-size: 13px;
}
.sidebar-footer .btn-outline-secondary:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* ── Main content ───────────────────────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}
.view { display: none; }
.view.active { display: block; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.card-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 14px;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table { font-size: 14px; }
.table thead th {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}
.table td { vertical-align: middle; }
.table > :not(caption) > * > * { padding: 12px 16px; }

/* ── Health indicators ──────────────────────────────────────────────────── */
.health-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
.health-dot.online  { background: var(--online);  box-shadow: 0 0 6px var(--online); }
.health-dot.idle    { background: var(--idle);    box-shadow: 0 0 6px var(--idle); }
.health-dot.offline { background: var(--offline); }
.health-dot.unknown { background: var(--unknown); }

/* ── Dashboard stat cards ───────────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}
.stat-card .stat-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}
.stat-card.online .stat-value  { color: var(--online); }
.stat-card.offline .stat-value { color: var(--offline); }

/* ── Media grid ─────────────────────────────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.media-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.media-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.media-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--muted);
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-info {
  padding: 10px 12px;
}
.media-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-meta { font-size: 11px; color: var(--muted); }

/* ── Playlist items list ─────────────────────────────────────────────────── */
.playlist-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  cursor: grab;
}
.playlist-item-row .drag-handle { color: var(--muted); font-size: 18px; cursor: grab; }
.playlist-item-row .item-label  { flex: 1; font-size: 14px; font-weight: 500; }
.playlist-item-row .item-meta   { font-size: 12px; color: var(--muted); }
.playlist-item-row.dragging     { opacity: 0.4; background: #f8fafc; }
.playlist-item-row.drag-over    { border-color: var(--accent); background: #eff6ff; }

/* ── Upload drop zone ───────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: #eff6ff;
}
.upload-zone i { font-size: 40px; color: var(--accent); }
.upload-zone p { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

/* ── Token display ──────────────────────────────────────────────────────── */
.token-box {
  font-family: monospace;
  font-size: 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  word-break: break-all;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { width: 200px; }
  #main-content { margin-left: 200px; padding: 16px; }
}
