/* ──────────────────────────────────────────────
   NaruHub Dark Design System
   Theme: Deep Charcoal & Midnight surfaces
   Accent: Neon Mint/Cyan #00e5ff
   Font: Geist
────────────────────────────────────────────── */

/* ── Tokens ── */
:root {
    --nh-bg: #0b0d14;
    --nh-surface: #12151f;
    --nh-surface-2: #1a1e2d;
    --nh-surface-3: #22273a;
    --nh-border: #2a2f45;
    --nh-border-light: #343a52;

    --nh-mint: #00e5ff;
    --nh-mint-dim: rgba(0, 229, 255, 0.12);
    --nh-mint-glow: rgba(0, 229, 255, 0.25);

    --nh-amber: #f59e0b;
    --nh-amber-dim: rgba(245, 158, 11, 0.12);

    --nh-red: #ef4444;
    --nh-red-dim: rgba(239, 68, 68, 0.12);

    --nh-violet: #a78bfa;

    --nh-text: #e8eaf0;
    --nh-text-2: #8b91a8;
    --nh-text-3: #555c75;

    --nh-sidebar-w: 260px;
    --nh-header-h: 60px;
    --nh-radius: 10px;
    --nh-radius-sm: 6px;
    --nh-shadow: 0 4px 24px rgba(0,0,0,0.4);

    --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--nh-bg);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    height: 100%;
}

a { color: var(--nh-mint); text-decoration: none; }
a:hover { opacity: 0.85; }

/* ── Splash Screen ── */
.nh-splash {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--nh-bg);
}
.nh-splash__inner { text-align: center; }
.nh-splash__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--nh-mint);
    letter-spacing: -0.3px;
    margin-bottom: 24px;
}
.nh-brand-icon {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}
.nh-splash__logo-mark {
    width: 36px;
    height: 36px;
}
.nh-login-brand-mark {
    width: 36px;
    height: 36px;
}
.nh-splash__dots { display: flex; gap: 6px; justify-content: center; }
.nh-splash__dots span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--nh-border);
    animation: nh-pulse 1.2s ease-in-out infinite;
}
.nh-splash__dots span:nth-child(2) { animation-delay: 0.2s; }
.nh-splash__dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes nh-pulse {
    0%, 80%, 100% { background: var(--nh-border); transform: scale(1); }
    40% { background: var(--nh-mint); transform: scale(1.3); }
}

/* ── App Shell ── */
.nh-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ── */
.nh-sidebar {
    width: var(--nh-sidebar-w);
    background: var(--nh-surface);
    border-right: 1px solid var(--nh-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    position: fixed;
    left: 0; top: 0;
    z-index: 100;
}

.nh-sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--nh-border);
    height: var(--nh-header-h);
}
.nh-sidebar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 22%;
}
.nh-sidebar__brand-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--nh-mint);
    line-height: 1.2;
    letter-spacing: -0.2px;
}
.nh-sidebar__brand-sub {
    font-size: 10px;
    color: var(--nh-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nh-sidebar__nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}
.nh-sidebar__section {
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--nh-text-3);
    margin-top: 8px;
}
.nh-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: var(--nh-text-2);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 0;
    text-decoration: none;
    position: relative;
}
.nh-nav-item:hover {
    color: var(--nh-text);
    background: var(--nh-surface-2);
}
.nh-nav-item.active {
    color: var(--nh-mint);
    background: var(--nh-mint-dim);
}
.nh-nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--nh-mint);
    border-radius: 0 2px 2px 0;
}
.nh-nav-icon {
    width: 18px;
    height: 18px;
    opacity: 0.85;
    flex-shrink: 0;
}

/* ── Main Content ── */
.nh-main {
    margin-left: var(--nh-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Header ── */
.nh-header {
    height: var(--nh-header-h);
    background: var(--nh-surface);
    border-bottom: 1px solid var(--nh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}
.nh-header__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--nh-text);
}
.nh-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.nh-header__search {
    position: relative;
}
.nh-header__search input {
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 13px;
    padding: 7px 12px 7px 34px;
    width: 220px;
    outline: none;
    transition: border-color 0.15s;
}
.nh-header__search input:focus { border-color: var(--nh-mint); }
.nh-header__search input::placeholder { color: var(--nh-text-3); }
.nh-header__search-icon {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--nh-text-3);
}

.nh-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--nh-mint-dim);
    border: 1px solid var(--nh-mint);
    color: var(--nh-mint);
    font-size: 12px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}

/* ── Page Content ── */
.nh-page {
    flex: 1;
    overflow-y: auto;
    padding: 28px 28px;
}

/* ── Page Header ── */
.nh-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}
.nh-page-header__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--nh-text);
}
.nh-page-header__sub {
    font-size: 13px;
    color: var(--nh-text-2);
    margin-top: 2px;
}

/* ── Cards / Surfaces ── */
.nh-card {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
    padding: 20px;
}
.nh-card--sm { padding: 16px; }

/* ── Grid ── */
.nh-grid { display: grid; gap: 16px; }
.nh-grid--4 { grid-template-columns: repeat(4, 1fr); }
.nh-grid--3 { grid-template-columns: repeat(3, 1fr); }
.nh-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1200px) { .nh-grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .nh-grid--4, .nh-grid--3, .nh-grid--2 { grid-template-columns: 1fr; } }

/* ── Stat Cards ── */
.nh-stat {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.nh-stat::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--nh-accent, var(--nh-mint));
}
.nh-stat__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nh-text-3);
    margin-bottom: 8px;
}
.nh-stat__value {
    font-size: 32px;
    font-weight: 700;
    color: var(--nh-text);
    line-height: 1;
}
.nh-stat__sub {
    font-size: 12px;
    color: var(--nh-text-2);
    margin-top: 6px;
}
.nh-stat--mint { --nh-accent: var(--nh-mint); }
.nh-stat--amber { --nh-accent: var(--nh-amber); }
.nh-stat--red { --nh-accent: var(--nh-red); }
.nh-stat--violet { --nh-accent: var(--nh-violet); }

