/* ========================================
   CandleCraft Academy Bootstrap 5 Admin + Portal Styles
   ======================================== */

/* ---- Font ---- */
@font-face {
    font-family: 'Playfair Display';
    src: url('../font/PlayfairDisplay.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ---- CSS Custom Properties ---- */
:root {
    --cc-sidebar-bg: #2f2219;
    --cc-sidebar-hover: #4f3726;
    --cc-sidebar-active: #1a120c;
    --cc-sidebar-text: #f5ecdf;
    --cc-sidebar-width: 240px;
    --cc-primary: #c0873a;
    --cc-primary-dark: #a06e2a;
    --cc-light-bg: #faf6f1;
    --cc-card-bg: #ffffff;
    --cc-text-dark: #2d190e;
    --cc-text-muted: #8a7565;
    --cc-border-color: #e3d5c5;
    --cc-success: #27ae60;
    --cc-warning: #f39c12;
    --cc-danger: #e74c3c;
    --cc-info: #2ecc71;

    /* Override Bootstrap variables */
    --bs-primary: #c0873a;
    --bs-primary-rgb: 192, 135, 58;
    --bs-body-bg: #faf6f1;
    --bs-body-color: #2d190e;
    --bs-border-color: #e3d5c5;
    --bs-font-sans-serif: 'Times New Roman', Times, serif;
    --bs-link-color: #c0873a;
    --bs-link-hover-color: #a06e2a;
}

body {
    font-family: 'Times New Roman', Times, serif;
    background: var(--cc-light-bg);
    color: var(--cc-text-dark);
}

/* ========================================
   Admin Sidebar (Bootstrap offcanvas)
   ======================================== */

@media (min-width: 992px) {
    #adminSidebar,
    #portalSidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--cc-sidebar-width);
        z-index: 1046;
        background: var(--cc-sidebar-bg) !important;
        transform: none !important;
        visibility: visible !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
    }

    .offcanvas-backdrop {
        display: none !important;
    }

    .sidebar-main {
        margin-left: var(--cc-sidebar-width);
        min-height: 100vh;
    }

    .sidebar-toggle-btn {
        display: none !important;
    }
}

#adminSidebar,
#portalSidebar {
    background: var(--cc-sidebar-bg);
}

#adminSidebar .offcanvas-header,
#portalSidebar .offcanvas-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 20px;
}

#adminSidebar .sidebar-brand-icon,
#portalSidebar .sidebar-brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#adminSidebar .sidebar-brand-text,
#portalSidebar .sidebar-brand-text {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

#adminSidebar .nav-link,
#portalSidebar .nav-link {
    color: rgba(255, 255, 255, 0.6);
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

#adminSidebar .nav-link:hover,
#portalSidebar .nav-link:hover {
    color: #fff;
    background: var(--cc-sidebar-hover);
}

#adminSidebar .nav-link.active,
#portalSidebar .nav-link.active {
    color: #fff;
    background: var(--cc-sidebar-active);
    border-left-color: var(--cc-primary);
}

#adminSidebar .nav-link i,
#portalSidebar .nav-link i {
    width: 22px;
    text-align: center;
    margin-right: 12px;
    font-size: 16px;
}

#adminSidebar .sidebar-footer,
#portalSidebar .sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 0;
}

#adminSidebar .sidebar-footer .nav-link,
#portalSidebar .sidebar-footer .nav-link {
    color: rgba(255, 255, 255, 0.5);
}

#adminSidebar .sidebar-footer .nav-link:hover,
#portalSidebar .sidebar-footer .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* ---- Admin Top Navbar ---- */
.sidebar-navbar {
    background: #fff;
    border-bottom: 1px solid var(--cc-border-color);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-navbar .page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--cc-text-dark);
    margin: 0;
}

/* Right-side cluster always anchors to the right edge of the navbar so the
   bell + avatar never float in the middle when the title is short. */
.sidebar-navbar .admin-header-actions {
    margin-left: auto;
}

/* ---- Admin Stat Cards (Bootstrap) ---- */
.stat-card {
    border-top: 4px solid var(--cc-primary) !important;
}

