v1.31.0
conocimientowebapp-dashboardtemplates/13.382 B

dashboard.css

Fichero que /hv:webapp-dashboard usa o materializa en el proyecto. Se muestra tal cual está en el plugin.

webapp-dashboardskill
templatescarpeta
13.382 Btamaño
2026-10-02último cambio del pack
/* =============================================================================
   dashboard.css - Plantilla base de panel administrativo Ovillo (MiOrganizacion)
   Bootstrap 5.3 (data-bs-theme) + tokens de marca del tema. Full-width.
   Sidebar navy en AMBOS temas; solo cambian superficies del area de contenido.
   ============================================================================= */

:root {
  /* --- Marca (theme.*) --- */
  --brand: #33475B;        /* navy institucional, ancla del sidebar */
  --brand-600: #0066CC;    /* interactivo / acentos / foco / enlaces */
  --danger: #CC0000;       /* SOLO alertas y estados criticos (uso comedido) */

  /* --- Paleta de datos para graficos --- */
  --c-teal:   #17a2b8;
  --c-green:  #2faa6e;
  --c-amber:  #e0921f;
  --c-purple: #6f5bd6;

  /* --- Sidebar (navy fijo en ambos temas) --- */
  --sb-bg-top: #013a6b;
  --sb-bg-bot: #001b38;
  --sb-text: #cfe0f5;
  --sb-text-dim: #8fb0d6;
  --sb-text-active: #ffffff;
  --sb-active-bg: rgba(0, 102, 204, .28);
  --sb-active-bar: var(--brand-600);
  --sb-border: rgba(255, 255, 255, .08);

  /* --- Metricas de layout --- */
  --sidebar-w: 264px;
  --sidebar-w-collapsed: 74px;
  --topbar-h: 60px;
  --radius: 14px;
  --radius-sm: 10px;

  /* --- Tipografia --- */
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* --- Superficies por tema (Bootstrap data-bs-theme) --- */
[data-bs-theme="light"] {
  --surface: #eef2f7;
  --surface-2: #ffffff;
  --card: #ffffff;
  --text: #0f172a;
  --text-muted: #5b6b82;
  --border: #e2e8f1;
  --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .12);
}
[data-bs-theme="dark"] {
  --surface: #0a1120;
  --surface-2: #121b2e;
  --card: #121b2e;
  --text: #e6edf6;
  --text-muted: #93a4bd;
  --border: #1e2a40;
  --shadow: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-lg: 0 14px 30px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .display { font-family: var(--font-display); letter-spacing: -.01em; }
.mono, .metric-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
a { color: var(--brand-600); }

/* =================== LAYOUT (full-width grid) =================== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  transition: grid-template-columns .22s ease;
}
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* El area de contenido OCUPA todo el ancho restante (sin max-width). min-width:0 evita overflow. */
.content { display: flex; flex-direction: column; min-width: 0; }
.main { flex: 1; padding: 22px clamp(16px, 2.4vw, 36px) 56px; width: 100%; }

/* =================== SIDEBAR (navy en ambos temas) =================== */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--sb-bg-top), var(--sb-bg-bot));
  color: var(--sb-text);
  display: flex; flex-direction: column;
  overflow: hidden; z-index: 1040;
  border-right: 1px solid var(--sb-border);
}
.sidebar .sb-brand {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 18px; flex-shrink: 0;
  border-bottom: 1px solid var(--sb-border);
}
.sidebar .sb-brand .logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand-600), #4aa3ff);
  display: grid; place-items: center; color: #fff; font-weight: 800;
  font-family: var(--font-display); font-size: 1.05rem;
}
.sidebar .sb-brand .txt { line-height: 1.15; white-space: nowrap; overflow: hidden; }
.sidebar .sb-brand .txt b { color: #fff; font-family: var(--font-display); font-size: .98rem; }
.sidebar .sb-brand .txt small { color: var(--sb-text-dim); font-size: .72rem; }

.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 3px; }
.sb-section { color: var(--sb-text-dim); font-size: .66rem; text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; padding: 14px 12px 6px; white-space: nowrap; }
.sb-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin: 2px 0; border-radius: var(--radius-sm);
  color: var(--sb-text); text-decoration: none; position: relative;
  font-size: .9rem; font-weight: 500; white-space: nowrap; transition: background .15s, color .15s;
}
.sb-link .bi { font-size: 1.15rem; flex-shrink: 0; width: 22px; text-align: center; }
.sb-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sb-link.active { background: var(--sb-active-bg); color: var(--sb-text-active); font-weight: 600; }
.sb-link.active::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 4px; border-radius: 0 4px 4px 0; background: var(--sb-active-bar);
}
.sb-link .badge { margin-left: auto; }

