/* Staff Hound Portal — Design System */
:root {
    --sh-blue: #003399;
    --sh-blue-light: #1a4db3;
    --sh-blue-dark: #002266;
    --sh-red: #E30613;
    --sh-red-soft: rgba(227, 6, 19, 0.12);
    --sh-navy: #0c1a3a;
    /* Light sidebar palette */
    --sh-sidebar-bg: #ffffff;
    --sh-sidebar-border: #e8edf6;
    --sh-sidebar-hover: #f2f6fc;
    --sh-sidebar-active-bg: rgba(0, 51, 153, 0.08);
    --sh-sidebar-text: #475569;
    --sh-sidebar-text-muted: #94a3b8;
    --sh-sidebar-icon-bg: #f1f5fb;
    --sh-body-bg: #eef2f8;
    --sh-surface: #ffffff;
    --sh-border: #e2e8f0;
    --sh-text: #1e293b;
    --sh-text-muted: #64748b;
    --sh-sidebar-width: 268px;
    --sh-sidebar-collapsed: 76px;
    --sh-topbar-height: 68px;
    --sh-radius: 12px;
    --sh-shadow: 0 1px 3px rgba(0, 51, 153, 0.06), 0 4px 16px rgba(0, 51, 153, 0.04);
    --sh-shadow-lg: 0 8px 32px rgba(0, 51, 153, 0.1);
    --sh-transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background: var(--sh-body-bg);
    color: var(--sh-text);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ─── Shell ─── */
.portal-shell {
    display: flex;
    min-height: 100vh;
}

.portal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sh-sidebar-width);
    transition: margin-left var(--sh-transition);
}

.portal-shell.sidebar-collapsed .portal-main {
    margin-left: var(--sh-sidebar-collapsed);
}

/* ─── Sidebar ─── */
.portal-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sh-sidebar-width);
    height: 100vh;
    background: var(--sh-sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: width var(--sh-transition), transform var(--sh-transition);
    border-right: 1px solid var(--sh-sidebar-border);
    box-shadow: 0 0 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.portal-shell.sidebar-collapsed .portal-sidebar {
    width: var(--sh-sidebar-collapsed);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.15rem;
    border-bottom: 1px solid var(--sh-sidebar-border);
    min-height: 72px;
}

.brand-link { display: block; line-height: 0; }

.brand-logo {
    max-height: 38px;
    width: auto;
    transition: opacity var(--sh-transition);
}

.portal-shell.sidebar-collapsed .brand-logo {
    max-height: 32px;
}

.sidebar-collapse-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--sh-sidebar-border);
    background: var(--sh-sidebar-icon-bg);
    color: var(--sh-sidebar-text-muted);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--sh-transition);
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: var(--sh-blue);
    border-color: var(--sh-blue);
    color: #fff;
}

.portal-shell.sidebar-collapsed .sidebar-collapse-btn i {
    transform: rotate(180deg);
}

/* Nav */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.85rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.nav-group { margin-bottom: 0.75rem; }

.nav-group-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sh-sidebar-text-muted);
    padding: 0 0.65rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    transition: opacity var(--sh-transition);
}

.portal-shell.sidebar-collapsed .nav-group-label {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.7rem;
    margin-bottom: 0.1rem;
    border-radius: 10px;
    color: var(--sh-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--sh-transition);
    position: relative;
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.portal-shell.sidebar-collapsed .nav-badge {
    position: absolute;
    top: 0.15rem;
    right: 0.15rem;
    margin-left: 0;
    min-width: 1rem;
    height: 1rem;
    line-height: 1rem;
    padding: 0 0.28rem;
    font-size: 0.58rem;
}

.nav-item:hover {
    background: var(--sh-sidebar-hover);
    color: var(--sh-blue);
}

.nav-item.active {
    background: var(--sh-sidebar-active-bg);
    color: var(--sh-blue-dark);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 62%;
    background: var(--sh-red);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--sh-sidebar-icon-bg);
    color: var(--sh-sidebar-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    transition: all var(--sh-transition);
}

.nav-item:hover .nav-icon {
    background: #e2ebfa;
    color: var(--sh-blue);
}

.nav-item.active .nav-icon {
    background: linear-gradient(135deg, var(--sh-blue), var(--sh-blue-light));
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 51, 153, 0.25);
}

.nav-text {
    transition: opacity var(--sh-transition);
}

.portal-shell.sidebar-collapsed .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.portal-shell.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 0.65rem;
}

