/* ============================================================
   ShiftCore — shiftcore.css (Phase 2.5 UI redesign)
   Glassmorphism light-blue theme. RTL, Vazirmatn.
   Loaded after site.css; overrides Bootstrap 5 defaults only
   through classes — no behaviour, routes or markup logic change.
   No external dependencies: pure CSS, works offline.
   ============================================================ */

:root {
    --sc-deep: #0b3d91;
    --sc-blue: #1565d8;
    --sc-sky: #38a1f2;
    --sc-sky-soft: #d6e9ff;
    --sc-ink: #0f2a44;
    --sc-ink-soft: #3d5a78;
    --sc-glass: rgba(255, 255, 255, 0.72);
    --sc-glass-strong: rgba(255, 255, 255, 0.85);
    --sc-border: rgba(255, 255, 255, 0.65);
    --sc-shadow: 0 10px 30px rgba(11, 61, 145, 0.10);
    --sc-radius: 18px;
}

/* ---------- Page background & type ---------- */
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--sc-ink);
    background:
        radial-gradient(1100px 480px at 85% -10%, rgba(56, 161, 242, 0.22), transparent 60%),
        radial-gradient(900px 420px at 5% 0%, rgba(21, 101, 216, 0.16), transparent 55%),
        linear-gradient(180deg, #eaf4ff 0%, #e2efff 42%, #f6fbff 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

main {
    padding-top: 0.5rem;
}

h1, h2, h3, h4, h5 {
    color: var(--sc-ink);
}

.page-title {
    font-weight: 800;
    color: var(--sc-deep);
    font-size: 1.65rem;
    margin-bottom: 0;
    padding-bottom: 0.35rem;
    position: relative;
}

.page-title::after {
    content: "";
    display: block;
    width: 64px;
    height: 4px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sc-blue), var(--sc-sky));
}

.page-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.text-muted {
    color: var(--sc-ink-soft) !important;
}

/* ---------- Gradient glass navbar ---------- */
/* Phase 13 — the navbar is ALWAYS visible (sticky) on every page: the
   sticky positioning lives on the <header> itself, NOT on the <nav>.
   The nav already had `position: sticky` here, but it never engaged:
   the nav's parent is the <header>, which is exactly nav-height, so
   the nav had zero sticky range and scrolled away with the header.
   Sticking the header (whose parent is <body>) pins the whole bar at
   viewport top:0. z-index 1030 sits above the roster shell (20) and
   roster toolbar (30) and below modals (1060) and the cell combobox
   (1070); the navbar dropdowns render inside the header's stacking
   context, so they stay above the grid too. The trial/seed banner
   lives inside <main> and still scrolls away, as before. */
.shiftcore-header {
    position: sticky;
    top: 0;
    z-index: 1030;
}