/* ── Status Badge ── */
.nh-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(0, 229, 255, 0.16);
    color: var(--nh-mint);
    border: 1px solid rgba(0, 229, 255, 0.38);
}
.nh-badge::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.nh-badge--tinted {
    background: color-mix(in srgb, var(--nh-badge-color, var(--nh-mint)) 24%, transparent);
    color: color-mix(in srgb, var(--nh-badge-color, var(--nh-mint)) 60%, var(--nh-text));
    border-color: color-mix(in srgb, var(--nh-badge-color, var(--nh-mint)) 50%, transparent);
}

/* ── Load Level Badges ── */
.nh-load {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}
.nh-load--optimal { background: rgba(0, 229, 255, 0.16); color: var(--nh-mint); border: 1px solid rgba(0, 229, 255, 0.38); }
.nh-load--saturated { background: rgba(245, 158, 11, 0.16); color: var(--nh-amber); border: 1px solid rgba(245, 158, 11, 0.38); }
.nh-load--critical  { background: rgba(239, 68, 68, 0.16);  color: var(--nh-red);    border: 1px solid rgba(239, 68, 68, 0.38); }
.nh-load--inactive  { background: var(--nh-surface-2);       color: var(--nh-text-3); border: 1px solid var(--nh-border); }

/* ── Progress Bar ── */
.nh-progress {
    height: 4px;
    background: var(--nh-surface-3);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.nh-progress__fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease;
}
.nh-progress__fill--optimal { background: var(--nh-mint); }
.nh-progress__fill--saturated { background: var(--nh-amber); }
.nh-progress__fill--critical { background: var(--nh-red); }

/* ── Table ── */
.nh-table-wrap {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
    overflow: hidden;
}
.nh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}
.nh-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nh-text-3);
    background: var(--nh-surface-2);
    border-bottom: 1px solid var(--nh-border);
}
.nh-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--nh-border);
    vertical-align: middle;
    color: var(--nh-text);
}
.nh-table tr:last-child td { border-bottom: none; }
.nh-table tr:hover td { background: var(--nh-surface-2); }
.nh-table__code {
    width: 1%;
    white-space: nowrap;
}
.nh-project-code {
    display: inline-block;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--nh-mint);
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid rgba(0, 229, 255, 0.22);
    padding: 3px 9px;
    border-radius: 4px;
    white-space: nowrap;
    word-break: keep-all;
}

.nh-th-sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s ease, background 0.15s ease;
}
.nh-th-sortable:hover {
    color: var(--nh-text);
    background: var(--nh-surface-3);
}
.nh-th-sortable--active {
    color: var(--nh-mint);
}
.nh-th-sortable__icon {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--nh-mint);
    vertical-align: middle;
}

.nh-sort-bar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.nh-sort-bar__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--nh-text-3);
}
.nh-sort-bar__fields {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
}
.nh-sort-bar__pill {
    border: none;
    background: transparent;
    color: var(--nh-text-2);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.nh-sort-bar__pill:hover {
    color: var(--nh-text);
    background: var(--nh-surface-3);
}
.nh-sort-bar__pill--active {
    color: var(--nh-mint);
    background: rgba(0, 229, 255, 0.12);
    box-shadow: inset 0 0 0 1px rgba(0, 229, 255, 0.25);
}
.nh-sort-bar__dir {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--nh-radius-sm);
    border: 1px solid var(--nh-border);
    background: var(--nh-surface-2);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.nh-sort-bar__dir:hover {
    border-color: rgba(0, 229, 255, 0.35);
    color: var(--nh-mint);
    background: rgba(0, 229, 255, 0.08);
}
.nh-sort-bar__dir-icon {
    transition: transform 0.2s ease;
    color: var(--nh-mint);
}
.nh-sort-bar__dir-icon--desc {
    transform: rotate(180deg);
}
.nh-sort-bar__dir-text {
    white-space: nowrap;
}

/* ── Buttons ── */
.nh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--nh-radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}
.nh-btn--primary {
    background: var(--nh-mint);
    color: var(--nh-bg);
    border-color: var(--nh-mint);
}
.nh-btn--primary:hover { opacity: 0.88; }
.nh-btn--ghost {
    background: transparent;
    color: var(--nh-text-2);
    border-color: var(--nh-border);
}
.nh-btn--ghost:hover { border-color: var(--nh-border-light); color: var(--nh-text); }
.nh-btn--accent {
    background: var(--nh-mint-dim);
    color: var(--nh-mint);
    border-color: rgba(0,229,255,0.35);
    font-weight: 600;
}
.nh-btn--accent:hover:not(:disabled) { background: rgba(0,229,255,0.2); border-color: var(--nh-mint); }
.nh-btn--accent:disabled { opacity: 0.45; cursor: not-allowed; }
.nh-btn--danger {
    background: var(--nh-red-dim);
    color: var(--nh-red);
    border-color: rgba(239,68,68,0.25);
}
.nh-btn--danger:hover { background: rgba(239,68,68,0.2); }
.nh-btn--sm { padding: 5px 10px; font-size: 12px; }
.nh-btn--icon { padding: 6px; border-radius: 6px; }

.nh-dp__footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--nh-border);
    display: flex;
    justify-content: flex-end;
}

/* ── Modal ── */
.nh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: nh-fade-in 0.15s ease;
}
.nh-modal {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 12px;
    width: 520px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--nh-shadow);
    animation: nh-slide-up 0.2s ease;
}
.nh-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--nh-border);
}
.nh-modal__title { font-size: 16px; font-weight: 600; color: var(--nh-text); }
.nh-modal__close {
    width: 28px; height: 28px;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--nh-text-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    transition: background 0.15s;
}
.nh-modal__close:hover { background: var(--nh-surface-2); color: var(--nh-text); }
.nh-modal__body {
    padding: 20px 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
}
.nh-modal__footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--nh-border);
    flex-shrink: 0;
}