.portal-shell.sidebar-collapsed .nav-icon {
    width: 40px;
    height: 40px;
}

/* Sidebar stats */
.sidebar-stats-card {
    background: linear-gradient(160deg, #f7faff, #eef3fc);
    border: 1px solid var(--sh-sidebar-border);
    border-radius: 12px;
    padding: 0.65rem 0.85rem;
}

.portal-shell.sidebar-collapsed .sidebar-stats-group {
    display: none;
}

.sidebar-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0;
    font-size: 0.78rem;
}

.sidebar-stat-row + .sidebar-stat-row {
    border-top: 1px solid var(--sh-sidebar-border);
}

.sidebar-stat-label { color: var(--sh-sidebar-text); }

.sidebar-stat-value {
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--sh-blue), var(--sh-blue-light));
    padding: 0.1rem 0.55rem;
    border-radius: 20px;
    font-size: 0.72rem;
    min-width: 28px;
    text-align: center;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 1rem 0.85rem;
    border-top: 1px solid var(--sh-sidebar-border);
    background: #f8fafd;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--sh-red), #ff4757);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.35);
}

.user-info { min-width: 0; transition: opacity var(--sh-transition); }

.portal-shell.sidebar-collapsed .user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.7rem;
    color: var(--sh-sidebar-text-muted);
    text-transform: capitalize;
}

.sidebar-logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem;
    border: 1px solid var(--sh-sidebar-border);
    background: #ffffff;
    color: var(--sh-sidebar-text);
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--sh-transition);
}

.sidebar-logout-btn:hover {
    background: var(--sh-red-soft);
    border-color: rgba(227, 6, 19, 0.4);
    color: var(--sh-red);
}

.portal-shell.sidebar-collapsed .sidebar-logout-btn span {
    display: none;
}

.portal-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

/* Mobile overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.show { display: block; }

/* ─── Topbar ─── */
.portal-topbar {
    height: var(--sh-topbar-height);
    background: var(--sh-surface);
    border-bottom: 1px solid var(--sh-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: var(--sh-shadow);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.topbar-menu-btn {
    width: 40px;
    height: 40px;
    border: 1px solid var(--sh-border);
    background: var(--sh-surface);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--sh-blue);
    cursor: pointer;
    transition: all var(--sh-transition);
}

.topbar-menu-btn:hover {
    background: var(--sh-body-bg);
    border-color: var(--sh-blue);
}

.topbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--sh-blue-dark);
    margin: 0;
    line-height: 1.2;
}

.topbar-breadcrumb {
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.topbar-breadcrumb .breadcrumb-item a {
    color: var(--sh-text-muted);
    text-decoration: none;
}

.topbar-breadcrumb .breadcrumb-item a:hover { color: var(--sh-blue); }

.topbar-breadcrumb .breadcrumb-item.active { color: var(--sh-text-muted); }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-date {
    font-size: 0.82rem;
    color: var(--sh-text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topbar-user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.85rem 0.35rem 0.35rem;
    background: var(--sh-body-bg);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sh-blue-dark);
    border: 1px solid var(--sh-border);
    cursor: pointer;
    transition: border-color var(--sh-transition), box-shadow var(--sh-transition);
}

.topbar-user-chip:hover,
.topbar-user-chip[aria-expanded="true"] {
    border-color: var(--sh-blue);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.topbar-user-caret {
    font-size: 0.7rem;
    color: var(--sh-text-muted);
    transition: transform var(--sh-transition);
}

.topbar-user-chip[aria-expanded="true"] .topbar-user-caret { transform: rotate(180deg); }

.topbar-user-menu {
    border: 1px solid var(--sh-border);
    border-radius: 12px;
    box-shadow: var(--sh-shadow);
    padding: 0.4rem;
    min-width: 220px;
    margin-top: 0.5rem;
}

.topbar-user-meta {
    padding: 0.5rem 0.75rem;
}

.topbar-user-meta-name {
    font-weight: 700;
    color: var(--sh-text);
    font-size: 0.9rem;
}

.topbar-user-meta-role {
    font-size: 0.75rem;
    color: var(--sh-text-muted);
    text-transform: capitalize;
}

.topbar-user-menu .dropdown-divider { margin: 0.4rem 0; }

.topbar-user-logout {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--sh-red);
    padding: 0.5rem 0.75rem;
}

.topbar-user-logout:hover,
.topbar-user-logout:focus {
    background: rgba(227, 6, 19, 0.08);
    color: var(--sh-red);
}

.topbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sh-blue), var(--sh-blue-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

.topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.topbar-org-logo {
    display: flex;
    align-items: center;
    height: 36px;
    max-width: 140px;
    padding: 0.2rem 0.55rem;
    background: var(--sh-body-bg);
    border: 1px solid var(--sh-border);
    border-radius: 10px;
}

.topbar-org-logo img {
    max-height: 28px;
    max-width: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Logo upload preview (profile / create / edit forms) */
.logo-upload-preview-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--sh-body-bg);
    border: 1px solid var(--sh-border);
    border-radius: 12px;
}

