/* ==========================================
   📱 MOBILE RESPONSIVE (max‑width: 768px)
   ========================================== */
@media (max-width: 768px) {

  /* ---- NAVBAR ---- */
  .teacher-nav {
    padding: 8px 12px;
  }
  .brand-logo-img {
    height: 35px;
  }
  .page-title {
    font-size: 0.8rem !important;
    letter-spacing: 0.3px;
  }

  /* ---- MAIN CONTAINER ---- */
  .timetable-main {
    padding: 15px 5px 100px 5px;
  }

  /* ---- TITLE ---- */
  .dynamic-title {
    font-size: 1.3rem !important;
    white-space: normal;
    text-align: center;
  }

    /* ---- FILTER POPUP: make it a centered modal on mobile ---- */
    .filter-popup {
        position: fixed !important;
        top: 55% !important;
        left: 30% !important;
        transform: translate(-50%, -50%) !important;
        width: 50vw !important;
        max-width: 400px !important;
        max-height: 50vh !important;
        overflow-y: auto !important;
        z-index: 3000 !important;
        border-radius: 16px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.15);
        padding: 20px;
        background: white;
    }

    /* ---- TOP CONTROLS: keep search and date selectors on the same line ---- */
    .timetable-controls-bar {
    flex-direction: row;          /* side‑by‑side */
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    }

    .left-controls {
    flex: 1 1 auto;               /* allow shrinking */
    min-width: 0;                 /* let it shrink below content size */
    gap: 6px;
    flex-wrap: nowrap;            /* keep buttons in one row */
    }

    .search-wrapper input {
    width: 160px !important;      /* narrower search box */
    height: 36px;
    font-size: 0.8rem;
    }

    .date-selectors {
    flex: 1 1 auto;
    min-width: 0;
    gap: 6px;
    flex-direction: row;          /* Year and Month side‑by‑side */
    flex-wrap: nowrap;
    }

    .date-selectors .dropdown-style {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    font-size: 0.8rem;
    text-align: center;
    }
    /* ---- BUTTONS & DROPDOWNS ---- */
    .history-btn,
    #toggleFilterBtn,
    #freezeBtn {
        width: 32px;
        height: 32px;
    }
  .btn-yellow, .dropdown-style {
    padding: 6px 14px;
    font-size: 0.8rem;
    height: auto;
  }

  /* ---- TABLE: reset all column‑width rules so columns shrink ---- */
  #timetable th,
  #timetable td {
    min-width: 55px !important;      /* allow tighter columns */
    max-width: none !important;      /* remove upper bounds */
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 6px 3px;
  }

  /* Row‑number column – extra narrow */
  #timetable th:nth-child(1),
  #timetable td:nth-child(1) {
    min-width: 28px !important;
    max-width: 32px !important;
    font-size: 0.65rem;
  }

  /* Let the table itself be as wide as needed, scroll container handles overflow */
  table {
    width: auto;
    table-layout: auto;
  }

  .table-scroll-container {
    max-height: none;
    -webkit-overflow-scrolling: touch;
    overflow-x: auto;
    max-width: 100vw;
  }

  /* Inputs – smaller text */
  .cell-input, .header-input, .sibling-input {
    font-size: 0.7rem !important;
    padding: 2px 4px !important;
    height: auto !important;
  }

    /* ---- PLUS BUTTONS ---- */
    .vertical-plus, .horizontal-plus {
        font-size: 1.3rem;
    }

    /* ---- FIXED BOTTOM BAR (force small) ---- */
    .timetable-bottom-bar {
        bottom: 8px !important;
        right: 8px !important;
        gap: 4px !important;
        position: fixed !important;
        z-index: 200 !important;
    }

    #highlighterBtn {
        font-size: 1.2rem !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        padding: 0 !important;
    }

    .save-btn {
        padding: 5px 17px !important;
        font-size: 1rem !important;
        border-radius: 18px !important;
        height: auto !important;
    }

  /* ---- CONTEXT MENU ---- */
  .context-menu {
    min-width: auto;
    max-width: 85vw;
  }

    /* ---- SUMMARY CARDS (override inline styles with !important) ---- */
    #timetableSummary {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        gap: 2px !important;
        margin-top: 6px !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        overflow: visible !important;
    }
    .summary-card {
        padding: 10px 10px !important;
        min-width: unset !important;
        width: auto !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        border: 1px solid #f4cce0 !important;
    }
    .summary-label {
        font-size: 0.75rem !important;
        margin-bottom: 1px !important;
        line-height: 1.1 !important;
        letter-spacing: 0 !important;
    }
    .summary-value {
        font-size: 0.6rem !important;
        line-height: 1.1 !important;
}

  /* ---- FILTER POPUP ---- */
  .filter-popup {
    max-width: 90vw;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* --- BASE & FONTS --- */
body.target-body {
    font-family: 'Poppins', sans-serif; 
    margin: 0;
    background-color: #f7f6ec; /* Keeps your background consistent */
}

.teacher-timetable-page {
    background-image: url('classroom.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-color: #f7f6ec;
}

/* --- FULL WIDTH PINK WAVY NAVBAR --- */
.teacher-nav {
    background-color: #f4cce0; /* Soft pink */
    padding: 15px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0; 
    position: relative;
    z-index: 10;
}

/* This creates the actual Wavy bottom edge */
.teacher-nav::after {
    content: "";
    position: absolute;
    bottom: -20px; 
    left: 0;
    width: 100%;
    height: 25px; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120' preserveAspectRatio='none'%3E%3Cpath d='M321.39,56.44c58-10.79,114.16-30.13,172-41.86,82.39-16.72,168.19-17.73,250.45-.39C823.78,31,906.67,72,985.66,92.83c70.05,18.48,146.53,26.09,214.34,3V0H0V27.35A600.21,600.21,0,0,0,321.39,56.44Z' fill='%23f4cce0'%3E%3C/path%3E%3C/svg%3E");
    background-size: 100% 100%;
    background-repeat: no-repeat;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #532561; 
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s;
}

.back-icon:hover {
    transform: translateX(-4px); 
    color: #00afee; 
}

.brand-logo-img {
    height: 60px; 
    width: auto;
    object-fit: contain;
}

.nav-right .page-title {
    font-weight: 700;
    color: #532561;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* --- TIMETABLE PAGE LAYOUT --- */
.timetable-main {
    padding: 40px 5%;
    display: flex;
    flex-direction: column;
    gap: 15px; 
    padding-bottom: 100px; 
}

/* --- TOP BAR: CONTROLS, TITLE & DROPDOWNS --- */
.timetable-top-bar {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 20px;
    gap: 10px;
}

.timetable-top-section {
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 100%;
    margin-bottom: 20px;
    gap: 20px; 
}

/* --- CENTER TITLE & SUBTITLE --- */
.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    text-align: center;
}

.dynamic-title {
    font-size: 2.8rem; 
    font-weight: 600;
    color: #532561; 
    margin: 0;
    font-family: 'Poppins', sans-serif; 
    white-space: nowrap;
    align-self: center; /* <-- ADD THIS to center just the title */
}

.sub-title {
    font-size: 0.95rem;
    color: #8C6A96; /* Soft pastel purple */
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.date-selectors {
    display: flex;
    align-items: center;
    gap: 15px;
    align-self: flex-end; /* <-- ADD THIS to push dropdowns to the right */
}

/* --- LEFT CONTROLS (SEARCH & FILTER POP-UP) --- */
.timetable-controls-bar {
    display: flex;
    flex-direction: row; 
    justify-content: space-between; 
    align-items: center;
    width: 100%;
}

.left-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative; 
}

/* Aesthetic Yellow Funnel & Highlighter Buttons */
.filter-btn, #highlighterBtn {
    background-color: #FCEBA7; 
    border: 2px solid #F6D673;
    border-radius: 20px; 
    height: 42px;
    width: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    outline: none;
    color: #532561; 
}

/* Make Highlighter Button a perfect circle to match your vibe */
#highlighterBtn {
    border-radius: 50%;
    width: 42px;
}