@keyframes nh-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes nh-slide-up { from { opacity: 0; } to { opacity: 1; } }

/* ── Form ── */
.nh-form-group { margin-bottom: 16px; }
.nh-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--nh-text-2);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.nh-input, .nh-select {
    width: 100%;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 13.5px;
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.15s;
    appearance: none;
}
.nh-input:focus, .nh-select:focus { border-color: var(--nh-mint); box-shadow: 0 0 0 2px var(--nh-mint-glow); }
.nh-input::placeholder { color: var(--nh-text-3); }
.nh-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Staff Card ── */
.nh-staff-card {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius);
    padding: 20px;
    transition: border-color 0.15s;
}
.nh-staff-card:hover { border-color: var(--nh-border-light); }
.nh-staff-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.nh-staff-avatar {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    color: var(--nh-text-2);
    font-size: 16px;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nh-staff-card__name { font-size: 14px; font-weight: 600; color: var(--nh-text); }
.nh-staff-card__position { font-size: 12px; color: var(--nh-text-2); margin-top: 1px; }

.nh-staff-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.nh-staff-card__projects {
    font-size: 12px;
    color: var(--nh-text-2);
}
.nh-staff-card__projects strong {
    color: var(--nh-text);
    font-weight: 600;
}

.nh-staff-card__assignments {
    margin-top: 14px;
    border-top: 1px solid var(--nh-border);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nh-assignment-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--nh-surface-2);
    border: 1px solid transparent;
    border-radius: var(--nh-radius-sm);
    font-size: 12px;
    transition: border-color 0.12s;
}
.nh-assignment-chip--inactive {
    background: var(--nh-surface);
    border-color: var(--nh-border);
    opacity: 0.6;
}
.nh-assignment-chip--inactive .nh-assignment-chip__code {
    color: var(--nh-text-3);
}
.nh-assignment-chip--inactive .nh-assignment-chip__name {
    color: var(--nh-text-2);
    text-decoration: line-through;
    text-decoration-color: var(--nh-text-3);
    text-decoration-thickness: 1px;
}
.nh-assignment-chip__code {
    font-weight: 600;
    color: var(--nh-mint);
    font-size: 11px;
    font-family: monospace;
}
.nh-assignment-chip__name { color: var(--nh-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nh-assignment-chip__status-tag {
    font-size: 10px;
    font-weight: 500;
    color: var(--nh-text-3);
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nh-role-badge,
.nh-assignment-chip__role {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--nh-mint);
    background: rgba(0, 229, 255, 0.16);
    border: 1px solid rgba(0, 229, 255, 0.38);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}
.nh-role-badge--dim {
    color: var(--nh-text-3);
    background: var(--nh-surface-3);
    border-color: var(--nh-border);
}
.nh-role-badge--chip {
    gap: 2px;
    padding: 3px 4px 3px 10px;
}
.nh-role-badge__rm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.12s, background 0.12s;
}
.nh-role-badge__rm:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
}

.nh-assignment-inactive-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 4px;
}
.nh-assignment-inactive-divider::before,
.nh-assignment-inactive-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--nh-border);
}
.nh-assignment-inactive-divider span {
    font-size: 10px;
    font-weight: 600;
    color: var(--nh-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.nh-assignment-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--nh-text-3);
    font-size: 11px;
    font-family: var(--font);
    padding: 4px 2px;
    margin-top: 2px;
    transition: color 0.12s;
}
.nh-assignment-toggle:hover { color: var(--nh-mint); }

/* ── Empty state ── */
.nh-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}
.nh-empty__icon {
    width: 48px; height: 48px;
    background: var(--nh-surface-2);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.nh-empty__title { font-size: 15px; font-weight: 600; color: var(--nh-text); }
.nh-empty__sub { font-size: 13px; color: var(--nh-text-2); margin-top: 4px; }

/* ── Loading spinner ── */
.nh-spinner {
    width: 32px; height: 32px;
    border: 2px solid var(--nh-border);
    border-top-color: var(--nh-mint);
    border-radius: 50%;
    animation: nh-spin 0.7s linear infinite;
    margin: 40px auto;
}
@keyframes nh-spin { to { transform: rotate(360deg); } }

/* ── Utilities ── */
.nh-flex { display: flex; align-items: center; }
.nh-flex--gap { gap: 10px; }
.nh-text-mint { color: var(--nh-mint); }
.nh-text-dim { color: var(--nh-text-2); }
.nh-text-faint { color: var(--nh-text-3); }
.nh-mt-4 { margin-top: 4px; }
.nh-mt-8 { margin-top: 8px; }
.nh-mt-16 { margin-top: 16px; }
.nh-mt-24 { margin-top: 24px; }
.nh-mb-16 { margin-bottom: 16px; }
.nh-mb-24 { margin-bottom: 24px; }

/* ── Number input — hide/style browser spin arrows ── */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* ── Date input — hide native picker chrome, force dark ── */
input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input[type="date"]::-webkit-inner-spin-button { display: none; }

/* ── Custom Date Picker ── */
.nh-dp {
    position: relative;
    display: block;
    width: 100%;
}

/* Wrapper: the visible "input" box */
.nh-dp__wrap {
    display: flex;
    align-items: center;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    min-height: 38px;
    transition: border-color 0.15s, box-shadow 0.15s;
    overflow: hidden;
}
.nh-dp__wrap:hover,
.nh-dp__wrap--open { border-color: var(--nh-mint); }
.nh-dp__wrap--open { box-shadow: 0 0 0 2px var(--nh-mint-glow); }

/* Main trigger: fills the wrapper, no border of its own */
.nh-dp__trigger {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    min-width: 0;
}
.nh-dp__val { flex: 1; min-width: 0; }
.nh-dp__ph  { flex: 1; min-width: 0; color: var(--nh-text-3); }

/* Clear button: sibling of trigger, not nested */
.nh-dp__clear-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 38px;
    background: transparent;
    border: none;
    border-left: 1px solid var(--nh-border);
    color: var(--nh-text-3);
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
}
.nh-dp__clear-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.nh-dp__icon { color: var(--nh-text-3); flex-shrink: 0; }
.nh-dp__chevron {
    color: var(--nh-text-3);
    flex-shrink: 0;
    transition: transform 0.15s;
}
.nh-dp__trigger--open .nh-dp__chevron { transform: rotate(180deg); }