.stat-card.stat-primary { border-top-color: var(--cc-primary) !important; }
.stat-card.stat-success { border-top-color: var(--cc-success) !important; }
.stat-card.stat-warning { border-top-color: var(--cc-warning) !important; }
.stat-card.stat-danger  { border-top-color: var(--cc-danger) !important; }
.stat-card.stat-info    { border-top-color: #3498db !important; }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cc-text-dark);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-muted);
}

/* ---- Admin Detail Table ---- */
.detail-table th {
    width: 180px;
    font-weight: 600;
    color: var(--cc-text-muted);
    font-size: 13px;
    text-align: right;
    vertical-align: top;
}

/* ---- Admin Message Thread ---- */
.message-bubble {
    padding: 16px 20px;
    border-bottom: 1px solid var(--cc-border-color);
}

.message-bubble:last-child {
    border-bottom: none;
}

.message-bubble .meta {
    font-size: 12px;
    color: var(--cc-text-muted);
    margin-bottom: 6px;
}

.message-bubble .body {
    font-size: 14px;
    line-height: 1.6;
}

/* ========================================
   Shared Components (Admin + Portal)
   ======================================== */

/* ---- Portal Stats Row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--cc-light-bg);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cc-text-muted);
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--cc-border-color);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #fdf8f2;
}

.data-table .actions {
    display: flex;
    gap: 8px;
}

/* ---- Portal Status Badges ---- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-new,
.badge-unread {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-replied {
    background: #fff3e0;
    color: #ef6c00;
}

.badge-read {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-archived {
    background: #f5f5f5;
    color: #757575;
}

.badge-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-inactive {
    background: #ffebee;
    color: #c62828;
}

.badge-pending {
    background: #fff8e1;
    color: #f57f17;
}

.badge-confirmed {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-cancelled {
    background: #ffebee;
    color: #c62828;
}

.badge-scheduled {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-ongoing {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-completed {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-full {
    background: #fce4ec;
    color: #c62828;
}

.badge-present {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-late {
    background: #fff8e1;
    color: #f57f17;
}

.badge-absent {
    background: #ffebee;
    color: #c62828;
}

.badge-excused {
    background: #ede7f6;
    color: #5e35b1;
}

/* ---- Portal Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 0;
    list-style: none;
    margin: 0;
}

.pagination li a,
.pagination li span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--cc-border-color);
    border-radius: 4px;
    font-size: 13px;
    color: var(--cc-text-dark);
}

.pagination li a:hover {
    background: var(--cc-primary);
    color: #fff;
    border-color: var(--cc-primary);
}

.pagination li.active span {
    background: var(--cc-primary);
    color: #fff;
    border-color: var(--cc-primary);
}

.pagination li.disabled span {
    color: #ccc;
}

/* ---- Portal Toolbar & Filters ---- */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.toolbar .filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar .filters select {
    padding: 8px 12px;
    border: 1px solid var(--cc-border-color);
    border-radius: 6px;
    font-size: 13px;
    background: #fff;
}

/* ---- Portal Form Group (for non-Bootstrap portal pages) ---- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--cc-text-dark);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="datetime-local"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--cc-border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--cc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* ---- Portal Button (for non-Bootstrap portal pages) ---- */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--cc-primary);
    color: #fff;
}

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

.btn-success {
    background: var(--cc-success);
    color: #fff;
}

.btn-success:hover {
    background: #219a52;
    color: #fff;
}

