/* styles.css — YPO Hyderabad Admin Portal
   Brand tokens per spec/YPO_Hyd_Brand_Token_Table.md */

:root {
    /* Core brand */
    --primary: #041E42;
    --gold: #D69D23;
    --white: #FFFFFF;
    --blue: #0057B7;
    --purple: #753BBD;

    /* Semantic */
    --success: #64A70B;
    --success-surface: rgba(151, 215, 0, 0.2);
    --warning: #EA7600;
    --warning-surface: rgba(255, 158, 27, 0.2);
    --error: #DA291C;
    --error-surface: rgba(248, 72, 94, 0.2);
    --info: #0057B7;

    /* Surface / text */
    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --text-primary: #041E42;
    --text-secondary: rgba(4, 30, 66, 0.55);
    --text-disabled: rgba(4, 30, 66, 0.3);
    --text-on-primary: #FFFFFF;
    --divider: rgba(4, 30, 66, 0.1);
    --hover-tint: rgba(4, 30, 66, 0.03);
    --card-shadow: 0px 2px 8px rgba(4, 30, 66, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    /* Gotham is the brand typeface; Outfit/Inter are the closest web-safe stand-ins. */
    --font-header: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-header); color: var(--text-primary); }

/* Gold keyboard focus ring — mandatory per web idiom baseline */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ===================== Login Screen ===================== */