.logo-upload-preview {
    max-height: 56px;
    max-width: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    padding: 0.25rem;
}

.logo-upload-preview-label {
    font-size: 0.78rem;
    color: var(--sh-text-muted);
    font-weight: 600;
}

/* Org logo on detail page heroes */
.org-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: inherit;
    background: #fff;
    padding: 0.35rem;
}

.detail-logo-thumb {
    max-height: 48px;
    max-width: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--sh-body-bg);
    border: 1px solid var(--sh-border);
    padding: 0.25rem 0.4rem;
}

/* ─── Content ─── */
.portal-content {
    flex: 1;
    min-width: 0;
    padding: 1.5rem 1.75rem 2rem;
}

.portal-footer {
    padding: 0.85rem 1.75rem;
    border-top: 1px solid var(--sh-border);
    background: var(--sh-surface);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--sh-text-muted);
}

/* ─── Guest / Auth pages ─── */
.portal-guest-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef3fb 0%, #f6f9fe 45%, #fdf0f1 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.portal-guest-wrap::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 51, 153, 0.10) 0%, transparent 70%);
    top: -220px;
    right: -160px;
    pointer-events: none;
}

.portal-guest-wrap::after {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227, 6, 19, 0.08) 0%, transparent 70%);
    bottom: -200px;
    left: -160px;
    pointer-events: none;
}

.auth-card-wrap {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--sh-surface);
    border: 1px solid var(--sh-border);
    border-radius: 20px;
    box-shadow: var(--sh-shadow-lg);
    overflow: hidden;
}

.auth-card-header {
    background: linear-gradient(135deg, #f5f8ff 0%, #eef3fb 100%);
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--sh-border);
}

.auth-card-header img { max-width: 180px; margin-bottom: 0.5rem; }

.auth-card-header p {
    color: var(--sh-text-muted);
    font-size: 0.85rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.auth-card-body { padding: 2rem; }

.auth-card-body .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sh-text);
}

.auth-card-body .form-control {
    border-radius: 10px;
    border-color: var(--sh-border);
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
}

.auth-card-body .form-control:focus {
    border-color: var(--sh-blue);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

/* ─── Shared UI components ─── */
.text-sh-blue { color: var(--sh-blue) !important; }
.text-brand { color: var(--sh-blue) !important; }

.btn-sh-primary {
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-disabled-color: #fff;
    background: linear-gradient(135deg, var(--sh-blue), var(--sh-blue-dark));
    border: none;
    color: #fff !important;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.15rem;
    transition: all var(--sh-transition);
}

.btn-sh-primary:hover,
.btn-sh-primary:focus,
.btn-sh-primary:focus-visible,
.btn-sh-primary:active,
.btn-sh-primary.active,
.btn-sh-primary:disabled,
.btn-sh-primary.disabled {
    background: var(--sh-blue-dark);
    color: #fff !important;
}

.btn-sh-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 51, 153, 0.3);
}

.btn-sh-primary i,
.btn-sh-primary .bi {
    color: inherit !important;
}

.btn-sh-danger {
    background: linear-gradient(135deg, var(--sh-red), #c00510);
    border: none;
    color: #fff;
    border-radius: 10px;
    font-weight: 600;
}

.btn-sh-danger:hover { color: #fff; opacity: 0.92; }

.btn-primary {
    background: var(--sh-blue);
    border-color: var(--sh-blue);
    border-radius: 10px;
}

.btn-primary:hover {
    background: var(--sh-blue-dark);
    border-color: var(--sh-blue-dark);
}

.btn-outline-primary {
    border-radius: 10px;
    border-color: var(--sh-blue);
    color: var(--sh-blue);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:focus-visible,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background: var(--sh-blue);
    border-color: var(--sh-blue);
    color: #fff !important;
}

.card {
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow);
    background: var(--sh-surface);
}

.card-sh {
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow);
    background: var(--sh-surface);
    overflow: hidden;
}