.btn-danger {
    background: var(--cc-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

.btn-warning {
    background: var(--cc-warning);
    color: #fff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ---- Portal Flash Messages ---- */
.flash-message {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.flash-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.flash-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.flash-message.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.flash-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

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

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
}

/* ---- Portal Class Cards ---- */
.portal-class-list {
    display: grid;
    gap: 18px;
}

.portal-class-card {
    padding: 22px;
    border: 1px solid var(--cc-border-color);
    border-radius: 12px;
    background: linear-gradient(180deg, #fffcf8, #f9f3eb);
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.portal-class-card:has(a.stretched-link):hover {
    border-color: var(--cc-primary);
    box-shadow: 0 2px 10px rgba(192, 135, 58, 0.14);
}

.portal-class-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.portal-class-card__header h3 {
    margin: 0;
    font-size: 20px;
}

.portal-class-card__eyebrow {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
}

.portal-class-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--cc-text-muted);
}

.portal-muted {
    margin: 0;
    color: var(--cc-text-muted);
}

/* ---- Portal Attendance ---- */
.portal-attendance-list {
    display: grid;
    gap: 12px;
}

.portal-attendance-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e7edf3;
    border-radius: 10px;
    background: #fff;
}

.portal-attendance-card__student {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.portal-attendance-card__student span {
    color: var(--cc-text-muted);
}

.attendance-form {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.attendance-form__fields {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(240px, 1fr);
    gap: 12px;
    flex: 1;
}

.attendance-form select,
.attendance-form input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--cc-border-color);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.portal-status-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--cc-border-color);
}

.portal-status-row__label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
}

/* ---- Portal Section Headings ---- */
.section-heading {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--cc-text-dark);
}

.overline {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-text-muted);
}

/* ========================================
   Login Page
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-nav {
    background: var(--cc-sidebar-bg);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.login-nav .brand {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.login-nav .nav-links a {
    color: rgba(255, 255, 255, 0.65);
    font-size: 14px;
    transition: color 0.2s;
}

.login-nav .nav-links a:hover {
    color: #fff;
}

.login-hero {
    flex: 1;
    background: linear-gradient(135deg, #4f3726, #2f2219);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 960px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.portal-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.portal-entry-card {
    padding: 18px;
    border: 1px solid var(--cc-border-color);
    border-radius: 10px;
    background: linear-gradient(180deg, #fdf8f2, #f5ece0);
}

.portal-entry-card__label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cc-primary-dark);
}

.portal-entry-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
}

.portal-entry-card p {
    margin: 0;
    color: var(--cc-text-muted);
    line-height: 1.5;
}

.login-card .logo .icon {
    width: 60px;
    height: 60px;
    background: var(--cc-sidebar-bg);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
}

.login-footer {
    background: #f0e8dd;
    padding: 30px;
    text-align: center;
    font-size: 13px;
    color: var(--cc-text-muted);
}

/* ========================================
   Schedule Page  PerfectGym-style
   ======================================== */

/* -- Toolbar -- */
.schedule-page {
    background: #fff;
    border: 1px solid var(--cc-border-color);
    border-radius: 10px;
    overflow: hidden;
}

.sp-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--cc-border-color);
    background: var(--cc-light-bg);
    flex-wrap: wrap;
}

.sp-toolbar__center {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-toolbar__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--cc-text-dark);
    margin-left: 4px;
}

.sp-view-btn.active {
    background: var(--cc-primary) !important;
    border-color: var(--cc-primary) !important;
    color: #fff !important;
}

/* -- Week Calendar -- */
:root {
    --wc-hour-h: 60px;
    --wc-min-h: calc(var(--wc-hour-h) / 60);
    --wc-gutter-w: 58px;
}

.wc-wrapper {
    display: flex;
    flex-direction: column;
}

/* Header row */
.wc-header {
    display: grid;
    grid-template-columns: var(--wc-gutter-w) repeat(7, 1fr);
    border-bottom: 2px solid #e0e0e0;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
}

.wc-gutter-header {
    border-right: 1px solid #e8e8e8;
}

.wc-col-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 8px;
    border-right: 1px solid #e8e8e8;
}

.wc-col-header:last-child {
    border-right: none;
}

.wc-col-header__name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #70757a;
}

.wc-col-header__num {
    font-size: 24px;
    font-weight: 400;
    color: #3c4043;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: 2px;
}

.wc-col-header--today .wc-col-header__name {
    color: #1a73e8;
}

.wc-col-header__num--today {
    background: #1a73e8;
    color: #fff !important;
    font-weight: 500;
}

/* Scrollable body */
.wc-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(var(--wc-hour-h) * 9 + 20px);
}

.wc-body-grid {
    display: grid;
    grid-template-columns: var(--wc-gutter-w) repeat(7, 1fr);
    min-height: calc(var(--wc-hour-h) * var(--wc-rows));
    position: relative;
}