.shiftcore-navbar {
    background: linear-gradient(90deg, #0a2f6e 0%, var(--sc-deep) 28%, var(--sc-blue) 62%, var(--sc-sky) 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 8px 28px rgba(11, 61, 145, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.shiftcore-brand {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.shiftcore-navbar .nav-link {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.4rem 0.95rem !important;
    margin-inline-start: 0.15rem;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.shiftcore-navbar .nav-link:hover,
.shiftcore-navbar .nav-link:focus {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.shiftcore-navbar .btn-outline-light {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 999px;
    font-weight: 600;
}

.shiftcore-navbar .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
}

/* ---------- Glass buttons ---------- */
.btn {
    border-radius: 12px;
    font-weight: 700;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn-primary,
.btn-glass {
    background: linear-gradient(135deg, rgba(56, 161, 242, 0.92) 0%, rgba(21, 101, 216, 0.94) 100%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 22px rgba(21, 101, 216, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-glass:hover,
.btn-glass:focus {
    background: linear-gradient(135deg, rgba(96, 180, 250, 0.95) 0%, rgba(37, 140, 251, 0.96) 100%);
    border-color: rgba(255, 255, 255, 0.75);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(37, 140, 251, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:active,
.btn-glass:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(21, 101, 216, 0.35);
}

/* Glass secondary / ghost buttons */
.btn-outline-secondary,
.btn-ghost {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(21, 101, 216, 0.28);
    color: #0b4ea2;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(11, 61, 145, 0.08);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-ghost:hover,
.btn-ghost:focus {
    background: rgba(255, 255, 255, 0.92);
    border-color: var(--sc-sky);
    color: var(--sc-deep);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(56, 161, 242, 0.25);
}

.btn-outline-primary {
    background: rgba(214, 233, 255, 0.55);
    border: 1px solid rgba(21, 101, 216, 0.4);
    color: var(--sc-deep);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: linear-gradient(135deg, rgba(56, 161, 242, 0.92), rgba(21, 101, 216, 0.94));
    border-color: rgba(255, 255, 255, 0.55);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(37, 140, 251, 0.4);
}

.btn-outline-warning {
    background: rgba(255, 243, 205, 0.6);
    border: 1px solid rgba(190, 140, 0, 0.35);
    color: #7a5b00;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background: rgba(255, 243, 205, 0.95);
    border-color: #d9a400;
    color: #5f4700;
    transform: translateY(-1px);
}

.btn-sm {
    border-radius: 10px;
    padding: 0.32rem 0.75rem;
    font-size: 0.85rem;
}

.btn-lg {
    border-radius: 14px;
    padding: 0.7rem 1.6rem;
}

.btn:focus-visible,
.btn-primary:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.page-link:focus-visible,
.nav-link:focus-visible {
    outline: 3px solid rgba(56, 161, 242, 0.55);
    outline-offset: 2px;
}

/* ---------- Glass cards ---------- */
.card {
    background: var(--sc-glass);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
}

.card-header {
    background: linear-gradient(90deg, rgba(214, 233, 255, 0.75), rgba(234, 244, 255, 0.55));
    border-bottom: 1px solid rgba(21, 101, 216, 0.14);
    color: var(--sc-deep);
    font-weight: 800;
    border-radius: var(--sc-radius) var(--sc-radius) 0 0 !important;
    padding: 0.85rem 1.15rem;
}

/* ---------- Dashboard stat cards ---------- */
.stat-card {
    border: none;
    border-radius: 20px;
    color: #fff;
    overflow: hidden;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    top: -52px;
    inset-inline-start: -38px;
    pointer-events: none;
}

.stat-card .card-body {
    position: relative;
    z-index: 1;
    padding: 1.35rem 1rem 1.15rem;
}

.stat-card h3,
.stat-card p {
    color: #fff;
    margin-bottom: 0;
}

.stat-card .stat-number {
    color: #fff;
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    -webkit-text-stroke: 0.25px rgba(0, 0, 0, 0.22);
}

.stat-card .stat-label {
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    margin-top: 0.15rem;
}

.stat-card .stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 0.6rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-size: 1.7rem;
    line-height: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(11, 61, 145, 0.28);
}

.stat-card--blue   { background: linear-gradient(135deg, #0b3d91 0%, #1565d8 55%, #38a1f2 100%); }
.stat-card--sky    { background: linear-gradient(135deg, #0e7490 0%, #0284c7 55%, #38bdf8 100%); }
.stat-card--teal   { background: linear-gradient(135deg, #0f766e 0%, #14b8a6 60%, #2dd4bf 100%); }
.stat-card--violet { background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 55%, #a78bfa 100%); }
.stat-card--green  { background: linear-gradient(135deg, #14532d 0%, #16a34a 55%, #4ade80 100%); }
.stat-card--amber  { background: linear-gradient(135deg, #92400e 0%, #d97706 55%, #fbbf24 100%); }

/* ---------- Tables ---------- */
.table-card {
    overflow: hidden;
    border-radius: var(--sc-radius);
}

.table-card .table-responsive {
    border-radius: var(--sc-radius);
}

.shiftcore-table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
}

.shiftcore-table thead th {
    background: linear-gradient(90deg, #dceeff, #cfe6ff);
    color: var(--sc-deep);
    font-weight: 800;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(21, 101, 216, 0.18);
    padding: 0.85rem 0.9rem;
    white-space: nowrap;
}

.shiftcore-table tbody td {
    padding: 0.75rem 0.9rem;
    vertical-align: middle;
    border-color: rgba(11, 61, 145, 0.07);
    background: transparent;
}

.shiftcore-table.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(56, 161, 242, 0.05);
}

.shiftcore-table tbody tr {
    transition: background 0.15s ease;
}

.shiftcore-table tbody tr:hover > * {
    --bs-table-accent-bg: rgba(56, 161, 242, 0.10);
    background: rgba(56, 161, 242, 0.10);
}

.shiftcore-table tbody tr td:first-child {
    font-weight: 700;
    color: var(--sc-ink);
}

/* ---------- Badges / pills ---------- */
.badge {
    border-radius: 999px;
    padding: 0.42em 0.85em;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.badge.bg-success {
    background-color: #d8f3e3 !important;
    color: #146c43 !important;
    border: 1px solid #a9e2c0;
}

.badge.bg-danger {
    background-color: #fde3e3 !important;
    color: #a50e0e !important;
    border: 1px solid #f3b0b0;
}

.badge.bg-secondary {
    background-color: #e6edf5 !important;
    color: #44566b !important;
    border: 1px solid #cbd8e6;
}

/* ---------- Forms ---------- */
.form-card {
    border-radius: 20px;
}

.form-label {
    font-weight: 700;
    color: #123a63;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    border-radius: 12px;
    border: 1px solid rgba(11, 61, 145, 0.20);
    background-color: rgba(255, 255, 255, 0.88);
    padding: 0.55rem 0.9rem;
    color: var(--sc-ink);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: rgba(56, 161, 242, 0.55);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sc-sky);
    background-color: #fff;
    box-shadow: 0 0 0 0.25rem rgba(56, 161, 242, 0.28);
}

.form-control::placeholder {
    color: #8aa0b5;
}

.form-check-input {
    border-radius: 6px;
    border-color: rgba(11, 61, 145, 0.35);
}

.form-check-input:checked {
    background-color: var(--sc-blue);
    border-color: var(--sc-blue);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(56, 161, 242, 0.28);
}

.filter-card .card-body {
    padding: 1rem 1.15rem;
}

/* ---------- Alerts, lists, pagination ---------- */
.alert {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(11, 61, 145, 0.08);
}

.alert-info {
    background: rgba(214, 233, 255, 0.75);
    color: #0b3d91;
}

.alert-secondary {
    background: rgba(255, 255, 255, 0.75);
    color: var(--sc-ink-soft);
}

.list-group-item {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(21, 101, 216, 0.14);
    border-radius: 12px !important;
    margin-bottom: 0.5rem;
    color: var(--sc-deep);
    font-weight: 600;
    transition: background 0.18s ease, transform 0.18s ease;
}

.list-group-item:hover,
.list-group-item:focus {
    background: rgba(214, 233, 255, 0.9);
    transform: translateY(-1px);
}

.pagination .page-link {
    border-radius: 10px;
    margin-inline-start: 0.3rem;
    color: #0b4ea2;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(21, 101, 216, 0.2);
    font-weight: 600;
}

.pagination .page-link:hover {
    background: rgba(214, 233, 255, 0.95);
    color: var(--sc-deep);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, var(--sc-sky), var(--sc-blue));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 16px rgba(37, 140, 251, 0.4);
}

/* ---------- Home hero & feature cards ---------- */
.hero h1 {
    font-weight: 800;
    background: linear-gradient(135deg, var(--sc-deep), var(--sc-blue) 55%, var(--sc-sky));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(11, 61, 145, 0.16);
}

.feature-card h5 {
    color: var(--sc-deep);
    font-weight: 800;
}

/* ---------- Footer ---------- */
.shiftcore-footer {
    background: transparent;
    border-top: 1px solid rgba(21, 101, 216, 0.15) !important;
    color: var(--sc-ink-soft);
    padding: 1.1rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.4rem;
    }

    .stat-card .stat-number {
        font-size: 1.75rem;
    }

    .stat-card .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 1.45rem;
    }

    .shiftcore-navbar .nav-link {
        margin-inline-start: 0;
    }

    .table-card .btn {
        margin-bottom: 0.3rem;
    }

    .shiftcore-table thead th,
    .shiftcore-table tbody td {
        padding: 0.6rem 0.65rem;
        font-size: 0.92rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn,
    .stat-card,
    .feature-card,
    .list-group-item,
    .shiftcore-navbar .nav-link {
        transition: none;
    }

    .btn-primary:hover,
    .stat-card:hover,
    .feature-card:hover {
        transform: none;
    }
}

/* ---------- Grouped dropdown navigation (Phase 6) ---------- */
/* Active top-level link / open section: filled glass pill on the gradient bar. */
.shiftcore-navbar .nav-link.active {
    background: rgba(255, 255, 255, 0.28) !important;
    color: #fff !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.shiftcore-navbar .dropdown-menu {
    background: var(--sc-glass-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--sc-border);
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(11, 61, 145, 0.22);
    padding: 0.4rem;
    min-width: 13rem;
}

.shiftcore-navbar .dropdown-item {
    color: var(--sc-ink);
    font-weight: 600;
    border-radius: 10px;
    padding: 0.5rem 0.9rem;
}

.shiftcore-navbar .dropdown-item:hover,
.shiftcore-navbar .dropdown-item:focus {
    background: rgba(214, 233, 255, 0.9);
    color: var(--sc-deep);
}

.shiftcore-navbar .dropdown-item.active,
.shiftcore-navbar .dropdown-item:active {
    background: linear-gradient(135deg, var(--sc-sky), var(--sc-blue));
    color: #fff;
}

/* Inside the collapsed (mobile) navbar the menu sits on the gradient bar,
   so it stays translucent dark instead of a white card. */
@media (max-width: 575.98px) {
    .shiftcore-navbar .dropdown-menu {
        background: rgba(255, 255, 255, 0.12);
        border-color: rgba(255, 255, 255, 0.25);
        box-shadow: none;
    }

    .shiftcore-navbar .dropdown-item {
        color: rgba(255, 255, 255, 0.92);
    }

    .shiftcore-navbar .dropdown-item:hover,
    .shiftcore-navbar .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.18);
        color: #fff;
    }
}

/* ---------- Phase 9 — profile avatars & navbar user chip ---------- */
/* Shared avatar (Views/Shared/_Avatar.cshtml): photo or coloured initials circle. */
.sc-avatar {
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 14px rgba(11, 61, 145, 0.18);
    background: var(--sc-sky-soft);
}

.sc-avatar-sm { width: 32px; height: 32px; }
.sc-avatar-md { width: 64px; height: 64px; }
.sc-avatar-lg { width: 96px; height: 96px; }
.sc-avatar-chip { width: 36px; height: 36px; }

.sc-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    line-height: 1;
}

.sc-avatar-sm.sc-avatar-initials { font-size: 1rem; }
.sc-avatar-md.sc-avatar-initials { font-size: 1.8rem; }
.sc-avatar-lg.sc-avatar-initials { font-size: 2.6rem; }
.sc-avatar-chip.sc-avatar-initials { font-size: 1.05rem; }

/* Deterministic palette for initials circles (index = name hash % 7). */
.sc-avatar-color-0 { background: linear-gradient(135deg, #1565d8, #38a1f2); }
.sc-avatar-color-1 { background: linear-gradient(135deg, #0e7490, #38bdf8); }
.sc-avatar-color-2 { background: linear-gradient(135deg, #0f766e, #2dd4bf); }
.sc-avatar-color-3 { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
.sc-avatar-color-4 { background: linear-gradient(135deg, #16a34a, #4ade80); }
.sc-avatar-color-5 { background: linear-gradient(135deg, #d97706, #fbbf24); }
.sc-avatar-color-6 { background: linear-gradient(135deg, #be185d, #f472b6); }

/* Name + avatar inline in list tables. */
.sc-name-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

/* Navbar user chip (avatar + name + Persian role, dropdown toggle). */
.navbar-user-nav {
    align-items: center;
}

.navbar-user-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 0.55rem;
    padding: 0.25rem 0.7rem !important;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.navbar-user-chip:hover,
.navbar-user-chip:focus {
    background: rgba(255, 255, 255, 0.26) !important;
}

.navbar-user-chip::after {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
    text-align: start;
}

.navbar-user-name {
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
}

.navbar-user-role {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Logout is a form button inside the chip dropdown — make it look like a menu item. */
.shiftcore-navbar .dropdown-menu form .dropdown-item {
    width: 100%;
    text-align: start;
    background: transparent;
    border: 0;
}

/* Profile page. */
.profile-card .profile-avatar-wrap {
    display: flex;
    justify-content: center;
}

@media (max-width: 575.98px) {
    .navbar-user-nav {
        margin-top: 0.5rem;
    }

    .sc-avatar-md { width: 52px; height: 52px; }
    .sc-avatar-lg { width: 80px; height: 80px; }
}

/* ---------- Phase 12 — Form help («؟» button + modal) ---------- */
/* Small glass button, placed in a slim bar above the form card (end
   corner in RTL = left). It never takes a full row of its own height
   and does not shift the form layout on mobile. */
.fh-help-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.fh-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 34px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: linear-gradient(135deg, rgba(56, 161, 242, 0.92) 0%, rgba(21, 101, 216, 0.94) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(21, 101, 216, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fh-help-btn:hover,
.fh-help-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 140, 251, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    color: #fff;
    outline: none;
}

.fh-help-btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(56, 161, 242, 0.4);
}

.fh-help-btn [aria-hidden="true"] {
    font-size: 1.05rem;
    font-weight: 700;
}

/* Modal: above the Jalali date-picker popup (z-index 1050) and Bootstrap
   modals, so it always stays on top while open. */
.fh-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.fh-modal[hidden] {
    display: none;
}

.fh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 35, 66, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.fh-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    color: var(--sc-ink, #123a63);
    border: 1px solid rgba(21, 101, 216, 0.25);
    border-radius: 20px;
    box-shadow: 0 1rem 3rem rgba(10, 35, 66, 0.35);
    overflow: hidden;
}

.fh-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid rgba(11, 61, 145, 0.15);
    background: linear-gradient(135deg, rgba(56, 161, 242, 0.12) 0%, rgba(21, 101, 216, 0.08) 100%);
}

.fh-modal-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0b4ea2;
}

.fh-modal-close {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0.25rem 0.55rem;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.fh-modal-close:hover,
.fh-modal-close:focus-visible {
    background: rgba(11, 61, 145, 0.1);
    outline: none;
}

.fh-modal-body {
    padding: 1rem 1.1rem;
    overflow-y: auto;
}

.fh-help-list {
    margin: 0;
}

.fh-help-item {
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(11, 61, 145, 0.1);
}

.fh-help-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.fh-help-item dt {
    font-weight: 700;
    color: #0b4ea2;
    margin-bottom: 0.15rem;
}

.fh-help-item dd {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.8;
}

.fh-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem 1.1rem;
    border-top: 1px solid rgba(11, 61, 145, 0.15);
}

body.fh-no-scroll {
    overflow: hidden;
}

@media (max-width: 575.98px) {
    .fh-help-btn-text {
        display: none;
    }

    .fh-modal {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .fh-modal-dialog {
        max-height: 88vh;
    }
}


/* فهرست پرسنل: اسکرول مستقل ردیف‌ها و سرستون چسبان */
.staff-table-card {
    overflow: hidden;
}

.staff-list-scroll {
    max-height: clamp(240px, calc(100vh - 350px), 720px);
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.staff-list-scroll .shiftcore-table {
    min-width: 1080px;
}

.staff-list-scroll .shiftcore-table thead th {
    position: sticky;
    inset-block-start: 0;
    z-index: 5;
    background: #dceeff;
    box-shadow: 0 2px 5px rgba(11, 61, 145, 0.12);
}

.staff-list-scroll .shiftcore-table tbody td {
    background-color: rgba(255, 255, 255, 0.94);
}

.staff-list-scroll .shiftcore-table tbody tr:nth-child(even) td {
    background-color: rgba(244, 249, 255, 0.96);
}

.staff-list-scroll .shiftcore-table tbody tr:hover td {
    background-color: rgba(219, 234, 254, 0.98);
}

.staff-scheduling-cell {
    min-width: 245px;
}

.staff-scheduling-form {
    display: grid;
    grid-template-columns: minmax(128px, 1fr) auto auto;
    align-items: end;
    gap: 7px;
    min-width: 230px;
}

.staff-experience-control {
    display: grid;
    gap: 3px;
    color: var(--sc-ink-soft);
    font-size: 0.76rem;
    font-weight: 700;
}

.staff-experience-control .form-select {
    min-width: 128px;
    padding: 0.38rem 1.8rem 0.38rem 0.55rem;
    border-radius: 9px;
    font-size: 0.84rem;
}

.staff-combined-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 38px;
    color: var(--sc-ink);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.staff-combined-toggle input {
    width: 17px;
    height: 17px;
    accent-color: #4f46e5;
}

.staff-scheduling-form .btn {
    white-space: nowrap;
}

.staff-scheduling-status {
    grid-column: 1 / -1;
    min-height: 1.15rem;
    color: #166534;
    font-size: 0.76rem;
}

@media (max-width: 768px) {
    .staff-list-scroll {
        max-height: clamp(240px, calc(100vh - 310px), 620px);
    }

    .staff-list-scroll .shiftcore-table thead th,
    .staff-list-scroll .shiftcore-table tbody td {
        padding: 0.55rem 0.65rem;
    }

    .staff-scheduling-form {
        grid-template-columns: minmax(120px, 1fr) auto auto;
        gap: 6px;
    }
}


/* نوار ثابت بالای فرم پرسنل و منوی فشرده اقدام‌های هر ردیف */
.staff-page-top {
    position: sticky;
    inset-block-start: 0;
    z-index: 30;
    margin: -0.25rem -0.25rem 0.75rem;
    padding: 0.55rem 0.75rem 0.35rem;
    border: 1px solid rgba(21, 101, 216, 0.12);
    border-radius: 0 0 14px 14px;
    background: rgba(239, 247, 255, 0.96);
    box-shadow: 0 6px 18px rgba(11, 61, 145, 0.10);
    backdrop-filter: blur(12px);
}

.staff-page-top .page-title {
    margin-bottom: 0.45rem;
}

.staff-page-actions {
    margin-bottom: 0.25rem !important;
}

.staff-page-actions .btn {
    white-space: nowrap;
}

.staff-row-number {
    width: 58px;
    min-width: 58px;
    text-align: center;
    color: var(--sc-ink-soft) !important;
    font-variant-numeric: tabular-nums;
}

.staff-quick-add-row > td {
    background: #eff6ff !important;
    vertical-align: middle;
}

.staff-actions-trigger {
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(21, 101, 216, 0.25);
    border-radius: 9px;
    background: #fff;
    color: var(--sc-deep);
    font-size: 0.83rem;
    font-weight: 700;
    white-space: nowrap;
}

.staff-full-name {
    display: block;
    white-space: nowrap;
}

.staff-filter-bar .card-body {
    padding: 0.55rem 0.65rem;
}

.staff-filter-bar .form-label {
    margin-bottom: 0.2rem;
    font-size: 0.85rem;
}

.staff-actions-list {
    position: fixed;
    inset: auto;
    box-sizing: border-box;
    width: min(192px, calc(100vw - 16px));
    margin: 0;
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(21, 101, 216, 0.18);
    border-radius: 11px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.16);
}

.staff-actions-list:popover-open {
    display: grid;
    gap: 4px;
}

.staff-actions-list .btn,
.staff-actions-list form {
    width: 100%;
}

.staff-actions-list .btn {
    white-space: normal;
    text-align: start;
    padding: 0.4rem 0.55rem;
}

@media (max-width: 768px) {
    .staff-page-top {
        margin-inline: -0.5rem;
        padding-inline: 0.6rem;
    }

    .staff-page-actions {
        gap: 0.35rem !important;
    }

    .staff-page-actions .btn {
        padding: 0.45rem 0.65rem;
        font-size: 0.82rem;
    }
}

.staff-list-scroll .shiftcore-table {
    min-width: 0;
}

.staff-list-scroll .shiftcore-table tbody td,
.staff-list-scroll .shiftcore-table thead th {
    padding-inline: 0.55rem;
}

.staff-scheduling-status:empty {
    display: none;
}



.staff-table-card { container-type: inline-size; }
.staff-list-scroll .shiftcore-table { width: 100%; table-layout: auto; }
.staff-identity > div { display: grid; justify-items: start; gap: .15rem; }
.staff-identity small, .staff-full-name { white-space: nowrap; }
.staff-list-scroll .staff-scheduling-form { grid-template-columns: minmax(7.8rem,1fr) auto auto; align-items: center; }
.staff-list-scroll .staff-experience-control .form-select { min-width: 0; }
.quick-staff-add-form { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,1.5fr) minmax(0,1.5fr) minmax(0,.65fr) auto; gap: .5rem; align-items: end; }
.quick-staff-add-form label { display: grid; min-width: 0; gap: .2rem; font-size: .8rem; }
.quick-staff-add-form :is(input,select) { min-width: 0; width: 100%; }
@container (max-width: 72rem) {
    .staff-list-scroll table, .staff-list-scroll tbody { display: block; }
    .staff-list-scroll thead { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
    .staff-list-scroll tbody tr:not([hidden]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem .75rem; padding: .75rem; border-bottom: 2px solid #cbdff3; }
    .staff-list-scroll .shiftcore-table tbody td { min-width: 0; width: auto; padding: .2rem; border: 0; overflow-wrap: anywhere; background: transparent; }
    .staff-list-scroll td[data-label]::before { content: attr(data-label) " "; color: #52677c; font-size: .8rem; }
    .staff-list-scroll .staff-row-number { grid-column: 2; grid-row: 1; justify-self: end; }
    .staff-list-scroll .staff-identity { grid-column: 1 / -1; grid-row: 1; padding-inline-end: 3rem; }
    .staff-identity > div { min-width: 0; }
    .staff-identity .staff-full-name { max-width: 100%; overflow-x: auto; }
    .staff-quick-add-row td:first-child { display: none; }
    .staff-scheduling-cell, .staff-quick-add-row td { grid-column: 1 / -1; }
}
@container (max-width: 38rem) {
    .quick-staff-add-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .quick-staff-add-form button { grid-column: 1 / -1; }
    .staff-list-scroll .staff-scheduling-form { min-width: 0; grid-template-columns: minmax(0,1fr) auto; }
    .staff-scheduling-form .btn { justify-self: start; }
}


.staff-reminder-count {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 0 3px;
    border-radius: 4px;
    background: #fff1cb;
    color: #714600;
    font-size: .65rem;
    line-height: 1.35;
    white-space: nowrap;
}

.staff-reminder-count[hidden] { display: none; }