.card-sh > .card-header {
    background: transparent;
    color: var(--sh-blue);
    font-weight: 700;
    font-size: 0.92rem;
    padding: 1rem 1.35rem;
    border: none;
    border-bottom: 1px solid var(--sh-border);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.card-sh > .card-header::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--sh-blue), var(--sh-red));
    flex-shrink: 0;
}

.section-title {
    color: var(--sh-blue-dark);
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid var(--sh-border);
    padding-bottom: 0.65rem;
    margin-bottom: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 17px;
    border-radius: 4px;
    background: linear-gradient(180deg, var(--sh-blue), var(--sh-red));
    flex-shrink: 0;
}

.repeatable-row {
    background: #f8fafd;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color var(--sh-transition), box-shadow var(--sh-transition);
}

.repeatable-row:hover {
    border-color: #c3cfe0;
    box-shadow: 0 2px 10px rgba(0, 51, 153, 0.05);
}

/* ─── Forms — modern light design system ─── */
form .card,
form .card-sh { margin-bottom: 1.5rem; }

form .card > .card-body,
form .card-sh > .card-body { padding: 1.5rem; }

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sh-text);
    margin-bottom: 0.4rem;
    letter-spacing: 0.01em;
}

.form-control,
.form-select {
    border: 1px solid var(--sh-border);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    color: var(--sh-text);
    background-color: #fff;
    transition: border-color var(--sh-transition), box-shadow var(--sh-transition);
}

.form-control::placeholder { color: #aab4c4; opacity: 1; }

.form-control:hover:not(:focus):not([disabled]):not([readonly]),
.form-select:hover:not(:focus):not([disabled]) {
    border-color: #c3cfe0;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sh-blue);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

textarea.form-control { min-height: 92px; line-height: 1.5; }

.form-control[disabled],
.form-control[readonly],
.form-select[disabled] {
    background-color: #f4f7fb;
    color: var(--sh-text-muted);
    cursor: not-allowed;
}

/* File inputs */
.form-control[type="file"] { padding: 0.42rem 0.85rem; }
.form-control[type="file"]::file-selector-button {
    background: var(--sh-sidebar-active-bg);
    border: none;
    color: var(--sh-blue);
    border-radius: 7px;
    padding: 0.35rem 0.75rem;
    margin: -0.02rem 0.85rem -0.02rem -0.35rem;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--sh-transition);
}
.form-control[type="file"]::file-selector-button:hover { background: rgba(0, 51, 153, 0.16); }

/* Input groups */
.input-group-text {
    background: #f4f7fb;
    border: 1px solid var(--sh-border);
    color: var(--sh-text-muted);
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Checkboxes, radios & switches */
.form-check { padding-left: 1.7em; }
.form-check-input {
    border-color: #c3cfe0;
    cursor: pointer;
    width: 1.05em;
    height: 1.05em;
    margin-left: -1.7em;
}
.form-check-input:checked {
    background-color: var(--sh-blue);
    border-color: var(--sh-blue);
}
.form-check-input:focus {
    border-color: var(--sh-blue);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}
.form-check-label { font-size: 0.875rem; color: var(--sh-text); }
.form-switch { padding-left: 2.6em; }
.form-switch .form-check-input { width: 2.1em; margin-left: -2.6em; border-radius: 2em; }

/* Validation states */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--sh-red);
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.12);
}
.invalid-feedback { font-size: 0.78rem; font-weight: 500; }
.invalid-feedback.d-block,
.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback,
.col .is-invalid ~ .invalid-feedback,
.usa-phone-field.is-invalid .usa-phone-error,
.usa-phone-field.is-invalid .invalid-feedback {
    display: block !important;
}

/* Form action footer buttons spacing */
.btn-secondary {
    border-radius: 10px;
    background: #eef2f8;
    border-color: #e2e8f0;
    color: var(--sh-text);
    font-weight: 600;
}
.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #d3dbe6;
    color: var(--sh-text);
}

/* Space out adjacent action buttons at the end of a form */
form > .btn + .btn { margin-left: 0.5rem; }

.alert-portal { border-radius: var(--sh-radius); border: none; }

