/* ============================================================================
   Magister · ntfy — tema visual basado en la paleta del dashboard/ACP.
   Solo CSS: no toca la lógica, la autenticación ni el API de ntfy.
   ========================================================================== */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/theme/fonts/PlusJakartaSans.woff2') format('woff2');
}
@font-face {
  font-family: 'Fira Code';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/theme/fonts/FiraCode.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --mg-bg: #0b1120;
  --mg-bg-deep: #070a12;
  --mg-panel: #0f172a;
  --mg-panel-soft: rgba(24, 34, 54, 0.78);
  --mg-border: rgba(148, 163, 184, 0.16);
  --mg-border-strong: rgba(148, 163, 184, 0.26);
  --mg-text: #e2e8f0;
  --mg-muted: #94a3b8;
  --mg-accent: #6366f1;
  --mg-accent-soft: #818cf8;
  --mg-blue: #2563eb;
  --mg-cyan: #38bdf8;
  --mg-warning: #f59e0b;
  --mg-success: #22c55e;
  --mg-danger: #fb7185;
  --mg-radius: 12px;
  --mg-radius-lg: 16px;
  --mg-font: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas,
    'Liberation Mono', monospace;
  --mg-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, Consolas,
    'Liberation Mono', monospace;
}

html {
  /* 15 % menos que el tamaño base del navegador (16px → 13.6px). */
  font-size: 85% !important;
  background: var(--mg-bg) !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--mg-text) !important;
  background-color: var(--mg-bg) !important;
  background-image:
    radial-gradient(950px 560px at 8% 4%, rgba(37, 99, 235, 0.28), transparent 60%),
    radial-gradient(900px 540px at 92% 96%, rgba(79, 70, 229, 0.20), transparent 62%),
    linear-gradient(160deg, #0b1120 0%, #0b0d12 55%, #070a12 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  font-family: var(--mg-font) !important;
}

#root,
.MuiBox-root,
.MuiContainer-root {
  background-color: transparent !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}
*::-webkit-scrollbar-track { background: transparent; }

::selection {
  background: rgba(99, 102, 241, 0.45);
  color: #fff;
}

/* Tipografía ------------------------------------------------------------- */
body,
.MuiTypography-root,
.MuiButton-root,
.MuiInputBase-root,
.MuiInputLabel-root,
.MuiMenuItem-root,
.MuiListItemText-primary,
.MuiListItemText-secondary,
.MuiTab-root,
.MuiChip-root,
.MuiAlert-root,
.MuiDialogTitle-root,
.MuiDialogContent-root,
.MuiFormHelperText-root {
  font-family: var(--mg-font) !important;
}

.MuiTypography-root { color: var(--mg-text) !important; }
.MuiTypography-root.MuiTypography-caption,
.MuiTypography-root.MuiTypography-body2 {
  color: var(--mg-muted) !important;
}
.MuiTypography-h1, .MuiTypography-h2, .MuiTypography-h3,
.MuiTypography-h4, .MuiTypography-h5, .MuiTypography-h6 {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}

pre, code, kbd, samp,
.MuiTypography-root code,
.message-content code {
  font-family: var(--mg-mono) !important;
}
code {
  background: rgba(2, 6, 23, 0.62) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 6px !important;
  padding: 1px 5px !important;
  color: #c7d2fe !important;
}
pre {
  background: rgba(2, 6, 23, 0.62) !important;
  border: 1px solid rgba(148, 163, 184, 0.16) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  overflow-x: auto;
}
pre code {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: #e2e8f0 !important;
}

a, .MuiLink-root {
  color: var(--mg-accent-soft) !important;
  text-underline-offset: 2px;
}
a:hover, .MuiLink-root:hover { color: #c7d2fe !important; }

/* Barra superior --------------------------------------------------------- */
header.MuiAppBar-root {
  background: rgba(15, 23, 42, 0.78) !important;
  background-image: none !important;
  color: var(--mg-text) !important;
  border-bottom: 1px solid var(--mg-border) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22) !important;
  backdrop-filter: blur(14px);
}
header .MuiToolbar-root,
.MuiAppBar-root .MuiToolbar-root {
  background: transparent !important;
  background-image: none !important;
}
header.MuiAppBar-root .MuiTypography-root {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  color: #f8fafc !important;
}
header img {
  content: url('/theme/isotipo.png');
  width: 30px !important;
  height: 30px !important;
  object-fit: contain;
}
img[alt="ntfy logo"] {
  content: url('/theme/isotipo.png');
  object-fit: contain;
}
main img[height="64"],
main img[width="64"] {
  content: url('/theme/isotipo.png');
  object-fit: contain;
}