/* Time gutter */
.wc-gutter {
    border-right: 1px solid #e8e8e8;
}

.wc-gutter__label {
    height: var(--wc-hour-h);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 10px;
    font-weight: 500;
    color: #70757a;
    transform: translateY(-6px);
    user-select: none;
}

/* Day columns */
.wc-day {
    position: relative;
    border-right: 1px solid #e8e8e8;
    min-height: calc(var(--wc-hour-h) * var(--wc-rows));
}

.wc-day:last-child {
    border-right: none;
}

.wc-day--today {
    background: rgba(26, 115, 232, 0.03);
}

.wc-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid #e8e8e8;
}

/* Events */
.wc-evt {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: 6px;
    padding: 4px 8px;
    color: #fff;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    z-index: 1;
    background: var(--evt-color, #1a73e8);
    border-left: 4px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: box-shadow 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.wc-evt:hover {
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transform: translateY(-1px);
    z-index: 10;
    text-decoration: none;
}

.wc-evt:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
    color: #fff;
    text-decoration: none;
}

.wc-evt__title {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-evt__time {
    font-size: 10px;
    opacity: 0.9;
    white-space: nowrap;
}

.wc-evt__loc {
    font-size: 10px;
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-evt--compact {
    padding: 4px 6px;
}

.wc-evt--compact .wc-evt__title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wc-evt--compact .wc-evt__loc:last-child {
    display: none;
}

.wc-evt--tiny {
    padding: 3px 6px;
    gap: 0;
}

.wc-evt--tiny .wc-evt__time {
    font-size: 9px;
}

.wc-evt--tiny .wc-evt__title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wc-evt--tiny .wc-evt__loc {
    display: none;
}

/* Now line */
.wc-now-line {
    position: absolute;
    left: -1px;
    right: 0;
    height: 0;
    border-top: 2px solid #ea4335;
    z-index: 5;
    pointer-events: none;
}

.wc-now-dot {
    position: absolute;
    top: -5px;
    left: -4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ea4335;
}

/* -- List View -- */
.sp-view--list {
    padding: 0;
}

.sp-list-date {
    border-bottom: 1px solid #eee;
}

.sp-list-date:last-child {
    border-bottom: none;
}

.sp-list-date__label {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cc-text-muted);
    background: var(--cc-light-bg);
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-list-date__badge {
    background: #1a73e8;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-list-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}

.sp-list-card:hover {
    background: #fafbfc;
}

.sp-list-card:last-child {
    border-bottom: none;
}

.sp-list-card__time {
    min-width: 60px;
    text-align: right;
    padding-top: 2px;
}

.sp-list-card__time strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--cc-text-dark);
}

.sp-list-card__time span {
    font-size: 12px;
    color: var(--cc-text-muted);
}

.sp-list-card__body {
    flex: 1;
    min-width: 0;
}

.sp-list-card__body h6 {
    font-size: 15px;
    font-weight: 600;
    color: var(--cc-text-dark);
}

.sp-list-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--cc-text-muted);
    margin-top: 4px;
}

.sp-list-card__meta i {
    margin-right: 2px;
}

.sp-list-card__actions {
    text-align: right;
    min-width: 90px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 992px) {
    .sp-toolbar {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .sp-toolbar__center {
        justify-content: center;
    }

    .sp-toolbar__left,
    .sp-toolbar__right {
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .login-card {
        padding: 32px 22px;
    }

    .portal-entry-grid {
        grid-template-columns: 1fr;
    }

    .portal-attendance-card,
    .portal-class-card__header {
        flex-direction: column;
    }

    .attendance-form__fields,
    .portal-status-row {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    :root {
        --wc-hour-h: 50px;
        --wc-gutter-w: 44px;
    }

    .wc-scroll {
        overflow-x: auto;
    }

    .wc-body-grid,
    .wc-header {
        min-width: 640px;
    }

    .wc-col-header__num {
        font-size: 18px;
        width: 32px;
        height: 32px;
    }

    .wc-evt__title {
        font-size: 10px;
    }

    .wc-evt__time,
    .wc-evt__loc {
        font-size: 9px;
    }

    .sp-list-card {
        flex-wrap: wrap;
    }

    .sp-list-card__actions {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }
}

/* ========================================
   Availability Calendar Grid
   ======================================== */
.avail-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    min-height: 400px;
}

.avail-day {
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.avail-day:last-child {
    border-right: none;
}

.avail-day--today {
    background: rgba(192, 135, 58, 0.03);
}

.avail-day__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 4px;
    border-bottom: 1px solid #f0f0f0;
    background: var(--cc-light-bg);
}

.avail-day__header--today {
    background: rgba(192, 135, 58, 0.08);
}

.avail-day__name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--cc-text-muted);
}

