/* Enterprise departments: symbol chips, symbol picker, setup wizard, org chart.
   Colours come from the server-validated palette and arrive as --chip-color. */

/* ------------------------------- chips ---------------------------------- */
.ff-symbol-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    color: var(--chip-color, #4a78c2);
    background: color-mix(in srgb, var(--chip-color, #4a78c2) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--chip-color, #4a78c2) 30%, transparent);
}

.ff-symbol-chip i {
    font-size: 0.9em;
}

.ff-symbol-chip.is-lead {
    background: color-mix(in srgb, var(--chip-color, #4a78c2) 20%, transparent);
    border-color: var(--chip-color, #4a78c2);
}

.ff-symbol-chip-sm {
    padding: 0.1rem 0.45rem;
    font-size: 0.72rem;
}

.ff-symbol-chip-lead {
    font-size: 0.7em;
    opacity: 0.85;
}

.ff-symbol-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 14rem;
}

.ff-symbol-chip-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

/* --------------------------- symbol picker ------------------------------ */
.ff-symbol-picker {
    position: relative;
}

.ff-symbol-preview {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 12px;
    border: 2px solid var(--chip-color, #4a78c2);
    background: color-mix(in srgb, var(--chip-color, #4a78c2) 14%, transparent);
    color: var(--chip-color, #4a78c2);
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease;
}

.ff-symbol-preview:hover {
    transform: translateY(-1px);
}

.ff-symbol-swatches {
    display: inline-flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.ff-symbol-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--swatch, #4a78c2);
    padding: 0;
    outline-offset: 2px;
}

.ff-symbol-swatch.is-active {
    border-color: var(--bs-body-color, #1e293b);
    transform: scale(1.12);
}

.ff-symbol-grid-wrap {
    margin-top: 0.6rem;
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 12px;
    background: var(--bs-body-bg, #fff);
}

.ff-symbol-grid-scroll {
    max-height: 260px;
    overflow-y: auto;
}

.ff-symbol-group-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-secondary-color, #94a3b8);
    margin: 0.5rem 0 0.35rem;
}

.ff-symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 0.3rem;
}

.ff-symbol-option {
    aspect-ratio: 1;
    border-radius: 9px;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #334155);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ff-symbol-option:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.ff-symbol-option.is-active {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
}

/* --------------------------- setup wizard ------------------------------- */
.dept-wizard-shell {
    max-width: 1000px;
}

.dept-cta-hero {
    border: 2px dashed var(--bs-border-color, #cbd5e1);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    background: var(--bs-tertiary-bg, #f8fafc);
}

.dept-preset-card {
    border: 2px solid var(--bs-border-color, #e2e8f0);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    height: 100%;
    background: var(--bs-body-bg, #fff);
    transition: border-color 0.12s ease, transform 0.12s ease;
}

.dept-preset-card:hover {
    border-color: var(--bs-primary);
    transform: translateY(-2px);
}

.dept-preset-card.selected {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bs-primary) 18%, transparent);
}

.dept-builder-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: var(--bs-body-bg, #fff);
}

.dept-builder-row .form-control {
    border: 0;
    box-shadow: none;
    padding-left: 0;
}

.dept-assign-table {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--bs-border-color, #e2e8f0);
    border-radius: 12px;
}

.dept-assign-table table {
    margin: 0;
    font-size: 0.85rem;
}

.dept-assign-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-tertiary-bg, #f8fafc);
    white-space: nowrap;
    vertical-align: bottom;
}

.dept-assign-table tbody th {
    position: sticky;
    left: 0;
    background: var(--bs-body-bg, #fff);
    z-index: 1;
    font-weight: 500;
    min-width: 220px;
}

.dept-assign-cell {
    text-align: center;
    white-space: nowrap;
}

.dept-manager-star {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color, #cbd5e1);
    padding: 0 0.15rem;
    font-size: 0.85rem;
}

.dept-manager-star.is-on {
    color: #f59e0b;
}

.dept-manager-star:disabled {
    opacity: 0.25;
}

/* ---------------------------- org chart --------------------------------- */
.dept-tree-scroll {
    overflow-x: auto;
    padding: 8px 0 12px;
}

.dept-tree,
.dept-tree ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dept-tree {
    display: flex;
    justify-content: center;
}

.dept-tree ul {
    display: flex;
    justify-content: center;
    position: relative;
    padding-top: 24px;
}

.dept-tree li {
    position: relative;
    padding: 24px 10px 0;
    text-align: center;
}

.dept-tree li::before,
.dept-tree li::after {
    content: '';
    position: absolute;
    top: 0;
    right: 50%;
    width: 50%;
    height: 24px;
    border-top: 2px solid var(--bs-border-color);
}

.dept-tree li::after {
    right: auto;
    left: 50%;
    border-left: 2px solid var(--bs-border-color);
}

.dept-tree li::before {
    border-right: 2px solid var(--bs-border-color);
}

.dept-tree > li {
    padding-top: 0;
}

.dept-tree > li::before,
.dept-tree > li::after {
    display: none;
}

.dept-tree li:only-child::before,
.dept-tree li:only-child::after {
    display: none;
}

.dept-tree li:only-child {
    padding-top: 24px;
}

.dept-tree li:first-child::before,
.dept-tree li:last-child::after {
    border: 0 none;
}

.dept-tree li:last-child::before {
    border-right: 2px solid var(--bs-border-color);
    border-radius: 0 6px 0 0;
}

.dept-tree li:first-child::after {
    border-radius: 6px 0 0 0;
}

.dept-tree ul::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 24px;
    background: var(--bs-border-color);
    transform: translateX(-1px);
}

.dept-node {
    display: inline-block;
    min-width: 210px;
    max-width: 280px;
    padding: 0.75rem 0.9rem;
    border: 2px solid var(--chip-color, #4a78c2);
    border-radius: 12px;
    background: var(--bs-body-bg, #fff);
    text-align: left;
    vertical-align: top;
}

.dept-node-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
    color: var(--chip-color, #4a78c2);
    margin-bottom: 0.15rem;
}

.dept-node-count {
    font-size: 0.72rem;
    color: var(--bs-secondary-color, #64748b);
    margin-bottom: 0.5rem;
}

.dept-person {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0;
    border-top: 1px dashed var(--bs-border-color, #e2e8f0);
    text-align: left;
}

.dept-person-name {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
}

.dept-person-email {
    font-size: 0.7rem;
    color: var(--bs-secondary-color, #64748b);
    word-break: break-all;
}

.dept-person.is-manager .dept-person-name::after {
    content: 'Manager';
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    background: #fef3c7;
    color: #92400e;
    vertical-align: middle;
}

.dept-person.is-hidden,
.dept-node.is-hidden {
    display: none;
}

.dept-unassigned-card {
    border: 2px dashed var(--bs-border-color, #cbd5e1);
    border-radius: 12px;
    padding: 1rem;
}

/* Member-facing "what I teach" surfaces */
.dept-my-teaching-empty {
    font-size: 0.85rem;
    color: var(--bs-secondary-color, #64748b);
}