/* Menú lateral ----------------------------------------------------------- */
.MuiDrawer-paper {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(8, 13, 24, 0.99) 100%) !important;
  border-right: 1px solid var(--mg-border) !important;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.22) !important;
}
.MuiDrawer-paper .MuiDivider-root {
  border-color: rgba(148, 163, 184, 0.12) !important;
}
.MuiListItemButton-root {
  border-radius: 10px !important;
  margin: 2px 8px !important;
  color: #cbd5e1 !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.MuiListItemButton-root:hover {
  background: rgba(148, 163, 184, 0.10) !important;
  color: #fff !important;
}
.MuiListItemButton-root.Mui-selected {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.26), rgba(59, 130, 246, 0.10)) !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28), 0 6px 18px rgba(37, 99, 235, 0.12);
}
.MuiListItemButton-root.Mui-selected .MuiListItemIcon-root {
  color: var(--mg-accent-soft) !important;
}
.MuiListItemIcon-root { color: #94a3b8 !important; min-width: 38px !important; }
.MuiListSubheader-root {
  background: transparent !important;
  color: var(--mg-muted) !important;
  font-size: 9.35px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
}

/* Paneles, tarjetas y diálogos ------------------------------------------ */
.MuiPaper-root {
  background-image: none !important;
}
.MuiPaper-elevation1,
.MuiPaper-elevation2,
.MuiPaper-elevation3,
.MuiPaper-elevation4,
.MuiPaper-elevation5 {
  background-color: var(--mg-panel) !important;
}
.MuiCard-root {
  background: var(--mg-panel-soft) !important;
  border: 1px solid var(--mg-border) !important;
  border-radius: var(--mg-radius-lg) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.MuiCard-root:hover {
  border-color: rgba(129, 140, 248, 0.28) !important;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
.MuiCardContent-root { padding: 18px !important; }
.MuiCardContent-root:last-child { padding-bottom: 18px !important; }

.MuiDialog-paper {
  background: rgba(15, 23, 42, 0.98) !important;
  border: 1px solid rgba(99, 102, 241, 0.28) !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.60), 0 0 0 1px rgba(99, 102, 241, 0.10) !important;
}
.MuiDialogTitle-root {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}
.MuiBackdrop-root {
  background: rgba(2, 6, 23, 0.72) !important;
  backdrop-filter: blur(6px);
}

.MuiMenu-paper,
.MuiPopover-paper {
  background: #0f172a !important;
  border: 1px solid var(--mg-border-strong) !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.50) !important;
}
.MuiMenuItem-root {
  font-size: 11.05px !important;
  color: #dbe4f0 !important;
}
.MuiMenuItem-root:hover {
  background: rgba(99, 102, 241, 0.16) !important;
}
.MuiDivider-root { border-color: rgba(148, 163, 184, 0.14) !important; }

/* Botones ---------------------------------------------------------------- */
.MuiButton-root {
  text-transform: none !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  font-size: 10.2px !important;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.MuiButton-contained.MuiButton-colorPrimary,
.MuiButton-containedPrimary {
  background: linear-gradient(135deg, #2563eb, #3b82f6) !important;
  color: #fff !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28) !important;
}
.MuiButton-contained.MuiButton-colorPrimary:hover,
.MuiButton-containedPrimary:hover {
  background: linear-gradient(135deg, #3b82f6, #60a5fa) !important;
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.36) !important;
  transform: translateY(-1px);
}
.MuiButton-outlined {
  border-color: var(--mg-border-strong) !important;
  color: var(--mg-text) !important;
}
.MuiButton-outlined:hover {
  border-color: rgba(129, 140, 248, 0.60) !important;
  background: rgba(99, 102, 241, 0.10) !important;
}
.MuiButton-text,
.MuiButton-text.MuiButton-colorInherit {
  color: var(--mg-accent-soft) !important;
}
.MuiButton-text:hover { background: rgba(99, 102, 241, 0.12) !important; }
.MuiIconButton-root { border-radius: 10px !important; }
.MuiIconButton-root:hover {
  background: rgba(99, 102, 241, 0.16) !important;
  color: #fff !important;
}

/* Formularios ------------------------------------------------------------ */
.MuiOutlinedInput-root {
  background: rgba(2, 6, 23, 0.62) !important;
  border-radius: 12px !important;
  color: var(--mg-text) !important;
}
.MuiOutlinedInput-notchedOutline {
  border-color: rgba(148, 163, 184, 0.22) !important;
}
.MuiOutlinedInput-root:hover .MuiOutlinedInput-notchedOutline {
  border-color: rgba(148, 163, 184, 0.42) !important;
}
.MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-notchedOutline {
  border-color: var(--mg-accent) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}
.MuiInputLabel-root { color: var(--mg-muted) !important; }
.MuiInputLabel-root.Mui-focused { color: #a5b4fc !important; }
.MuiInputBase-input { color: var(--mg-text) !important; }
.MuiInputBase-input::placeholder { color: #64748b !important; opacity: 1; }
.MuiInput-root {
  background: rgba(2, 6, 23, 0.62) !important;
  border: 1px solid rgba(148, 163, 184, 0.22) !important;
  border-radius: 10px !important;
  padding: 7px 10px !important;
}
.MuiInput-root:before,
.MuiInput-root:after {
  display: none !important;
}
.MuiInput-root.Mui-focused {
  border-color: var(--mg-accent) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}
.MuiInputBase-root.MuiInput-root.MuiInput-underline:before,
.MuiInputBase-root.MuiInput-root.MuiInput-underline:after {
  border-bottom: 0 !important;
}
.MuiFormHelperText-root { color: var(--mg-muted) !important; }
.MuiInput-underline:before { border-bottom-color: rgba(148, 163, 184, 0.28) !important; }
.MuiInput-underline:hover:not(.Mui-disabled):before { border-bottom-color: rgba(129, 140, 248, 0.60) !important; }
.MuiInput-underline:after { border-bottom-color: var(--mg-accent) !important; }

/* Selección, chips, pestañas y switches -------------------------------- */
.MuiChip-root {
  border-radius: 999px !important;
  background: rgba(30, 41, 59, 0.80) !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #cbd5e1 !important;
}
.MuiChip-colorPrimary {
  background: rgba(99, 102, 241, 0.22) !important;
  border-color: rgba(129, 140, 248, 0.36) !important;
  color: #c7d2fe !important;
}
.MuiTab-root {
  text-transform: none !important;
  color: var(--mg-muted) !important;
  font-weight: 600 !important;
}
.MuiTab-root.Mui-selected { color: #c7d2fe !important; }
.MuiTabs-indicator {
  background: linear-gradient(90deg, #6366f1, #38bdf8) !important;
  height: 3px !important;
  border-radius: 999px;
}
.MuiSwitch-switchBase.Mui-checked { color: #a5b4fc !important; }
.MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track {
  background-color: #4f46e5 !important;
  opacity: 1 !important;
}

/* Alertas, tooltips, snackbars ------------------------------------------ */
.MuiAlert-root {
  background: rgba(15, 23, 42, 0.90) !important;
  color: var(--mg-text) !important;
  border-radius: 12px !important;
  border: 1px solid var(--mg-border) !important;
}
.MuiAlert-standardWarning,
.MuiAlert-colorWarning {
  background: rgba(245, 158, 11, 0.10) !important;
  color: #fcd34d !important;
  border-color: rgba(245, 158, 11, 0.28) !important;
}
.MuiAlert-standardInfo,
.MuiAlert-colorInfo {
  background: rgba(56, 189, 248, 0.10) !important;
  color: #bae6fd !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
}
.MuiAlert-standardError,
.MuiAlert-colorError {
  background: rgba(251, 113, 133, 0.10) !important;
  color: #fecdd3 !important;
  border-color: rgba(251, 113, 133, 0.28) !important;
}
.MuiAlert-standardSuccess,
.MuiAlert-colorSuccess {
  background: rgba(34, 197, 94, 0.10) !important;
  color: #bbf7d0 !important;
  border-color: rgba(34, 197, 94, 0.28) !important;
}
.MuiTooltip-tooltip {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border: 1px solid var(--mg-border-strong);
  border-radius: 8px !important;
  font-family: var(--mg-font) !important;
}
.MuiSnackbarContent-root {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border: 1px solid var(--mg-border-strong);
  border-radius: 12px !important;
}

/* Splash y logo --------------------------------------------------------- */
#splash {
  background: linear-gradient(160deg, #0b1120 0%, #0b0d12 55%, #070a12 100%) !important;
}
#splash img {
  content: url('/theme/isotipo.png');
  width: 112px !important;
  height: 112px !important;
  object-fit: contain;
}
.MuiAvatar-root img[alt="ntfy logo"] {
  content: url('/theme/isotipo.png');
  width: 64px !important;
  height: 64px !important;
  object-fit: contain;
}
.MuiAvatar-root .MuiAvatar-img {
  content: url('/theme/isotipo.png');
  object-fit: contain;
}

/* Login: tarjeta de cristal centrada, como el panel ---------------------- */
form:has(#username) {
  background: rgba(30, 41, 59, 0.72) !important;
  border: 1px solid rgba(99, 102, 241, 0.28) !important;
  border-radius: 18px !important;
  padding: 28px !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.08) !important;
  backdrop-filter: blur(14px);
}
form:has(#username) .MuiTypography-h5,
form:has(#username) .MuiTypography-h6 {
  font-weight: 700 !important;
  letter-spacing: -0.01em;
}
form:has(#username) .MuiButton-root {
  margin-top: 6px;
}

/* Ajustes finos --------------------------------------------------------- */
.MuiBadge-badge {
  background: linear-gradient(135deg, #6366f1, #2563eb) !important;
  color: #fff !important;
}
.MuiLinearProgress-bar,
.MuiCircularProgress-root { color: var(--mg-accent-soft) !important; }
.MuiLinearProgress-root { background-color: rgba(148, 163, 184, 0.16) !important; }
.MuiStepIcon-root.Mui-active,
.MuiStepIcon-root.Mui-completed { color: var(--mg-accent) !important; }
.MuiRating-root { color: var(--mg-warning) !important; }
.MuiSkeleton-root { background-color: rgba(148, 163, 184, 0.12) !important; }
