:root {
  --dash-navy: #153147;
  --dash-navy-2: #1e4355;
  --dash-bg: #f6f5f2;
  --dash-surface: #ffffff;
  --dash-border: #e4e1da;
  --dash-text: #232a2f;
  --dash-muted: #6b7378;
}

body.dash {
  background: var(--dash-bg);
  color: var(--dash-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--dash-navy-2); }

.btn-dash {
  background: var(--dash-navy);
  border-color: var(--dash-navy);
  color: #fff;
  font-weight: 600;
}
.btn-dash:hover, .btn-dash:focus { background: var(--dash-navy-2); border-color: var(--dash-navy-2); color: #fff; }

/* Layout */
.dash-shell { display: flex; min-height: 100vh; }

.dash-sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--dash-navy);
  color: #d5dde2;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.dash-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
  font-weight: 600; font-size: 17px;
  padding: 4px 10px 22px;
}
.dash-brand img { border-radius: 50%; background: #fff; }

.dash-nav a, .dash-sidebar-footer a, .dash-sidebar-footer button {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #d5dde2; text-decoration: none; font-size: 15px;
  background: none; border: 0; width: 100%; text-align: left;
}
.dash-nav a:hover, .dash-sidebar-footer a:hover, .dash-sidebar-footer button:hover { background: rgba(255,255,255,.08); color: #fff; }
.dash-nav a.active { background: rgba(255,255,255,.14); color: #fff; font-weight: 600; }

.dash-sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 12px; }
.dash-user { font-size: 12px; color: #9fb0bb; padding: 10px 12px 0; }

.dash-main { flex: 1; min-width: 0; padding: 36px 44px 60px; max-width: 1000px; }

.dash-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.dash-header h1 { font-size: 28px; font-weight: 700; margin: 0; color: var(--dash-navy); }

.dash-back { display: inline-block; margin-bottom: 12px; text-decoration: none; color: var(--dash-muted); font-size: 14px; }
.dash-back:hover { color: var(--dash-navy); }

/* Search */
.dash-search { position: relative; margin-bottom: 16px; }
.dash-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--dash-muted); }
.dash-search input { padding-left: 40px; border-radius: 10px; border-color: var(--dash-border); height: 46px; }

/* Sermon list */
.dash-list { background: var(--dash-surface); border: 1px solid var(--dash-border); border-radius: 12px; overflow: hidden; }

.dash-item {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 20px; border-bottom: 1px solid var(--dash-border);
}
.dash-item:last-child { border-bottom: 0; }
.dash-item:hover { background: #fbfaf8; }

.dash-item-date {
  width: 64px; flex-shrink: 0; text-align: center;
  background: var(--dash-bg); border-radius: 8px; padding: 6px 0;
  line-height: 1.1;
}
.dash-item-date .day { display: block; font-size: 22px; font-weight: 700; color: var(--dash-navy); }
.dash-item-date .month { font-size: 11px; text-transform: uppercase; color: var(--dash-muted); letter-spacing: .04em; }

.dash-item-body { flex: 1; min-width: 0; }
.dash-item-title { font-weight: 600; font-size: 16px; color: var(--dash-text); text-decoration: none; }
.dash-item-title:hover { color: var(--dash-navy-2); text-decoration: underline; }
.dash-item-meta { font-size: 13px; color: var(--dash-muted); display: flex; flex-wrap: wrap; }
.dash-item-meta span + span::before { content: "·"; margin: 0 6px; }
.dash-item-links { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; background: var(--dash-bg); border-radius: 20px; padding: 2px 9px; color: var(--dash-muted); }

.dash-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.status {
  border: 0; border-radius: 20px; padding: 4px 12px;
  font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.status i { font-size: 8px; }
.status-live { background: #e3f4e8; color: #1c7c3c; }
.status-draft { background: #eeeeec; color: #6b7378; }
.status:hover { filter: brightness(.95); }

.dash-pagination { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; color: var(--dash-muted); }

.dash-empty {
  background: var(--dash-surface); border: 1px dashed var(--dash-border); border-radius: 12px;
  padding: 56px 24px; text-align: center;
}
.dash-empty > i { font-size: 44px; color: #adb8bb; }
.dash-empty h2 { font-size: 20px; margin: 10px 0 6px; }
.dash-empty p { color: var(--dash-muted); }

/* Forms */
.dash-panel {
  background: var(--dash-surface); border: 1px solid var(--dash-border);
  border-radius: 12px; padding: 24px; margin-bottom: 20px;
}
.dash-panel h2 { font-size: 17px; font-weight: 700; color: var(--dash-navy); margin-bottom: 14px; }
.dash-panel .form-control { border-color: var(--dash-border); }
.dash-panel .form-control:focus { border-color: var(--dash-navy-2); box-shadow: 0 0 0 .2rem rgba(21,49,71,.12); }
.form-label { font-weight: 600; font-size: 14px; }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-switch .form-check-label { font-weight: 600; padding-left: 6px; padding-top: 2px; }
.form-check-input:checked { background-color: var(--dash-navy); border-color: var(--dash-navy); }

.dash-current-file {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--dash-bg); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
}
.dash-current-file audio { height: 36px; max-width: 100%; }

.dash-upload { margin-bottom: 16px; font-size: 14px; }
.dash-upload .progress-bar { background: var(--dash-navy); transition: width .2s; }

.dash-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.dash-confirm { max-width: 560px; }
.dash-confirm h1 { font-size: 22px; font-weight: 700; color: var(--dash-navy); }

.dash-messages .alert { border-radius: 10px; }

/* Login */
.dash-auth { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; }
.auth-card {
  background: var(--dash-surface); border: 1px solid var(--dash-border); border-radius: 16px;
  padding: 40px 36px; width: 100%; max-width: 400px; text-align: center;
  box-shadow: 0 20px 50px rgba(21,49,71,.08);
}
.auth-card img { border-radius: 50%; margin-bottom: 12px; }
.auth-card h1 { font-size: 22px; font-weight: 700; color: var(--dash-navy); margin-bottom: 4px; }
.auth-card form { margin-top: 24px; }
.auth-back { display: inline-block; margin-top: 20px; font-size: 14px; color: var(--dash-muted); text-decoration: none; }

/* Mobile */
@media (max-width: 800px) {
  .dash-shell { flex-direction: column; }
  .dash-sidebar { width: 100%; height: auto; position: static; padding: 12px; }
  .dash-brand { padding-bottom: 10px; }
  .dash-nav, .dash-sidebar-footer { display: flex; flex-wrap: wrap; gap: 4px; }
  .dash-nav a, .dash-sidebar-footer a, .dash-sidebar-footer button { width: auto; padding: 6px 10px; font-size: 14px; }
  .dash-sidebar-footer { margin-top: 8px; padding-top: 8px; }
  .dash-sidebar-footer form { display: inline; }
  .dash-user { width: 100%; padding-top: 4px; }
  .dash-main { padding: 20px 16px 40px; }
  .dash-item { flex-wrap: wrap; gap: 12px; }
  .dash-item-actions { width: 100%; justify-content: flex-end; }
}

/* Roles, series, podcast, team */
.dash-role { display: block; color: #c9d6de; margin-top: 2px; }
.dash-hint {
  background: #eef3f6; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 14px; color: var(--dash-navy-2);
}
.series-tag { color: var(--dash-navy-2); font-weight: 600; }
.dash-item-icon, .dash-avatar {
  width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--dash-bg); color: var(--dash-navy); font-size: 20px;
}
.dash-avatar { font-size: 16px; font-weight: 700; background: #dfe8ee; }
.dash-item-desc { font-size: 13px; color: var(--dash-muted); margin-top: 4px; }
.dash-item.is-inactive { opacity: .55; }

.dash-copy { display: flex; gap: 8px; flex-wrap: wrap; }
.dash-copy input { flex: 1; min-width: 220px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--dash-bg); }
.dash-checklist { list-style: none; padding: 0; margin: 0 0 12px; }
.dash-checklist li { padding: 4px 0; color: var(--dash-muted); }
.dash-checklist li i { margin-right: 6px; }
.dash-checklist li.done { color: #1c7c3c; }
.dash-steps summary { cursor: pointer; font-weight: 600; color: var(--dash-navy-2); }
.dash-steps ol { margin-top: 10px; padding-left: 20px; }
.dash-steps li { margin-bottom: 8px; }
.dash-artwork { width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--dash-border); }

.role-badge {
  display: inline-block; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 10px;
  background: #eeeeec; color: #555; white-space: nowrap;
}
.role-owner { background: #153147; color: #fff; }
.role-pastor-elder { background: #e5ecf7; color: #1d3f78; }
.role-deacon { background: #e6f3ec; color: #1c6b3e; }
.role-serving { background: #f6efe2; color: #7a5413; }

.role-option {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
  border: 1px solid var(--dash-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.role-option:hover { background: #fbfaf8; }
.role-option input { margin-top: 4px; flex-shrink: 0; }
.role-option:has(input:checked) { border-color: var(--dash-navy); background: #f2f5f8; }

.dash-roles { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 0; }
.dash-roles dd { margin: 0; color: var(--dash-muted); }

.dash-credentials { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; background: var(--dash-bg); border-radius: 10px; padding: 16px; }
.dash-credentials dt { color: var(--dash-muted); font-weight: 500; }
.dash-credentials dd { margin: 0; font-weight: 600; word-break: break-all; }
.dash-credentials code { font-size: 18px; color: var(--dash-navy); background: #fff; padding: 2px 8px; border-radius: 6px; letter-spacing: .05em; }

@media (max-width: 800px) {
  .dash-roles, .dash-credentials { grid-template-columns: 1fr; }
  .dash-roles dd { margin-bottom: 8px; }
}