.login-screen {
    position: fixed;
    inset: 0;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0px 8px 32px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .logo-placeholder { margin: 0 auto 12px; }
.login-brand h1 { font-size: 22px; letter-spacing: 3px; }
.login-brand span { color: var(--text-secondary); font-size: 13px; }

.login-step { display: flex; flex-direction: column; gap: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ===================== Layout ===================== */

.dashboard-wrapper { display: flex; min-height: 100vh; }

/* Sidebar — Primary nav bar per brand tokens */
.sidebar {
    width: 270px;
    background-color: var(--primary);
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    position: fixed;
    height: 100vh;
    z-index: 50;
}

.brand-section { display: flex; align-items: center; gap: 12px; padding: 0 6px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); flex-shrink: 0; }

.logo-placeholder {
    width: 44px; height: 44px;
    background: var(--gold);
    color: var(--primary);
    font-family: var(--font-header);
    font-weight: 800;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.brand-info h1 { color: var(--white); font-size: 16px; letter-spacing: 2px; }
.brand-info span { color: rgba(255, 255, 255, 0.55); font-size: 11px; }

/* The nav scrolls inside itself, so the brand stays at the top and Log Out stays at the
   bottom no matter how short the window is. Before this, the whole sidebar overflowed 100vh
   (765px of content in a 693px viewport with 12 tabs) and the footer was simply cut off —
   reported 19 Aug. min-height:0 is what actually lets a flex child scroll. */
.nav-menu {
    display: flex; flex-direction: column; gap: 2px;
    margin-top: 14px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.nav-menu::-webkit-scrollbar { width: 6px; }
.nav-menu::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 3px; }
.nav-menu::-webkit-scrollbar-track { background: transparent; }

.nav-btn {
    display: flex; align-items: center; gap: 12px;
    background: transparent; border: none;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-body);
    font-size: 14px; font-weight: 500;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.nav-btn i { width: 18px; text-align: center; }
.nav-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.nav-btn.active { background: rgba(255, 255, 255, 0.1); color: var(--gold); }

.sidebar-footer { border-top: 1px solid rgba(255, 255, 255, 0.12); padding-top: 14px; margin-top: 8px; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }

.user-profile { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.user-profile .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.user-info h3 { color: var(--white); font-size: 13px; }
.user-info span { color: rgba(255, 255, 255, 0.5); font-size: 11px; }

.btn-logout {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
    padding: 9px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-logout:hover { background: rgba(255, 255, 255, 0.08); }

/* Main content */
.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 28px 36px 48px;
    min-width: 0;
}

.top-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-title h2 { font-size: 24px; font-weight: 700; }
.page-title p { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.16s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===================== Stats ===================== */

.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.stat-label {
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.stat-num { font-family: var(--font-header); font-size: 32px; font-weight: 700; color: var(--text-primary); line-height: 1; }

/* ===================== Toolbar / Actions Bar ===================== */

.actions-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }

.search-box {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    height: 40px;
    width: 320px;
}
.search-box:hover { border-color: rgba(4, 30, 66, 0.3); }
.search-box:focus-within { border-color: var(--gold); border-width: 1.5px; }
.search-box i { color: var(--text-secondary); font-size: 14px; }
.search-box input {
    border: none; background: transparent; outline: none;
    font-family: var(--font-body); font-size: 14px;
    color: var(--text-primary);
    width: 100%; height: 100%;
}
.search-box input::placeholder { color: var(--text-secondary); }

.filter-select {
    height: 40px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    padding: 0 12px;
    cursor: pointer;
}
.filter-select:hover { border-color: rgba(4, 30, 66, 0.3); }

.button-group { display: flex; gap: 10px; margin-left: auto; }

/* Tab strip (Upcoming / Past) */
.tab-strip { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); }
.tab-strip-btn {
    background: transparent; border: none;
    font-family: var(--font-body); font-size: 15px; font-weight: 500;
    color: var(--text-secondary);
    padding: 10px 18px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}
.tab-strip-btn:hover { color: var(--text-primary); }
.tab-strip-btn.active { color: var(--text-primary); border-bottom-color: var(--gold); }

/* ===================== Buttons ===================== */

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-body);
    font-size: 13px; font-weight: 600;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: var(--text-on-primary); }
.btn-primary:hover { background: #0b2e5c; }

.btn-gold { background: var(--gold); color: var(--primary); }
.btn-gold:hover { background: #c08c1e; }

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-secondary:hover { background: rgba(4, 30, 66, 0.04); }

.btn-tertiary { background: transparent; color: var(--primary); font-weight: 500; }
.btn-tertiary:hover { background: rgba(4, 30, 66, 0.04); }

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

.btn-danger-outline {
    background: transparent;
    border: 1.5px solid var(--error);
    color: var(--error);
}
.btn-danger-outline:hover { background: var(--error-surface); }

.btn-text { background: transparent; color: var(--primary); font-weight: 500; height: 32px; padding: 0 6px; }
.btn-text:hover { text-decoration: underline; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===================== Tables ===================== */

.table-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    overflow-x: auto;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table thead th {
    text-align: left;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 14px 16px;
    border-bottom: 1px solid var(--divider);
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider);
    font-size: 14px;
    color: var(--text-primary);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr.clickable-row { cursor: pointer; }
.data-table tbody tr.clickable-row:hover { background: var(--hover-tint); }

.text-right { text-align: right !important; }

.empty-cell {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--text-secondary);
}
.empty-cell .empty-icon { font-size: 36px; color: var(--text-disabled); display: block; margin-bottom: 10px; }
.empty-cell .empty-headline { font-weight: 600; font-size: 15px; color: var(--text-primary); display: block; }
.empty-cell .empty-body { font-size: 13px; color: var(--text-secondary); }

/* Member cell */
.user-row-display { display: flex; align-items: center; gap: 12px; }
.user-row-display .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: var(--text-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.user-row-display .avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-weight: 600; font-size: 14px; }
.user-sub { color: var(--text-secondary); font-size: 12px; }

.last-active-never { color: var(--text-disabled); font-style: italic; }

/* ===================== Badges / Pills ===================== */

.badge {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
}
.badge-success { background: var(--success-surface); color: var(--success); }
.badge-danger { background: var(--error-surface); color: var(--error); }
.badge-secondary { background: rgba(4, 30, 66, 0.1); color: rgba(4, 30, 66, 0.7); }
/* Phase 15 §UX: Dismissed referral pill is Primary-7%/70% (distinct from the shared 10% secondary token). */
.badge-referral-dismissed { background: rgba(4, 30, 66, 0.07); color: rgba(4, 30, 66, 0.7); }
.badge-purple { background: rgba(150, 120, 211, 0.2); color: var(--purple); }
/* Walk-in attendee: matched member who attended without registering (#84 follow-up). */
.badge-info { background: rgba(0, 87, 183, 0.12); color: var(--blue); }
.attendance-locked-caption { color: var(--text-secondary); }
.attendance-locked-caption i { color: var(--gold); margin-right: 4px; }
.badge-blue { background: rgba(0, 87, 183, 0.1); color: var(--blue); }
.badge-gold { background: rgba(214, 157, 35, 0.2); color: var(--gold); }
.badge-warning { background: var(--warning-surface); color: var(--warning); }

/* Action icon buttons */
.action-btn {
    position: relative;
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.action-btn:hover { background: rgba(4, 30, 66, 0.06); color: var(--primary); }
.action-btn.delete-btn:hover { background: var(--error-surface); color: var(--error); }

/* Hover label for the Actions-column icons (data-tooltip holds the text). */
.action-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 8px;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(4, 30, 66, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s, transform 0.15s;
    z-index: 20;
}
.action-btn[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* The events table sits in an overflow-clipping container; let its action-row
   tooltips escape it (so the top row's label isn't clipped at the card edge). */
.table-container:has(#events-table) { overflow: visible; }

/* ===================== Cards / Settings ===================== */

.settings-stack { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }

.settings-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 20px;
}
.settings-stack .settings-card { margin-bottom: 0; }

.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.card-header i { color: var(--gold); font-size: 16px; }
.card-header h3 { font-size: 17px; font-weight: 600; }
.card-caption { color: var(--text-secondary); font-size: 13px; margin-bottom: 16px; }

.section-title {
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 28px 0 2px;
}
.section-caption { color: var(--text-secondary); font-size: 12px; margin-bottom: 12px; }

.empty-note { color: var(--text-secondary); font-size: 13px; }

/* Chips (Event Window) */
.chip-row { display: flex; gap: 10px; margin-bottom: 16px; }
.chip {
    height: 36px;
    padding: 0 18px;
    border-radius: 18px;
    border: 1px solid var(--divider);
    background: var(--surface);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.chip:hover { border-color: rgba(4, 30, 66, 0.3); }
.chip.selected { background: var(--primary); color: var(--text-on-primary); border-color: var(--primary); }

/* Feedback template question rows */
.template-question {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}
.template-question .q-text { flex: 1; font-size: 14px; }
.template-question .q-type { font-size: 11px; font-weight: 600; background: rgba(4, 30, 66, 0.1); color: rgba(4, 30, 66, 0.7); padding: 3px 10px; border-radius: 20px; }

/* ===================== Forms ===================== */

.settings-form { display: flex; flex-direction: column; gap: 14px; }

.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; position: relative; }

.form-group label { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.form-group label .req { color: var(--error); }

.form-group input,
.form-group select,
.form-group textarea {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover { border-color: rgba(4, 30, 66, 0.3); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--gold); border-width: 1.5px; }
.form-group input.input-error,
.form-group textarea.input-error { border-color: var(--error); border-width: 1.5px; background: rgba(248, 72, 94, 0.06); }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-secondary); opacity: 0.7; }
.form-group textarea { resize: vertical; min-height: 72px; }

.input-desc { font-size: 12px; color: var(--text-secondary); }
.field-error { font-size: 12.5px; color: var(--error); display: none; }
.field-error.visible { display: block; }

.char-counter { font-size: 11.5px; color: var(--text-secondary); align-self: flex-end; display: none; }
.char-counter.visible { display: block; }
.char-counter.warn { color: var(--warning); font-weight: 600; }

.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-row-3 .form-group { flex: 1; }

.form-section-label {
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--divider);
    padding-bottom: 6px;
    margin-top: 10px;
}
.section-sublabel { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-secondary); }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; }

.radio-row { display: flex; gap: 24px; }
.radio-option { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio-option input { width: auto; accent-color: var(--primary); cursor: pointer; }

/* Children repeatable rows */
.child-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.child-row input { flex: 1; }
.child-remove {
    background: transparent; border: none;
    color: var(--text-secondary);
    font-size: 18px;
    width: 28px; height: 28px;
    cursor: pointer;
    border-radius: 50%;
}
.child-remove:hover { color: var(--error); background: var(--error-surface); }

/* System fields */
.system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; padding: 4px 0; }
.system-field { display: flex; flex-direction: column; gap: 4px; }
.system-label { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-secondary); }
.system-value { font-size: 14px; color: var(--text-disabled); }

