/* ═══════════════════════════════════════════════════════════════
   Component Styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    height: 36px;
    cursor: pointer;
}

.btn--primary {
    background: var(--color-primary);
    color: #ffffff;
}
.btn--primary:hover { background: var(--color-primary-dark); color: #ffffff; }

.btn--accent {
    background: var(--color-primary);
    color: white;
}
.btn--accent:hover { background: var(--color-primary-dark); }

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
.btn--secondary:hover { background: var(--color-surface-hover); }

.btn--ghost {
    background: transparent;
    color: var(--color-text-secondary);
}
.btn--ghost:hover { background: var(--color-surface-hover); color: var(--color-text); }

.btn--danger {
    background: var(--color-error);
    color: white;
}
.btn--danger:hover { background: #dc2626; }

.btn--sm { height: 28px; padding: var(--space-1) var(--space-3); font-size: var(--font-size-xs); }
.btn--lg { height: 44px; padding: var(--space-3) var(--space-6); font-size: var(--font-size-md); }

.btn:disabled, .btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn__icon {
    width: 16px;
    height: 16px;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-5);
    transition: box-shadow var(--transition-fast);
}

.card--hover:hover {
    box-shadow: var(--shadow-md);
}

.card--clickable {
    cursor: pointer;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
}

.card__body {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* ── Kudos Recognition Card ───────────────────────────────────── */
.kudos-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-5);
    transition: box-shadow var(--transition-normal);
    position: relative;
    margin-bottom: var(--space-4);
}

.kudos-card:last-child {
    margin-bottom: 0;
}
.kudos-card:hover {
    box-shadow: var(--shadow-md);
}

.kudos-card__top {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.kudos-card__avatars {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.kudos-card__arrow {
    color: var(--color-text-muted);
    font-size: var(--font-size-md);
}

.kudos-card__info {
    flex: 1;
    min-width: 0;
}

.kudos-card__headline {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-1);
}

.kudos-card__headline strong {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.kudos-card__time {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.kudos-card__points {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    background: var(--color-primary-lighter);
    color: var(--color-primary);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    flex-shrink: 0;
}

.kudos-card__badges {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.kudos-card__criteria {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    background: var(--color-primary-lighter);
    color: var(--color-primary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.kudos-card__context {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-1) var(--space-3);
    background: var(--color-info-light);
    color: var(--color-info);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
}

.kudos-card__context--internal {
    background: var(--color-success-light);
    color: var(--color-success);
}

.kudos-card__message {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
}

.kudos-card__actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-light);
}

.kudos-card__boost-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: auto;
}

/* ── Stat Cards ───────────────────────────────────────────────── */
.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    padding: var(--space-3) var(--space-4);
}

.stat-card__label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
}

.stat-card__value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-text);
    line-height: 1;
}

.stat-card__value--accent { color: var(--color-accent); }
.stat-card__value--primary { color: var(--color-primary); }
.stat-card__value--success { color: var(--color-success); }

.stat-card__footer {
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* ── Avatar ───────────────────────────────────────────────────── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    overflow: hidden;
    flex-shrink: 0;
    font-weight: var(--font-weight-semibold);
    color: white;
    text-transform: uppercase;
}

.avatar--sm  { width: 32px; height: 32px; font-size: var(--font-size-xs); }
.avatar--md  { width: 40px; height: 40px; font-size: var(--font-size-sm); }
.avatar--lg  { width: 56px; height: 56px; font-size: var(--font-size-lg); }
.avatar--xl  { width: 80px; height: 80px; font-size: var(--font-size-2xl); }

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Badge ────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
}

.badge--primary  { background: var(--color-primary-lighter); color: var(--color-primary); }
.badge--accent   { background: var(--color-accent-lighter);  color: var(--color-accent-dark); }
.badge--success  { background: var(--color-success-light);   color: var(--color-success); }
.badge--error    { background: var(--color-error-light);     color: var(--color-error); }
.badge--neutral  { background: var(--color-bg);              color: var(--color-text-secondary); }