.filter-btn svg {
    stroke: #532561;
}

.filter-btn:hover, #highlighterBtn:hover {
    background-color: #FDF0B8;
    transform: translateY(-2px);
    box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.08);
}

.filter-btn:active, #highlighterBtn:active {
    transform: scale(0.95);
}

/* The White Search Bar */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    background-color: #ffffff; 
    color: #532561;
    border: 1px solid #EBEBEB; /* Soft light grey */
    border-radius: 25px;
    height: 42px;
    padding: 10px 15px 10px 35px; 
    width: 220px;
    font-size: 0.95rem;
    outline: none;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.02);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.search-wrapper input:focus {
    border-color: #DDE2F0;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.06);
}

.search-wrapper input::placeholder {
    color: #B0A1B5;
}

.search-icon {
    position: absolute;
    left: 12px;
    pointer-events: none;
    stroke: #B0A1B5;
}

/* --- THE FLOATING POP-UP MENU --- */
.filter-popup {
    position: absolute;
    top: 50px; 
    left: 0;
    background-color: white;
    border: 1px solid #EBEBEB;
    border-radius: 12px;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.08); 
    padding: 15px;
    min-width: 200px;
    z-index: 2000; 
    max-height: 400px;
    overflow-y: auto; 
}

.filter-popup label {
    display: flex !important; 
    align-items: center;
    gap: 10px;
    padding: 6px 5px;
    color: #532561;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.filter-popup label:hover {
    background-color: #FDF9E6; 
}