.nh-dp__backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
}

.nh-dp__popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10050;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border-light);
    border-radius: var(--nh-radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    padding: 10px;
    width: 260px;
    animation: nh-dp-in 0.12s ease;
}
.nh-dp__popup--fixed {
    position: fixed;
    z-index: 10050;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    box-sizing: border-box;
}
@keyframes nh-dp-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.nh-dp__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.nh-dp__nav-btn {
    background: none;
    border: none;
    color: var(--nh-text-2);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--nh-radius-sm);
    display: flex;
    align-items: center;
    transition: background 0.12s, color 0.12s;
}
.nh-dp__nav-btn:hover { background: var(--nh-surface-3); color: var(--nh-mint); }

.nh-dp__month-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--nh-text);
    letter-spacing: 0.01em;
}

.nh-dp__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 4px;
}
.nh-dp__weekdays span {
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    color: var(--nh-text-3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 0;
}

.nh-dp__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.nh-dp__day {
    background: none;
    border: none;
    border-radius: 5px;
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 12px;
    padding: 4px 2px;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, color 0.1s;
}
.nh-dp__day:hover { background: var(--nh-surface-3); }
.nh-dp__day--other { color: var(--nh-text-3); }
.nh-dp__day--today {
    color: var(--nh-mint);
    font-weight: 600;
}
.nh-dp__day--sel {
    background: var(--nh-mint);
    color: #000;
    font-weight: 700;
}
.nh-dp__day--sel:hover { background: var(--nh-mint); }

/* ── Custom Select ── */
.nh-sel {
    position: relative;
    display: block;
    width: 100%;
}

.nh-sel__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 13.5px;
    padding: 9px 12px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    text-align: left;
}
.nh-sel__trigger:hover,
.nh-sel__trigger--open {
    border-color: var(--nh-mint);
}
.nh-sel__trigger--open {
    box-shadow: 0 0 0 2px var(--nh-mint-glow);
}

.nh-sel__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nh-sel__label--placeholder { color: var(--nh-text-3); }

.nh-sel__chevron {
    color: var(--nh-text-3);
    flex-shrink: 0;
    transition: transform 0.15s;
}
.nh-sel__trigger--open .nh-sel__chevron { transform: rotate(180deg); }

.nh-sel__backdrop {
    position: fixed;
    inset: 0;
    z-index: 10040;
}

.nh-sel__popup {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 10050;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border-light);
    border-radius: var(--nh-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 4px;
    max-height: 240px;
    overflow-y: auto;
    animation: nh-dp-in 0.12s ease;
}
.nh-sel__popup--fixed {
    position: fixed;
    z-index: 10050;
    min-width: 200px;
}

.nh-sel__popup::-webkit-scrollbar { width: 6px; }
.nh-sel__popup::-webkit-scrollbar-thumb {
    background: var(--nh-border-light);
    border-radius: 3px;
}

.nh-sel__empty {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--nh-text-3);
    text-align: center;
    user-select: none;
}

.nh-sel__option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 13px;
    padding: 8px 10px;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s, color 0.1s;
}
.nh-sel__option:hover:not(:disabled) {
    background: var(--nh-surface-3);
    color: var(--nh-mint);
}
.nh-sel__option--sel {
    background: var(--nh-mint-dim);
    color: var(--nh-mint);
    font-weight: 500;
}
.nh-sel__option--sel:hover:not(:disabled) {
    background: var(--nh-mint-dim);
    color: var(--nh-mint);
}
.nh-sel__option--disabled {
    color: var(--nh-text-3);
    cursor: not-allowed;
    opacity: 0.55;
}
.nh-sel__option-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nh-sel__check {
    flex-shrink: 0;
    color: var(--nh-mint);
}

/* ── Staff Modal — two-column layout ── */
.nh-staff-modal {
    max-width: 860px;
    width: 96vw;
    display: flex;
    flex-direction: column;
    height: 80vh;
    max-height: 640px;
    min-height: 420px;
}
.nh-staff-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--nh-border);
    flex-shrink: 0;
}
.nh-staff-modal__title { font-size: 16px; font-weight: 700; color: var(--nh-text); }
.nh-staff-modal__sub   { font-size: 12px; color: var(--nh-text-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.nh-staff-modal__sep   { opacity: 0.4; }
.nh-staff-modal__code  { font-family: monospace; color: var(--nh-mint); font-size: 11px; }
.nh-staff-modal__header-info { flex: 1; }

.nh-staff-modal__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    height: 0; /* forces grid children to respect flex parent height */
}

/* ── Columns ── */
.nh-staff-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding: 20px;
}
.nh-staff-col--left {
    border-right: 1px solid var(--nh-border);
}
.nh-staff-col--right {
    overflow-y: auto;
}
.nh-staff-col--right::-webkit-scrollbar { width: 4px; }
.nh-staff-col--right::-webkit-scrollbar-thumb { background: var(--nh-border-light); border-radius: 2px; }
.nh-staff-col__label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--nh-text-3);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.nh-staff-col__hint {
    font-size: 12px;
    color: var(--nh-text-2);
    line-height: 1.45;
    margin: -6px 0 12px;
}
.nh-staff-col__hint strong { color: var(--nh-text); font-weight: 600; }
.nh-staff-col__hint--warn { color: var(--nh-amber); }
.nh-staff-col__badge {
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    color: var(--nh-text-2);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
}
.nh-staff-col__list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.nh-staff-col__list::-webkit-scrollbar { width: 4px; }
.nh-staff-col__list::-webkit-scrollbar-thumb { background: var(--nh-border-light); border-radius: 2px; }
.nh-staff-col__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 40px 0;
    font-size: 13px;
    color: var(--nh-text-2);
    font-weight: 500;
    height: 100%;
}