/* Toggle switch */
.toggle-container { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-container input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-slider {
    width: 44px; height: 24px;
    background: rgba(4, 30, 66, 0.2);
    border-radius: 12px;
    position: relative;
    transition: background 0.15s;
    flex-shrink: 0;
}
.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.15s;
}
.toggle-container input:checked + .toggle-slider { background: var(--success); }
.toggle-container input:checked + .toggle-slider::after { transform: translateX(20px); }
.toggle-container input:focus-visible + .toggle-slider { outline: 2px solid var(--gold); outline-offset: 2px; }
.toggle-label { font-size: 14px; }

/* ===================== Modals ===================== */

.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(4, 30, 66, 0.4);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 200;
    padding: 40px 20px;
    overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
/* Confirmation dialogs must sit above whatever modal triggered them
   (e.g. deleting a photo from inside the Event Detail modal). All other
   backdrops share z-index 200, so DOM order alone would paint this behind
   a later modal. */
#confirm-modal { z-index: 600; }

.modal-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0px 8px 32px rgba(4, 30, 66, 0.25);
    width: 100%;
    max-width: 560px;
    padding: 24px;
    animation: modalIn 0.2s ease-out;
}
.modal-wide { max-width: 720px; }
.modal-confirm { max-width: 480px; }

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h3 { font-size: 19px; font-weight: 700; }