.filter-popup input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #b5dcd4; /* Soft pastel blue */
}

/* --- AESTHETIC YELLOW PILL DROPDOWNS --- */
.dropdown-style {
    padding: 8px 20px;
    font-size: 0.95rem;
    border-radius: 20px;
    cursor: pointer;
    border: 2px solid #F6D673;
    background-color: #FCEBA7; 
    color: #532561;
    font-weight: 600;
    outline: none;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.dropdown-style:hover {
    background-color: #FDF0B8;
    transform: translateY(-2px);
    box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.08);
}

.dropdown-style option {
    background-color: white;
    color: #532561; 
}

/* --- TABLE WRAPPER & SCROLLBAR --- */
.table-outer-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    max-width: 100%; 
}

.table-scroll-container {
    overflow: auto; 
    background: transparent;
    max-width: calc(100% - 30px); 
    max-height: 65vh; 
    padding-bottom: 15px; 
}

.table-scroll-container::-webkit-scrollbar {
    height: 10px; 
    width: 10px; 
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f7f6ec; 
    border-radius: 10px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #b5dcd4; /* Pastel blue scrollbar */
    border-radius: 10px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #C4CBE0; 
}

/* --- AESTHETIC TABLE --- */
table {
    border-collapse: separate; /* Required for sticky positioning to work perfectly with borders */
    border-spacing: 0;
    background-color: #ffffff; 
    width: max-content; 
    transform-origin: top left; 
    transition: transform 0.1s ease-out; 
    border-radius: 12px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.03);
}

th, td {
    padding: 0;
    border-right: 1px solid #EBEBEB; 
    border-bottom: 1px solid #EBEBEB;
}

/* Base Header Style (Not Sticky Yet - JS Handles It) */
th {
    background-color: #b5dcd4;
    padding: 6px 4px;
    border-top: 1px solid #EBEBEB;
}

/* Adding top and left borders for the edges because we are using border-collapse: separate */
table td:first-child, table th:first-child { 
    border-left: 1px solid #EBEBEB; 
}

.header-input {
    width: 100%;
    background: transparent;
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    color: #4A4A4A;
    outline: none;
    text-align: center;
}

.header-input::placeholder {
    color: rgba(74, 74, 74, 0.5);
    font-weight: normal;
}

td {
    height: 25px; 
    position: relative; /* ✨ ADD THIS: Anchors the floating menu to the cell */
}

.cell-input {
    width: 100%;
    height: 100%;
    border: none;
    padding: 10px;
    box-sizing: border-box;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
    color: #333; 
    transition: background-color 0.2s;
}

.cell-input:focus {
    background-color: #FDF9E6; /* Soft aesthetic focus glow */
}

/* --- PLUS BUTTONS --- */
.plus-btn {
    background: transparent;
    border: none;
    font-size: 1.2rem; 
    cursor: pointer;
    color: #B0A1B5; /* Softer color for plus buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.plus-btn:hover {
    color: #532561;
    transform: scale(1.1);
}

.horizontal-plus {
    margin-left: 5px;
    margin-top: 5px; 
}

.vertical-plus {
    align-self: flex-start;
    margin-top: -10px; 
    margin-left: 5px;  
}