/* ── Team member card (left column) ── */
.nh-tmember {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: var(--nh-radius-sm);
    transition: background 0.12s;
}
.nh-tmember:hover { background: var(--nh-surface-2); }
.nh-tmember__avatar {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--nh-surface-3), var(--nh-surface-2));
    border: 1px solid var(--nh-border-light);
    color: var(--nh-mint);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nh-tmember__info { flex: 1; min-width: 0; }
.nh-tmember__name { font-size: 13px; font-weight: 600; color: var(--nh-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-tmember__meta { font-size: 11px; color: var(--nh-text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-tmember__roles {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.nh-tmember__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    margin-top: 2px;
}
.nh-tmember__add-role {
    font-size: 10px;
    font-weight: 600;
    color: var(--nh-mint);
    background: var(--nh-mint-dim);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 5px;
    padding: 2px 7px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
}
.nh-tmember__add-role:hover {
    background: rgba(0, 229, 255, 0.2);
    border-color: var(--nh-mint);
}
.nh-tmember__remove {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--nh-text-3);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.nh-tmember__remove:hover { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.3); }
.nh-tmember--expired { opacity: 0.55; }
.nh-tmember--expired .nh-tmember__avatar { background: var(--nh-surface-3); color: var(--nh-text-3); }

/* Expiry badges */
.nh-expiry-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
}
.nh-expiry-badge--expired { background: rgba(239,68,68,0.12);  color: #ef4444; border: 1px solid rgba(239,68,68,0.25); }
.nh-expiry-badge--soon    { background: rgba(245,158,11,0.12); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.nh-expiry-badge--ok      { background: var(--nh-surface-3);   color: var(--nh-text-3); border: 1px solid var(--nh-border); }

/* ── Recommendation bar (right column) ── */
.nh-rec-bar {
    background: rgba(0,229,255,0.05);
    border: 1px solid rgba(0,229,255,0.15);
    border-radius: var(--nh-radius-sm);
    padding: 10px 12px;
    margin-bottom: 16px;
}
.nh-rec-bar__label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: var(--nh-mint);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 8px;
}
.nh-rec-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nh-rec-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: 20px;
    padding: 4px 10px 4px 5px;
    font-size: 12px;
    font-family: var(--font);
    color: var(--nh-text);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.nh-rec-chip:hover { border-color: var(--nh-mint); background: var(--nh-surface-3); }
.nh-rec-chip--active { border-color: var(--nh-mint); background: var(--nh-mint-dim); color: var(--nh-mint); }
.nh-rec-chip__av {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--nh-surface-3); border: 1px solid var(--nh-border-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700; color: var(--nh-mint); flex-shrink: 0;
}
.nh-rec-chip__name { font-weight: 500; }
.nh-rec-chip__ct {
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    color: var(--nh-text-3);
}
.nh-rec-chip--active .nh-rec-chip__ct { color: var(--nh-mint); border-color: rgba(0,229,255,0.3); }

/* ── Field wrapper ── */
.nh-field { display: flex; flex-direction: column; gap: 6px; }
.nh-field__label { font-size: 11px; font-weight: 600; color: var(--nh-text-2); }
.nh-field__req { color: var(--nh-mint); margin-left: 1px; }
.nh-field__hint {
    font-size: 11px;
    color: var(--nh-text-3);
    margin: -8px 0 8px;
    line-height: 1.4;
}
.nh-field__hint--sel { color: var(--nh-mint); margin-top: 8px; margin-bottom: 0; }
.nh-field-err { font-size: 12px; color: #ef4444; margin-top: 6px; }

/* ── Staff combobox ── */
.nh-combo { position: relative; }
.nh-combo__face {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font);
    color: var(--nh-text);
    min-height: 40px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.nh-combo--open .nh-combo__face,
.nh-combo__face:hover { border-color: var(--nh-mint); }
.nh-combo--open .nh-combo__face { box-shadow: 0 0 0 2px var(--nh-mint-glow); border-radius: var(--nh-radius-sm) var(--nh-radius-sm) 0 0; }
.nh-combo__ph   { color: var(--nh-text-3); flex: 1; font-size: 13px; }
.nh-combo__val  { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-combo__av {
    width: 24px; height: 24px;
    border-radius: 6px;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border-light);
    color: var(--nh-mint);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nh-combo__load {
    font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    flex-shrink: 0;
}
.nh-combo__clear {
    background: transparent; border: none;
    color: var(--nh-text-3); cursor: pointer;
    font-size: 10px; padding: 2px 4px;
    border-radius: 4px;
    transition: color 0.1s, background 0.1s;
    flex-shrink: 0;
}
.nh-combo__clear:hover { color: #ef4444; background: rgba(239,68,68,0.1); }
.nh-combo__chev { color: var(--nh-text-3); flex-shrink: 0; transition: transform 0.15s; margin-left: auto; }
.nh-combo__chev--open { transform: rotate(180deg); }

.nh-combo__panel {
    position: absolute;
    top: 100%; left: 0; right: 0;
    z-index: 9999;
    background: var(--nh-surface);
    border: 1px solid var(--nh-mint);
    border-top: none;
    border-radius: 0 0 var(--nh-radius-sm) var(--nh-radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    overflow: hidden;
}
.nh-combo__search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--nh-border);
    color: var(--nh-text-3);
}
.nh-combo__input {
    flex: 1; background: transparent; border: none; outline: none;
    font-size: 13px; font-family: var(--font); color: var(--nh-text);
}
.nh-combo__input::placeholder { color: var(--nh-text-3); }
.nh-combo__list { max-height: 200px; overflow-y: auto; padding: 4px; }
.nh-combo__list::-webkit-scrollbar { width: 4px; }
.nh-combo__list::-webkit-scrollbar-thumb { background: var(--nh-border-light); border-radius: 2px; }
.nh-combo__opt {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; background: transparent; border: none;
    border-radius: 6px; cursor: pointer; font-family: var(--font);
    font-size: 13px; color: var(--nh-text); text-align: left;
    transition: background 0.1s;
}
.nh-combo__opt:hover:not(:disabled) { background: var(--nh-surface-2); }
.nh-combo__opt--sel { background: var(--nh-mint-dim); color: var(--nh-mint); }
.nh-combo__opt--dim { opacity: 0.4; cursor: not-allowed; }
.nh-combo__opt--team { border-left: 2px solid rgba(0, 229, 255, 0.35); }
.nh-combo__opt-tag {
    font-size: 10px;
    font-weight: 500;
    color: var(--nh-mint);
    margin-left: 4px;
}
.nh-combo__opt-av {
    width: 28px; height: 28px; border-radius: 8px;
    background: var(--nh-surface-3); border: 1px solid var(--nh-border-light);
    color: var(--nh-mint); font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nh-combo__opt-body { flex: 1; min-width: 0; }
.nh-combo__opt-name { display: block; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-combo__opt-sub  { display: block; font-size: 11px; color: var(--nh-text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nh-combo__opt-pill {
    font-size: 10px; font-weight: 600;
    padding: 2px 8px; border-radius: 10px;
    white-space: nowrap; flex-shrink: 0;
}
.nh-combo__empty { font-size: 12px; color: var(--nh-text-3); text-align: center; padding: 14px; }

/* ── Role pills ── */
.nh-role-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.nh-role-pill {
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--font);
    color: var(--nh-text-2);
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.nh-role-pill:hover { border-color: var(--nh-mint); color: var(--nh-text); background: var(--nh-surface-2); }
.nh-role-pill--sel {
    border-color: var(--nh-mint);
    background: var(--nh-mint-dim);
    color: var(--nh-mint);
    font-weight: 600;
}

/* ── Staff modal action row ── */
.nh-staff-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.nh-staff-actions .nh-btn--accent { flex: 1; justify-content: center; }
.nh-staff-actions .nh-btn--ghost  { flex-shrink: 0; }

/* ── Load level pill colors ── */
.nh-load-pill--optimal   { background: rgba(74,222,128,0.15);  color: #4ade80; }
.nh-load-pill--saturated { background: rgba(245,158,11,0.15);  color: #f59e0b; }
.nh-load-pill--critical  { background: rgba(239,68,68,0.15);   color: #ef4444; }

/* ── Blazor error UI ── */
#blazor-error-ui {
    background: var(--nh-surface);
    border: 1px solid var(--nh-red);
    border-radius: var(--nh-radius);
    bottom: 20px; left: 50%; transform: translateX(-50%);
    color: var(--nh-text);
    display: none;
    padding: 12px 20px;
    position: fixed;
    z-index: 1000;
    font-size: 13px;
    white-space: nowrap;
}
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 10px; color: var(--nh-text-3); }

/* ── Login Page ── */
.nh-auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nh-bg);
    background-image:
        radial-gradient(ellipse 60% 50% at 20% 20%, rgba(0,229,255,0.05) 0%, transparent 70%),
        radial-gradient(ellipse 50% 60% at 80% 80%, rgba(167,139,250,0.05) 0%, transparent 70%);
}

.nh-login-card {
    width: 100%;
    max-width: 400px;
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--nh-shadow);
}

.nh-login-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.nh-login-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--nh-mint);
    letter-spacing: -0.3px;
}

.nh-login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--nh-text);
    margin-bottom: 4px;
}

.nh-login-sub {
    color: var(--nh-text-2);
    font-size: 13px;
    margin-bottom: 28px;
}

.nh-login-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--nh-red-dim);
    border: 1px solid rgba(239,68,68,0.3);
    color: #fca5a5;
    border-radius: var(--nh-radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

.nh-form-group { margin-bottom: 18px; }

.nh-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--nh-text-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.nh-input {
    width: 100%;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text);
    font-family: var(--font);
    font-size: 14px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.15s;
}

.nh-input:focus { border-color: var(--nh-mint); }
.nh-input--error { border-color: var(--nh-red) !important; }
.nh-input:disabled { opacity: 0.5; cursor: not-allowed; }
.nh-input::placeholder { color: var(--nh-text-3); }

.nh-input-wrap { position: relative; }
.nh-input-wrap .nh-input { padding-right: 42px; }

.nh-input-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--nh-text-3);
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.nh-input-eye:hover { color: var(--nh-text-2); }

.nh-btn--full { width: 100%; justify-content: center; margin-top: 8px; }

.nh-spinner-sm {
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: nh-spin 0.6s linear infinite;
    margin-right: 6px;
}

/* ── Header user section ── */
.nh-header__user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nh-header__username {
    font-size: 13px;
    color: var(--nh-text-2);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nh-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--nh-radius-sm);
    display: flex;
    align-items: center;
    transition: background 0.15s, color 0.15s;
}
.nh-btn-icon--dim { color: var(--nh-text-3); }
.nh-btn-icon:hover { background: var(--nh-surface-3); color: var(--nh-text); }

