/* =============================================================================
   IREF Member Dashboards — dashboard.css
   ============================================================================= */

/* ── Scope & base ──────────────────────────────────────────────────────────── */

.iref-dashboard {
    font-family: inherit;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    color: #111827;
}

/* ── Header ────────────────────────────────────────────────────────────────── */

.iref-dashboard__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid #e5e7eb;
}

.iref-dashboard__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.iref-dashboard__badge {
    background: #1d4ed8;
    color: #fff;
    border-radius: 9999px;
    padding: 0.2rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Notice / info bar ─────────────────────────────────────────────────────── */

.iref-notice {
    padding: 0.75rem 1rem;
    background: #f0f9ff;
    border-left: 4px solid #0ea5e9;
    border-radius: 4px;
    color: #0c4a6e;
    margin: 0;
}

/* ── Toolbar: search + export button row ───────────────────────────────────── */

.iref-toolbar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
    margin-bottom: 0.875rem;
}

.iref-toolbar .iref-search-bar {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.iref-club-filter-wrap {
    flex-shrink: 0;
}

.iref-club-select {
    height: 2.25rem;
    padding: 0 0.625rem;
    font-size: 0.875rem;
    min-width: 180px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.iref-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}

.iref-btn--export {
    background: #1d4ed8;
    color: #fff;
}

.iref-btn--export:hover {
    background: #1e40af;
}

/* ── Search bar (club admin) ───────────────────────────────────────────────── */

.iref-search-bar {
    margin-bottom: 0.875rem;
}

.iref-search-bar input[type="search"] {
    width: 100%;
    max-width: 360px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.iref-search-bar input[type="search"]:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* ── Table ─────────────────────────────────────────────────────────────────── */

.iref-table-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.iref-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: #fff;
}

.iref-table th,
.iref-table td {
    padding: 0.65rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.iref-table thead th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
}

.iref-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.iref-table th.sortable:hover {
    background: #f1f5f9;
}

.iref-table th .sort-icon {
    color: #9ca3af;
    font-size: 0.7rem;
    margin-left: 0.2rem;
}

.iref-table th.sort-asc .sort-icon,
.iref-table th.sort-desc .sort-icon {
    color: #1d4ed8;
}

.iref-table tbody tr:last-child td {
    border-bottom: none;
}

.iref-table tbody tr:hover {
    background: #f9fafb;
}

.iref-table tr.iref-hidden {
    display: none;
}

/* ── Status badges ─────────────────────────────────────────────────────────── */

.iref-status {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: capitalize;
    white-space: nowrap;
}

/* Course-completion status (replaces old membership-status badges) */
.iref-status.status--complete      { background: #dcfce7; color: #15803d; }
.iref-status.status--in-progress   { background: #fef9c3; color: #854d0e; }
.iref-status.status--not-started   { background: #fee2e2; color: #991b1b; }

/* Legacy membership-status variants (retained for any old templates) */
.iref-status.status--active    { background: #dcfce7; color: #15803d; }
.iref-status.status--pending   { background: #fef9c3; color: #854d0e; }
.iref-status.status--failed    { background: #fee2e2; color: #991b1b; }
.iref-status.status--refunded  { background: #f3f4f6; color: #6b7280; }
.iref-status.status--inactive  { background: #f3f4f6; color: #6b7280; }
.iref-status.status--none      { background: #f3f4f6; color: #9ca3af; }

/* ── Account card (referee) ────────────────────────────────────────────────── */

.iref-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.iref-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
}

.iref-card h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e5e7eb;
}

/* ── Definition list ───────────────────────────────────────────────────────── */

.iref-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 0.75rem;
    margin: 0;
    font-size: 0.875rem;
}

.iref-dl dt {
    font-weight: 600;
    color: #6b7280;
}

.iref-dl dd {
    margin: 0;
    color: #111827;
    word-break: break-word;
}

/* ── Section title ─────────────────────────────────────────────────────────── */

.iref-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.75rem 0 1rem;
    color: #374151;
}

/* ── Course cards (referee) ────────────────────────────────────────────────── */

.iref-courses {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.iref-course-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
    transition: box-shadow 0.15s;
}

.iref-course-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* When the card is an <a> tag (linked to the course) */
a.iref-course-card--link {
    display: block;
    color: inherit;
    text-decoration: none;
}
a.iref-course-card--link:hover {
    box-shadow: 0 4px 14px rgba(196, 30, 30, 0.12);
    border-color: #C41E1E;
    text-decoration: none;
    color: inherit;
}

.iref-course-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.iref-course-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

.iref-course-card__pct {
    font-size: 1rem;
    font-weight: 700;
    color: #1d4ed8;
    white-space: nowrap;
}

.iref-course-card__pct.pct--complete {
    color: #15803d;
}

.iref-course-card__meta {
    margin: 0.45rem 0 0;
    font-size: 0.78rem;
    color: #6b7280;
}

/* ── Progress bar ──────────────────────────────────────────────────────────── */

.iref-progress {
    height: 10px;
    background: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.iref-progress__bar {
    height: 100%;
    width: 0;                      /* animated in from 0 by JS */
    background: #1d4ed8;
    border-radius: 9999px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.iref-progress__bar--complete {
    background: #16a34a;
}

/* ── Course completion cells ───────────────────────────────────────────────── */

.iref-course-cell {
    display: block;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    text-align: center;
}

/* Green — course fully complete */
.iref-course-cell--complete {
    background: #dcfce7;
    color: #15803d;
}

/* Amber — started but not finished */
.iref-course-cell--progress {
    background: #fef9c3;
    color: #854d0e;
}

/* Red — not started */
.iref-course-cell--none {
    background: #fee2e2;
    color: #991b1b;
}

/* ── Column filter row ─────────────────────────────────────────────────────── */

.iref-filter-row th {
    padding: 0.3rem 0.5rem;
    background: #f3f4f6;
    border-bottom: 2px solid #d1d5db;
}

.iref-col-filter {
    width: 100%;
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    color: #374151;
    cursor: pointer;
}

.iref-col-filter:focus {
    outline: none;
    border-color: #C41E1E;
    box-shadow: 0 0 0 2px rgba(196,30,30,0.15);
}

/* ── Program Admin: section spacing ───────────────────────────────────────── */

.iref-section-header {
    margin-top: 2.5rem;
}

/* ── Clubs list-table ──────────────────────────────────────────────────────── */

.iref-clubs-table {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.iref-clubs-table__head {
    display: grid;
    grid-template-columns: 1fr 180px 120px 100px 80px;
    gap: 0;
    background: #f9fafb;
    padding: 0.55rem 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
}

.iref-club-row-wrap {
    border-bottom: 1px solid #e5e7eb;
}

.iref-club-row-wrap:last-child {
    border-bottom: none;
}

.iref-club-row-wrap--inactive .iref-club-row {
    background: #fafafa;
    color: #9ca3af;
}

.iref-club-row {
    display: grid;
    grid-template-columns: 1fr 180px 120px 100px 80px;
    align-items: center;
    padding: 0.65rem 1rem;
    transition: background 0.12s;
}

.iref-club-row:hover {
    background: #f9fafb;
}

.iref-club-row__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.iref-inactive-badge {
    font-size: 0.68rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #9ca3af;
    border-radius: 9999px;
    padding: 0.1rem 0.5rem;
    white-space: nowrap;
}

.iref-club-row__phone {
    font-size: 0.82rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iref-club-row__stat {
    font-size: 0.82rem;
    color: #374151;
}

.iref-club-row__actions {
    display: flex;
    justify-content: flex-end;
}

/* ── Club edit/new panel ───────────────────────────────────────────────────── */

.iref-club-panel {
    background: #f8faff;
    border-top: 1px solid #dbeafe;
    padding: 1.25rem 1.25rem 1rem;
}

.iref-new-club-panel {
    border: 1px solid #dbeafe;
    border-radius: 8px;
    margin-bottom: 1.25rem;
}

.iref-panel-title {
    margin: 0 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #1e3a8a;
}

/* ── Form grid inside panels ───────────────────────────────────────────────── */

.iref-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.iref-form-label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
}

.iref-form-label--full {
    grid-column: 1 / -1;
}

.iref-form-label--checkbox {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.iref-form-input,
.iref-form-textarea {
    padding: 0.45rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}

.iref-form-input:focus,
.iref-form-textarea:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.iref-form-input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: default;
}

.iref-form-textarea {
    resize: vertical;
    min-height: 60px;
}

.iref-required {
    color: #dc2626;
}

.iref-form-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: #9ca3af;
    font-style: normal;
}

/* ── Panel sub-section (admins) ────────────────────────────────────────────── */

.iref-panel-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 0.875rem;
}

.iref-panel-section__title {
    margin: 0 0 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

/* ── Panel action row ──────────────────────────────────────────────────────── */

.iref-panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
}

.iref-btn--edit {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-size: 0.82rem;
    padding: 0.35rem 0.8rem;
}

.iref-btn--edit:hover { background: #e5e7eb; }

.iref-btn--save {
    background: #1d4ed8;
    color: #fff;
    margin-left: auto;
}

.iref-btn--save:hover { background: #1e40af; }
.iref-btn--save:disabled { opacity: 0.6; cursor: not-allowed; }

.iref-btn--link {
    background: transparent;
    color: #1d4ed8;
    font-size: 0.82rem;
    padding: 0.35rem 0;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.iref-btn--link:hover { text-decoration: underline; }

.iref-panel-notice {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: #dc2626;
    background: #fee2e2;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
}

/* ── Legacy club card styles (kept for any external usage) ─────────────────── */

.iref-clubs-grid {
    /* now used as the list-table wrapper — grid layout defined above */
}

.iref-club-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
}

.iref-club-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #e5e7eb;
}

.iref-club-card__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}

.iref-club-card__count {
    font-size: 0.73rem;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 9999px;
    padding: 0.15rem 0.6rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Admin list ────────────────────────────────────────────────────────────── */

.iref-admin-list {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.iref-admin-list__empty {
    font-size: 0.82rem;
    color: #9ca3af;
    font-style: italic;
    padding: 0.25rem 0;
}

.iref-admin-list__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.iref-admin-list__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.iref-admin-list__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iref-admin-list__email {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Add / Remove / Cancel buttons ────────────────────────────────────────── */

.iref-btn--add {
    background: #16a34a;
    color: #fff;
}

.iref-btn--add:hover  { background: #15803d; }

.iref-btn--remove {
    background: transparent;
    color: #dc2626;
    border: 1px solid #fca5a5;
    font-size: 0.75rem;
    padding: 0.3rem 0.65rem;
    flex-shrink: 0;
}

.iref-btn--remove:hover    { background: #fee2e2; }
.iref-btn--remove:disabled { opacity: 0.5; cursor: not-allowed; }

.iref-btn--cancel {
    background: #f3f4f6;
    color: #374151;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #e5e7eb;
}

.iref-btn--cancel:hover { background: #e5e7eb; }

/* ── Add admin panel (search) ──────────────────────────────────────────────── */

.iref-add-admin-wrap {
    margin-top: 0.75rem;
}

.iref-add-admin-panel {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.iref-user-search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.iref-user-search-input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* ── User search results ───────────────────────────────────────────────────── */

.iref-user-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.iref-search-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
}

.iref-search-result__info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    flex: 1 1 auto;
}

.iref-search-result__name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iref-search-result__email {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.iref-role-badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

.iref-search-loading,
.iref-search-empty {
    font-size: 0.82rem;
    color: #9ca3af;
    font-style: italic;
    padding: 0.35rem 0;
}

.iref-btn--select {
    background: #1d4ed8;
    color: #fff;
    font-size: 0.78rem;
    padding: 0.3rem 0.7rem;
    flex-shrink: 0;
}

.iref-btn--select:hover    { background: #1e40af; }
.iref-btn--select:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Toast notification ────────────────────────────────────────────────────── */

.iref-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    z-index: 99999;
    opacity: 0;
    transform: translateY(0.5rem);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}

.iref-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.iref-toast--success { background: #16a34a; }
.iref-toast--error   { background: #dc2626; }

/* ── Stat grid (dashboard tiles) ───────────────────────────────────────────── */

.iref-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.iref-stat-tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.iref-stat-tile__value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: #1e3a8a;
}

.iref-stat-tile__label {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 500;
}

.iref-stat-tile--green .iref-stat-tile__value { color: #15803d; }
.iref-stat-tile--amber .iref-stat-tile__value { color: #92400e; }

/* ── Course progress cards (dashboard) ─────────────────────────────────────── */

.iref-course-progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.iref-course-progress-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.25rem;
}

.iref-course-progress-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

.iref-course-progress-card__title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
}

.iref-course-progress-card__pct {
    font-weight: 700;
    font-size: 0.95rem;
    color: #15803d;
    white-space: nowrap;
}

.iref-progress-stacked {
    height: 12px;
    background: #f3f4f6;
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
    margin-bottom: 0.55rem;
}

.iref-progress-stacked__bar {
    height: 100%;
    width: 0;   /* animated from JS */
    transition: width 0.55s cubic-bezier(0.4, 0, 0.2, 1);
}

.iref-progress-stacked__bar--complete { background: #16a34a; }
.iref-progress-stacked__bar--progress { background: #d97706; }

.iref-course-progress-card__meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.iref-legend {
    font-size: 0.78rem;
    font-weight: 500;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.iref-legend::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.iref-legend--complete::before    { background: #16a34a; }
.iref-legend--progress::before    { background: #d97706; }
.iref-legend--none::before        { background: #e5e7eb; border: 1px solid #d1d5db; }
.iref-legend--notstarted::before  { background: #f87171; }
.iref-legend--unused::before      { background: #e5e7eb; border: 1px solid #d1d5db; }

.iref-progress-stacked__bar--notstarted { background: #f87171; }
.iref-progress-stacked__bar--unused     { background: #e5e7eb; }

.iref-coupon-progress-card { margin-top: 12px; }
.iref-course-progress-card__label { font-size: 0.85em; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* ── Coupon table ───────────────────────────────────────────────────────────── */

.iref-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.iref-coupon-table .iref-col-num    { text-align: center; width: 80px; }
.iref-coupon-table .iref-col-action { width: 60px; text-align: right; }
.iref-coupon-table .iref-coupon-desc { color: #6b7280; font-size: 0.9em; }

.iref-coupon-row--low td { background: #fffbeb; }

.iref-coupon-remaining--low {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.82em;
}

.iref-coupon-edit-row td { background: #f9fafb; padding: 12px 16px; }

.iref-coupon-form { }
.iref-coupon-form--inline { }

.iref-coupon-form__fields {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.iref-coupon-form__field { display: flex; flex-direction: column; gap: 4px; }
.iref-coupon-form__field label { font-size: 0.8em; font-weight: 600; color: #374151; }
.iref-coupon-form__field input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 0.9em; }
.iref-coupon-form__field input:focus { outline: none; border-color: #C41E1E; box-shadow: 0 0 0 2px rgba(196,30,30,0.15); }
.iref-coupon-form__field--sm input { width: 90px; }

.iref-coupon-form__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.iref-coupon-form__msg {
    font-size: 0.85em;
    color: #6b7280;
    margin: 0;
}
.iref-coupon-form__msg.is-error { color: #dc2626; }
.iref-coupon-form__msg.is-success { color: #16a34a; }

.iref-btn--sm {
    font-size: 0.8em;
    padding: 4px 10px;
}

.iref-btn--cancel {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}
.iref-btn--cancel:hover { background: #e5e7eb; }

/* ── Quick link cards ───────────────────────────────────────────────────────── */

.iref-quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.iref-quick-link-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: #f8faff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.iref-quick-link-card:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    text-decoration: none;
}

.iref-quick-link-card__title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1e3a8a;
}

.iref-quick-link-card__desc {
    font-size: 0.78rem;
    color: #6b7280;
}

/* ── Pagination ────────────────────────────────────────────────────────────── */

.iref-table tr.iref-page-hidden {
    display: none;
}

.iref-pagination {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.iref-pagination__info {
    flex: 1;
    text-align: center;
    font-size: 0.82rem;
    color: #6b7280;
    min-width: 120px;
}

.iref-btn--page {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
}

.iref-btn--page:hover:not(:disabled) { background: #e5e7eb; }
.iref-btn--page:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Manage button ─────────────────────────────────────────────────────────── */

.iref-btn--manage {
    background: #1d4ed8;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
}

.iref-btn--manage:hover { background: #1e40af; color: #fff; }

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .iref-clubs-table__head { display: none; }

    .iref-club-row {
        grid-template-columns: 1fr auto;
        gap: 0.35rem 0.5rem;
    }

    .iref-club-row__phone,
    .iref-club-row__stat    { display: none; }

    .iref-form-grid         { grid-template-columns: 1fr; }
    .iref-form-label--full  { grid-column: 1; }
}

@media (max-width: 640px) {
    .iref-dashboard__title  { font-size: 1.2rem; }
    .iref-table th,
    .iref-table td          { padding: 0.5rem 0.6rem; font-size: 0.8rem; }
    .iref-course-card       { padding: 1rem; }
}

/* =============================================================================
   Course Request Form — [iref_course_request]
   ============================================================================= */

.iref-course-request {
    margin-top: 1.25rem;
}

.iref-cr-gate {
    padding: 0.875rem 1rem;
    background: #f8f9fa;
    border-left: 4px solid #adb5bd;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #495057;
}

.iref-cr-gate--mismatch {
    border-left-color: #ffa94d;
    background: #fff9f0;
    color: #664d03;
}

.iref-cr-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.iref-cr-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.iref-cr-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.iref-cr-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.02em;
}

.iref-cr-field input[type="text"],
.iref-cr-field input[type="email"],
.iref-cr-field textarea {
    padding: 0.55rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
    background: #fff;
    color: #111827;
    width: 100%;
    box-sizing: border-box;
}

.iref-cr-field input[readonly] {
    background: #f3f4f6;
    color: #6b7280;
    cursor: default;
}

.iref-cr-field input:focus,
.iref-cr-field textarea:focus {
    outline: 2px solid #C41E1E;
    outline-offset: 1px;
    border-color: #C41E1E;
}

.iref-cr-field textarea {
    resize: vertical;
    min-height: 90px;
}

.iref-cr-actions {
    display: flex;
    align-items: center;
}

.iref-cr-submit-btn {
    padding: 0.6rem 1.5rem;
    background: #C41E1E;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.iref-cr-submit-btn:hover:not(:disabled) {
    background: #9e1818;
}

.iref-cr-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.iref-cr-response {
    padding: 0.75rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.iref-cr-response--success {
    background: #d1fae5;
    border-left: 4px solid #10b981;
    color: #065f46;
}

.iref-cr-response--error {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

@media (max-width: 600px) {
    .iref-cr-row--2col {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   Playbook — [iref_playbook]
   Mobile-first reference + announcement hub for IREF referees.
   ============================================================================= */

/* ── Search bar ────────────────────────────────────────────────────────────── */

.iref-pb-search-wrap {
    margin-bottom: 1rem;
}

.iref-pb-search {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.6rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.156a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E") no-repeat 0.8rem center;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.iref-pb-search:focus {
    border-color: #C41E1E;
    box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.12);
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */

.iref-pb-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.iref-pb-tabs::-webkit-scrollbar {
    display: none;
}

.iref-pb-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 0.75rem 1.5rem;
    font-size: 0.925rem;
    font-weight: 600;
    font-family: inherit;
    color: #6b7280;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.iref-pb-tab:hover {
    color: #374151;
}

.iref-pb-tab.active,
.iref-pb-tab[aria-selected="true"] {
    color: #C41E1E;
    border-bottom-color: #C41E1E;
}

/* ── Panel ─────────────────────────────────────────────────────────────────── */

.iref-pb-panel {
    display: none;
}

.iref-pb-panel.active {
    display: block;
}

/* ── Write actions bar ─────────────────────────────────────────────────────── */

.iref-pb-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.iref-btn--write {
    background: #C41E1E;
    color: #fff;
    font-size: 0.875rem;
}

.iref-btn--write:hover { background: #a31818; }

/* ── Write / edit form ─────────────────────────────────────────────────────── */

.iref-pb-form-wrap {
    background: #f8faff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.iref-pb-form-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 1rem;
}

.iref-pb-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Larger touch targets on mobile */
.iref-pb-form select,
.iref-pb-form .iref-form-input {
    font-size: 1rem;
    padding: 0.65rem 0.75rem;
    height: auto;
}

.iref-pb-content {
    min-height: 120px;
    font-size: 0.95rem;
    line-height: 1.6;
    padding: 0.65rem 0.75rem;
}

.iref-pb-form .iref-panel-actions {
    padding-top: 0;
    justify-content: flex-end;
    gap: 0.625rem;
}

/* ── Quill editor integration ──────────────────────────────────────────────── */

.iref-ql-wrap {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    font-size: 0.9375rem;
}

.iref-ql-wrap .ql-toolbar {
    border: none;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    padding: 0.35rem 0.5rem;
}

.iref-ql-wrap .ql-container {
    border: none;
    font-family: inherit;
    font-size: inherit;
}

.iref-ql-wrap .ql-editor {
    min-height: 140px;
    padding: 0.55rem 0.75rem;
    line-height: 1.6;
}

.iref-ql-wrap .ql-editor.ql-blank::before {
    color: #9ca3af;
    font-style: normal;
}

.iref-ql-wrap .ql-editor img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 0.25rem 0;
}

/* Focus ring to match other form inputs */
.iref-ql-wrap:focus-within {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

/* ── Post list ─────────────────────────────────────────────────────────────── */

.iref-pb-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.iref-pb-empty {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
    padding: 1.25rem 0;
}

.iref-pb-hidden {
    display: none !important;
}

.iref-pb-no-results {
    display: none;
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9rem;
    padding: 1.25rem 0;
}

.iref-pb-no-results.visible {
    display: block;
}

/* ── Card base ─────────────────────────────────────────────────────────────── */

.iref-pb-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.15s;
}

.iref-pb-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── On The Field: accordion ───────────────────────────────────────────────── */

.iref-pb-card--field .iref-pb-card__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.95rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    gap: 0.75rem;
    font-family: inherit;
    transition: background 0.1s;
}

.iref-pb-card--field .iref-pb-card__toggle:hover {
    background: #fafafa;
}

.iref-pb-card--field.open .iref-pb-card__toggle {
    background: #fafafa;
    border-bottom: 1px solid #e5e7eb;
}

/* Chevron icon — inline SVG via background */
.iref-pb-card__chevron {
    display: inline-block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%239ca3af'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E") no-repeat center;
    transition: transform 0.2s;
}

.iref-pb-card--field.open .iref-pb-card__chevron {
    transform: rotate(180deg);
}

/* ── Card title (shared) ───────────────────────────────────────────────────── */

.iref-pb-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
}

/* ── News / Club card header ───────────────────────────────────────────────── */

.iref-pb-card--news .iref-pb-card__header,
.iref-pb-card--club .iref-pb-card__header {
    padding: 1rem 1rem 0;
}

.iref-pb-card--news .iref-pb-card__title,
.iref-pb-card--club .iref-pb-card__title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.3rem;
}

.iref-pb-card__meta {
    font-size: 0.77rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0;
}

.iref-pb-club-tag {
    background: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    padding: 0.1rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Card body ─────────────────────────────────────────────────────────────── */

.iref-pb-card__body {
    padding: 0.875rem 1rem 1rem;
}

.iref-pb-card__content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
}

.iref-pb-card__content p:first-child { margin-top: 0; }
.iref-pb-card__content p:last-child  { margin-bottom: 0; }

.iref-pb-card__content ul,
.iref-pb-card__content ol {
    margin: 0.5rem 0;
    padding-left: 1.4rem;
}

/* ── Card admin actions ────────────────────────────────────────────────────── */

.iref-pb-card__admin {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .iref-pb-tab {
        padding: 0.65rem 1rem;
        font-size: 0.85rem;
    }

    .iref-pb-card__title {
        font-size: 0.9rem;
    }

    .iref-pb-card--field .iref-pb-card__toggle {
        padding: 0.85rem 0.875rem;
    }

    .iref-pb-card--news .iref-pb-card__header,
    .iref-pb-card--club .iref-pb-card__header {
        padding: 0.875rem 0.875rem 0;
    }

    .iref-pb-card__body {
        padding: 0.75rem 0.875rem 0.875rem;
    }

    .iref-pb-form-wrap {
        padding: 1rem;
    }
}

/* ================================================================
   Certificate panel (My Progress tab)
   ================================================================ */

/* Pin account + cert side by side, cert panel min-width so it fills the space */
.iref-cards--account-row {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .iref-cards--account-row {
        grid-template-columns: 1fr;
    }
}

.iref-cert-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
    min-height: 220px;
}

.iref-cert-panel h3 {
    width: 100%;
    text-align: left;
}

/* Thumbnail link */
.iref-cert-thumb-link {
    display: block;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    max-width: 200px;
    width: 100%;
}
.iref-cert-thumb-link:hover {
    border-color: #C41E1E;
    box-shadow: 0 4px 14px rgba(196, 30, 30, 0.15);
}
.iref-cert-thumb {
    display: block;
    width: 100%;
    height: auto;
}

/* Placeholder when thumbnail image not yet available */
.iref-cert-thumb-placeholder {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 8.5 / 11;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

/* Certificate icon */
.iref-cert-icon {
    font-size: 3rem;
    line-height: 1;
    display: block;
    margin-bottom: 0.5rem;
}
.iref-cert-icon--locked {
    opacity: 0.4;
}

/* Download button */
a.iref-btn--download,
a.iref-btn--download:visited {
    display: inline-block;
    padding: 7px 16px;
    background: #C41E1E;
    color: #fff !important;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: background 0.15s;
}
a.iref-btn--download:hover,
a.iref-btn--download:focus {
    background: #a01818;
    color: #fff !important;
    text-decoration: none !important;
}

/* Pending state */
.iref-cert-pending p,
.iref-cert-locked p {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
}
.iref-cert-pending p:first-of-type {
    font-weight: 600;
    color: #2d7a2d;
    font-size: 1rem;
}
.iref-cert-pending__note {
    font-size: 0.8rem !important;
    color: #888 !important;
    margin-top: 0.25rem !important;
}
.iref-cert-locked__pct {
    font-weight: 600;
    color: #C41E1E !important;
    font-size: 0.95rem !important;
    margin-top: 0.25rem !important;
}

/* ================================================================
   Dashboard view-switcher
   ================================================================ */

.iref-dash-switcher {
    margin-bottom: 24px;
    border-bottom: 3px solid #C41E1E;
    padding-bottom: 0;
}

.iref-dash-tabs {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    align-items: stretch;
}

/* Tab links — use !important to override GP global anchor styles */
a.iref-dash-tab {
    display: inline-flex !important;
    align-items: center !important;
    padding: 10px 22px !important;
    background: #ececec !important;
    color: #555 !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    border: 1px solid #d0d0d0 !important;
    border-bottom: none !important;
    border-radius: 5px 5px 0 0 !important;
    transition: background 0.15s, color 0.15s !important;
    cursor: pointer;
    white-space: nowrap;
}

a.iref-dash-tab:hover {
    background: #e0e0e0 !important;
    color: #222 !important;
    text-decoration: none !important;
}

a.iref-dash-tab.iref-dash-tab--active {
    background: #fff !important;
    color: #C41E1E !important;
    border-color: #C41E1E !important;
    border-bottom: 3px solid #fff !important;
    font-weight: 700 !important;
    margin-bottom: -3px; /* sit flush on the red border-bottom */
}

/* Club selector below tabs (program admin Club Admin view) */
.iref-dash-club-selector {
    padding: 10px 0 4px;
}

.iref-dash-club-selector select {
    padding: 7px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    background: #fff;
    cursor: pointer;
    max-width: 320px;
    width: 100%;
}

/* ── My Profile page ───────────────────────────────────────────────────────── */

.iref-profile-page .iref-card {
    margin-bottom: 1.25rem;
    background: #fff;
}

.iref-profile__info-card .iref-dl {
    max-width: 520px;
}

.iref-profile__meta {
    color: #6b7280;
    font-size: 0.85em;
}

.iref-profile__lead {
    margin: 0 0 1.25rem;
    font-size: 0.9rem;
    color: #6b7280;
}

/* ── Notification preference list ──────────────────────────────────────────── */

.iref-notify__list {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.iref-notify__item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.125rem;
    border-bottom: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background 0.12s;
    user-select: none;
}

.iref-notify__item:last-child {
    border-bottom: none;
}

.iref-notify__item:hover {
    background: #f9fafb;
}

/* Custom checkbox */

.iref-notify__checkbox-wrap {
    position: relative;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.iref-notify__checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.iref-notify__checkmark {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}

.iref-notify__checkbox:checked + .iref-notify__checkmark {
    background: #1d4ed8;
    border-color: #1d4ed8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpolyline points='1,5 4.5,9 11,1' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px 10px;
    background-repeat: no-repeat;
    background-position: center;
}

.iref-notify__checkbox:focus + .iref-notify__checkmark {
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.18);
    border-color: #1d4ed8;
}

/* Notification text */

.iref-notify__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    line-height: 1.4;
}

.iref-notify__label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
}

.iref-notify__desc {
    font-size: 0.82rem;
    color: #6b7280;
}

/* Footer row */

.iref-notify__footer {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.iref-notify__status {
    font-size: 0.875rem;
    font-weight: 500;
}

.iref-notify__status--ok {
    color: #15803d;
}

.iref-notify__status--err {
    color: #dc2626;
}

/* Primary button (for profile save, etc.) */

.iref-btn--primary {
    background: #1d4ed8;
    color: #fff;
}

.iref-btn--primary:hover {
    background: #1e40af;
}

/* ── Notification groups ────────────────────────────────────────────────────── */

.iref-notify__group {
    margin-bottom: 2rem;
}

.iref-notify__group:last-of-type {
    margin-bottom: 0;
}

.iref-notify__group-title {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin: 0 0 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #e5e7eb;
}

.iref-btn--primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

/* ── View toggle (table / tiles) ────────────────────────────────────────────── */

.iref-view-toggle {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.iref-btn--view {
    background: #fff;
    color: #374151;
    border: none;
    border-radius: 0;
    padding: 0.45rem 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.iref-btn--view + .iref-btn--view {
    border-left: 1px solid #d1d5db;
}

.iref-btn--view:hover {
    background: #f3f4f6;
}

.iref-btn--view-active {
    background: #1d4ed8;
    color: #fff;
}

.iref-btn--view-active:hover {
    background: #1e40af;
}

/* ── Referee tile grid ──────────────────────────────────────────────────────── */

.iref-ref-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.iref-ref-tile {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 1.25rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.3rem;
    transition: box-shadow 0.15s;
}

.iref-ref-tile:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.iref-ref-tile.iref-hidden,
.iref-ref-tile.iref-page-hidden {
    display: none;
}

.iref-ref-tile__avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    background: #f3f4f6;
}

.iref-ref-tile__name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.iref-ref-tile__username {
    font-size: 0.8rem;
    color: #6b7280;
    font-family: ui-monospace, monospace;
}

.iref-ref-tile__email {
    font-size: 0.775rem;
    color: #4b5563;
    word-break: break-all;
    line-height: 1.3;
}

.iref-ref-tile__courses {
    margin-top: 0.625rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.iref-ref-tile__course-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    font-size: 0.775rem;
}

.iref-ref-tile__course-label {
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    text-align: left;
}

.iref-ref-tile__course-row .iref-status {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    white-space: nowrap;
    flex-shrink: 0;
}