.close-modal-btn {
    background: transparent; border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px; height: 32px;
    border-radius: 50%;
    line-height: 1;
}
.close-modal-btn:hover { background: rgba(4, 30, 66, 0.06); color: var(--primary); }

.modal-form { display: flex; flex-direction: column; gap: 14px; }

/* Image crop modal (Cropper.js) */
.crop-hint { margin: 0 0 10px; color: #667085; font-size: 13px; }
.crop-stage { max-height: 60vh; overflow: hidden; background: #f0f1f4; border-radius: 8px; }
.crop-stage img { display: block; max-width: 100%; }

/* Event Detail view (Registrations / Photos / Feedback tabs) */
.event-detail-meta { margin: 0 0 12px; color: #667085; font-size: 13px; }
.detail-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--primary); border-bottom-color: rgba(4,30,66,0.1); margin-bottom: 16px; }
.detail-tab { background: none; border: none; padding: 10px 16px; font-size: 14px; font-weight: 500; color: #667085; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.detail-tab:hover { color: var(--primary); }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--gold); font-weight: 600; }
.detail-panel { min-height: 120px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f0f1f4; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-delete { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(4,30,66,0.7); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.photo-delete:hover { background: var(--error, #DA291C); }
.feedback-q-list { list-style: none; padding: 0; margin: 8px 0 16px; }
.feedback-q-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border: 1px solid rgba(4,30,66,0.1); border-radius: 8px; margin-bottom: 6px; }
.feedback-q-list em { color: #667085; font-style: normal; font-size: 12px; }
.feedback-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.feedback-add input[type=text] { flex: 1; min-width: 160px; padding: 8px 10px; border: 1px solid rgba(4,30,66,0.15); border-radius: 8px; }
.feedback-add select { padding: 8px 10px; border: 1px solid rgba(4,30,66,0.15); border-radius: 8px; }
.feedback-summary-q { border: 1px solid rgba(4,30,66,0.1); border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.feedback-q-title { font-weight: 600; margin-bottom: 6px; }
.feedback-text { color: #344054; font-style: italic; padding: 4px 0; border-top: 1px solid rgba(4,30,66,0.06); }

.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.split-footer { justify-content: space-between; }
.footer-left, .footer-right { display: flex; gap: 10px; }

.confirm-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.confirm-body { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }

.warning-text { color: var(--error); font-size: 13px; }

/* ===================== CSV Import ===================== */

.import-card {
    display: flex; align-items: center; gap: 14px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    padding: 16px;
}
.import-icon { font-size: 28px; color: var(--primary); }
.import-card > div { flex: 1; }
.import-title { font-weight: 600; font-size: 14px; }
.import-caption { font-size: 12.5px; color: var(--text-secondary); }

.dropzone {
    border: 2px dashed var(--divider);
    border-radius: var(--radius-md);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}
.dropzone i { font-size: 30px; color: var(--text-disabled); }
.dropzone:hover { border-color: rgba(4, 30, 66, 0.3); }
.dropzone.drag-over { border: 1.5px solid var(--gold); background: rgba(214, 157, 35, 0.04); }
.browse-link { color: var(--primary); font-weight: 600; text-decoration: underline; }

.file-chip {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--divider);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    align-self: flex-start;
}
.file-chip i { color: var(--primary); }

.chip-remove {
    background: transparent; border: none;
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    width: 22px; height: 22px;
    border-radius: 50%;
    line-height: 1;
}
.chip-remove:hover { color: var(--error); background: var(--error-surface); }

.import-summary { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.import-summary.all-skipped { color: var(--warning); }
.import-error-list {
    list-style: none;
    max-height: 160px;
    overflow-y: auto;
    font-size: 12.5px;
    color: var(--error);
    margin-bottom: 10px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}
.import-error-list:empty { display: none; border: none; padding: 0; }
.import-error-list li { padding: 2px 0; }

/* ===================== Registrations ===================== */

.registrations-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.registrations-count { font-size: 16px; font-weight: 600; }
.registrations-count .count-blue { color: var(--blue); }
.attendance-table-container { max-height: 420px; overflow-y: auto; border: 1px solid var(--divider); border-radius: var(--radius-sm); }

.attendance-guests {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    color: var(--text-primary);
}

/* ===================== ExCo ===================== */

.exco-search-results {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-sm);
    box-shadow: 0px 4px 16px rgba(4, 30, 66, 0.16);
    max-height: 220px;
    overflow-y: auto;
    z-index: 20;
    display: none;
}
.exco-search-results.open { display: block; }
.exco-result-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px;
    cursor: pointer;
    width: 100%;
    background: transparent; border: none;
    font-family: var(--font-body); font-size: 14px;
    color: var(--text-primary);
    text-align: left;
}
.exco-result-row:hover { background: rgba(4, 30, 66, 0.04); }
.exco-result-row .avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary); color: var(--text-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
    flex-shrink: 0;
}
.exco-result-row .result-company { color: var(--text-secondary); font-size: 12px; margin-left: auto; }

.member-chip {
    display: inline-flex; align-items: center; gap: 10px;
    border: 1px solid var(--divider);
    border-radius: 24px;
    padding: 6px 12px 6px 6px;
    align-self: flex-start;
    font-weight: 600; font-size: 14px;
}
.member-chip .avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--primary); color: var(--text-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}

/* ===================== News Review Queue (Phase 12) ===================== */

.news-count { font-size: 16px; font-weight: 500; color: var(--text-secondary); }
.news-count b { color: var(--text-primary); font-weight: 700; }

.news-list { display: flex; flex-direction: column; gap: 14px; }

.news-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* Negative-sentiment items are tinted Error at 2.5% with a subtle red edge. */
.news-card.negative { background: rgba(218, 41, 28, 0.025); border: 1px solid rgba(218, 41, 28, 0.18); }

.news-card-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.news-member { display: flex; align-items: center; gap: 10px; min-width: 0; }
.news-member .avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--primary); color: var(--text-on-primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}
.news-member .avatar img { width: 100%; height: 100%; object-fit: cover; }
.news-member-name { font-weight: 600; font-size: 14px; }
.news-member-company { color: var(--text-secondary); font-size: 12px; }

.news-pills { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.news-headline { font-family: var(--font-header); font-size: 17px; font-weight: 600; line-height: 1.35; }
.news-summary { font-size: 14px; color: var(--text-primary); line-height: 1.55; }

.news-meta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.news-source-link {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600;
    color: var(--blue);
    text-decoration: none;
}
.news-source-link:hover { text-decoration: underline; }
.news-candidate-date { font-size: 12.5px; color: var(--text-secondary); }

/* Delight Moment — "news goes live" commitment sweep (spec §4): Primary→Success
   over 200ms with a transient "Published ✓" and a spring pulse. */
@keyframes publishPulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.06); }
    70%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}
.btn.publish-sweep {
    background: var(--success) !important;
    color: #fff !important;
    transition: background 0.2s ease;
    animation: publishPulse 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s;
}

/* Sentiment pill tints per brand tokens */
.pill-sentiment-positive { background: var(--success-surface); color: var(--success); }
.pill-sentiment-neutral { background: rgba(4, 30, 66, 0.07); color: rgba(4, 30, 66, 0.7); }
/* Error-derived surface (the shared --error-surface token is Lred-derived); text stays --error. */
.pill-sentiment-negative { background: rgba(218, 41, 28, 0.10); color: var(--error); }
/* Confidence pill — Gold at 15% */
.pill-confidence { background: rgba(214, 157, 35, 0.15); color: var(--gold); }

.news-negative-flag {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--error); font-weight: 500;
}

