/* ============================================================
   CAMP HUB — CENTRALIZED STYLESHEET
   ============================================================ */

/* --- Design Tokens --- */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-app: #f1f5f9;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --red-group: #ef4444;
    --carolina-group: #7bafd4;
    --green-group: #22c55e;
    --navy-group: #1e3a8a;
    --bus-group: #f59e0b;
    --lilplace-group: #6ee7b7;
    --kinderplace-group: #fef08a;
    --split-group: #fbbf24;
    --sprc-group: #94a3b8;
    --swim-group: #22d3ee;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --success: #22c55e;
}

/* --- Base --- */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.container-sm  { max-width: 900px;  margin: 0 auto; padding: 20px; }
.container-md  { max-width: 1000px; margin: 0 auto; padding: 20px; }
.container-lg  { max-width: 1100px; margin: 0 auto; padding: 20px; }
.container-xl  { max-width: 1400px; margin: 0 auto; padding: 20px; }

/* --- Navigation --- */
.nav-bar {
    background: white;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-radius: 0 0 12px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
}
.nav-bar::-webkit-scrollbar { display: none; }

.nav-btn {
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    background: #e2e8f0;
    color: var(--text-main);
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.nav-btn:hover { background: #cbd5e1; }
.nav-btn.primary { background: var(--primary); color: white; }

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    background: #e2e8f0;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-weight: 600;
    flex-shrink: 0;
    margin-left: auto;
    line-height: 1;
}
.nav-toggle:hover { background: #cbd5e1; }

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

/* --- Buttons --- */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}
.btn-primary, .btn.primary { background: var(--primary); color: white; }
.btn-primary:hover, .btn.primary:hover { background: var(--primary-hover); }
.btn-success, .btn.btn-success { background: #10b981; color: white; }
.btn-success:hover, .btn.btn-success:hover { background: #059669; }

/* --- Data Table (shared generic) --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}
.data-table th {
    background: #f8fafc;
    padding: 12px;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
}
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* Responsive table wrapper */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Camp Group Badges --- */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}
.Red      { background-color: var(--red-group); }
.Carolina { background-color: var(--carolina-group); }
.Green    { background-color: var(--green-group); }
.Navy     { background-color: var(--navy-group); }
.Bus        { background-color: var(--bus-group);        color: #451a03; }
.LilPlace   { background-color: var(--lilplace-group);   color: #064e3b; }
.KinderPlace{ background-color: var(--kinderplace-group); color: #713f12; }
.SPLIT      { background-color: var(--split-group);      color: #451a03; }
.SPRC       { background-color: var(--sprc-group);       color: #1e293b; }
.Swim       { background-color: var(--swim-group);       color: #083344; }

/* --- Alert / Banner --- */
.alert {
    background: #dcfce7;
    color: #166534;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #bbf7d0;
}

/* --- Utility --- */
.text-right  { text-align: right; }
.mt-20       { margin-top: 20px; }
.text-muted  { color: var(--text-muted); }

/* Back navigation link */
.back-link { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; white-space: nowrap; }
.back-link:hover { color: var(--text-main); }

/* Pipe separator */
.pipe-sep { color: var(--border-color); }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* Page header flex row */
.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.page-header h1 { margin: 0; font-size: 1.5rem; }
.page-header p  { margin: 2px 0 0; color: var(--text-muted); font-size: 0.875rem; }

/* --- Navigation Links (counselor/camper) --- */
.counselor-link,
.camper-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}
.counselor-link:hover,
.camper-item a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}
.camper-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

/* ============================================================
   SHARED: SEARCH HEADER + INPUT
   ============================================================ */
.search-header {
    background: white;
    padding: 24px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}
.search-bar-container {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}
.search-input {
    flex: 1;
    min-width: 180px;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
}
.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
    outline: none;
}

/* ============================================================
   SHARED: DATE BAR
   ============================================================ */
.date-bar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: var(--shadow);
}
.date-bar label { font-weight: 600; font-size: 0.875rem; }
.date-bar input[type=date] {
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
}

/* ============================================================
   ACTIVITY MANAGER
   ============================================================ */
.rules-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.upload-banner {
    background: #f1f5f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 2px dashed #cbd5e1;
}
.sports-row  { border-left: 5px solid #ef4444; }
.enrich-row  { border-left: 5px solid #3b82f6; }

/* ============================================================
   ATTENDANCE FORM
   ============================================================ */
.att-header { margin-bottom: 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.att-title h1 { margin: 0; font-size: 1.5rem; }
.att-title p  { margin: 2px 0 0; color: var(--text-muted); font-size: 0.875rem; }

.roster-card { background: white; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: var(--shadow); overflow: hidden; }
.roster-card-header { padding: 16px 20px; border-bottom: 2px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.count-bar     { font-size: 0.82rem; color: var(--text-muted); }
.count-present { color: #166534; font-weight: 700; }
.count-absent  { color: #991b1b; font-weight: 700; }

.camper-row { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #f1f5f9; flex-wrap: wrap; }
.camper-row:last-child { border-bottom: none; }
.camper-name   { font-weight: 600; font-size: 0.92rem; flex: 1; min-width: 120px; }
.camper-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.badge-absent-am    { background: #fef9c3; color: #854d0e; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-absent-bus   { background: #dbeafe; color: #1e40af; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-dismissed    { background: #fee2e2; color: #991b1b; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-seen-earlier { background: #dcfce7; color: #166534; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }

.activity-checkbox-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-check-label { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border: 1px solid var(--border-color); border-radius: 20px; cursor: pointer; font-size: 0.85rem; background: white; transition: background 0.12s, border-color 0.12s; user-select: none; }
.activity-check-label:hover { background: #f8fafc; border-color: var(--primary); }
.activity-check-label input[type="checkbox"] { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }

.toggle-wrap { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.btn-present,
.btn-absent {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    font-family: inherit;
}
.btn-present { background: #f1f5f9; color: var(--text-muted); }
.btn-present.active { background: #dcfce7; color: #166534; border-color: #86efac; }
.btn-absent  { background: #f1f5f9; color: var(--text-muted); }
.btn-absent.active  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.btn-dismiss { padding: 5px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; background: none; border: 1px solid #fca5a5; color: #991b1b; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-dismiss:hover { background: #fee2e2; }

.dismiss-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1000; align-items: center; justify-content: center; }
.dismiss-modal.open { display: flex; }
.dismiss-box { background: white; border-radius: 14px; padding: 28px; width: min(340px, calc(100vw - 40px)); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.dismiss-box h3 { margin: 0 0 16px; font-size: 1.1rem; }

.dismiss-field { margin-bottom: 12px; }
.dismiss-field label { font-size: 0.82rem; font-weight: 600; display: block; margin-bottom: 4px; }
.dismiss-field input { width: 100%; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 0.875rem; box-sizing: border-box; }
.dismiss-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-cancel { padding: 8px 16px; border-radius: 6px; border: 1px solid #cbd5e1; background: white; cursor: pointer; font-family: inherit; }
.btn-dismiss-confirm { padding: 8px 16px; border-radius: 6px; border: none; background: #ef4444; color: white; font-weight: 700; cursor: pointer; font-family: inherit; }

.search-bar { padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.875rem; font-family: inherit; width: 100%; max-width: 220px; outline: none; box-sizing: border-box; }
.search-bar:focus { border-color: var(--primary); }

.saving-indicator { font-size: 0.75rem; color: var(--text-muted); margin-left: 6px; opacity: 0; transition: opacity 0.2s; }
.saving-indicator.show { opacity: 1; }

/* ============================================================
   ATTENDANCE LATE ARRIVALS
   ============================================================ */
.late-card { background: white; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: var(--shadow); overflow: hidden; }
.late-table { width: 100%; border-collapse: collapse; }
.late-table th { background: #f8fafc; padding: 11px 16px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.late-table td { padding: 13px 16px; border-bottom: 1px solid #f8fafc; font-size: 0.875rem; vertical-align: middle; }
.late-table tr:last-child td { border-bottom: none; }
.late-table tr:hover td { background: #fafbff; }
.sched-mini { display: flex; gap: 5px; flex-wrap: wrap; }
.sched-pill { font-size: 0.7rem; background: #f1f5f9; color: var(--text-muted); padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.btn-checkin { padding: 7px 16px; background: #22c55e; color: white; border: none; border-radius: 6px; font-weight: 700; font-size: 0.82rem; cursor: pointer; font-family: inherit; }
.btn-checkin:hover { background: #16a34a; }

/* ============================================================
   ATTENDANCE OVERVIEW
   ============================================================ */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.att-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.att-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,0.12); border-color: var(--primary); }
.att-card-label { font-weight: 600; font-size: 0.875rem; }

.badge-submitted { background: #dcfce7; color: #166534; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; white-space: nowrap; }
.badge-pending   { background: #f1f5f9; color: #64748b; font-size: 0.68rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; white-space: nowrap; }

.att-section { border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 10px; background: white; overflow: hidden; }
.att-section > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    user-select: none;
}
.att-section > summary::-webkit-details-marker { display: none; }
.att-section > summary::before { content: '▶'; font-size: 0.6rem; transition: transform 0.15s; display: inline-block; flex-shrink: 0; }
.att-section[open] > summary::before { transform: rotate(90deg); }
.att-section > summary:hover { background: #f8fafc; }
.att-section-body { padding: 16px 20px 20px; border-top: 1px solid #f1f5f9; }

.sec-count         { margin-left: auto; font-size: 0.72rem; font-weight: 600; padding: 2px 10px; border-radius: 20px; text-transform: none; letter-spacing: 0; white-space: nowrap; }
.sec-count-none    { background: #f1f5f9; color: var(--text-muted); }
.sec-count-partial { background: #fef3c7; color: #92400e; }
.sec-count-done    { background: #dcfce7; color: #166534; }

.color-filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { padding: 4px 14px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; border: 2px solid transparent; cursor: pointer; font-family: inherit; transition: all 0.1s; }
.pill-all           { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.pill-all.active    { background: #334155; color: white; border-color: #334155; }
.pill-Red           { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.pill-Red.active    { background: #dc2626; color: white; border-color: #dc2626; }
.pill-Carolina      { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.pill-Carolina.active { background: #2563eb; color: white; border-color: #2563eb; }
.pill-Green         { background: #dcfce7; color: #166534; border-color: #86efac; }
.pill-Green.active  { background: #16a34a; color: white; border-color: #16a34a; }
.pill-Navy          { background: #e0e7ff; color: #3730a3; border-color: #a5b4fc; }
.pill-Navy.active   { background: #4338ca; color: white; border-color: #4338ca; }

.att-search-input { padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 0.875rem; width: 200px; outline: none; }
.late-warning-link { margin-left: auto; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; padding: 6px 14px; border-radius: 6px; font-weight: 700; font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.late-arrivals-link { color: var(--text-muted); font-size: 0.82rem; text-decoration: none; }

/* ============================================================
   CLASS ROSTER
   ============================================================ */
.roster-layout { display: grid; grid-template-columns: 320px 1fr; gap: 28px; align-items: start; }

.info-card { background: white; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: var(--shadow); overflow: hidden; }
.info-card-header { background: var(--primary); color: white; padding: 24px; }
.info-card-header h2 { margin: 0 0 4px 0; font-size: 1.4rem; }
.info-card-body { padding: 20px; }

.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-muted); font-weight: 500; }
.info-value { font-weight: 600; }

.section-block { margin-top: 18px; padding-top: 18px; border-top: 2px solid #f1f5f9; }
.section-block h4 { margin: 0 0 12px 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }

.staff-item-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px; }
.staff-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.staff-info-name { font-weight: 600; font-size: 0.875rem; }
.staff-info-type { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; }

.counselor-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #f8fafc; border-radius: 8px; margin-bottom: 7px; text-decoration: none; color: var(--text-main); transition: background 0.15s; }
.counselor-item:hover { background: #eff6ff; }
.counselor-name-text  { font-weight: 600; font-size: 0.875rem; }
.counselor-group-label { font-size: 0.72rem; color: var(--text-muted); }

.roster-card-header h3 { margin: 0; font-size: 1.05rem; }

.roster-table { width: 100%; border-collapse: collapse; }
.roster-table th { background: #f8fafc; padding: 11px 16px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
.roster-table td { padding: 13px 16px; border-bottom: 1px solid #f8fafc; font-size: 0.875rem; vertical-align: middle; }
.roster-table tr:last-child td { border-bottom: none; }
.roster-table tr:hover td { background: #fafbff; }

.camper-name-link { font-weight: 600; color: var(--primary); text-decoration: none; }
.camper-name-link:hover { color: var(--primary-hover); text-decoration: underline; }

.roster-search { padding: 8px 14px; border: 1px solid var(--border-color); border-radius: 8px; font-size: 0.875rem; font-family: inherit; width: 200px; max-width: 100%; outline: none; }
.roster-search:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }

/* ============================================================
   COUNSELOR DIRECTORY
   ============================================================ */
.directory-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.counselor-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.counselor-card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.counselor-name { font-size: 1.25rem; font-weight: 700; margin: 10px 0; color: var(--text-main); }
.assignment-info { background: #f8fafc; border-radius: 8px; padding: 12px; margin: 15px 0; font-size: 0.9rem; }
.assignment-info .info-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.profile-btn {
    margin-top: auto;
    text-align: center;
    background: var(--primary);
    color: white;
    text-decoration: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
    display: block;
}
.profile-btn:hover { background: var(--primary-hover); }

.dir-filters { display: flex; gap: 15px; flex-wrap: wrap; }
.dir-filters input,
.dir-filters select {
    flex: 1;
    min-width: 150px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-family: inherit;
    font-size: 0.9rem;
}

/* ============================================================
   COUNSELOR VIEW (Profile)
   ============================================================ */
.profile-container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.counselor-header {
    background: var(--primary);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}
.duty-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    backdrop-filter: blur(5px);
}
.duty-box small  { display: block; text-transform: uppercase; font-size: 0.7rem; opacity: 0.8; margin-bottom: 4px; }
.duty-box strong { font-size: 1.1rem; }

.dashboard-layout { display: grid; grid-template-columns: 350px 1fr; gap: 30px; }
.schedule-list { list-style: none; padding: 0; margin: 0; }
.schedule-card { padding: 15px; border-left: 4px solid var(--primary); background: #f8fafc; margin-bottom: 12px; border-radius: 0 8px 8px 0; }

.roster-card-cv { background: white; border-radius: 12px; padding: 25px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.roster-card-cv table { width: 100%; border-collapse: collapse; }
.roster-card-cv th { text-align: left; padding: 12px; border-bottom: 2px solid #edf2f7; color: #64748b; font-size: 0.8rem; text-transform: uppercase; }
.roster-card-cv td { padding: 15px 12px; border-bottom: 1px solid #f1f5f9; }

/* ============================================================
   INDEX / DASHBOARD
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}
.stat-card   { text-align: center; padding: 30px; }
.stat-number { font-size: 2.5rem; font-weight: 800; display: block; color: var(--primary); }
.stat-label  { color: var(--text-muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }

.promo-alert {
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-tasks { display: flex; gap: 15px; flex-wrap: wrap; }
.quick-tasks .card { flex: 1; min-width: 240px; }
.quick-tasks ul { list-style: none; padding: 0; margin: 0; }
.quick-tasks li { padding: 10px 0; border-bottom: 1px solid #eee; }
.quick-tasks li:last-child { border-bottom: none; }
.quick-tasks a { text-decoration: none; color: var(--primary); }

/* ============================================================
   MASTER SCHEDULE
   ============================================================ */
.period-section { margin-bottom: 40px; }
.period-header   { display: flex; align-items: center; gap: 15px; margin-bottom: 14px; }
.period-badge    { background: var(--primary); color: white; font-weight: 800; font-size: 0.85rem; padding: 6px 16px; border-radius: 20px; letter-spacing: 0.5px; white-space: nowrap; }
.period-divider  { flex: 1; height: 2px; background: var(--border-color); border-radius: 2px; }

.class-table { width: 100%; border-collapse: separate; border-spacing: 0; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.class-table th { background: #f8fafc; padding: 11px 15px; text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 2px solid var(--border-color); white-space: nowrap; }
.class-table td { padding: 13px 15px; border-bottom: 1px solid #f1f5f9; font-size: 0.875rem; vertical-align: middle; }
.class-table tr:last-child td { border-bottom: none; }
.class-table tr:hover td { background: #fafbff; }

.activity-link { font-weight: 700; color: var(--primary); text-decoration: none; font-size: 0.92rem; }
.activity-link:hover { color: var(--primary-hover); text-decoration: underline; }

.side-pill        { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.side-sports      { background: #fee2e2; color: #991b1b; }
.side-enrichment  { background: #dbeafe; color: #1e40af; }
.side-neutral     { background: #f1f5f9; color: #64748b; }

.enroll-badge { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border-radius: 6px; padding: 3px 9px; font-size: 0.8rem; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.enroll-badge.near-full { background: #fef3c7; color: #92400e; }
.enroll-badge.full      { background: #fee2e2; color: #991b1b; }

.group-dots { display: flex; flex-wrap: wrap; gap: 5px; }

.staff-link { text-decoration: none; color: inherit; display: block; }
.staff-link:hover .staff-name-sched { color: var(--primary); text-decoration: underline; }
.staff-name-sched { font-size: 0.82rem; color: var(--text-main); white-space: nowrap; }
.staff-type-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }

.counselor-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.counselor-chip  { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 20px; font-size: 0.75rem; font-weight: 600; color: white; text-decoration: none; transition: opacity 0.15s; white-space: nowrap; }
.counselor-chip:hover { opacity: 0.82; }

.location-text { font-size: 0.82rem; color: var(--text-muted); }

.filter-bar { background: white; padding: 14px 20px; border-radius: 10px; margin-bottom: 28px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--border-color); flex-wrap: wrap; }
.filter-bar label { font-weight: 600; font-size: 0.875rem; color: var(--text-main); white-space: nowrap; }
select.filter-dropdown { padding: 7px 12px; border-radius: 6px; border: 1px solid #cbd5e1; font-family: inherit; font-size: 0.875rem; background: white; }

/* ============================================================
   PROMOTIONS
   ============================================================ */
.promo-container { max-width: 1000px; margin: 0 auto; padding: 20px; }
.promo-card {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-left: 6px solid #10b981;
    margin-bottom: 20px;
    padding: 24px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    gap: 20px;
}
.promo-details h2 { margin: 0 0 8px 0; font-size: 1.25rem; }
.promo-info { display: flex; gap: 15px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.capacity-badge { background: #ecfdf5; color: #065f46; padding: 8px 16px; border-radius: 8px; font-weight: bold; text-align: center; border: 1px solid #10b981; white-space: nowrap; }
.cap-sub     { font-size: 0.7rem; font-weight: normal; text-transform: uppercase; margin-top: 2px; }
.timestamp   { color: var(--text-muted); font-size: 0.8rem; margin-top: 10px; display: block; }
.promo-empty { text-align: center; padding: 80px 20px; background: white; border-radius: 12px; border: 2px dashed var(--border-color); }
.promo-action { text-align: right; }

/* ============================================================
   SEARCH (Camper Lookup)
   ============================================================ */
.search-table { width: 100%; border-collapse: collapse; }
.search-table th { text-align: left; border-bottom: 2px solid #e2e8f0; padding: 12px; font-size: 0.85rem; color: var(--text-muted); }
.search-table td { padding: 12px; }

.camper-group { border-bottom: 8px solid var(--bg-app); }
.main-info-row td { background: white; font-weight: 500; padding: 18px 12px; border-top: 1px solid #f1f5f9; }
.schedule-row td  { background: #f8fafc; padding: 0 12px 12px; }

.mini-schedule { display: flex; gap: 8px; background: #f8fafc; padding: 10px; border-radius: 8px; flex-wrap: wrap; }
.period-box { flex: 1; min-width: 75px; font-size: 0.75rem; border-left: 3px solid #cbd5e1; padding-left: 8px; }
.period-box strong { display: block; color: #64748b; font-size: 0.65rem; }
.period-box span   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.lunch-yes  { background: #dcfce7; color: #166534; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.action-btn { padding: 6px 12px; font-size: 0.8rem; background: #f1f5f9; border-radius: 6px; color: #475569; text-decoration: none; }
.danger-btn { background: #fee2e2; color: #dc2626; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; font-family: inherit; }

.admin-footer { margin-top: 50px; padding: 20px; border-top: 2px dashed #fee2e2; opacity: 0.7; transition: opacity 0.3s; }
.admin-footer:hover { opacity: 1; }
.admin-footer-inner { display: flex; justify-content: space-between; align-items: center; background: white; padding: 20px; border-radius: 12px; border: 1px solid #fee2e2; gap: 16px; flex-wrap: wrap; }

/* ============================================================
   SETTINGS
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 20px; }
.settings-card { background: white; padding: 25px; border-radius: 12px; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.upload-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.upload-section:last-child { border-bottom: none; }
.danger-zone { border: 2px solid #fee2e2; background: #fffafa; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; }
.row-sports      { border-left: 5px solid #ef4444 !important; }
.row-enrichment  { border-left: 5px solid #3b82f6 !important; }

.settings-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.settings-table th { text-align: left; font-size: 0.8rem; color: #64748b; padding: 10px; border-bottom: 2px solid #eee; }
.settings-table td { padding: 10px; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.activity-table tr { border-bottom: 1px solid #eee; }

.upload-box { background: #f1f5f9; padding: 15px; border-radius: 8px; margin: 20px 0; border: 2px dashed #cbd5e1; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.settings-link-btn { color: #dc2626; background: none; border: none; cursor: pointer; font-size: 0.8rem; padding: 0; font-family: inherit; }

/* ============================================================
   STAFF LOOKUP
   ============================================================ */
.staff-table { width: 100%; border-collapse: collapse; background: white; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.staff-table thead th { text-align: left; padding: 12px 16px; border-bottom: 2px solid #e2e8f0; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); background: #f8fafc; }
.staff-row td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
.staff-row:last-child td { border-bottom: none; }
.staff-row:hover td { background: #fafbff; }
.staff-name      { font-weight: 700; color: #1e293b; font-size: 0.95rem; }
.staff-type-badge { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #e0e7ff; color: #3730a3; text-transform: uppercase; white-space: nowrap; }

.mini-sched { display: flex; gap: 8px; flex-wrap: wrap; }
.period-pill { background: #f8fafc; border: 1px solid #e2e8f0; border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; padding: 6px 10px; min-width: 90px; }
.period-pill-label    { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 2px; }
.period-pill-activity { font-size: 0.8rem; font-weight: 600; color: #1e293b; }
.period-pill-location { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

.no-results { text-align: center; padding: 48px 20px; color: var(--text-muted); font-style: italic; }
.type-group-header td { padding: 6px 16px; background: #f1f5f9; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); border-bottom: 1px solid #e2e8f0; }

/* ============================================================
   SWAP TOOL
   ============================================================ */
.swap-grid { display: grid; grid-template-columns: 380px 1fr; gap: 30px; align-items: start; }
.period-card { padding: 15px; margin-bottom: 12px; border: 2px solid transparent; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.period-card:hover  { border-color: var(--border-color); background: #f8fafc; }
.period-card.active { border-color: var(--primary); background: #eff6ff; box-shadow: 0 4px 6px -1px rgba(79,70,229,0.1); }

.option-link { display: block; padding: 15px; margin-bottom: 10px; background: white; border-radius: 8px; text-decoration: none; color: var(--text-main); border: 1px solid var(--border-color); transition: all 0.2s; }
.option-link:hover { transform: translateX(5px); border-color: var(--primary); }
.option-full  { border-left: 5px solid var(--red-group); background: #fff1f2; }
.option-open  { border-left: 5px solid var(--green-group); }
.option-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.waitlist-warning { color: var(--red-group); font-size: 0.8rem; }
.capacity-pill { font-weight: bold; font-size: 0.85rem; padding: 4px 8px; border-radius: 4px; background: #f1f5f9; white-space: nowrap; }

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .container, .container-sm, .container-md, .container-lg, .container-xl { padding: 12px; }

    /* --- Hamburger Nav --- */
    .nav-toggle { display: block; }

    .nav-bar {
        flex-wrap: wrap;
        overflow: visible;
        -webkit-overflow-scrolling: auto;
        padding: 0.6rem 0.75rem;
        gap: 4px;
        margin-bottom: 16px;
        align-items: center;
    }

    /* Hide all nav links by default on mobile */
    .nav-bar .nav-btn { display: none; }

    /* When open: show links as full-width rows */
    .nav-bar.nav-open .nav-btn {
        display: block;
        width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
        text-align: left;
        border-radius: 8px;
        margin: 1px 0;
        box-sizing: border-box;
    }

    /* Grids → single column */
    .roster-layout,
    .dashboard-layout,
    .swap-grid,
    .settings-grid { grid-template-columns: 1fr; }

    /* Counselor view */
    .duty-strip { grid-template-columns: 1fr; gap: 12px; }
    .counselor-header { padding: 24px 20px; }

    /* Dashboard stats */
    .stats-grid { gap: 12px; }
    .stat-card   { padding: 20px 16px; }
    .stat-number { font-size: 1.8rem; }

    /* Promotions */
    .promo-card   { grid-template-columns: 1fr; }
    .promo-action { text-align: left; }
    .promo-info   { gap: 8px; }

    /* Attendance form rows */
    .camper-row  { padding: 16px 14px; gap: 10px; }
    .toggle-wrap { width: 100%; justify-content: flex-end; }
    .search-bar, .att-search-input { max-width: 100%; width: 100%; }

    /* Table rows — taller cells for readability */
    .roster-table td,
    .late-table td,
    .search-table td,
    .class-table td,
    .staff-row td,
    .settings-table td { padding: 16px 12px; }

    .roster-table th,
    .late-table th,
    .search-table th,
    .class-table th,
    .settings-table th { padding: 12px; }

    /* Roster card header */
    .roster-card-header { flex-direction: column; align-items: flex-start; }
    .roster-search { width: 100%; max-width: 100%; }

    /* Filter bar */
    .filter-bar { padding: 12px 14px; gap: 8px; }
    select.filter-dropdown { font-size: 0.8rem; flex: 1; }

    /* Directory grid */
    .directory-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
    .dir-filters input, .dir-filters select { min-width: 120px; }

    /* Search inputs */
    .search-input { font-size: 0.95rem; padding: 10px 14px; }
    .search-bar-container { gap: 8px; }

    /* Date bar */
    .date-bar { padding: 12px 14px; gap: 10px; }
    .date-bar input[type=date] { width: 100%; }

    /* Quick tasks / index */
    .quick-tasks { flex-direction: column; }

    /* Admin footer */
    .admin-footer-inner { flex-direction: column; align-items: flex-start; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; gap: 4px; }
    .att-header  { flex-direction: column; align-items: flex-start; gap: 4px; }

    /* Mini schedule in search */
    .period-box { min-width: 70px; }

    /* Period pill in staff lookup */
    .period-pill { min-width: 80px; }

    /* Swap tool */
    .swap-grid input[type=text] { max-width: 100%; width: 100%; }
}

@media (max-width: 480px) {
    .nav-btn    { font-size: 0.75rem; padding: 6px 8px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .att-grid   { grid-template-columns: 1fr; }
    .duty-strip { gap: 8px; }
    .promo-card { padding: 16px; }
    .counselor-header { padding: 20px 16px; }
    .class-table th, .class-table td { padding: 8px 10px; font-size: 0.8rem; }
}

/* Field labels inside mobile cards — hidden on desktop */
.mc-label { display: none; }

/* ── Mobile card table transformation ──────────────────────────────────────
   Tables with class "mc" reflow into counselor-directory-style cards on mobile.
   .mc-card  = the row/tbody that becomes one card
   .mc-title = the first cell (name / class title) — styled as card header
   .mc-hide  = cells hidden on mobile (but visible on desktop)
   ─────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .table-scroll { overflow-x: visible; overflow: visible; }

    table.mc { display: block; width: 100%; }
    table.mc thead { display: none; }
    table.mc tbody { display: block; }

    /* Section / type group dividers */
    table.mc .type-group-header { display: block; margin: 20px 0 8px; }
    table.mc .type-group-header td {
        display: block;
        padding: 5px 2px;
        border: none;
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--text-muted);
    }

    /* Period section headings (master schedule) */
    table.mc + .period-section .period-header,
    .period-section table.mc ~ .period-header { margin-bottom: 8px; }

    /* Card base — works on both <tbody> and <tr> */
    .mc-card {
        display: block !important;
        background: white;
        border-radius: 12px;
        padding: 16px;
        box-shadow: var(--shadow);
        border: 1px solid var(--border-color);
        margin-bottom: 12px;
        transition: transform 0.15s, box-shadow 0.15s;
    }
    .mc-card[data-href] { cursor: pointer; }
    .mc-card[data-href]:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    }

    /* Flatten internal table structure */
    .mc-card tr { display: block; }
    .mc-card td {
        display: block !important;
        padding: 3px 0 !important;
        border: none !important;
        vertical-align: top;
    }

    /* Field label shown only inside mobile cards */
    .mc-label {
        display: block;
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: 2px;
    }

    /* Card title cell — bold header with bottom rule */
    td.mc-title {
        font-size: 1.05rem !important;
        font-weight: 700;
        color: var(--text-main);
        padding-bottom: 10px !important;
        border-bottom: 1px solid var(--border-color) !important;
        margin-bottom: 4px;
    }
    td.mc-title a { color: inherit; text-decoration: none; }
    td.mc-title a:hover { text-decoration: underline; }

    /* Hidden columns on mobile */
    .mc-hide { display: none !important; }

    /* Schedule row inside camper-group tbody should be hidden on mobile */
    .mc-card tr.schedule-row { display: none !important; }

    /* Master schedule: 2-column info grid inside each card */
    .class-table .mc-card {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    .class-table .mc-card td.mc-title {
        grid-column: 1 / -1;
        padding-bottom: 10px !important;
    }
    .class-table .mc-card td.mc-hide { display: none !important; }

    /* Camper lookup: 2-column info grid inside each card */
    .search-table .mc-card tr.main-info-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    .search-table .mc-card tr.main-info-row td.mc-title {
        grid-column: 1 / -1;
        padding-bottom: 10px !important;
    }
    .search-table .mc-card tr.main-info-row td.mc-hide { display: none !important; }

    /* Period pills inside cards wrap naturally */
    .mc-card .mini-sched { flex-wrap: wrap; gap: 6px; margin-top: 4px; }
    .mc-card .period-pill { min-width: 80px; }

    /* Counselor chips wrap inside cards */
    .mc-card .counselor-chips { flex-wrap: wrap; gap: 4px; margin-top: 2px; }

    /* Staff / class name styling inside card title */
    .mc-card .staff-name   { font-size: 1.05rem; font-weight: 700; }
    .mc-card .activity-link { font-size: 1.05rem; font-weight: 700; color: var(--text-main); text-decoration: none; }
    .mc-card .activity-link:hover { text-decoration: underline; }
}

/* Quill formatting classes scoped to .ql-editor don't apply outside the editor */
.hub-rich-content .ql-align-center  { text-align: center; }
.hub-rich-content .ql-align-right   { text-align: right; }
.hub-rich-content .ql-align-justify { text-align: justify; }
.hub-rich-content .ql-size-small    { font-size: 0.75em; }
.hub-rich-content .ql-size-large    { font-size: 1.5em; }
.hub-rich-content .ql-size-huge     { font-size: 2.5em; }

/* Director Notes feed */
.note-item            { padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.note-item:last-child { border-bottom: none; }
.note-meta            { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; font-size: 0.8rem; }
.note-ts              { color: var(--text-muted); font-size: 0.78rem; }
.note-body            { font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; }
.filter-tab           { padding: 4px 12px; border-radius: 4px; border: 1px solid #e2e8f0; background: #f8fafc; cursor: pointer; font-size: 0.8rem; }
.filter-tab.active    { background: var(--primary); color: white; border-color: var(--primary); }
