/* HR Daily Dashboard - global stylesheet (loaded via _Host.cshtml) */

/* ---------- Back button ---------- */
.hrd-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1.5px solid #e2e8f0;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 700;
    color: #475569;
    background: #fff;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
    transition: all .15s ease;
    white-space: nowrap;
}
.hrd-back:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateX(-2px);
}

/* ---------- Filter bar ---------- */
.hrd-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    background: #fff;
    border-radius: 16px;
    padding: 14px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 14px rgba(15,23,42,.06);
}

.hrd-filter-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.hrd-preset {
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: .78rem;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s ease;
}
.hrd-preset:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}
.hrd-preset.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
    box-shadow: 0 4px 10px rgba(79,70,229,.3);
}

.hrd-filter-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hrd-filter-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hrd-filter-field label {
    font-size: .72rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.hrd-date-input {
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 6px 10px;
    font-size: .83rem;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    outline: none;
    cursor: pointer;
    transition: border-color .15s;
}
.hrd-date-input:focus {
    border-color: #4f46e5;
    background: #fff;
}

.hrd-filter-sep {
    color: #94a3b8;
    font-size: 1rem;
    margin-top: 16px;
}

.hrd-panel-range {
    font-size: .75rem;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 6px;
}
.hrd-root {
    padding: 24px 28px 40px;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    min-height: 100%;
    box-sizing: border-box;
}

/* ---------- Header ---------- */
.hrd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.hrd-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.hrd-header-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    box-shadow: 0 10px 24px rgba(124, 58, 237, .35);
}

.hrd-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -.01em;
}

.hrd-subtitle {
    margin: 2px 0 0;
    font-size: .85rem;
    color: #64748b;
    font-weight: 500;
}

.hrd-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: .85rem;
    font-weight: 700;
    color: #4f46e5;
    background: #fff;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
    transition: transform .15s ease, box-shadow .15s ease;
}

.hrd-refresh:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.hrd-refresh:disabled { opacity: .6; cursor: default; }

.hrd-root .spin { animation: hrd-spin 1s linear infinite; }
@keyframes hrd-spin { to { transform: rotate(360deg); } }

/* ---------- Loading ---------- */
.hrd-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 0;
    color: #64748b;
    font-weight: 600;
}

.hrd-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #e2e8f0;
    border-top-color: #7c3aed;
    animation: hrd-spin .8s linear infinite;
}

/* ---------- KPI grid ---------- */
.hrd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.hrd-card {
    position: relative;
    background: #fff;
    border-radius: 18px;
    padding: 18px 20px 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
    transition: transform .18s ease, box-shadow .18s ease;
}

.hrd-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}

.hrd-card-bar {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 5px;
    background: var(--accent);
}

.hrd-card-body {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.hrd-card-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
}

.hrd-card-label {
    margin-top: 8px;
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
}

.hrd-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: var(--accent-soft);
    flex-shrink: 0;
}

.hrd-card-footer {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.hrd-card-hint {
    font-size: .75rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ---------- Panels ---------- */
.hrd-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 18px;
}

.hrd-panel {
    background: #fff;
    border-radius: 18px;
    padding: 22px 24px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.hrd-panel-head h3 {
    margin: 0 0 18px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
}

.hrd-bars {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hrd-bar-row {
    display: grid;
    grid-template-columns: 110px 1fr 44px;
    align-items: center;
    gap: 12px;
}

.hrd-bar-label {
    font-size: .82rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hrd-bar-track {
    height: 10px;
    border-radius: 6px;
    background: #f1f5f9;
    overflow: hidden;
}

.hrd-bar-fill {
    height: 100%;
    border-radius: 6px;
    min-width: 2px;
    transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

.hrd-bar-count {
    font-size: .85rem;
    font-weight: 800;
    color: #0f172a;
    text-align: right;
}

.hrd-empty {
    color: #94a3b8;
    font-size: .85rem;
    font-weight: 500;
    padding: 12px 0;
}

@media (max-width: 640px) {
    .hrd-root { padding: 16px; }
    .hrd-title { font-size: 1.25rem; }
}

/* ---------- Clickable card enhancements ---------- */
.hrd-card-click {
    cursor: pointer;
}
.hrd-card-click .hrd-card-drill-hint {
    display: none;
    font-size: .72rem;
    font-weight: 700;
    color: var(--accent);
    margin-left: auto;
}
.hrd-card-click:hover .hrd-card-hint { display: none; }
.hrd-card-click:hover .hrd-card-drill-hint { display: inline; }
.hrd-card-click:hover {
    transform: translateY(-5px);
    box-shadow: 0 18px 36px rgba(15,23,42,.15);
    border: 1.5px solid var(--accent);
}
.hrd-card-click:active { transform: translateY(-2px); }

/* ---------- Drill overlay + drawer ---------- */
.hrd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.35);
    backdrop-filter: blur(2px);
    z-index: 200;
    animation: hrd-fade-in .18s ease;
}

@keyframes hrd-fade-in { from { opacity: 0; } to { opacity: 1; } }

.hrd-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(420px, 92vw);
    background: #fff;
    box-shadow: -8px 0 40px rgba(15,23,42,.16);
    z-index: 201;
    display: flex;
    flex-direction: column;
    animation: hrd-slide-in .22s cubic-bezier(.4,0,.2,1);
    border-radius: 20px 0 0 20px;
    overflow: hidden;
}

@keyframes hrd-slide-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.hrd-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 22px 18px;
    background: linear-gradient(135deg, var(--da, #4f46e5), color-mix(in srgb, var(--da, #4f46e5) 70%, #000));
    color: #fff;
    flex-shrink: 0;
}

.hrd-dh-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hrd-dh-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

.hrd-dh-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.hrd-dh-count {
    font-size: .78rem;
    opacity: .78;
    margin-top: 2px;
    font-weight: 500;
}

.hrd-drawer-close {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: rgba(255,255,255,.18);
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    transition: background .14s;
    flex-shrink: 0;
}
.hrd-drawer-close:hover { background: rgba(255,255,255,.32); }

.hrd-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.hrd-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #94a3b8;
    font-size: .88rem;
    font-weight: 600;
    padding: 48px 24px;
}

/* ---------- Drill rows ---------- */
.hrd-drow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.hrd-drow:hover { background: #f8fafc; }
.hrd-drow:last-child { border-bottom: none; }

.hrd-drow-av {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .85rem;
    color: #fff;
    flex-shrink: 0;
    opacity: .88;
}

.hrd-drow-info { flex: 1; min-width: 0; }

.hrd-drow-name {
    font-size: .85rem;
    font-weight: 700;
    color: #0f172a;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hrd-drow-sub {
    font-size: .74rem;
    color: #64748b;
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hrd-drow-tag {
    font-size: .7rem;
    font-weight: 800;
    border: 1.5px solid currentColor;
    border-radius: 8px;
    padding: 2px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Clickable drill row ---------- */
.hrd-drow-click {
    cursor: pointer;
    transition: background .12s;
}
.hrd-drow-active {
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    padding-left: 17px;
}

/* ---------- Financial position panel ---------- */
.hrd-fin-panel {
    border-top: 2px solid #e2e8f0;
    padding: 16px 20px 20px;
    background: #f8fafc;
    flex-shrink: 0;
}

.hrd-fin-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .8rem;
    font-weight: 800;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 14px;
}

.hrd-fin-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: .82rem;
    font-weight: 600;
    padding: 8px 0;
}

.hrd-fin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.hrd-fin-item {
    background: #fff;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 8px rgba(15,23,42,.06);
}

.hrd-fin-label {
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}

.hrd-fin-value {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
}
