/* ============================================================
   IT Helpdesk v2 — Extended Stylesheet
   Appended to existing style.css
============================================================ */

/* ── Version badge ───────────────────────────────────────── */
.version-badge {
    font-size: 0.6rem;
    background: var(--accent2);
    color: #fff;
    padding: 1px 5px;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 4px;
    font-family: 'JetBrains Mono', monospace;
}

/* ── Flash bar ───────────────────────────────────────────── */
.flash-bar {
    position: sticky;
    top: 62px;
    z-index: 90;
    padding: 11px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 500;
}
.flash-success { background: rgba(34,197,94,0.15);  border-bottom: 1px solid rgba(34,197,94,0.3);  color: var(--success); }
.flash-error   { background: rgba(239,68,68,0.15);  border-bottom: 1px solid rgba(239,68,68,0.3);  color: var(--danger); }
.flash-info    { background: rgba(59,130,246,0.15); border-bottom: 1px solid rgba(59,130,246,0.3); color: var(--accent); }
.flash-close   { background: none; border: none; color: inherit; cursor: pointer; font-size: 1.2rem; padding: 0 4px; }

/* ── Notification system ─────────────────────────────────── */
.notif-wrap    { position: relative; }
.notif-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px 12px;
    position: relative;
    transition: border-color 0.2s;
}
.notif-btn:hover { border-color: var(--accent); }
.notif-badge {
    position: absolute;
    top: -5px; right: -5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 5px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}
.notif-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 200;
    overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.88rem;
}
.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42,48,80,0.4);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
    display: block;
    color: var(--text);
}
.notif-item:hover  { background: var(--bg3); }
.notif-item.unread { background: rgba(59,130,246,0.06); border-left: 3px solid var(--accent); }
.notif-title  { font-size: 0.85rem; font-weight: 600; }
.notif-msg    { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.notif-time   { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.notif-empty  { padding: 24px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.notif-loading { padding: 16px; text-align: center; color: var(--muted); font-size: 0.85rem; }
.notif-footer { padding: 10px 16px; text-align: center; border-top: 1px solid var(--border); }

/* ── Star rating ─────────────────────────────────────────── */
.star-rating { display: flex; gap: 4px; flex-direction: row-reverse; justify-content: flex-end; }
.star-rating input { display: none; }
.star-rating label {
    font-size: 1.6rem;
    color: var(--border);
    cursor: pointer;
    transition: color 0.15s;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label { color: var(--warning); }
.star-display { color: var(--warning); font-size: 1rem; letter-spacing: 2px; }
.rating-num   { font-family: 'JetBrains Mono', monospace; font-size: 1.4rem; color: var(--warning); }

/* ── Asset card grid ─────────────────────────────────────── */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.asset-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: block;
    color: var(--text);
}
.asset-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.asset-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--bg3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.asset-img img { width: 100%; height: 140px; object-fit: cover; }
.asset-body { padding: 14px; }
.asset-code { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; color: var(--accent); }
.asset-name { font-weight: 600; font-size: 0.95rem; margin: 4px 0; }
.asset-meta { font-size: 0.8rem; color: var(--muted); }

/* ── Employee card ───────────────────────────────────────── */
.emp-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.2s;
}
.emp-card:hover { border-color: var(--accent); }
.emp-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg3);
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    border: 2px solid var(--border);
}
.emp-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.emp-name { font-weight: 600; font-size: 0.95rem; }
.emp-role { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.emp-dept { font-size: 0.78rem; color: var(--accent); margin-top: 3px; }

/* ── Tabs ────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; gap: 0; }
.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s;
    margin-bottom: -1px;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Clickable stat cards ────────────────────────────────── */
.stat-card { cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.stat-card a { text-decoration: none; display: block; }

/* ── Timeline extended ───────────────────────────────────── */
.timeline-item:last-child { border-bottom: none; }
.tl-feedback { background: rgba(245,158,11,0.06); border-radius: 8px; padding: 10px; margin-top: 6px; }

/* ── Allocation history ──────────────────────────────────── */
.alloc-row-active { background: rgba(34,197,94,0.05); }
.alloc-row-returned { opacity: 0.7; }

/* ── Status pill extensions ──────────────────────────────── */
.badge-available  { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-assigned   { background: rgba(59,130,246,0.15);  color: var(--accent); }
.badge-repair     { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-retired    { background: rgba(100,116,139,0.15); color: var(--muted); }
.badge-active     { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-on_leave   { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-resigned   { background: rgba(239,68,68,0.15);   color: var(--danger); }
.badge-terminated { background: rgba(100,116,139,0.15); color: var(--muted); }
.badge-new        { background: rgba(6,182,212,0.15);   color: var(--accent2); }
.badge-good       { background: rgba(34,197,94,0.15);   color: var(--success); }
.badge-fair       { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-poor       { background: rgba(239,68,68,0.15);   color: var(--danger); }
.badge-employee   { background: rgba(6,182,212,0.12);   color: var(--accent2); }

/* ── Report export button ────────────────────────────────── */
.export-btn {
    background: linear-gradient(135deg, #217346, #1e6b40);
    color: #fff;
    border: none;
}
.export-btn:hover { background: linear-gradient(135deg, #1a5c38, #165430); }

/* ── Audit log ───────────────────────────────────────────── */
.audit-action { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; color: var(--accent2); }
.audit-entity { font-size: 0.78rem; color: var(--muted); }

/* ── Feedback card ───────────────────────────────────────── */
.feedback-prompt {
    background: rgba(245,158,11,0.08);
    border: 1px dashed rgba(245,158,11,0.4);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 16px;
}
.feedback-given {
    background: rgba(34,197,94,0.06);
    border: 1px solid rgba(34,197,94,0.2);
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}

/* ── Progress bars ───────────────────────────────────────── */
.mini-bar { height: 6px; background: var(--bg3); border-radius: 999px; overflow: hidden; }
.mini-bar-fill { height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s; }

/* ── Search highlight ────────────────────────────────────── */
mark { background: rgba(245,158,11,0.25); color: inherit; border-radius: 2px; padding: 0 2px; }

/* ── Modal (fixed-height faux viewport) ──────────────────── */
.modal-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 999;
    align-items: center;
    justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-box {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    width: 480px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }

/* ── Responsive tweaks ───────────────────────────────────── */
@media (max-width: 768px) {
    .asset-grid { grid-template-columns: 1fr; }
    .notif-dropdown { width: 280px; right: -80px; }
}

/* ── Placeholder image ───────────────────────────────────── */
.img-placeholder {
    width: 100%; height: 140px;
    background: var(--bg3);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: var(--border);
}
