:root {
    --bg-main: #0d1117;
    --bg-header: #161b22;
    --bg-footer: #161b22;
    --text-primary: #e6edf3;
    --text-muted: #8b949e;
    --border-color: #30363d;
    --blue: #1565C0;
    --green: #2E7D32;
    --yellow: #F9A825;
    --red: #C62828;
    --shadow: 0 4px 16px rgba(0,0,0,0.5);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

/* ── Header ─────────────────────────────────────────── */

.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    gap: 16px;
}

.company-name {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    text-transform: uppercase;
    flex: 1;
}

.page-indicator {
    font-size: 1.2rem;
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.clock {
    font-size: 1.6rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    flex: 1;
    text-align: right;
}

/* ── Main grid ───────────────────────────────────────── */

.dashboard-main {
    padding: 20px 20px 8px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    opacity: 1;
    transition: opacity 0.25s ease;
}

.dashboard-grid.fade-out {
    opacity: 0;
}

/* ── Cards ───────────────────────────────────────────── */

.dash-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    height: 220px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    padding: 18px 20px 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
}

.dash-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(0,0,0,0.65);
}

.bg-c-blue   { background: var(--blue); }
.bg-c-green  { background: var(--green); }
.bg-c-yellow { background: var(--yellow); color: #1a1a1a; }
.bg-c-red    { background: var(--red); }

.bg-c-yellow .card-project,
.bg-c-yellow .card-partner,
.bg-c-yellow .card-detalle,
.bg-c-yellow .card-user { color: #1a1a1a; }

.card-project {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    margin-bottom: 8px;
}

.card-partner {
    font-size: 1.05rem;
    font-weight: 500;
    text-align: right;
    opacity: 0.9;
    word-break: break-word;
    color: inherit;
}

.card-detalle {
    font-size: 1rem;
    font-weight: 700;
    text-align: right;
    word-break: break-word;
    color: inherit;
    margin-top: 4px;
    flex: 1;
}

.card-user {
    font-size: 0.95rem;
    font-weight: 400;
    opacity: 0.85;
    margin-top: auto;
    word-break: break-word;
    color: inherit;
}

/* ── Alert banners ───────────────────────────────────── */

.banner, .bannerpr {
    position: absolute;
    width: 120px;
    padding: 5px 0;
    font-size: 0.7rem;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.banner {
    top: 18px;
    right: -32px;
    background: #e53935;
    color: #fff;
    transform: rotate(45deg);
    box-shadow: 0 2px 8px rgba(229,57,53,0.6);
}

.bannerpr {
    bottom: 18px;
    right: -32px;
    background: #546e7a;
    color: #fff;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.banner.visible {
    opacity: 1;
    animation: pulse-banner 1.4s ease-in-out infinite;
}

.bannerpr.visible {
    opacity: 1;
}

.banner.oculto, .bannerpr.oculto {
    opacity: 0;
    animation: none;
}

@keyframes pulse-banner {
    0%, 100% { box-shadow: 0 2px 8px rgba(229,57,53,0.6); }
    50%       { box-shadow: 0 2px 20px rgba(229,57,53,1); }
}

/* ── Footer ──────────────────────────────────────────── */

.dashboard-footer {
    height: 36px;
    background: var(--bg-footer);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 28px;
    font-size: 0.82rem;
    color: var(--text-muted);
    position: sticky;
    bottom: 0;
}

/* ── TV 1080p: force 5 columns ───────────────────────── */

@media (min-width: 1600px) {
    .dashboard-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