/* Grade badges */
/* Grade badges — consistent outline style for both light and dark mode */
.badge--intern,
.badge--consultant,
.badge--senior,
.badge--manager,
.badge--assoc-director,
.badge--director,
.badge--partner {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}
.badge--intern           { border-color: #94a3b8; color: #94a3b8; }
.badge--consultant       { border-color: #3b82f6; color: #3b82f6; }
.badge--senior           { border-color: #7c3aed; color: #7c3aed; }
.badge--manager          { border-color: #059669; color: #059669; }
.badge--assoc-director   { border-color: #0077b6; color: #0077b6; }
.badge--director         { border-color: #00338d; color: #00338d; }
.badge--partner          { border-color: #002266; color: #002266; }

[data-theme="dark"] .badge--director  { border-color: #60a5fa; color: #60a5fa; }
[data-theme="dark"] .badge--partner   { border-color: #93c5fd; color: #93c5fd; }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text);
    margin-bottom: var(--space-1);
}

.form-label--required::after {
    content: ' *';
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    display: block;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    height: 38px;
}

.form-textarea {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.form-input--error {
    border-color: var(--color-error);
}

.form-hint {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

.form-error {
    font-size: var(--font-size-xs);
    color: var(--color-error);
    margin-top: var(--space-1);
}

/* ── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    padding: var(--space-4);
}

.modal-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 620px;
    max-height: calc(100vh - var(--space-4));
    overflow-y: auto;
    transform: translateY(16px) scale(0.97);
    transition: transform var(--transition-normal);
}

.modal-overlay--visible .modal {
    transform: translateY(0) scale(1);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

.modal__title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

.modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}
.modal__close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

.modal__body {
    padding: var(--space-4) var(--space-6);
}

.modal__body .form-group {
    margin-bottom: var(--space-3);
}

.modal__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border);
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-primary);
    font-size: var(--font-size-sm);
    pointer-events: auto;
    animation: toastIn 0.3s ease forwards;
    max-width: 400px;
}

.toast--success { border-left-color: var(--color-success); }
.toast--error   { border-left-color: var(--color-error); }
.toast--warning { border-left-color: var(--color-warning); }

.toast--exit {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

.toast__icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast__message { flex: 1; }
.toast__close {
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
}
.toast__close:hover { background: var(--color-bg); }

/* ── Table ────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-border);
    background: var(--color-bg);
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-sm);
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.data-table tr:hover td {
    background: var(--color-surface-hover);
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    margin-bottom: var(--space-6);
    gap: var(--space-2);
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    border: 1px solid var(--color-border);
}

.tab {
    padding: var(--space-2) var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    justify-content: center;
}
.tab:hover {
    color: var(--color-text);
    background: var(--color-surface-hover);
}
.tab--active {
    color: var(--color-primary);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-weight-semibold);
}

.tab__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 11px;
    font-weight: var(--font-weight-bold);
}

.tab--active .tab__badge {
    background: #ffffff;
    color: #00338d;
    font-weight: var(--font-weight-bold);
}

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
    text-align: center;
}

.empty-state__icon {
    width: 64px;
    height: 64px;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.empty-state__description {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    max-width: 360px;
    margin-bottom: var(--space-6);
}

/* ── Search Box (admin users, etc.) ────────────────────────────── */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box__icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.search-box .form-input,
.search-box__input {
    padding-left: 36px;
    width: 100%;
}

.admin-users__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.admin-users__toolbar .search-box {
    flex: 1;
    max-width: 400px;
}

.admin-users__count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ── User Cell (avatar + name in table) ───────────────────────── */
.user-cell {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-cell__name {
    font-weight: var(--font-weight-medium);
}

/* ── Avatar spacing fix ───────────────────────────────────────── */
.avatar + span,
.avatar + div,
.avatar + .user-cell__name {
    margin-left: 0;
}

/* ── Loading Skeleton ─────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-border-light) 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton--text { height: 14px; margin-bottom: var(--space-2); }
.skeleton--title { height: 24px; width: 60%; margin-bottom: var(--space-3); }
.skeleton--avatar { border-radius: var(--radius-full); }
.skeleton--card { height: 120px; }

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ── Search Input ─────────────────────────────────────────────── */
.search-input {
    position: relative;
}

.search-input__icon {
    position: absolute;
    left: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-input .form-input {
    padding-left: calc(var(--space-3) + 16px + var(--space-2));
}

/* ── Dropdown ─────────────────────────────────────────────────── */
.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: var(--z-dropdown);
    max-height: 240px;
    overflow-y: auto;
    margin-top: var(--space-1);
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
}
.dropdown__item:hover {
    background: var(--color-surface-hover);
}

.dropdown__item--active {
    background: var(--color-primary-lighter);
}

/* ── Slider / Range ───────────────────────────────────────────── */
.range-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

/* ── Grid Layouts ─────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }

/* ── Utility Classes ──────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--color-text-secondary); }
.text-sm     { font-size: var(--font-size-sm); }
.text-xs     { font-size: var(--font-size-xs); }
.font-bold   { font-weight: var(--font-weight-bold); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.hidden { display: none !important; }

/* ── Grade Checkbox Grid ──────────────────────────────────────── */
.grade-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.grade-checkbox-grid .modern-checkbox {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.grade-checkbox-grid .modern-checkbox:hover {
    background: var(--color-surface-hover);
}

/* ── Dark Mode Text Fixes ─────────────────────────────────────── */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="dark"] .kudos-card__comment-input textarea {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: var(--color-border);
}

[data-theme="dark"] .kudos-card__comment-text {
    color: var(--color-text-secondary);
}

[data-theme="dark"] .kudos-card__comment-author {
    color: var(--color-text);
}

[data-theme="dark"] .dropdown,
[data-theme="dark"] .mention-dropdown {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .dropdown__item:hover,
[data-theme="dark"] .mention-dropdown__item:hover {
    background: var(--color-surface-hover);
}

[data-theme="dark"] .modal {
    background: var(--color-surface);
}

[data-theme="dark"] .modal__header,
[data-theme="dark"] .modal__footer {
    border-color: var(--color-border);
}

[data-theme="dark"] .toast {
    background: var(--color-surface);
    color: var(--color-text);
}

[data-theme="dark"] .app-header__points-badge {
    background: rgba(var(--color-accent-rgb), 0.15);
}

[data-theme="dark"] .empty-state__title {
    color: var(--color-text);
}

[data-theme="dark"] .badge--outline {
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: var(--color-text-muted);
}

[data-theme="dark"] select option {
    background: var(--color-surface);
    color: var(--color-text);
}

[data-theme="dark"] .kudos-card__message {
    background: rgba(255,255,255,0.05);
    color: var(--color-text-secondary);
}

[data-theme="dark"] .give-kudos__criteria-card {
    border-color: var(--color-border);
    background: var(--color-surface);
}

[data-theme="dark"] .give-kudos__criteria-card:hover {
    border-color: var(--color-primary-light);
    background: rgba(var(--color-primary-rgb), 0.1);
}

[data-theme="dark"] .admin-org__panel-header {
    background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .team-member-card,
[data-theme="dark"] .admin-card {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .profile-header {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .notification-panel {
    background: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] .user-menu__dropdown {
    background: var(--color-surface);
    border-color: var(--color-border);
}

/* ── Modern Toggle Switch ─────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
}

.toggle-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch__slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.toggle-switch__slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal);
}

.toggle-switch__input:checked + .toggle-switch__slider {
    background: var(--color-primary);
}

.toggle-switch__input:checked + .toggle-switch__slider::after {
    transform: translateX(20px);
}

.toggle-switch__input:focus-visible + .toggle-switch__slider {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.toggle-switch__label {
    font-size: var(--font-size-sm);
    color: var(--color-text);
    font-weight: var(--font-weight-medium);
}

/* ── Modern Checkbox ──────────────────────────────────────────── */
.modern-checkbox {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    user-select: none;
}

.modern-checkbox__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.modern-checkbox__box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    background: var(--color-surface);
}

.modern-checkbox__box svg {
    width: 12px;
    height: 12px;
    opacity: 0;
    transform: scale(0.5);
    transition: all var(--transition-fast);
    color: white;
}

.modern-checkbox__input:checked + .modern-checkbox__box {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.modern-checkbox__input:checked + .modern-checkbox__box svg {
    opacity: 1;
    transform: scale(1);
}

.modern-checkbox__input:focus-visible + .modern-checkbox__box {
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.2);
}

.modern-checkbox__label {
    font-size: var(--font-size-sm);
    color: var(--color-text);
}

/* ── Animations ───────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.animate-fade {
    animation: fadeIn 0.3s ease forwards;
}

/* Staggered children animation */
.stagger-in > * {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}
.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }

/* ── Better Button Hovers ─────────────────────────────────────── */
.btn:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:not(:disabled):active {
    transform: translateY(0);
}

/* ── Card Hover Enhancement ───────────────────────────────────── */
.card--hover:hover,
.kudos-card:hover {
    transform: translateY(-2px);
}

/* ── Better Focus States ──────────────────────────────────────── */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

/* ── Progress Bar Component ───────────────────────────────────── */
.progress-bar {
    height: 6px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-6);
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-full);
    transition: width 0.4s ease;
}

/* ── Step Indicator ───────────────────────────────────────────── */
.step-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
}

.step-indicator__step {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.step-indicator__step--active {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.step-indicator__step--done {
    color: var(--color-success);
}

.step-indicator__dot {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    transition: all var(--transition-fast);
}

.step-indicator__step--active .step-indicator__dot {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
}

.step-indicator__step--done .step-indicator__dot {
    border-color: var(--color-success);
    background: var(--color-success);
    color: white;
}

.step-indicator__line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
}

.step-indicator__line--done {
    background: var(--color-success);
}

/* ── Welcome Banner ───────────────────────────────────────────── */
.welcome-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    color: white;
    margin-bottom: var(--space-4);
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -5%;
    width: 200px;
    height: 200px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}

.welcome-banner__title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-1);
}

.welcome-banner__subtitle {
    font-size: var(--font-size-sm);
    opacity: 0.85;
}

/* ── Dark Mode Toggle ─────────────────────────────────────────── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
}

.theme-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

/* ── User Dropdown Menu ───────────────────────────────────────── */
.user-menu {
    position: relative;
}

.user-menu__trigger {
    display: flex;
    align-items: center;
    padding: var(--space-1);
    border: none;
    background: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.user-menu__trigger:hover {
    box-shadow: 0 0 0 2px var(--color-primary-lighter);
}

.user-menu__header {
    padding: var(--space-3) var(--space-4);
}

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
}

.user-menu__dropdown--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.user-menu__item:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    text-decoration: none;
}

.user-menu__divider {
    height: 1px;
    background: var(--color-border);
    margin: var(--space-1) 0;
}

.user-menu__item--danger {
    color: var(--color-error);
}

.user-menu__item--danger:hover {
    background: var(--color-error-light);
}

/* ── Profile Banner ───────────────────────────────────────────── */
.profile-banner {
    background: var(--color-primary);
    height: 80px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
}

/* ── Grade Progress Bar ───────────────────────────────────────── */
.grade-progress {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.grade-progress__bar {
    flex: 1;
    height: 6px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.grade-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), var(--color-accent));
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

.grade-progress__label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* ── Breadcrumb ───────────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.breadcrumb a {
    color: var(--color-text-secondary);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.breadcrumb__separator {
    color: var(--color-border);
}

/* ── Alternating table rows ───────────────────────────────────── */
.data-table tbody tr:nth-child(even) td {
    background: var(--color-bg);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.02);
}

/* ── Likes & Comments ────────────────────────────────────────── */
.kudos-card__like { cursor:pointer; display:inline-flex; align-items:center; gap:4px; font-size:13px; color:var(--color-text-muted); transition:all 0.2s; }
.kudos-card__like:hover { color:var(--color-error); }
.kudos-card__like--liked { color:var(--color-error); }
.kudos-card__comments-toggle { cursor:pointer; display:inline-flex; align-items:center; gap:4px; font-size:13px; color:var(--color-text-muted); }
.kudos-card__comments-section { padding:var(--space-4); border-top:1px solid var(--color-border-light); }
.kudos-card__comment { display:flex; gap:var(--space-3); margin-bottom:var(--space-3); }
.kudos-card__comment-body { flex:1; }
.kudos-card__comment-author { font-size:12px; font-weight:600; color:var(--color-text); }
.kudos-card__comment-time { font-size:11px; color:var(--color-text-muted); margin-left:8px; }
.kudos-card__comment-text { font-size:13px; color:var(--color-text-secondary); margin-top:2px; line-height:1.4; }
.mention { color:var(--color-primary); font-weight:500; }
.mention-dropdown { position:absolute; background:var(--color-surface); border:1px solid var(--color-border); border-radius:var(--radius-md); box-shadow:var(--shadow-lg); max-height:160px; overflow-y:auto; z-index:200; }
.mention-dropdown__item { display:flex; align-items:center; gap:8px; padding:6px 12px; cursor:pointer; font-size:13px; }
.mention-dropdown__item:hover { background:var(--color-surface-hover); }
.kudos-card__comment-input { display:flex; gap:var(--space-2); margin-top:var(--space-3); position:relative; align-items:stretch; }
.kudos-card__comment-input textarea { flex:1; resize:none; min-height:40px; padding:10px 12px; border:1px solid var(--color-border); border-radius:var(--radius-md); font-size:13px; font-family:inherit; background:var(--color-surface); color:var(--color-text); }
.kudos-card__comment-input .btn { align-self:stretch; min-height:40px; padding:0 16px; }

/* ── Notifications ───────────────────────────────────────────── */
.notification-bell-wrapper { position: relative; }
.notification-bell { position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); transition: all 0.2s; color: var(--color-text-secondary); background: none; border: none; }
.notification-bell:hover { background: var(--color-surface-hover); color: var(--color-text); }
.notification-bell__badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; background: var(--color-error); color: white; font-size: 10px; font-weight: 700; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; padding: 0 4px; line-height: 1; }
.notification-panel { position: absolute; top: calc(100% + 8px); right: 0; width: 380px; max-height: 480px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); z-index: 500; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s; }
.notification-panel--open { opacity: 1; visibility: visible; transform: translateY(0); }
.notification-panel__header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--color-border); }
.notification-panel__title { font-size: 15px; font-weight: 600; }
.notification-panel__mark-read { font-size: 12px; color: var(--color-primary); cursor: pointer; }
.notification-panel__mark-read:hover { text-decoration: underline; }
.notification-panel__settings { color: var(--color-text-muted); display: flex; align-items: center; transition: color 0.15s; }
.notification-panel__settings:hover { color: var(--color-primary); }
.notification-panel__list { max-height: 400px; overflow-y: auto; }
.notification-item { display: flex; gap: 12px; padding: 12px 16px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--color-border-light); }
.notification-item:hover { background: var(--color-surface-hover); }
.notification-item--unread { background: rgba(var(--color-primary-rgb, 26, 86, 219), 0.04); }
.notification-item__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; margin-top: 6px; }
.notification-item__dot--read { background: transparent; }
.notification-item__content { flex: 1; min-width: 0; }
.notification-item__message { font-size: 13px; color: var(--color-text); line-height: 1.4; }
.notification-item__message strong { font-weight: 600; }
.notification-item__time { font-size: 11px; color: var(--color-text-muted); margin-top: 2px; }
.notification-panel__empty { padding: 32px; text-align: center; color: var(--color-text-muted); font-size: 13px; }

/* ── Notification Settings Page ──────────────────────────────── */
.notification-settings__list { display: flex; flex-direction: column; gap: 16px; }
.notification-settings__list .toggle-switch { padding: 8px 0; }