/* ── Auth loading splash ── */
.nh-auth-splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nh-bg);
}

.nh-auth-splash__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--nh-surface-3);
    border-top-color: var(--nh-accent);
    border-radius: 50%;
    animation: nh-spin 0.7s linear infinite;
}

@keyframes nh-spin {
    to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════
   RESPONSIVE — Tablet & Mobile
════════════════════════════════════════════════ */

/* ── Hamburger button (shown only on mobile) ── */
.nh-hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--nh-radius-sm);
    color: var(--nh-text-2);
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.nh-hamburger:hover { background: var(--nh-surface-3); color: var(--nh-text); }

/* ── Nav overlay backdrop (mobile sidebar open) ── */
.nh-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
    animation: nh-fade-in 0.15s ease;
}
.nh-nav-overlay--active { display: block; }

/* ── Horizontal scroll utility (any inline table inside a card) ── */
.nh-scroll-x {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Toolbar row (search + sort) ── */
.nh-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}
.nh-toolbar__search {
    flex: 1;
    min-width: 160px;
    max-width: 380px;
}
.nh-toolbar__sort { margin-left: auto; }

/* ── Sidebar transition (always, so slide-in animates) ── */
.nh-sidebar { transition: transform 0.25s ease; }

/* ── Tablet: 768px – 1024px ── */
@media (max-width: 1024px) {
    :root { --nh-sidebar-w: 220px; }
    .nh-grid--3 { grid-template-columns: repeat(2, 1fr); }
    .nh-page { padding: 20px; }
    .nh-header { padding: 0 20px; }
}