/* --- FIXED BOTTOM RIGHT CONTROLS --- */
.timetable-bottom-bar {
    position: fixed;   
    bottom: 30px;      
    right: 40px;       
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;      
}

.icon-btn {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-btn:hover {
    transform: translateY(-2px);
}

/* Aesthetic Yellow Save Button */
.save-btn {
    padding: 10px 40px;
    font-size: 1.1rem;
    background-color: #FCEBA7; 
    color: #532561;
    border: 2px solid #F6D673;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    outline: none;
}

.save-btn:hover {
    background-color: #FDF0B8;
    transform: translateY(-2px);
    box-shadow: 0px 6px 14px rgba(0, 0, 0, 0.08);
}

/* --- CUSTOM RIGHT-CLICK MENU --- */
.context-menu {
    position: absolute;
    background-color: white;
    border: 1px solid #EBEBEB;
    box-shadow: 0px 8px 25px rgba(0,0,0,0.08);
    border-radius: 8px;
    z-index: 1000;
    min-width: 160px;
    overflow: hidden;
}

.menu-options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #532561;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.menu-item:hover {
    background-color: #FDF9E6;
}

/* --- MULTI-COLOR HIGHLIGHTER TOOL --- */
.color-palette {
    display: flex;
    gap: 8px;
    background: white;
    padding: 5px 10px;
    border-radius: 20px;
    border: 1px solid #EBEBEB;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.04);
    align-items: center;
}

.color-swatch {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.2);
}

.active-swatch {
    border: 2px solid #532561 !important;
    transform: scale(1.1);
}

.highlighter-active {
    background-color: #FCEBA7 !important; /* Soft aesthetic active highlight state */
    border-radius: 50%;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

/* --- SMART INPUT COLUMNS (LINKS & EMAILS) --- */
.link-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    height: 35px !important; /* ✨ FIX: Changed from 100%. Matches input height and stops it from stretching down! */
    position: relative;
}

.link-wrapper .cell-input {
    padding-right: 35px; 
}

.clickable-icon {
    position: absolute;
    right: 8px;
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    z-index: 10;
}

.clickable-icon:hover {
    transform: scale(1.2);
}

/* --- SIBLING ROW UI (MERGED EXCEL LOOK) --- */
.sibling-row {
    background-color: #FCFAFB; /* Very faint pink for siblings */
}

.sibling-row td:nth-child(-n+5) .cell-input {
    opacity: 0;
    pointer-events: none;
}

.sibling-row td:nth-child(-n+5) {
    border-top: none;
    background-color: white; 
}

/* --- IN-CELL SIBLING DROPDOWN UI --- */
.cell-dropdown-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
}

.sibling-toggle-btn {
    background: #f4cce0;
    border: none;
    border-radius: 4px;
    color: #532561;
    cursor: pointer;
    padding: 3px 6px;
    margin-left: 5px;
    font-size: 0.7rem;
    font-weight: bold;
}

.sibling-container {
    display: flex; /* ✨ FIX: Changed from 'none' to 'flex' so it is open right away! */
    flex-direction: column;
    gap: 5px;
    margin-top: 5px; 
}


.sibling-input {
    width: 100%;
    border: 1px solid #EBEBEB;
    background-color: #ffffff;
    color: #532561;
    border-radius: 10px; /* Fixed round edges */
}

/* --- EXCEL-LIKE COMPACT TABLE SIZES --- */
.header-input, .cell-input, .sibling-input {
    padding: 2px 6px; 
    font-size: 0.85rem; 
    height: 25px; 
    border: none;
    outline: none;
    width: 100%;
}

/* --- RESPONSIVE MOBILE/TABLET VIEW --- */
@media (max-width: 900px) {
    .timetable-top-bar {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

/* --- DYNAMIC FREEZE PANES (JS CONTROLLED) --- */
.freeze-highlight {
    outline: 2px solid #00afee !important; /* Excel-like blue selection box */
    outline-offset: -2px;
}

.frozen-cell {
    background-color: #ffffff; /* Keeps scrolling text from showing under sticky cells */
    box-shadow: 1px 1px 0px #EBEBEB; /* Keeps borders looking clean */
}

th.frozen-cell {
    background-color: #b5dcd4; /* Matches your header color */
}

#timetable td, #timetable th {
    user-select: none; /* Stops text from being highlighted when dragging */
    -webkit-user-select: none; /* For Safari */
    -moz-user-select: none; /* For Firefox */
}

/* ==========================================
   ADMIN TABLE (#timetable) - WITH ROW HEADER COLUMN
   ========================================== */

/* Row Number column (extra) - keep it small */
#timetable th:nth-child(1),
#timetable td:nth-child(1) {
    min-width: 40px !important;
    max-width: 50px !important;
}