.avail-day__header--today .avail-day__name {
    color: var(--cc-primary);
}

.avail-day__num {
    font-size: 20px;
    font-weight: 600;
    color: var(--cc-text-dark);
}

.avail-day__header--today .avail-day__num {
    background: var(--cc-primary);
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 15px;
}

.avail-day__body {
    flex: 1;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 280px;
}

.avail-empty {
    color: var(--cc-text-muted);
    font-size: 12px;
    text-align: center;
    padding-top: 24px;
    opacity: 0.6;
}

.avail-slot {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px;
    border-radius: 8px;
    background: rgba(192, 135, 58, 0.06);
    border: 1px solid rgba(192, 135, 58, 0.2);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, border-color 0.15s;
}

.avail-slot:hover {
    box-shadow: 0 2px 8px rgba(192, 135, 58, 0.15);
    border-color: var(--cc-primary);
    text-decoration: none;
    color: inherit;
}

.avail-slot__time {
    font-size: 10px;
    font-weight: 600;
    color: var(--cc-primary);
}

.avail-slot__title {
    font-size: 12px;
    font-weight: 700;
    color: var(--cc-text-dark);
    line-height: 1.3;
}

.avail-slot__teacher {
    font-size: 10px;
    color: var(--cc-text-muted);
}

.avail-slot__spots {
    font-size: 10px;
    font-weight: 500;
    color: #595959;
}

/* ---- Booking Avatar ---- */
.booking-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(192, 135, 58, 0.15);
    color: var(--cc-primary);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ---- Slot Color Variants ---- */
.avail-slot--pottery {
    background: rgba(192, 135, 58, 0.08);
    border-color: rgba(192, 135, 58, 0.25);
}
.avail-slot--pottery .avail-slot__time {
    color: #A06E2A;
}

.avail-slot--knitting {
    background: rgba(82, 196, 26, 0.06);
    border-color: rgba(82, 196, 26, 0.2);
}
.avail-slot--knitting .avail-slot__time {
    color: #389e0d;
}

/* ========================================
   All Available Courses Panel
   ======================================== */
.avail-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 20px;
}

.avail-course-card {
    display: flex;
    border-radius: 10px;
    border: 1px solid var(--cc-border-color);
    background: var(--cc-card-bg);
    overflow: hidden;
    transition: box-shadow 0.15s;
}

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

.avail-course-card__bar {
    width: 5px;
    flex-shrink: 0;
    background: var(--cc-primary);
}

.avail-course-card--pottery .avail-course-card__bar {
    background: #C0873A;
}

.avail-course-card--knitting .avail-course-card__bar {
    background: #52C41A;
}

.avail-course-card--default .avail-course-card__bar {
    background: #8C8C8C;
}

.avail-course-card--unscheduled {
    opacity: 0.75;
    border-style: dashed;
}

.avail-course-card__body {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.avail-course-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--cc-text-dark);
}

.avail-course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--cc-text-muted);
}

.avail-course-card__type,
.avail-course-card__level {
    background: rgba(192, 135, 58, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.avail-course-card__price {
    font-weight: 600;
    color: var(--cc-primary);
}

.avail-course-card__status {
    margin-top: 2px;
}

.avail-course-card__status .badge {
    font-size: 11px;
    font-weight: 500;
}

/* ---- Responsive: Availability ---- */
@media (max-width: 992px) {
    .avail-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .avail-course-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 576px) {
    .avail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .avail-day__body {
        min-height: 120px;
    }

    .avail-course-grid {
        grid-template-columns: 1fr;
    }
}