/* ── Mobile: ≤ 767px ── */
@media (max-width: 767px) {

    /* Hamburger visible */
    .nh-hamburger { display: flex; }

    /* Sidebar: off-screen by default, slides in */
    .nh-sidebar {
        transform: translateX(-100%);
        z-index: 100;
    }
    .nh-sidebar--open { transform: translateX(0); }

    /* Main: full width, no sidebar offset */
    .nh-main { margin-left: 0; }

    /* Header */
    .nh-header { padding: 0 12px; gap: 8px; }
    .nh-header__title { font-size: 14px; }
    .nh-header__username { display: none; }

    /* Page */
    .nh-page { padding: 14px; }
    .nh-page-header { margin-bottom: 14px; }
    .nh-page-header__title { font-size: 18px; }
    .nh-mb-24 { margin-bottom: 14px !important; }

    /* Cards */
    .nh-card { padding: 14px; }
    .nh-stat { padding: 14px; }
    .nh-stat__value { font-size: 24px; }

    /* Grids */
    .nh-grid--4 { grid-template-columns: repeat(2, 1fr) !important; }
    .nh-grid--3 { grid-template-columns: 1fr !important; }
    .nh-grid--2 { grid-template-columns: 1fr !important; }

    /* Tables: horizontal scroll */
    .nh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nh-table { min-width: 560px; }

    /* Toolbar: search full-width on first row, sort wraps below */
    .nh-toolbar { gap: 8px; }
    .nh-toolbar__search { max-width: 100%; flex: 1 1 auto; min-width: 0; }
    .nh-toolbar__sort { margin-left: 0; }

    /* Sort bar direction: hide text label, keep icon */
    .nh-sort-bar__dir-text { display: none; }

    /* Form rows: single column */
    .nh-form-row { grid-template-columns: 1fr !important; }

    /* Modal */
    .nh-modal {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 24px);
    }
    .nh-modal__body { padding: 16px !important; }
    .nh-modal__header { padding: 14px 16px 12px !important; }
    .nh-modal__footer { padding: 12px 16px !important; }

    /* Login page */
    .nh-login-card { padding: 24px 20px; }
}

/* ── Very small: ≤ 400px ── */
@media (max-width: 400px) {
    .nh-grid--4 { grid-template-columns: 1fr !important; }
    .nh-page { padding: 10px; }
    .nh-header { padding: 0 10px; }
    .nh-table { min-width: 480px; }
}

/* ══════════════════════════════════════════
   Gantt Chart — Project Timeline
══════════════════════════════════════════ */

/* Header controls bar */
.nh-gantt-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.nh-gantt-head__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--nh-text);
}
.nh-gantt-head__sub {
    font-size: 11px;
    color: var(--nh-text-3);
    margin-top: 2px;
}
.nh-gantt-head__controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Filter pills */
.nh-gantt-filters {
    display: flex;
    gap: 4px;
}
.nh-gantt-filter {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--nh-text-2);
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
}
.nh-gantt-filter:hover { color: var(--nh-text); border-color: var(--nh-border-light); }
.nh-gantt-filter--on {
    color: var(--nh-bg);
    background: var(--nh-mint);
    border-color: var(--nh-mint);
}

/* Year navigator */
.nh-gantt-year {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--nh-surface-2);
    border: 1px solid var(--nh-border);
    border-radius: var(--nh-radius-sm);
    overflow: hidden;
}
.nh-gantt-year span {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--nh-text);
    border-left: 1px solid var(--nh-border);
    border-right: 1px solid var(--nh-border);
    min-width: 52px;
    text-align: center;
}
.nh-gantt-year button {
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--nh-text-2);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color .15s;
    line-height: 1;
}
.nh-gantt-year button:hover { color: var(--nh-mint); }

/* Main Gantt grid */
.nh-gantt {
    overflow-x: auto;
    overflow-y: visible;
    /* keep horizontal scroll but let tooltips escape vertically */
    clip-path: none;
}

/* Rows */
.nh-gantt__row {
    display: flex;
    align-items: stretch;
    min-height: 36px;
    border-bottom: 1px solid var(--nh-border);
}
.nh-gantt__row:last-child { border-bottom: none; }
.nh-gantt__row--hdr {
    min-height: 44px;
    border-bottom: 1px solid var(--nh-border-light);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--nh-surface);
}