/* Column 1 (visual): Payment Method */
#timetable th:nth-child(2),
#timetable td:nth-child(2) {
    min-width: 130px !important;
    max-width: 160px !important;
}

/* Column 2: Payment Date */
#timetable th:nth-child(3),
#timetable td:nth-child(3) {
    min-width: 100px !important;
    max-width: 120px !important;
}

/* Column 3: Phone Number */
#timetable th:nth-child(4),
#timetable td:nth-child(4) {
    min-width: 110px !important;
    max-width: 130px !important;
}

/* Column 4: Email */
#timetable th:nth-child(5),
#timetable td:nth-child(5) {
    min-width: 200px !important;
    max-width: 260px !important;
}

/* Column 5: Parent Name */
#timetable th:nth-child(6),
#timetable td:nth-child(6) {
    min-width: 160px !important;
    max-width: 200px !important;
}

/* Column 6: Children's Name */
#timetable th:nth-child(7),
#timetable td:nth-child(7) {
    min-width: 160px !important;
    max-width: 220px !important;
}

/* Column 7: Age */
#timetable th:nth-child(8),
#timetable td:nth-child(8) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 8: Course */
#timetable th:nth-child(9),
#timetable td:nth-child(9) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 9: Slot */
#timetable th:nth-child(10),
#timetable td:nth-child(10) {
    min-width: 100px !important;
    max-width: 120px !important;
}

/* Column 10: Time */
#timetable th:nth-child(11),
#timetable td:nth-child(11) {
    min-width: 110px !important;
    max-width: 130px !important;
}

/* Column 11: Add On Book */
#timetable th:nth-child(12),
#timetable td:nth-child(12) {
    min-width: 80px !important;
    max-width: 110px !important;
}

/* Column 12: Recording Link */
#timetable th:nth-child(13),
#timetable td:nth-child(13) {
    min-width: 150px !important;
    max-width: 150px !important;
}

/* Column 13: Week 1 */
#timetable th:nth-child(14),
#timetable td:nth-child(14) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 14: Week 2 */
#timetable th:nth-child(15),
#timetable td:nth-child(15) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 15: Week 3 */
#timetable th:nth-child(16),
#timetable td:nth-child(16) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 16: Week 4 */
#timetable th:nth-child(17),
#timetable td:nth-child(17) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 17: Affiliate */
#timetable th:nth-child(18),
#timetable td:nth-child(18) {
    min-width: 75px !important;
    max-width: 75px !important;
}

/* Column 18: Base Price */
#timetable th:nth-child(19),
#timetable td:nth-child(19) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 19: Stripe Price */
#timetable th:nth-child(20),
#timetable td:nth-child(20) {
    min-width: 80px !important;
    max-width: 100px !important;
}

/* Column 20: Sum */
#timetable th:nth-child(21),
#timetable td:nth-child(21) {
    min-width: 70px !important;
    max-width: 90px !important;
}


/* --- EXCEL-LIKE ROW & COLUMN SELECTORS --- */
.excel-header {
    background-color: #EBEBEB !important;
    color: #532561;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    user-select: none;
    padding: 6px !important;
    border: 1px solid #D1D1D1 !important;
}

.excel-header:hover {
    background-color: #DDE2F0 !important;
}

/* Making the row numbers smaller and centered */
.row-selector {
    min-width: 40px !important;
    max-width: 40px !important;
    font-size: 0.9rem;
}

/* The top left corner should not do anything when clicked */
.empty-corner {
    cursor: default;
    background-color: #EBEBEB !important;
    border: 1px solid #D1D1D1 !important;
}


/* Column 1 (visual): Payment Method */
.teacher-timetable-page #teacherTable th:nth-child(1),
.teacher-timetable-page #teacherTable td:nth-child(1) {
    min-width: 130px !important;
    max-width: 160px !important;
}

