/* =========================================================================
   Enrollment Manager v1.0.0 — Frontend Styles
   Manager Dashboard + Public Enrollment Cards
   ========================================================================= */

/* =========================
   SHARED: Notices, Buttons, Inputs
   ========================= */

.em-notice { padding: 14px 20px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; font-weight: 500; }
.em-notice--success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.em-notice--error { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.em-notice--warning { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; text-align: center; padding: 24px; border-radius: 12px; }
.em-notice--warning a { color: #e65100; font-weight: 700; text-decoration: underline; }

.em-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px; border-radius: 8px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s; border: none; text-decoration: none;
    font-family: inherit; box-sizing: border-box; line-height: 1.4;
}
.em-btn--primary { background: linear-gradient(135deg, #7B1FA2, #6A1B9A); color: #fff; box-shadow: 0 2px 8px rgba(123,31,162,0.3); }
.em-btn--primary:hover { background: linear-gradient(135deg, #6A1B9A, #4A148C); box-shadow: 0 4px 14px rgba(123,31,162,0.4); transform: translateY(-1px); color: #fff; }
.em-btn--outline { background: #fff; border: 1.5px solid #7B1FA2; color: #7B1FA2; }
.em-btn--outline:hover { background: #7B1FA2; color: #fff; }
.em-btn--sm { padding: 6px 14px !important; font-size: 12px !important; border-radius: 6px !important; }
.em-btn--lg { padding: 14px 32px; font-size: 16px; }
.em-btn--danger { background: #fff; border: 1.5px solid #ef5350; color: #c62828; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; display: inline-flex; align-items: center; font-family: inherit; padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.em-btn--danger:hover { background: #c62828; color: #fff; border-color: #c62828; }

.em-input, .em-textarea, .em-select {
    width: 100%; padding: 11px 14px; border: 1.5px solid #ddd; border-radius: 8px;
    font-size: 14px; color: #333; background: #fff; transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit; box-sizing: border-box;
}
.em-input:focus, .em-textarea:focus, .em-select:focus {
    border-color: #7B1FA2; outline: none; box-shadow: 0 0 0 3px rgba(123,31,162,0.1);
}
.em-textarea { resize: vertical; min-height: 90px; }
.em-select { appearance: auto; }

.em-label { display: block; font-size: 13px; font-weight: 700; color: #444; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px; }
.em-req { color: #c62828; }
.em-opt { font-weight: 400; text-transform: none; color: #aaa; font-size: 12px; }
.em-help { font-size: 12px; color: #999; margin: 4px 0 0; }


/* =========================================================================
   MANAGER DASHBOARD
   ========================================================================= */

.em-manager-wrap { max-width: 880px; margin: 0 auto; padding: 10px 0 40px; }

.em-manager-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.em-manager-title { font-size: 26px; font-weight: 800; color: #1a1a1a; margin: 0 0 4px; }
.em-manager-subtitle { font-size: 14px; color: #888; margin: 0; }

.em-list-count { font-size: 13px; font-weight: 600; color: #888; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid #f0f0f0; }

/* Empty */
.em-empty-state { text-align: center; padding: 50px 30px; background: #fafafa; border: 2px dashed #e0e0e0; border-radius: 16px; }
.em-empty-icon { margin-bottom: 16px; }
.em-empty-state h3 { font-size: 20px; font-weight: 700; color: #555; margin: 0 0 6px; }
.em-empty-state p { font-size: 14px; color: #999; margin: 0 0 20px; }

/* Slot list rows */
.em-slot-list { display: flex; flex-direction: column; }
.em-slot-row {
    display: flex; align-items: center; gap: 14px;
    padding: 16px 18px; background: #fff; border: 1px solid #eee; border-bottom: none;
    transition: background 0.15s;
}
.em-slot-row:first-child { border-radius: 12px 12px 0 0; }
.em-slot-row:last-child { border-bottom: 1px solid #eee; border-radius: 0 0 12px 12px; }
.em-slot-row:only-child { border-radius: 12px; border-bottom: 1px solid #eee; }
.em-slot-row:hover { background: #faf5ff; }
.em-slot-row--expired { opacity: 0.65; }

/* Age icon badge */
.em-age-badge {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 12px; font-size: 22px;
    flex-shrink: 0;
}
.em-age--infant { background: #fce4ec; }
.em-age--toddler { background: #fff3e0; }
.em-age--preschool { background: #e8f5e9; }
.em-age--pre-k { background: #e3f2fd; }
.em-age--school-age { background: #f3e5f5; }
.em-age--mixed { background: #f5f5f5; }

/* Row info */
.em-slot-row-info { flex: 1; min-width: 0; }
.em-slot-row-title { font-size: 16px; font-weight: 700; color: #1a1a1a; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-slot-row-age { font-size: 12px; font-weight: 600; color: #7B1FA2; text-transform: uppercase; letter-spacing: 0.3px; margin-top: 1px; }
.em-slot-row-meta { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.em-slot-row-meta span { font-size: 12px; color: #888; white-space: nowrap; }

/* Mini spots bar in row */
.em-slot-row-spots { flex-shrink: 0; min-width: 110px; text-align: center; }
.em-spots-bar-mini { width: 100%; height: 6px; background: #f0f0f0; border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.em-spots-bar-mini-fill { height: 100%; border-radius: 3px; transition: width 0.4s; }
.em-spots-text { font-size: 12px; color: #666; }
.em-spots-text strong { font-weight: 700; }
.em-spots-text small { color: #999; }

/* Status */
.em-slot-row-status { flex-shrink: 0; }
.em-status-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }
.em-status--open { background: #e8f5e9; color: #2e7d32; }
.em-status--waitlist { background: #fff8e1; color: #F57F17; }
.em-status--closed { background: #fce4ec; color: #c62828; }
.em-status--upcoming { background: #e3f2fd; color: #1565C0; }

.em-slot-row-actions { display: flex; gap: 6px; flex-shrink: 0; }


/* =========================================================================
   ADD/EDIT FORM
   ========================================================================= */

.em-form-wrap { max-width: 780px; margin: 0 auto; padding: 10px 0 40px; }

.em-form-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.em-form-title { font-size: 24px; font-weight: 700; color: #1a1a1a; margin: 0 0 4px; }
.em-form-subtitle { font-size: 14px; color: #888; margin: 0; }

.em-form { display: flex; flex-direction: column; }

.em-form-section-group {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 14px;
    padding: 24px 28px; margin-bottom: 20px; box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}
.em-section-head {
    display: flex; align-items: flex-start; gap: 12px;
    margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;
}
.em-section-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.em-section-title { font-size: 18px; font-weight: 700; color: #1a1a1a; margin: 0 0 2px; }
.em-section-desc { font-size: 13px; color: #888; margin: 0; }

.em-field { margin-bottom: 18px; }
.em-field:last-child { margin-bottom: 0; }
.em-field-row { display: flex; gap: 16px; margin-bottom: 18px; }
.em-field-half { flex: 1; }
.em-field-row .em-field { margin-bottom: 0; }

.em-form-actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }


/* =========================================================================
   PUBLIC: [enrollment_openings]
   ========================================================================= */

.em-openings { display: flex; flex-direction: column; gap: 22px; margin: 20px 0; }
.em-openings.em-cols--2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.em-openings.em-cols--3 { display: grid; grid-template-columns: repeat(3, 1fr); }

.em-opening-card {
    background: #fff; border: 1px solid #e8e8e8; border-radius: 16px;
    padding: 0; overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04); transition: box-shadow 0.3s, transform 0.3s;
}
.em-opening-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.08); transform: translateY(-2px); }
.em-opening--expired { opacity: 0.6; }

/* Top bar */
.em-opening-top {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px; background: linear-gradient(135deg, #f3e5f5, #ede7f6);
    border-bottom: 1px solid #e8e0ed;
}
.em-opening-age-icon { font-size: 36px; flex-shrink: 0; }
.em-opening-title-wrap { flex: 1; min-width: 0; }
.em-opening-title { font-size: 20px; font-weight: 800; color: #1a1a1a; margin: 0; line-height: 1.3; }
.em-opening-age-label { font-size: 12px; font-weight: 700; color: #7B1FA2; text-transform: uppercase; letter-spacing: 0.4px; }
.em-opening-status { flex-shrink: 0; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; }

/* Spots section */
.em-spots-section { padding: 18px 24px; border-bottom: 1px solid #f0f0f0; }
.em-spots-info { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.em-spots-available { font-size: 15px; font-weight: 700; color: #2e7d32; }
.em-spots-count { font-size: 13px; color: #999; }
.em-spots-bar { width: 100%; height: 10px; background: #f0f0f0; border-radius: 5px; overflow: hidden; }
.em-spots-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }

/* Meta */
.em-opening-meta { display: flex; flex-wrap: wrap; gap: 14px; padding: 14px 24px; border-bottom: 1px solid #f0f0f0; }
.em-ometa { font-size: 13px; color: #666; white-space: nowrap; }

/* Programs */
.em-opening-programs { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 24px; }
.em-prog-tag { display: inline-block; padding: 2px 10px; border-radius: 12px; background: #f3e5f5; color: #7B1FA2; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

/* Content */
.em-opening-desc { padding: 0 24px 14px; font-size: 14px; line-height: 1.7; color: #555; }
.em-opening-desc p { margin: 0 0 8px; } .em-opening-desc p:last-child { margin-bottom: 0; }

.em-opening-section { padding: 0 24px 14px; }
.em-opening-section-title { font-size: 13px; font-weight: 700; color: #333; margin: 0 0 6px; }
.em-opening-section-content { font-size: 14px; line-height: 1.65; color: #666; }

/* Contact */
.em-opening-contact { display: flex; flex-wrap: wrap; gap: 16px; padding: 12px 24px; border-top: 1px solid #f0f0f0; }
.em-contact-link { font-size: 13px; color: #7B1FA2; text-decoration: none; transition: color 0.2s; }
.em-contact-link:hover { color: #4A148C; text-decoration: underline; }

/* CTA */
.em-opening-cta { padding: 18px 24px; border-top: 1px solid #f0f0f0; background: #fafafa; }
.em-btn--register { width: 100%; padding: 14px 24px; font-size: 16px; justify-content: center; }

/* Public empty */
.em-public-empty { text-align: center; padding: 40px; background: #fafafa; border: 1px solid #eee; border-radius: 12px; color: #888; font-size: 15px; }
.em-public-empty p { margin: 0; }


/* =========================
   RESPONSIVE
   ========================= */

@media screen and (max-width: 768px) {
    .em-manager-header, .em-form-header { flex-direction: column; }
    .em-field-row { flex-direction: column; gap: 0; }
    .em-field-row .em-field { margin-bottom: 18px; }
    .em-form-section-group { padding: 18px 16px; }

    .em-slot-row { flex-wrap: wrap; gap: 10px; padding: 14px; }
    .em-slot-row-info { flex-basis: calc(100% - 70px); }
    .em-slot-row-spots { order: 4; width: 100%; min-width: auto; text-align: left; }
    .em-slot-row-status { order: 5; }
    .em-slot-row-actions { order: 6; margin-left: auto; }

    .em-openings.em-cols--2, .em-openings.em-cols--3 { grid-template-columns: 1fr; }
    .em-opening-top { flex-wrap: wrap; padding: 16px 18px; }
    .em-opening-title { font-size: 18px; }
    .em-spots-section, .em-opening-meta, .em-opening-programs,
    .em-opening-desc, .em-opening-section, .em-opening-contact,
    .em-opening-cta { padding-left: 18px; padding-right: 18px; }
}

@media screen and (max-width: 480px) {
    .em-slot-row-meta { display: none; }
    .em-slot-row-title { font-size: 14px; }
    .em-manager-title { font-size: 22px; }
    .em-opening-meta { gap: 8px; }
    .em-ometa { font-size: 12px; }
}