/* Label column */
.nh-gantt__lbl {
    flex-shrink: 0;
    width: 220px;
    padding: 0 12px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    border-right: 1px solid var(--nh-border);
}
.nh-gantt__pcode {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    color: var(--nh-mint);
    background: var(--nh-mint-dim);
    border-radius: 4px;
    padding: 1px 5px;
    letter-spacing: .04em;
    white-space: nowrap;
}
.nh-gantt__pname {
    font-size: 12px;
    color: var(--nh-text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.nh-gantt__od-dot {
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--nh-red);
}

/* Bar area */
.nh-gantt__bars {
    flex: 1;
    position: relative;
    min-width: 400px;
    overflow: visible;
}

/* Quarter alternating bands */
.nh-gantt__qband {
    position: absolute;
    top: 0; bottom: 0;
    width: 25%;
    background: transparent;
    pointer-events: none;
}
.nh-gantt__qband--alt {
    background: rgba(255,255,255,0.018);
}

/* Quarter label (header only) */
.nh-gantt__qlbl {
    position: absolute;
    top: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--nh-text-3);
    text-transform: uppercase;
    pointer-events: none;
}

/* Month label (header only) */
.nh-gantt__mlbl {
    position: absolute;
    bottom: 6px;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 500;
    color: var(--nh-text-3);
    white-space: nowrap;
    pointer-events: none;
}
.nh-gantt__mlbl--cur {
    color: var(--nh-mint);
    font-weight: 700;
}

/* Month grid lines */
.nh-gantt__mgrid {
    position: absolute;
    top: 0; bottom: 0;
    width: 1px;
    background: var(--nh-border);
    opacity: 0.5;
    pointer-events: none;
}

/* Today marker in header */
.nh-gantt__today-hdr {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--nh-mint);
    box-shadow: 0 0 6px var(--nh-mint-glow);
    pointer-events: none;
}
.nh-gantt__today-label {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--nh-mint);
    color: var(--nh-bg);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
    margin-bottom: 2px;
    letter-spacing: .04em;
}

/* Today line in data rows */
.nh-gantt__today-line {
    position: absolute;
    top: 0; bottom: 0;
    width: 2px;
    background: var(--nh-mint);
    opacity: 0.6;
    box-shadow: 0 0 4px var(--nh-mint-glow);
    pointer-events: none;
    z-index: 1;
}

/* Project bar */
.nh-gantt__bar {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--gc) 22%, transparent);
    border: 1px solid var(--gc);
    z-index: 2;
    min-width: 4px;
    transition: box-shadow .15s, z-index 0s;
    cursor: default;
    overflow: visible;
}
.nh-gantt__bar:hover {
    box-shadow: 0 0 10px color-mix(in srgb, var(--gc) 40%, transparent);
    z-index: 100;
}
.nh-gantt__bar--overdue {
    border-style: dashed;
    opacity: 0.75;
}

/* Bar inner (clipped text content) */
.nh-gantt__bar-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 6px;
    height: 100%;
    overflow: hidden;
    border-radius: 5px;
}
.nh-gantt__bar-text {
    font-size: 9px;
    font-weight: 700;
    color: var(--gc);
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.nh-gantt__bar-staff {
    flex-shrink: 0;
    font-size: 9px;
    font-weight: 600;
    color: var(--gc);
    opacity: 0.8;
    background: rgba(0,0,0,0.25);
    border-radius: 3px;
    padding: 0 4px;
    line-height: 14px;
    white-space: nowrap;
}
.nh-gantt__arrow {
    flex-shrink: 0;
    font-size: 7px;
    color: var(--gc);
    opacity: 0.7;
}
.nh-gantt__arrow--l { margin-right: 1px; }
.nh-gantt__arrow--r { margin-left: 1px; }

/* Fixed tooltip — rendered outside the scroll container, position: fixed */
.nh-gantt-ftip {
    position: fixed;
    transform: translateX(-50%) translateY(-100%) translateY(-14px);
    z-index: 9999;
    background: var(--nh-surface-3);
    border: 1px solid var(--nh-border-light);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 230px;
    max-width: 290px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.05);
    pointer-events: none;
    white-space: normal;
}
.nh-gantt-ftip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top-color: var(--nh-border-light);
}
.nh-gantt-ftip__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--nh-text);
    margin-bottom: 7px;
    line-height: 1.4;
}
.nh-gantt-ftip__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.nh-gantt-ftip__code {
    font-size: 10px;
    font-weight: 700;
    color: var(--nh-mint);
    background: var(--nh-mint-dim);
    border-radius: 4px;
    padding: 1px 6px;
    letter-spacing: .04em;
}
.nh-gantt-ftip__status {
    font-size: 10px;
    font-weight: 600;
    color: var(--tc);
    background: color-mix(in srgb, var(--tc) 15%, transparent);
    border-radius: 4px;
    padding: 1px 6px;
}
.nh-gantt-ftip__overdue {
    font-size: 10px;
    font-weight: 600;
    color: var(--nh-red);
    background: var(--nh-red-dim);
    border-radius: 4px;
    padding: 1px 6px;
}
.nh-gantt-ftip__div {
    height: 1px;
    background: var(--nh-border);
    margin: 8px 0;
}
.nh-gantt-ftip__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--nh-text);
    margin-bottom: 4px;
    gap: 16px;
}
.nh-gantt-ftip__row:last-child { margin-bottom: 0; }
.nh-gantt-ftip__row > span:first-child { color: var(--nh-text-3); flex-shrink: 0; }
.nh-gantt-ftip__rem { color: var(--nh-mint); font-weight: 600; }

/* Legend row */
.nh-gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--nh-border);
}
.nh-gantt-leg__item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--nh-text-3);
}
.nh-gantt-leg__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.nh-gantt-leg__cnt {
    font-weight: 600;
    color: var(--nh-text-2);
}
.nh-gantt-leg__today-line {
    display: inline-block;
    width: 2px;
    height: 12px;
    background: var(--nh-mint);
    border-radius: 1px;
    flex-shrink: 0;
}