/* Column 2: Payment Date */
.teacher-timetable-page #teacherTable th:nth-child(2),
.teacher-timetable-page #teacherTable td:nth-child(2) {
    min-width: 100px !important;
    max-width: 120px !important;
}

/* Column 3: Phone Number */
.teacher-timetable-page #teacherTable th:nth-child(3),
.teacher-timetable-page #teacherTable td:nth-child(3) {
    min-width: 110px !important;
    max-width: 130px !important;
}

/* Column 4: Email */
.teacher-timetable-page #teacherTable th:nth-child(4),
.teacher-timetable-page #teacherTable td:nth-child(4) {
    min-width: 200px !important;
    max-width: 260px !important;
}

/* Column 5: Parent's Name */
.teacher-timetable-page #teacherTable th:nth-child(5),
.teacher-timetable-page #teacherTable td:nth-child(5) {
    min-width: 160px !important;
    max-width: 200px !important;
}

/* Column 6: Children's Name */
.teacher-timetable-page #teacherTable th:nth-child(6),
.teacher-timetable-page #teacherTable td:nth-child(6) {
    min-width: 160px !important;
    max-width: 220px !important;
}

/* Column 7: Age */
.teacher-timetable-page #teacherTable th:nth-child(7),
.teacher-timetable-page #teacherTable td:nth-child(7) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 8: Course */
.teacher-timetable-page #teacherTable th:nth-child(8),
.teacher-timetable-page #teacherTable td:nth-child(8) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* Column 9: Slot */
.teacher-timetable-page #teacherTable th:nth-child(9),
.teacher-timetable-page #teacherTable td:nth-child(9) {
    min-width: 80px !important;
    max-width: 110px !important;
}

/* Column 9: time */
.teacher-timetable-page #teacherTable th:nth-child(10),
.teacher-timetable-page #teacherTable td:nth-child(10) {
    min-width: 80px !important;
    max-width: 150px !important;
}

/* Column 10: Add On book */
.teacher-timetable-page #teacherTable th:nth-child(11),
.teacher-timetable-page #teacherTable td:nth-child(11) {
    min-width: 110px !important;
    max-width: 110px !important;
}

/* Column 11: Recording */
.teacher-timetable-page #teacherTable th:nth-child(12),
.teacher-timetable-page #teacherTable td:nth-child(12) {
    min-width: 150px !important;
    max-width: 150px !important;
}

/* Column 12: wwek 1 */
.teacher-timetable-page #teacherTable th:nth-child(13),
.teacher-timetable-page #teacherTable td:nth-child(13) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 13: week 2 */
.teacher-timetable-page #teacherTable th:nth-child(14),
.teacher-timetable-page #teacherTable td:nth-child(14) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 14: week 3 */
.teacher-timetable-page #teacherTable th:nth-child(15),
.teacher-timetable-page #teacherTable td:nth-child(15) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 15: week 4 */
.teacher-timetable-page #teacherTable th:nth-child(16),
.teacher-timetable-page #teacherTable td:nth-child(16) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 16: Affiliate */
.teacher-timetable-page #teacherTable th:nth-child(17),
.teacher-timetable-page #teacherTable td:nth-child(17) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 17: Base Price */
.teacher-timetable-page #teacherTable th:nth-child(18),
.teacher-timetable-page #teacherTable td:nth-child(18) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* Column 18: Stripe Price */
.teacher-timetable-page #teacherTable th:nth-child(19),
.teacher-timetable-page #teacherTable td:nth-child(19) {
    min-width: 80px !important;
    max-width: 100px !important;
}

/* Column 19: Sum */
.teacher-timetable-page #teacherTable th:nth-child(20),
.teacher-timetable-page #teacherTable td:nth-child(20) {
    min-width: 80px !important;
    max-width: 100px !important;
}

/* ========================================== */
/* 🎯 CENTER ALL TEXT IN BOTH TABLES          */
/* ========================================== */

/* Center the text inside the table boxes */
#timetable th, #timetable td,
#teacherTable th, #teacherTable td {
    text-align: center !important;
}

/* Center the text inside the input boxes & dropdowns */
.header-input, .cell-input, .sibling-input {
    text-align: center !important;
}

