/* YTN Dashboard Polish Pack
   Safe add-on CSS. Does not replace your current site.css.
*/

:root {
    --ytn-glow-blue: rgba(56, 189, 248, .22);
    --ytn-glow-green: rgba(34, 197, 94, .24);
    --ytn-glow-yellow: rgba(245, 158, 11, .24);
    --ytn-glow-red: rgba(239, 68, 68, .24);
}

/* Dashboard cards */
.cards {
    align-items: stretch;
}

.card {
    position: relative;
    overflow: hidden;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(56,189,248,.12), transparent 42%);
    pointer-events: none;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(56,189,248,.55);
    box-shadow: 0 20px 45px rgba(0,0,0,.34), 0 0 0 1px rgba(56,189,248,.08);
}

.card .label {
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 12px;
}

.card .number {
    text-shadow: 0 2px 18px rgba(255,255,255,.14);
}

.card.danger::before {
    background: radial-gradient(circle at top right, rgba(239,68,68,.16), transparent 42%);
}

/* Panels */
.panel {
    transition: border-color .16s ease, box-shadow .16s ease;
}

.panel:hover {
    border-color: rgba(148,163,184,.55);
}

/* Better table readability */
table {
    font-size: 14px;
}

th {
    text-transform: uppercase;
    letter-spacing: .035em;
    font-size: 12px;
}

td strong {
    letter-spacing: .01em;
}

tr:hover td {
    background: rgba(56,189,248,.045);
}

/* Safety badges */
.badge,
.risk-low,
.risk-medium,
.risk-high {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}

.risk-low {
    background: rgba(34,197,94,.18) !important;
    color: #86efac !important;
    box-shadow: 0 0 22px var(--ytn-glow-green);
}

.risk-medium {
    background: rgba(245,158,11,.18) !important;
    color: #fcd34d !important;
    box-shadow: 0 0 22px var(--ytn-glow-yellow);
}

.risk-high {
    background: rgba(239,68,68,.18) !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 22px var(--ytn-glow-red);
}

/* Quick action buttons */
.quick-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.quick-actions a,
.quick-actions button {
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 8px;
}

/* Thumbnail polish */
.ytn-thumb {
    width: 92px;
    max-height: 58px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(148,163,184,.28);
    box-shadow: 0 10px 24px rgba(0,0,0,.28);
}

/* Status chips */
.ytn-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(51,65,85,.8);
    color: #e5e7eb;
    font-weight: 700;
    font-size: 12px;
}

.ytn-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #94a3b8;
}

.ytn-chip.safe::before { background: #22c55e; }
.ytn-chip.warn::before { background: #f59e0b; }
.ytn-chip.danger::before { background: #ef4444; }

/* Dashboard header polish */
.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(10px);
}

.topbar h1 {
    letter-spacing: -.025em;
}

/* Sidebar active-ish hover */
.sidebar nav a,
.sidebar a {
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

.sidebar nav a:hover,
.sidebar a:hover {
    transform: translateX(2px);
}

/* Mobile improvements */
@media(max-width: 900px) {
    .content {
        padding: 22px 18px;
    }

    .card .number {
        font-size: 34px;
    }

    table {
        min-width: 760px;
    }

    .panel {
        overflow-x: auto;
    }
}

/* YTN unified risk score badge scale */
.badge.risk-low,.risk-low{background:linear-gradient(135deg,#bbf7d0,#86efac)!important;color:#052e16!important;border:1px solid rgba(134,239,172,.45)!important}
.badge.risk-medium,.risk-medium{background:linear-gradient(135deg,#fde68a,#facc15)!important;color:#111827!important;border:1px solid rgba(250,204,21,.45)!important}
.badge.risk-orange,.risk-orange{background:linear-gradient(135deg,#fdba74,#f97316)!important;color:#111827!important;border:1px solid rgba(249,115,22,.55)!important}
.badge.risk-high,.risk-high{background:linear-gradient(135deg,#f87171,#ef4444)!important;color:#fff!important;border:1px solid rgba(248,113,113,.55)!important}
.badge.risk-critical,.risk-critical{background:linear-gradient(135deg,#7f1d1d,#581c87)!important;color:#fff!important;border:1px solid rgba(168,85,247,.55)!important}

/* YTN unified numeric risk score colors - final override
   0-9 Safe=green, 10-24 Low=yellow, 25-49 Medium=orange, 50-74 High=red, 75-100 Critical=dark red/purple */
.badge.risk-low,.risk-low{background:linear-gradient(135deg,#bbf7d0,#86efac)!important;color:#052e16!important;border:1px solid rgba(134,239,172,.55)!important;box-shadow:0 0 0 1px rgba(134,239,172,.10),0 6px 18px rgba(34,197,94,.16)!important}
.badge.risk-medium,.risk-medium{background:linear-gradient(135deg,#fde68a,#facc15)!important;color:#111827!important;border:1px solid rgba(250,204,21,.55)!important;box-shadow:0 0 0 1px rgba(250,204,21,.10),0 6px 18px rgba(245,158,11,.18)!important}
.badge.risk-orange,.risk-orange{background:linear-gradient(135deg,#fdba74,#f97316)!important;color:#111827!important;border:1px solid rgba(249,115,22,.60)!important;box-shadow:0 0 0 1px rgba(249,115,22,.10),0 6px 18px rgba(249,115,22,.22)!important}
.badge.risk-high,.risk-high{background:linear-gradient(135deg,#f87171,#dc2626)!important;color:#fff!important;border:1px solid rgba(248,113,113,.60)!important;box-shadow:0 0 0 1px rgba(248,113,113,.10),0 6px 18px rgba(220,38,38,.24)!important}
.badge.risk-critical,.risk-critical{background:linear-gradient(135deg,#7f1d1d,#581c87)!important;color:#fff!important;border:1px solid rgba(168,85,247,.60)!important;box-shadow:0 0 0 1px rgba(168,85,247,.10),0 6px 18px rgba(127,29,29,.30)!important}