/* ─── Detail (show) pages ─── */
.detail-list dt {
    font-weight: 600;
    color: var(--sh-text-muted);
    font-size: 0.82rem;
    padding: 0.4rem 0;
}
.detail-list dd {
    color: var(--sh-text);
    font-size: 0.9rem;
    padding: 0.4rem 0;
    margin-bottom: 0;
}
.detail-list dt + dd { border-bottom: 1px solid var(--sh-border); }
.detail-list dt { border-bottom: 1px solid var(--sh-border); }
.detail-list dt:last-of-type, .detail-list dd:last-of-type { border-bottom: none; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--sh-blue-dark);
    margin: 0;
}

.page-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.table { font-size: 0.875rem; }

.table thead th {
    background: var(--sh-body-bg);
    color: var(--sh-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--sh-border);
}

/* ─── DataTables ─── */
.datatable-card .card-body { padding: 1.25rem; }

.datatable-toolbar .dataTables_length label,
.datatable-toolbar .dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--sh-text-muted);
}

.datatable-toolbar .dataTables_filter input {
    border: 1px solid var(--sh-border);
    border-radius: 10px;
    padding: 0.45rem 0.85rem;
    font-size: 0.875rem;
    min-width: 220px;
    margin-left: 0 !important;
}

.datatable-toolbar .dataTables_filter input:focus {
    border-color: var(--sh-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.1);
}

.datatable-toolbar .form-select {
    border-radius: 10px;
    font-size: 0.875rem;
    width: auto;
    display: inline-block;
    padding-right: 2.25rem;
    background-position: right 0.65rem center;
}

div.dataTables_wrapper .dataTables_length select {
    padding-right: 2.25rem !important;
    background-position: right 0.65rem center;
}

table.sh-datatable thead th {
    white-space: nowrap;
    vertical-align: middle;
}

table.dataTable.table-hover > tbody > tr:hover > * {
    box-shadow: inset 0 0 0 9999px rgba(0, 51, 153, 0.04);
}

div.dataTables_wrapper div.dataTables_info {
    font-size: 0.82rem;
    color: var(--sh-text-muted);
    padding-top: 0.5rem;
}

div.dataTables_wrapper div.dataTables_paginate {
    padding-top: 0.25rem;
}

div.dataTables_wrapper div.dataTables_paginate .pagination {
    margin-bottom: 0;
    gap: 0.2rem;
}

div.dataTables_wrapper div.dataTables_paginate .page-link {
    border-radius: 8px !important;
    border: 1px solid var(--sh-border);
    color: var(--sh-blue);
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
    margin: 0;
}

div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link {
    background: var(--sh-blue);
    border-color: var(--sh-blue);
    color: #ffffff !important;
}

div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link:hover,
div.dataTables_wrapper div.dataTables_paginate .page-item.active .page-link:focus {
    color: #ffffff !important;
}

div.dataTables_wrapper .dt-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

div.dataTables_wrapper .dt-buttons .btn,
div.dataTables_wrapper .dt-buttons .btn.btn-outline-secondary {
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    color: #fff;
    padding: 0.45rem 0.9rem;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
    transition: transform var(--sh-transition), box-shadow var(--sh-transition), filter var(--sh-transition);
}

div.dataTables_wrapper .dt-buttons .btn i { color: #fff; margin-right: 0.35rem; }

div.dataTables_wrapper .dt-buttons .btn:hover,
div.dataTables_wrapper .dt-buttons .btn:focus,
div.dataTables_wrapper .dt-buttons .btn.btn-outline-secondary:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.22);
    filter: brightness(1.06);
}

div.dataTables_wrapper .dt-buttons .btn:active,
div.dataTables_wrapper .dt-buttons .btn.active { transform: translateY(0); }