/* Fix for Dropdowns (Select boxes need a special centering rule) */
select.cell-input {
    text-align-last: center !important;
}

/* ==========================================
   🎯 TOTAL RESET: Inherit Color + Normal Size Highlight (Both Tables)
   ========================================== */

/* 1. Base Table Cells - Align to Top */
#timetable td,
#teacherTable td {
    background-color: #ffffff; 
    position: relative;
    vertical-align: top; /* Keeps everything neatly at the top when the row gets tall */
}

/* 2. REMOVE the Blue Outline from the tall cell */
#timetable td.selected-cell,
#teacherTable td.selected-cell {
    outline: none !important; 
    z-index: 20;
}

/* 3. Inputs - Transparent background to show TD colors, STOP vertical stretching */
#timetable td input,
#timetable td select,
#teacherTable td input,
#teacherTable td select {
    width: 100%;
    height: 35px !important; /* Forces normal size highlight */
    padding: 5px;
    font-family: 'Poppins', sans-serif;
    
    background-color: transparent; /* Lets your highlighter colors shine through! */
    color: #333 !important;
    border: none !important;
    box-shadow: none !important; 
    outline: none !important;    
    box-sizing: border-box;
}

/* 4. Restore your soft yellow focus glow when clicking a cell */
#timetable td input:focus,
#timetable td select:focus,
#teacherTable td input:focus,
#teacherTable td select:focus {
    background-color: #FDF9E6 !important; 
}

/* 5. Apply the Blue Outline to the Input (Works on wrapped inputs too!) */
#timetable td.selected-cell input,
#timetable td.selected-cell select,
#teacherTable td.selected-cell input,
#teacherTable td.selected-cell select {
    outline: 2px solid #007BFF !important; /* Sharp Blue */
    outline-offset: -2px;
}

/* Prevent text selection blue-ghosting while dragging */
.no-select {
    user-select: none;
}

/* --- FLOATING UNDO / REDO BUTTONS --- */

/* Base styling to make them perfect circles like your others */
.floating-circle-btn {
    position: fixed;
    width: 50px;           /* Adjust size to match your existing buttons */
    height: 50px;
    border-radius: 50%;    /* Makes it a perfect circle */
    background-color: #ffffff; 
    color: #532561;        /* Using the dark purple from your palette */
    border: 2px solid #f4cce0; /* Soft pink border to match your nav */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    font-size: 18px;
    cursor: pointer;
    z-index: 100;          /* Ensures they float above the table */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.floating-circle-btn:hover {
    background-color: #FCEBA7; /* Soft yellow hover */
    transform: translateY(-2px);
}

.floating-circle-btn:active {
    transform: translateY(1px);
}

/* POSITIONING: 
   You will need to adjust the 'bottom' and 'right'/'left' values 
   so they sit exactly above your existing Filter and Free Pane icons! 
*/

/* Places Undo directly above the Filter icon */
.undo-pos {
    bottom: 90px; /* Adjust this so it sits right above Filter */
    right: 20px;  /* Match the 'right' value of your Filter button */
}

/* Places Redo (Forward) directly above the Free Pane icon */
.redo-pos {
    bottom: 90px; /* Adjust this so it sits right above Free Pane */
    left: 20px;   /* Match the 'left' or 'right' value of your Free Pane button */
}

/* ==========================================
   ⏪ HISTORY BUTTONS (Undo / Redo)
   ========================================== */
.history-btn {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 42px; 
    height: 42px; 
    padding: 0; 
    border-radius: 50%; 
    background-color: #FCEBA7; /* Soft aesthetic yellow */
    cursor: pointer; 
    border: 2px solid #F6D673; /* Your custom border color! */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease; /* Makes the hover animation smooth */
}

/* The Hover Effect */
.history-btn:hover {
    background-color: #FDF0B8; /* Slightly lighter yellow on hover */
    transform: translateY(-2px); /* Makes it "lift up" */
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Increases shadow to look 3D */
}

/* The Click Effect */
.history-btn:active {
    transform: translateY(1px); /* Pushes it down when clicked */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Temporary fill preview (light green outline) */
.fill-preview {
    outline: 2px solid #2ecc71 !important;
    outline-offset: -2px;
    background-color: rgba(46, 204, 113, 0.05);
}

/* --- SUMMARY CARDS (Left-aligned, rounded) --- */
.summary-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 8px 15px;
    min-width: 110px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #f4cce0;
    transition: transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.summary-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #8C6A96;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.summary-value {
    font-size: 1rem;
    font-weight: 700;
    color: #532561;
    font-family: 'Poppins', monospace;
}

.freeze-selected {
    outline: 2px solid #532561 !important;
    outline-offset: -2px;
}

/* ==========================================
   GROUP SESSION TABLE (#teacherTable) – COLUMN WIDTHS
   ========================================== */

/* Row Number column (extra) – keep it narrow */
.group-session-page #teacherTable th:nth-child(1),
.group-session-page #teacherTable td:nth-child(1) {
    min-width: 40px !important;
    max-width: 50px !important;
}