.sb-foot { flex-shrink: 0; padding: 12px; border-top: 1px solid var(--sb-border); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); }
.sb-user:hover { background: rgba(255,255,255,.07); }
.sb-user .avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-600); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .82rem; font-family: var(--font-mono);
}
.sb-user .txt { line-height: 1.2; overflow: hidden; white-space: nowrap; }
.sb-user .txt b { color: #fff; font-size: .85rem; display: block; }
.sb-user .txt small { color: var(--sb-text-dim); font-size: .72rem; }

/* Colapsado (solo iconos) en escritorio */
.app.collapsed .sb-brand .txt,
.app.collapsed .sb-section,
.app.collapsed .sb-link span,
.app.collapsed .sb-link .badge,
.app.collapsed .sb-user .txt { display: none; }
.app.collapsed .sb-link { justify-content: center; gap: 0; }
.app.collapsed .sb-brand { justify-content: center; padding: 0; }
.app.collapsed .sb-user { justify-content: center; }

/* =================== TOPBAR sticky =================== */
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 1030;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 clamp(14px, 2vw, 28px);
  box-shadow: var(--shadow);
}
.topbar .icon-btn {
  width: 40px; height: 40px; border: 1px solid var(--border); background: var(--card);
  border-radius: var(--radius-sm); color: var(--text-muted); cursor: pointer;
  display: grid; place-items: center; font-size: 1.15rem; transition: all .15s; position: relative;
}
.topbar .icon-btn:hover { color: var(--text); border-color: var(--brand-600); }
.topbar .search {
  flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; color: var(--text-muted);
}
.topbar .search input { border: 0; background: transparent; outline: none; flex: 1; color: var(--text); font-family: var(--font-body); }
/* 2.4.7: el input cede su outline al contenedor, que es quien lo dibuja. Quitarlo sin
   sustituto deja la navegacion por teclado sin indicador: no es cosmetico. */
.topbar .search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,110,253,.25); }
.topbar .search kbd {
  font-family: var(--font-mono); font-size: .68rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; color: var(--text-muted);
}
.topbar .spacer { flex: 1; }
.topbar .dot {
  position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 2px solid var(--surface-2);
}

/* =================== CARDS / KPIs / CHARTS =================== */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.page-head .sub { color: var(--text-muted); font-size: .88rem; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 18px; }
.card-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px;
}
.kpi .top { display: flex; align-items: center; justify-content: space-between; }
.kpi .ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.25rem; color: #fff; }
.kpi .num { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 700; margin-top: 10px; line-height: 1; }
.kpi .lbl { color: var(--text-muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-top: 8px; }
.kpi .delta { font-family: var(--font-mono); font-size: .78rem; font-weight: 700; }
.delta.up { color: var(--c-green); } .delta.down { color: var(--danger); } .delta.flat { color: var(--text-muted); }
.bg-brand { background: var(--brand); } .bg-blue { background: var(--brand-600); }
.bg-teal { background: var(--c-teal); } .bg-green { background: var(--c-green); }
.bg-amber { background: var(--c-amber); } .bg-purple { background: var(--c-purple); } .bg-danger { background: var(--danger); }

.grid-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 18px; }
@media (max-width: 1100px) { .grid-charts { grid-template-columns: 1fr; } }
.card-panel .card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.card-panel .card-head h2 { font-size: .92rem; margin: 0; font-weight: 700; }
.chart-box { position: relative; height: 300px; }
.chart-box.sm { height: 260px; }

table.tbl-panel { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.tbl-panel th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.tbl-panel td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.tbl-panel tr:last-child td, table.tbl-panel tbody tr:last-child td { border-bottom: 0; }

/* =================== OFF-CANVAS < 820px =================== */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1035; }
@media (max-width: 820px) {
  .app, .app.collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; width: var(--sidebar-w);
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .app.sb-open .sidebar { transform: none; }
  .app.sb-open .overlay { display: block; }
  /* en movil el sidebar siempre muestra texto (no icon-only) */
  .app.collapsed .sb-brand .txt, .app.collapsed .sb-section,
  .app.collapsed .sb-link span, .app.collapsed .sb-user .txt { display: revert; }
  .app.collapsed .sb-link { justify-content: flex-start; gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   Accesibilidad (WCAG 2.1 AA)
   Los umbrales y el porque: skills/webapp-layout/patterns/accesibilidad.md
   ═══════════════════════════════════════════════════════════════ */

/* 2.4.7 Foco visible en todo lo enfocable. :focus-visible deja fuera el clic de raton
   y lo conserva para el teclado, que es a quien le sirve. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--brand, #0d6efd);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 2.4.1 Saltar al contenido: primero en el orden de tabulacion, invisible hasta que recibe foco. */
.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 1000;
  background: var(--brand, #0d6efd); color: #fff;
  padding: 10px 16px; border-radius: 0 0 6px 6px; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

/* El destino del salto es programatico: recibe foco sin dibujar un anillo alrededor
   de media pagina, pero SIGUE siendo enfocable. */
#contenido:focus { outline: none; }

/* Texto solo para tecnologia asistiva (la region de estado 4.1.3). No usar display:none:
   eso lo retira tambien del lector de pantalla. */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* 2.3.3 Quien pidio menos movimiento, menos movimiento. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

← Volver a la ficha de webapp-dashboard