.news-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }

.news-empty {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
    text-align: center;
    padding: 48px 16px;
}
.news-empty .empty-icon { font-size: 36px; color: var(--text-disabled); display: block; margin-bottom: 10px; }
.news-empty .empty-headline { font-weight: 600; font-size: 15px; color: var(--text-primary); display: block; }
.news-empty .empty-body { font-size: 13px; color: var(--text-secondary); }

/* News review modal */
.news-negative-note {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--error-surface);
    color: var(--error);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
}
.news-negative-note i { margin-top: 2px; }
.news-source-line { font-size: 13px; color: var(--text-secondary); margin-top: -4px; }
.news-source-line a { color: var(--blue); font-weight: 600; text-decoration: none; }
.news-source-line a:hover { text-decoration: underline; }

/* ===================== Toasts ===================== */

.toast-container {
    position: fixed;
    top: 24px; right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 400;
    max-width: 380px;
}

.toast {
    display: flex; align-items: center; gap: 10px;
    background: var(--primary);
    color: var(--text-on-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: 0px 4px 16px rgba(4, 30, 66, 0.3);
    font-size: 14px;
    animation: toastIn 0.2s ease-out;
    border-left: 4px solid var(--blue);
}
.toast.success { border-left-color: var(--success); }
.toast.success i { color: #97D700; }
.toast.error { border-left-color: var(--error); }
.toast.error i { color: #F8485E; }
.toast.info i { color: #41B6E6; }

.toast-close {
    background: transparent; border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 16px;
    margin-left: auto;
    line-height: 1;
}
.toast-close:hover { color: var(--white); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(40px); }
}

/* ===================== Responsive ===================== */

@media (max-width: 900px) {
    .sidebar { width: 76px; padding: 24px 10px; }
    .sidebar .brand-info, .nav-btn span, .user-info, .btn-logout span { display: none; }
    .nav-btn { justify-content: center; }
    .main-content { margin-left: 76px; padding: 20px; }
    .form-row { flex-direction: column; }
    .search-box { width: 100%; }
    .button-group { margin-left: 0; }
}

/* ===================== Committees (Phase 14) ===================== */
.row-actions { display: inline-flex; gap: 4px; justify-content: flex-end; }
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.action-btn:disabled:hover { background: transparent; color: var(--text-secondary); }

.committee-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--divider, #eef0f2);
}
.committee-member-row .avatar { flex-shrink: 0; }
.committee-member-info { flex: 1; min-width: 0; }
.committee-designation-input {
    width: 100%;
    margin-top: 4px;
    font-family: inherit;
    font-size: 12px;
    color: var(--primary);
    border: 1px solid var(--divider, #e5e7eb);
    border-radius: 8px;
    padding: 6px 9px;
}
.committee-designation-input:focus { outline: none; border-color: var(--primary); }

.chair-toggle {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--divider, #e5e7eb);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}
.chair-toggle.on {
    background: rgba(117, 59, 189, 0.12);
    color: var(--purple);
    border-color: rgba(117, 59, 189, 0.3);
}

.ccc-flag {
    margin-top: 16px;
    padding: 12px 14px;
    background: rgba(117, 59, 189, 0.05);
    border: 1px solid rgba(117, 59, 189, 0.2);
    border-radius: 10px;
}
.ccc-toggle { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.ccc-toggle input { margin-top: 3px; }
.ccc-text { font-size: 12px; }
.ccc-text b { display: block; font-size: 13px; color: var(--primary); }
.ccc-text span { color: var(--text-secondary); }
/* ============ Referrals (Phase 15 — Refer a New Member) ============ */
/* In-app portal notification: red count badge on the Referrals nav item. */
.nav-btn .nav-badge {
    margin-left: auto;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--error); color: var(--white);
    font-size: 11px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-btn.active .nav-badge { background: var(--gold); color: var(--primary); }

.referral-cards { display: flex; flex-direction: column; gap: 12px; }

.referral-card {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    box-shadow: var(--card-shadow);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.referral-card.has-dup { border-color: rgba(234, 118, 0, 0.5); }

.referral-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.referral-name {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.referral-meta { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; }
.referral-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.referral-actions .btn { padding: 7px 13px; font-size: 12px; }

.referral-duptag {
    font-size: 10px; font-weight: 700; color: var(--warning);
    background: var(--warning-surface);
    padding: 2px 8px; border-radius: 20px; white-space: nowrap;
}

.referral-dupbar {
    margin-top: 12px;
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 12px; font-weight: 500; color: #a85a00;
    background: rgba(234, 118, 0, 0.09);
    border: 1px solid rgba(234, 118, 0, 0.22);
    border-radius: var(--radius-sm);
    padding: 9px 12px; line-height: 1.45;
}
.referral-dupbar i { color: var(--warning); margin-top: 1px; }
.referral-dupbar b { color: var(--warning); }

.referral-grid {
    display: grid; grid-template-columns: 1fr 1.3fr 1.3fr; gap: 16px;
    margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--divider);
}
.referral-field .lb {
    font-size: 9px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--text-disabled); margin-bottom: 3px;
}
.referral-field .vl { font-size: 13px; color: var(--text-primary); font-weight: 500; word-break: break-word; }
.referral-field .vl small { color: var(--text-disabled); font-weight: 500; }

.referral-empty { text-align: center; padding: 48px 16px; color: var(--text-secondary); }
.referral-empty i { font-size: 28px; color: var(--divider); }
.referral-empty .b { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-top: 12px; }
.referral-empty .s { font-size: 12.5px; margin-top: 4px; }

@media (max-width: 720px) { .referral-grid { grid-template-columns: 1fr; } }

/* Chapter Holidays (Phase 21) — the count sits beside the actions so an admin sees what a
   replace would destroy before opening the upload dialog. */
#holidays-summary { display: flex; align-items: center; gap: 12px; }
.list-summary { color: var(--text-secondary); font-size: 14px; }
.list-summary strong { color: var(--text-primary); }


/* Upload result, shown on the page after the dialog closes (Phase 21 follow-up). The dialog
   used to stay open with a "Cancel" button beside a success toast, which read as a failure. */
.upload-result-banner {
    display: flex; align-items: center; gap: 12px;
    background: var(--success-surface, rgba(100, 167, 11, 0.12));
    border: 1px solid rgba(100, 167, 11, 0.35);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-primary);
}
.upload-result-banner i { color: var(--success, #64A70B); }
.upload-result-banner .banner-dismiss {
    margin-left: auto; background: none; border: none; cursor: pointer;
    font-size: 20px; line-height: 1; color: var(--text-secondary);
}