/* 1. Payment Method */
.group-session-page #teacherTable th:nth-child(2),
#teacherTable td:nth-child(2) {
    min-width: 150px !important;
    max-width: 170px !important;
}

/* 2. Payment Date */
.group-session-page #teacherTable th:nth-child(3),
.group-session-page #teacherTable td:nth-child(3) {
    min-width: 100px !important;
    max-width: 119px !important;
}

/* 3. Phone Number */
.group-session-page #teacherTable th:nth-child(4),
.group-session-page #teacherTable td:nth-child(4) {
    min-width: 110px !important;
    max-width: 125px !important;
}

/* 4. Email */
.group-session-page #teacherTable th:nth-child(5),
.group-session-page #teacherTable td:nth-child(5) {
    min-width: 200px !important;
    max-width: 260px !important;
}

/* 5. Parent's Name */
.group-session-page #teacherTable th:nth-child(6),
.group-session-page #teacherTable td:nth-child(6) {
    min-width: 160px !important;
    max-width: 200px !important;
}

/* 6. Children's Name */
.group-session-page #teacherTable th:nth-child(7),
.group-session-page #teacherTable td:nth-child(7) {
    min-width: 160px !important;
    max-width: 220px !important;
}

/* 7. Age */
.group-session-page #teacherTable th:nth-child(8),
.group-session-page #teacherTable td:nth-child(8) {
    min-width: 60px !important;
    max-width: 60px !important;
}

/* 8. Course */
.group-session-page #teacherTable th:nth-child(9),
.group-session-page #teacherTable td:nth-child(9) {
    min-width: 70px !important;
    max-width: 70px !important;
}

/* 9. Add On Book */
.group-session-page #teacherTable th:nth-child(10),
.group-session-page #teacherTable td:nth-child(10) {
    min-width: 80px !important;
    max-width: 110px !important;
}

/* 10. Recording Link */
.group-session-page #teacherTable th:nth-child(11),
.group-session-page #teacherTable td:nth-child(11) {
    min-width: 150px !important;
    max-width: 160px !important;
}

/* 11. Affiliate */
.group-session-page #teacherTable th:nth-child(12),
.group-session-page #teacherTable td:nth-child(12) {
    min-width: 75px !important;
    max-width: 80px !important;
}

/* 12. Base Price */
.group-session-page #teacherTable th:nth-child(13),
.group-session-page #teacherTable td:nth-child(13) {
    min-width: 80px !important;
    max-width: 95px !important;
}

/* 13. Stripe Price */
.group-session-page #teacherTable th:nth-child(14),
.group-session-page #teacherTable td:nth-child(14) {
    min-width: 80px !important;
    max-width: 100px !important;
}

/* 14. Sum */
.group-session-page #teacherTable th:nth-child(15),
.group-session-page #teacherTable td:nth-child(15) {
    min-width: 70px !important;
    max-width: 90px !important;
}

/* Hide price/sum columns on former students page */
body.former-mode #teacherTable th:nth-child(18),
body.former-mode #teacherTable td:nth-child(18),
body.former-mode #teacherTable th:nth-child(19),
body.former-mode #teacherTable td:nth-child(19),
body.former-mode #teacherTable th:nth-child(20),
body.former-mode #teacherTable td:nth-child(20) {
    display: none !important;
}

/* Drag‑and‑drop reorder styles */
tr.dragging {
    opacity: 0.4;
}

tr.drop-hint {
    border-top: 3px solid #00afee !important;
}
