/* ============================================================
 * Assignments page — tab toggle, filter strip, table styles
 * ============================================================ */

/* ── Tab bar ── */

.assign-tab-bar {
    display: flex;
    border-bottom: 2px solid var(--theme-border);
}

.assign-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--theme-text-muted);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    text-decoration: none;
    transition: color var(--theme-transition), border-color var(--theme-transition);
}

.assign-tab:hover {
    color: var(--theme-accent);
    text-decoration: none;
}

.assign-tab.active {
    color: var(--theme-accent);
    border-bottom-color: var(--theme-accent);
}

.assign-tab i { font-size: 0.82rem; }

/* ── Filter strip ── */

.filter-strip {
    background: var(--theme-bg-alt);
    border: 1px solid var(--theme-border);
    border-top: none;
    border-radius: 0 0 var(--theme-radius) var(--theme-radius);
    padding: 0.8rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-label {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--theme-text-muted);
}

.filter-strip select,
.filter-strip input[type="text"] {
    font-size: 0.82rem;
    border: 1px solid var(--theme-border-strong);
    border-radius: var(--theme-radius-sm);
    padding: 0.35rem 0.6rem;
    background: var(--theme-bg-card);
    color: var(--theme-text);
    height: 2rem;
    font-family: var(--theme-font-body);
}

.filter-strip select:focus,
.filter-strip input[type="text"]:focus {
    outline: none;
    border-color: var(--theme-accent);
    box-shadow: 0 0 0 2px rgba(var(--theme-accent-rgb), 0.15);
}

.autocomplete-wrap {
    position: relative;
}

.autocomplete-wrap input[type="text"] {
    padding-right: 1.6rem;
}

.autocomplete-wrap .ac-icon {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--theme-text-muted);
    font-size: 0.68rem;
    pointer-events: none;
}

.btn-filter-apply {
    background: var(--theme-btn-primary-bg);
    color: var(--theme-btn-primary-text);
    border: none;
    border-radius: var(--theme-radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    height: 2rem;
    cursor: pointer;
    font-family: var(--theme-font-body);
    transition: background var(--theme-transition);
}

.btn-filter-apply:hover { background: var(--theme-btn-primary-hover); }

.btn-filter-clear {
    background: none;
    border: 1px solid var(--theme-border-strong);
    border-radius: var(--theme-radius-sm);
    color: var(--theme-text-muted);
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    height: 2rem;
    cursor: pointer;
    font-family: var(--theme-font-body);
    transition: all var(--theme-transition);
}

.btn-filter-clear:hover {
    border-color: var(--theme-accent);
    color: var(--theme-accent);
}

/* ── Results bar ── */

.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.65rem;
}

.results-count {
    font-size: 0.8rem;
    color: var(--theme-text-muted);
}

.results-count strong { color: var(--theme-text-heading); }

/* ── Table additions ── */

.table-themed tbody .group-divider td {
    padding: 0;
    height: 0;
    border-top: 2px solid var(--theme-border);
    border-bottom: none;
    background: transparent;
}

.table-themed tbody .group-divider:hover {
    background: transparent;
}

/* Task / course code above task name */
.task-code {
    font-size: 0.72rem;
    font-family: var(--theme-font-mono);
    color: var(--theme-text-muted);
    display: block;
    margin-bottom: 1px;
    line-height: 1.2;
}

.task-name-link {
    font-weight: 500;
    color: var(--theme-text-heading);
}

.task-name-link:hover { color: var(--theme-accent); }

.task-name-plain { color: var(--theme-text); }

/* Role badges */
.role-badge {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 700;
    padding: 0.12rem 0.48rem;
    border-radius: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.role-lec { background: #dbeafe; color: #1e40af; }
.role-ta  { background: #dcfce7; color: #166534; }
.role-lab { background: #fef9c3; color: #854d0e; }

/* Semester badge */
.sem-badge {
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 600;
    padding: 0.12rem 0.48rem;
    border-radius: 2rem;
    background: var(--theme-bg-alt);
    border: 1px solid var(--theme-border-strong);
    color: var(--theme-text-muted);
    white-space: nowrap;
}

/* Numeric cells */
.cell-num {
    text-align: right;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
}

.cell-dim {
    text-align: right;
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

/* Person name cell */
.cell-name a {
    font-weight: 600;
    color: var(--theme-text-heading);
}

.cell-name a:hover { color: var(--theme-accent); }

/* Responsive */
@media (max-width: 767.98px) {
    .filter-strip {
        flex-direction: column;
    }

    .filter-strip select,
    .filter-strip input[type="text"] {
        width: 100%;
    }

    .filter-field {
        width: 100%;
    }

    .assign-tab {
        padding: 0.6rem 0.9rem;
        font-size: 0.82rem;
    }
}
