:root {
  --bg: #08111f;
  --bg2: #0b1830;
  --panel: linear-gradient(180deg, rgba(18,31,56,.96), rgba(11,20,38,.96));
  --panel-border: rgba(109, 145, 212, 0.20);
  --text: #e8f0ff;
  --muted: #9fb0d3;
  --accent: #4d7cff;
  --accent-2: #73a1ff;
  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 700px at 10% 0%, #102447 0%, var(--bg) 55%) fixed;
  color: var(--text);
  font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
  min-height: 100vh;
}

a { color: #7ec0ff; text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.app-shell { max-width: 1440px; margin: 0 auto; padding: 16px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(8,15,28,.9);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.mention{
  display:inline-block;
  padding:2px 6px;
  border-radius:6px;
  font-weight:700;
  background:rgba(88,101,242,.18);
  border:1px solid rgba(88,101,242,.35);
  color:#eaf1ff;
}
.mention-channel{
  background:rgba(0,184,255,.14);
  border-color:rgba(0,184,255,.35);
}
.mention-role{
  background:rgba(255,200,0,.12);
  border-color:rgba(255,200,0,.35);
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 12px;
  object-fit: contain;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(109,145,212,.18);
  padding: 4px;
  display: block;
}
.brand-title { font-weight: 700; }
.brand-subtitle { color: var(--muted); font-size: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 999px;
  border: 1px solid rgba(109,145,212,.25);
  background: rgba(15,25,45,.8);
  color: var(--text);
  font-size: 13px;
}
.user-chip .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--success); }
.user-chip .sep { color: var(--muted); }
.user-chip .muted { color: var(--muted); }

.main-layout { display: grid; grid-template-columns: 270px minmax(0,1fr); gap: 14px; }
.sidebar {
  position: sticky; top: 16px; align-self: start;
  display: flex; flex-direction: column; gap: 12px;
}
.d-emoji{
  width: 20px;
  height: 20px;
  vertical-align: -4px;
}
.nav-menu {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9,16,30,.86);
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-link {
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
}
.nav-link:hover { text-decoration: none; background: rgba(255,255,255,.03); }
.nav-link.active {
  background: linear-gradient(180deg, rgba(77,124,255,.15), rgba(77,124,255,.08));
  border-color: rgba(77,124,255,.35);
  color: #eaf2ff;
}
.sidebar-card {
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: rgba(9,16,30,.86);
  padding: 12px;
}
.sidebar-card-title { font-weight: 700; margin-bottom: 8px; }

.content { min-width: 0; }
.solo-content { max-width: 520px; margin: 48px auto; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.panel h1, .panel h2, .panel h3 { margin: 0 0 10px; }
.panel-title-row {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  margin-bottom: 10px;
}
.page-head {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  margin-bottom: 12px;
}
.page-head h1 { margin: 0; font-size: 24px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 700; }
.mt8 { margin-top: 8px; }
.mb8 { margin-bottom: 8px; }

.alert {
  border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; border: 1px solid transparent;
}
.alert-info { background: rgba(99, 124, 210, .12); border-color: rgba(99,124,210,.25); }
.alert-success { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.25); }
.alert-error { background: rgba(248,113,113,.12); border-color: rgba(248,113,113,.25); }

.btn {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.btn-primary { background: linear-gradient(180deg, rgba(77,124,255,.35), rgba(54,94,203,.32)); border-color: rgba(116,156,255,.45); }
.btn-danger { border-color: rgba(248,113,113,.40); color: #ffd5d5; }
.btn-sm { padding: 6px 10px; font-size: 12px; }

input, textarea, select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(109,145,212,.25);
  background: rgba(7,13,24,.85);
  color: var(--text);
  padding: 9px 10px;
  outline: none;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(116,156,255,.55);
  box-shadow: 0 0 0 3px rgba(77,124,255,.12);
}
textarea { resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); }
label > input, label > textarea, label > select { margin-top: 6px; }