/* Distinct, recognizable colours per export type */
div.dataTables_wrapper .dt-buttons .buttons-colvis { background: linear-gradient(135deg, #4f7cff, #2f55d4); }
div.dataTables_wrapper .dt-buttons .buttons-csv    { background: linear-gradient(135deg, #14b8a6, #0d9488); }
div.dataTables_wrapper .dt-buttons .buttons-excel  { background: linear-gradient(135deg, #22a565, #15803d); }
div.dataTables_wrapper .dt-buttons .buttons-pdf    { background: linear-gradient(135deg, #f0556b, #d6293e); }
div.dataTables_wrapper .dt-buttons .buttons-print  { background: linear-gradient(135deg, #64748b, #475569); }

/* Responsive expand/collapse control — modern rotating chevron chip */
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control {
    position: relative;
    cursor: pointer;
    padding-left: 2.75rem !important;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:before {
    content: "" !important;
    position: absolute;
    top: 50%;
    left: 0.65rem;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    margin: 0 !important;
    border: none !important;
    border-radius: 9px;
    background-color: var(--sh-blue);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpolyline points='9 6 15 12 9 18'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px 14px;
    box-shadow: 0 2px 6px rgba(0, 51, 153, 0.28);
    box-sizing: border-box;
    line-height: 1 !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    transition: transform 0.25s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
table.dataTable.dtr-inline.collapsed > tbody > tr > td.dtr-control:hover:before,
table.dataTable.dtr-inline.collapsed > tbody > tr > th.dtr-control:hover:before {
    background-color: var(--sh-blue-dark);
    box-shadow: 0 4px 12px rgba(0, 51, 153, 0.4);
}
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > td.dtr-control:before,
table.dataTable.dtr-inline.collapsed > tbody > tr.parent > th.dtr-control:before {
    transform: translateY(-50%) rotate(90deg);
    background-color: var(--sh-red, #e30613);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.32);
}

.badge-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 20px;
    text-transform: capitalize;
}

.badge-status.active { background: #dcfce7; color: #16a34a; }
.badge-status.pending { background: #fef9c3; color: #ca8a04; }
.badge-status.inactive { background: #fee2e2; color: #dc2626; }

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
    .portal-main {
        margin-left: 0 !important;
    }

    .portal-sidebar {
        transform: translateX(-100%);
        width: var(--sh-sidebar-width) !important;
    }

    .portal-sidebar.mobile-open {
        transform: translateX(0);
    }

    .sidebar-collapse-btn { display: none !important; }

    .portal-content { padding: 1.25rem; }
}

@media (min-width: 992px) {
    /* On desktop the hamburger collapses/expands the sidebar rail. */
    .topbar-menu-btn { display: flex; }
}

@media (max-width: 575.98px) {
    .portal-topbar { padding: 0 1rem; }
    .topbar-title { font-size: 1rem; }
    .topbar-breadcrumb { display: none; }
}

/* Notification bell */
.topbar-notify { position: relative; }
.topbar-notify-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 10px;
    background: var(--sh-body-bg);
    color: var(--sh-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background var(--sh-transition);
}
.topbar-notify-btn:hover { background: #dde6f5; }
.topbar-notify-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--sh-red);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.notify-menu {
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--sh-border);
    border-radius: var(--sh-radius);
    box-shadow: var(--sh-shadow-lg);
    padding: 0;
}
.notify-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--sh-border);
    font-weight: 600;
    font-size: 0.9rem;
}
.notify-mark-all {
    border: none;
    background: none;
    color: var(--sh-blue);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
}
.notify-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--sh-border);
    transition: background var(--sh-transition);
}
.notify-item:hover { background: var(--sh-body-bg); }
.notify-item-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }
.notify-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notify-item-title { font-weight: 600; font-size: 0.85rem; }
.notify-item-text { font-size: 0.78rem; color: var(--sh-text-muted); }
.notify-item-time { font-size: 0.7rem; color: var(--sh-text-muted); }
.notify-empty { padding: 1.5rem; text-align: center; color: var(--sh-text-muted); font-size: 0.85rem; }
.notify-menu-footer {
    display: block;
    text-align: center;
    padding: 0.65rem;
    font-size: 0.8rem;
    color: var(--sh-blue);
    text-decoration: none;
    font-weight: 600;
}
.notify-menu-footer:hover { background: var(--sh-body-bg); }

/* Workflow status badges */
.badge-status { font-size: 0.72rem; font-weight: 600; padding: 0.35em 0.65em; }

/* DataTables per-column filter row */
table.sh-datatable thead tr.dt-filter-row th {
    background: #f8fafc;
    border-top: 1px solid var(--sh-border);
    padding: 0.5rem 0.6rem;
    vertical-align: middle;
}
table.sh-datatable thead tr.dt-filter-row th::before,
table.sh-datatable thead tr.dt-filter-row th::after {
    display: none !important;
}
.dt-filter-row .dt-filter {
    width: 100%;
    font-size: 0.78rem;
    min-width: 90px;
}
.dt-filter-row select.dt-filter { cursor: pointer; }

/* Quick status filter tabs (jobseeker offers / jobs) */
.quick-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.quick-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--sh-border);
    border-radius: 999px;
    background: var(--sh-surface);
    color: var(--sh-text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all var(--sh-transition);
    white-space: nowrap;
}
.quick-filter-tab i { font-size: 0.95rem; }
.quick-filter-tab:hover {
    border-color: var(--sh-blue);
    color: var(--sh-blue);
    background: var(--sh-sidebar-active-bg);
}
.quick-filter-tab .quick-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--sh-body-bg);
    color: var(--sh-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}
.quick-filter-tab.active {
    border-color: var(--sh-blue);
    background: var(--sh-blue);
    color: #fff;
    box-shadow: var(--sh-shadow);
}
.quick-filter-tab.active .quick-filter-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* SweetAlert2 — match Staff Hound branding */
.sh-swal-popup {
    font-family: var(--sh-font, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
    border-radius: 18px;
}
.sh-swal-popup .swal2-title {
    font-weight: 700;
    color: var(--sh-blue-dark, #001a4d);
}
.sh-swal-popup .swal2-html-container {
    color: var(--sh-text-muted, #5a6477);
}
.sh-swal-popup .sh-swal-action-link {
    color: var(--sh-blue, #003399);
    font-weight: 700;
    text-decoration: underline;
}
.sh-swal-popup .swal2-confirm,
.sh-swal-popup .swal2-cancel {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    box-shadow: none !important;
}
.sh-swal-toast {
    font-family: var(--sh-font, 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif);
    border-radius: 12px;
}
.sh-swal-toast .swal2-title {
    font-size: 0.92rem;
    font-weight: 600;
}

/* ============================ Swipe to submit ============================ */
.swipe-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
/* Fallback button (shown when JS is unavailable) sits on the right too. */
.swipe-submit.is-enhanced .swipe-fallback {
    display: none;
}
.swipe-track {
    position: relative;
    width: 300px;
    max-width: 100%;
    height: 56px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--sh-blue, #003399), var(--sh-blue-light, #1a4db3));
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.18), var(--sh-shadow, 0 4px 16px rgba(0, 51, 153, 0.12));
    overflow: hidden;
    user-select: none;
    touch-action: none;
    cursor: pointer;
    outline: none;
}
.swipe-track:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 85, 204, 0.45), inset 0 1px 3px rgba(0, 0, 0, 0.18);
}
.swipe-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 2.5rem;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.15s;
}
.swipe-thumb {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: var(--sh-blue, #003399);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    cursor: grab;
    touch-action: none;
}
.swipe-track[style*="--snap"] .swipe-thumb {
    transition: left 0.2s ease;
}
.swipe-track.is-dragging .swipe-thumb {
    cursor: grabbing;
}
.swipe-track.is-complete {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    cursor: default;
}
.swipe-track.is-complete .swipe-thumb {
    color: #16a34a;
    transition: left 0.25s ease;
}

/* ---- Onboarding guided tour (driver.js) ---- */
.driver-popover.sh-tour-popover {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    max-width: 320px;
}
.driver-popover.sh-tour-popover .driver-popover-title {
    font-family: inherit;
    font-weight: 700;
    color: var(--sh-blue);
    font-size: 1.02rem;
}
.driver-popover.sh-tour-popover .driver-popover-description {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.45;
}
.driver-popover.sh-tour-popover .driver-popover-progress-text {
    color: #94a3b8;
    font-size: 0.78rem;
}
.driver-popover.sh-tour-popover .driver-popover-navigation-btns button {
    background: var(--sh-blue);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.85rem;
    text-shadow: none;
    font-weight: 600;
}
.driver-popover.sh-tour-popover .driver-popover-navigation-btns button:hover {
    background: var(--sh-blue-light, #1b4bb8);
}
.driver-popover.sh-tour-popover .driver-popover-prev-btn {
    background: #eef2f7 !important;
    color: #475569 !important;
}
.driver-popover.sh-tour-popover .driver-popover-close-btn {
    color: #94a3b8;
}

/* ─── Forced password change gate ─── */
.password-gate-body {
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: #0f172a;
}

.password-gate-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: all;
}

.password-gate-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    justify-content: center;
    padding: 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
}

.password-gate-card {
    width: 100%;
    max-width: 440px;
    margin: auto;
    pointer-events: all;
    animation: passwordGateIn 0.35s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}

@keyframes passwordGateIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─── Password rules checklist ─── */
.pw-rules {
    list-style: none;
    margin: 0.5rem 0 1rem;
    padding: 0.75rem 0.9rem;
    background: #f7f9fc;
    border: 1px solid var(--sh-border);
    border-radius: 10px;
}

.pw-rules li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #94a3b8;
    line-height: 1.7;
    transition: color 0.2s ease;
}

.pw-rules li i {
    font-size: 0.95rem;
    flex: none;
    transition: color 0.2s ease;
}

.pw-rules li.is-valid {
    color: #16a34a;
    font-weight: 600;
}

.pw-rules li.is-valid i {
    color: #16a34a;
}

/* ─── Password show/hide toggle ─── */
.pw-toggle-wrap {
    padding: 0;
    border-left: 0;
}

.pw-toggle-btn {
    border: 0;
    background: transparent;
    color: var(--sh-text-muted, #8899b3);
    cursor: pointer;
    padding: 0 0.75rem;
    height: 100%;
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    transition: color 0.15s ease;
}

.pw-toggle-btn:hover {
    color: var(--sh-blue, #003399);
}

.pw-toggle-standalone {
    position: relative;
    display: block;
}

.pw-toggle-standalone input {
    width: 100%;
    padding-right: 2.5rem;
}

.pw-toggle-standalone .pw-toggle-btn {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
}

/* ─── Auto label icons ─── */
.label-icon {
    margin-right: 0.35rem;
    font-size: 0.95em;
    opacity: 0.9;
}

/* ─── Required field asterisk ─── */
.req-asterisk {
    color: var(--sh-red, #E30613);
    font-weight: 700;
    margin-left: 0.2rem;
    line-height: 1;
}

/* ─── USA phone number fields ─── */
.usa-phone-field {
    margin-bottom: 0.25rem;
}

.usa-phone-field .usa-phone-region {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--sh-text-muted, #8899b3);
    letter-spacing: 0.03em;
}

.usa-phone {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border: 1px solid var(--sh-border, #dfe5ee);
    border-radius: 12px;
    background: var(--sh-surface, #fff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    max-width: 100%;
}

.usa-phone:focus-within {
    border-color: var(--sh-blue, #003399);
    box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

.usa-phone-cc {
    font-weight: 700;
    color: var(--sh-blue, #003399);
    background: rgba(0, 51, 153, 0.08);
    border-radius: 7px;
    padding: 0.2rem 0.5rem;
    font-size: 0.9rem;
    flex: none;
}

.usa-phone-paren,
.usa-phone-dash {
    color: var(--sh-text-muted, #8899b3);
    font-weight: 600;
    flex: none;
    user-select: none;
}

.usa-phone-seg {
    border: 1px solid transparent;
    border-radius: 7px;
    background: var(--sh-surface-2, #f7f9fc);
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.12em;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sh-text, #1f2a44);
    padding: 0.45rem 0.55rem;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.usa-phone-seg:focus {
    background: #fff;
    border-color: var(--sh-blue, #003399);
}

.usa-phone-seg::placeholder {
    color: #c2cbd9;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.usa-phone-area { width: 3.75rem; }
.usa-phone-exchange { width: 3.75rem; }
.usa-phone-line { width: 4.75rem; }

.usa-phone-seg.is-invalid {
    color: var(--sh-red, #E30613);
    background: rgba(227, 6, 19, 0.06);
    border-radius: 5px;
}

.usa-phone-seg.usa-phone-ok {
    color: #16a34a;
}

.usa-phone-hint {
    font-size: 0.74rem;
    color: var(--sh-text-muted, #8899b3);
    margin-top: 0.3rem;
}

.usa-phone-error {
    font-size: 0.78rem;
    color: var(--sh-red, #E30613);
    margin-top: 0.15rem;
}

/* Consistent styling for inline phone segments (dynamic owner/manager/contact rows)
   that don't use the partial, matched purely by their field name suffix. */
input[name$="phone1"],
input[name$="phone2"],
input[name$="phone3"],
input[name$="phone1]"],
input[name$="phone2]"],
input[name$="phone3]"] {
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    font-weight: 600;
}

input[name$="phone1"].is-invalid,
input[name$="phone2"].is-invalid,
input[name$="phone3"].is-invalid,
input[name$="phone1]"].is-invalid,
input[name$="phone2]"].is-invalid,
input[name$="phone3]"].is-invalid {
    border-color: var(--sh-red, #E30613);
    box-shadow: 0 0 0 2px rgba(227, 6, 19, 0.12);
}

input[name$="phone1"].usa-phone-ok,
input[name$="phone2"].usa-phone-ok,
input[name$="phone3"].usa-phone-ok,
input[name$="phone1]"].usa-phone-ok,
input[name$="phone2]"].usa-phone-ok,
input[name$="phone3]"].usa-phone-ok {
    border-color: #16a34a;
}
