@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg: #14161a;
    --panel: #1b1e24;
    --panel-2: #21252c;
    --border: #2b2f38;
    --text: #e7e6e2;
    --muted: #8b93a1;
    --accent: #f2a516;
    --accent-dim: #6b5420;
    --danger: #e5484d;
    --danger-dim: #4a2224;
    --ok: #3ecf8e;
    --ok-dim: #1c3d30;
    --crit-a: #e5484d;
    --crit-b: #f2a516;
    --crit-c: #4a90d9;
    --radius: 3px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

h1, h2, h3, .display {
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
    margin: 0 0 8px;
}

.mono { font-family: 'JetBrains Mono', monospace; }

a { color: inherit; text-decoration: none; }

.shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.side {
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: sticky;
    top: 0;
    height: 100vh;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}
.brand-mark {
    background: var(--accent);
    color: #14161a;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius);
    font-size: 16px;
}
.brand-text strong { display: block; font-size: 13px; letter-spacing: 0.05em; }
.brand-text small { color: var(--muted); font-size: 11px; }

.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; flex: 1; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    border-left: 2px solid transparent;
}
.nav a:hover { background: var(--panel-2); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--accent); border-left-color: var(--accent); }
.nav .ico { width: 16px; text-align: center; opacity: 0.85; }
.side-foot { padding: 12px 20px 0; color: var(--muted); font-size: 11px; border-top: 1px solid var(--border); margin-top: 12px; }

/* ---- Content ---- */
.content { padding: 28px 32px 60px; max-width: 1280px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }

.saludo-banda { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.saludo-texto { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.saludo-fecha { color: var(--muted); font-size: 13px; margin-top: 2px; text-transform: capitalize; }
.saludo-egg { flex-shrink: 0; }
.saludo-egg img { height: 64px; width: 64px; object-fit: cover; border-radius: 8px; border: 2px solid var(--accent); box-shadow: 0 2px 8px rgba(242,165,22,0.25); cursor: default; }
@media (max-width: 600px) { .saludo-egg img { height: 48px; width: 48px; } }
.page-head h1 { font-size: 28px; }
.page-head .sub { color: var(--muted); font-size: 13px; }

/* ---- Cards / stats ---- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
}
.stat .num { font-family: 'Barlow Condensed', sans-serif; font-size: 30px; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 6px; }
.stat.accent .num { color: var(--accent); }
.stat.danger .num { color: var(--danger); }
.stat.ok .num { color: var(--ok); }
.stat.medio .num { color: var(--accent); }
.stat.medio { border-left: 3px solid var(--accent); }
.stat.danger { border-left: 3px solid var(--danger); }
.stat.ok { border-left: 3px solid var(--ok); }
.nota-chica { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.nota-chica.alerta { color: var(--accent); }

/* ---- Panels / tables ---- */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.panel-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.panel-head h2 { font-size: 16px; margin: 0; }
.panel-body { padding: 0; }
.panel-body.pad { padding: 16px; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--panel-2); }

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge.crit-a { background: rgba(229,72,77,0.15); color: var(--crit-a); }
.badge.crit-b { background: rgba(242,165,22,0.15); color: var(--crit-b); }
.badge.crit-c { background: rgba(74,144,217,0.15); color: var(--crit-c); }
.badge.vencida { background: var(--danger-dim); color: var(--danger); }
.badge.al-dia { background: var(--ok-dim); color: var(--ok); }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--accent); color: #14161a;
    border: none; padding: 9px 16px;
    border-radius: var(--radius);
    font-weight: 600; font-size: 13px;
    cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12px; }

input, select, textarea {
    background: var(--panel-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    width: 100%;
}
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.03em; }
.field { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 160px; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

/* filas expandibles (dashboard de pendientes) */
details summary { transition: background 0.15s; }
details summary:hover { background: var(--panel-2); }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: '▸'; color: var(--muted); margin-right: 4px; font-size: 11px; }
details[open] summary::before { content: '▾'; }
details[open] summary { background: var(--panel-2); border-bottom: 1px solid var(--border); }
details table { margin-top: 8px; }
.flash { background: var(--ok-dim); color: var(--ok); padding: 10px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13px; }
.flash.error { background: var(--danger-dim); color: var(--danger); }

.tag-list { display: flex; gap: 6px; flex-wrap: wrap; }
.file-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.file-item:last-child { border-bottom: none; }

@media (max-width: 800px) {
    .shell { grid-template-columns: 1fr; }
    .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 12px; overflow-x: auto; }
    .brand { border-bottom: none; padding: 0 12px; margin: 0; }
    .nav { flex-direction: row; }
    .side-foot { display: none; }
    .content { padding: 16px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