.stack-form { display: grid; gap: 10px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form.tight { gap: 6px; align-items: center; }
.inline-form input, .inline-form select { width: auto; min-width: 140px; }
.filters-grid {
  display: grid;
  grid-template-columns: minmax(260px,1fr) 220px auto;
  gap: 10px;
  align-items: end;
}
.filter-actions { display: flex; gap: 8px; align-items: center; }
.row-split { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px,1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric-card {
  border: 1px solid rgba(109,145,212,.18);
  background: rgba(10,18,34,.85);
  border-radius: 14px;
  padding: 12px;
}
.metric-label { color: var(--muted); font-size: 12px; }
.metric-value { font-size: 26px; font-weight: 800; line-height: 1.05; margin-top: 4px; }
.metric-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

.panel-grid.two-col {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

.status-list { display: grid; gap: 8px; }
.status-item {
  display: grid; grid-template-columns: 10px 1fr; gap: 10px; align-items: start;
  background: rgba(255,255,255,.015);
  border: 1px solid rgba(255,255,255,.04);
  border-radius: 10px;
  padding: 8px 10px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; }
.status-dot.ok { background: var(--success); }
.status-dot.bad { background: var(--danger); }
.status-title { font-weight: 600; }
.status-detail { color: var(--muted); font-size: 12px; word-break: break-all; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-links { display: grid; gap: 10px; }
.quick-link {
  border: 1px solid rgba(109,145,212,.14);
  background: rgba(255,255,255,.02);
  border-radius: 12px;
  padding: 10px;
  color: var(--text);
}
.quick-link:hover { text-decoration: none; border-color: rgba(116,156,255,.30); }
.ql-title { font-weight: 700; }
.ql-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.notes-list { margin: 0; padding-left: 16px; line-height: 1.5; color: var(--muted); }
.notes-list li { margin: 6px 0; }

.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.15);
}
.badge-ok { background: rgba(52,211,153,.12); color: #c9ffec; border-color: rgba(52,211,153,.25); }
.badge-muted { background: rgba(255,255,255,.05); color: #d5def1; }

.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse; min-width: 720px;
}
th, td {
  text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: top;
}
th { color: #b8c9ec; font-size: 12px; font-weight: 700; }
td { font-size: 14px; }

.list-rows { display: grid; gap: 8px; }
.list-rows.compact { gap: 6px; }
.list-rows .row-split {
  border: 1px solid rgba(255,255,255,.05);
  background: rgba(255,255,255,.015);
  border-radius: 10px;
  padding: 8px 10px;
}
.pill-hours {
  border-radius: 999px; padding: 4px 10px; background: rgba(77,124,255,.14); border: 1px solid rgba(77,124,255,.28);
  font-weight: 700; font-size: 12px;
}

hr.soft { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 10px 0; }
.text-danger { color: #ffb5b5 !important; }

/* Login */
.login-wrap { display: flex; justify-content: center; }
.login-panel { width: 100%; }
.login-panel h1 { margin-bottom: 6px; }

/* Transcripción view */
.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px,1fr));
  gap: 10px;
}
.transcript-panel { padding: 8px; }
.transcript-frame { width: 100%; min-height: 78vh; border: 0; border-radius: 12px; background: #fff; }

/* Expediente */
.expediente-head {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 14px;
  align-items: start;
}
.avatar-big {
  width: 110px; height: 110px; border-radius: 18px; object-fit: cover;
  border: 1px solid rgba(109,145,212,.28);
  background: rgba(255,255,255,.03);
}
.expediente-main h2 { margin: 0 0 4px; }
.meta-strip-tight {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(5, minmax(100px,1fr));
  gap: 10px;
  font-size: 13px;
}
.meta-strip-tight > div {
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,.015);
}
.roles-list { display: flex; flex-wrap: wrap; gap: 8px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 999px; border: 1px solid var(--role-border, rgba(255,255,255,.15));
  background: var(--role-bg, rgba(255,255,255,.04));
  color: var(--role-text, var(--text));
  padding: 5px 10px;
}
.role-chip-lg { padding: 7px 10px; }
.role-dot { width: 9px; height: 9px; border-radius: 50%; }
.chip-x {
  border: 0; background: rgba(0,0,0,.18); color: inherit; border-radius: 999px;
  width: 20px; height: 20px; cursor: pointer; line-height: 1;
}
.chip-x:hover { background: rgba(0,0,0,.30); }
.expediente-actions { display: flex; flex-direction: column; gap: 8px; }

/* Admin */
.admin-actions { display: grid; gap: 6px; }
.admin-actions form { margin: 0; }

/* Discord preview */
.discord-mock {
  border: 1px solid rgba(255,255,255,.08);
  background: #313338;
  border-radius: 12px;
  overflow: hidden;
}
.discord-mock-header {
  background: #2b2d31;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 10px 12px;
  color: #f2f3f5;
  font-weight: 700;
}
.discord-message-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 12px;
}
.discord-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #5865f2; color: #fff; display: grid; place-items: center; font-weight: 700;
}
.discord-author {
  color: #f2f3f5; font-weight: 700; margin-bottom: 4px; font-size: 14px;
}
.discord-bot-tag {
  font-size: 10px; font-weight: 800; color: #fff;
  background: #5865f2; border-radius: 4px; padding: 1px 4px;
  margin-left: 6px; vertical-align: middle;
}
.discord-content {
  color: #dbdee1;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
}
.mock-line { margin: 1px 0; }
.mock-title { font-weight: 800; margin: 1px 0; }
.mock-gap { height: 4px; }
.mock-code {
  margin: 6px 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  overflow: hidden;
  background: #1e1f22;
}
.mock-code-lang {
  background: rgba(255,255,255,.03);
  color: #b5bac1;
  border-bottom: 1px solid rgba(255,255,255,.05);
  padding: 3px 8px;
  font-size: 11px;
  text-transform: lowercase;
}
.mock-code pre {
  margin: 0;
  padding: 8px;
  color: #dce0e5;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.preview-emoji {
  width: 20px; height: 20px; vertical-align: -4px; margin: 0 1px;
}
.preview-emoji.animated { image-rendering: auto; }
.discord-content a { color: #00a8fc; }
.discord-content code {
  background: rgba(255,255,255,.08);
  border-radius: 4px; padding: 1px 4px; color: #f2f3f5;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.emoji-btn {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.02);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.emoji-btn img { width: 20px; height: 20px; object-fit: contain; }
.emoji-btn:hover { border-color: rgba(116,156,255,.32); }

/* Misc */
.meta-strip-tight code, .notes-list code, .sidebar-card code {
  background: rgba(255,255,255,.05); padding: 2px 5px; border-radius: 6px;
}

@media (max-width: 1200px) {
  .grid-cards { grid-template-columns: repeat(3, minmax(160px,1fr)); }
}
@media (max-width: 980px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .panel-grid.two-col { grid-template-columns: 1fr; }
  .filters-grid { grid-template-columns: 1fr; }
  .meta-strip { grid-template-columns: 1fr 1fr; }
  .meta-strip-tight { grid-template-columns: 1fr 1fr; }
  .expediente-head { grid-template-columns: 90px 1fr; }
  .expediente-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .app-shell { padding: 10px; }
  .topbar { flex-wrap: wrap; }
  .grid-cards { grid-template-columns: 1fr 1fr; }
  .inline-form { flex-wrap: wrap; }
  .meta-strip { grid-template-columns: 1fr; }
  .meta-strip-tight { grid-template-columns: 1fr; }
}

/* ===== Horarios globales (debajo de la ruta) ===== */
.tz-strip{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:10px 0 0 0;
}

.tz-chip{
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border:1px solid rgba(120,160,255,.18);
  background:linear-gradient(180deg, rgba(22,36,72,.55), rgba(12,22,45,.55));
  border-radius:999px;
  font-size:12px;
  line-height:1;
  backdrop-filter: blur(4px);
}

.tz-label{
  color:#9fb7ff;
  font-weight:600;
}

.tz-time{
  color:#eaf1ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight:700;
  letter-spacing:.2px;
}

/* ===== Inicio - panel de centro de operaciones ===== */
.dashboard-intro{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.quick-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px;
}

.quick-card{
  display:block;
  text-decoration:none;
  border:1px solid rgba(120,160,255,.15);
  background:linear-gradient(180deg, rgba(20,34,66,.5), rgba(12,22,44,.5));
  border-radius:12px;
  padding:12px;
  transition:.15s ease;
}

.quick-card:hover{
  transform:translateY(-1px);
  border-color:rgba(120,160,255,.35);
  box-shadow:0 8px 24px rgba(0,0,0,.2);
}

.quick-title{
  color:#eef3ff;
  font-weight:700;
  margin-bottom:4px;
}

.quick-text{
  color:#9fb1d9;
  font-size:13px;
  line-height:1.35;
}

.ops-note{
  border:1px solid rgba(120,160,255,.12);
  background:rgba(12,22,44,.35);
  border-radius:10px;
  padding:10px 12px;
  color:#e8efff;
  font-size:13px;
}
.route-line{margin-bottom:6px;}

.login-logo-wrap{display:flex;justify-content:center;margin-bottom:8px;}
.login-logo{width:96px;height:96px;object-fit:contain;filter:drop-shadow(0 6px 20px rgba(0,0,0,.28));}
