:root {
   /* Updated Professional Palette */
 /* Updated Professional Palette */
    --primary-color: #00030a;    /* Brighter, modern blue */
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc;    /*   Slightly lighter background */
    --card-bg: #ffffff;   /* #50249c; */
    --text-color: #0f172a;
    --text-muted: #00030a ; /* time   #4a4a48 */
    --border-color: #e2e8f0;
    
    /* Soft status colors */
    --success: #16a34a;
    --warning: #d97706;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.4;
    font-size: 13px;
    -webkit-text-size-adjust: 100%;
}

.container { 
    width: 100%; 
    max-width: 1000px; 
    margin: 0 auto; 
    padding: 0.5rem; 
}

/* Responsive Navigation Bar */
nav { 
    background: #ffffff; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    padding: 0.5rem 0.75rem; 
    width: 100%; 
    position: sticky;
    top: 0;
    z-index: 1000;
}
.nav-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    max-width: 1000px; 
    margin: 0 auto; 
}
.logo { 
    font-weight: bold; 
    color: var(--primary-color); 
    font-size: 0.95rem; 
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-toggle { 
    display: none; 
    background: none; 
    border: none; 
    font-size: 1.5rem; 
    cursor: pointer; 
    color: var(--text-color); 
    padding: 0.4rem; 
    min-width: 44px;
    min-height: 44px;
}
.nav-links { 
    display: flex; 
    gap: 0.2rem; 
}
nav .nav-links button {
    background: none; 
    border: none; 
    padding: 0.6rem; 
    cursor: pointer;
    font-weight: 500; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    border-radius: 4px;
    min-height: 44px;
}
nav .nav-links button:hover { 
    color: var(--primary-color); 
    background: #f3f4f6; 
}
#logout-btn { color: #ef4444 !important; }

/* Contextual Dynamic Saturday Option Bar Layout Rules */
.saturday-bar {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.sat-bar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.sat-bar-content label {
    font-size: 0.8rem;
    color: #b45309;
}
.sat-bar-content select {
    max-width: 240px;
    border-color: #d97706;
    background-color: #ffffff;
    font-weight: 600;
    color: #451a03;
    height: 34px;
    padding: 0.2rem 0.4rem;
}

/* Forms System */
.card { 
    /* background: var(--card-bg); */
     background: #f0f5f5;    /* card background */
    padding: 1.25rem;            /* More breathing room */
    border-radius: 12px;        /* Smoother rounded corners */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); 
    margin: 0.5rem auto; 
    border: 3px solid var(--border-color);
}

.card h2 { font-size: 1rem; margin-bottom: 0.2rem; } /*name or school name arrear here */
.subtitle { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.5rem; }
hr { border: 0; border-top: 1px solid var(--border-color); margin-bottom: 0.5rem; }

.login-card { max-width: 360px; margin-top: 1.5rem; }
.form-group { margin-bottom: 0.6rem; }
.form-group label { display: block; margin-bottom: 1.2rem; font-weight: 500; font-size: 0.8rem; }

input[type="text"], input[type="password"], select {
    padding: 0.75rem;          /* Taller, easier to tap */
    border-radius: 8px;        /* More modern shape */
    border: 1px solid var(--border-color);
}

.btn-primary { 
    background: var(--primary-color); 
    color: #fff; 
    border-radius: 8px; 
    padding: 0.75rem;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}
.btn-primary, .btn-secondary { width: 100%; padding: 0.6rem 0.75rem; border-radius: 4px; font-weight: 600; font-size: 0.85rem; cursor: pointer; border: none; min-height: 40px; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-secondary { background: var(--secondary-color); color: #fff; }

/* Standard Checkbox Grid */
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(45px, 1fr)); gap: 0.4rem; background: #f9fafb; padding: 0.5rem; border-radius: 4px; border: 1px solid var(--border-color); text-align: center; }
.checkbox-item { display: flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 600; gap: 0.25rem; cursor: pointer; padding: 0.2rem 0; }

/* Grouped Structuring Containers */
.class-group-block {
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    margin-bottom: 0.75rem;
}
.class-group-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    cursor: pointer;
    user-select: none;
    padding: 0.2rem 0.4rem;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px dashed #cbd5e1;
}
.class-group-heading:hover {
    background: #e0e7ff;
    border-color: var(--primary-color);
}
.bulk-toggle-indicator {
    font-size: 0.65rem;
    color: #1f3b63;
    font-weight: 700;
    background: #e2e8f0;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
}
.class-group-heading:hover .bulk-toggle-indicator {
    background: var(--primary-color);
    color: #ffffff;
}

/* Expanded Checkbox Grid inside groups */
.checkbox-grid-large { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)); 
    gap: 0.35rem; 
    margin-top: 0.4rem;
}
.checkbox-item-large { 
    display: inline-flex; 
    align-items: center; 
    font-size: 0.85rem; 
    font-weight: 600; 
    gap: 0.4rem; 
    cursor: pointer; 
    padding: 0.3rem 0.4rem; 
    white-space: nowrap;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
}
.checkbox-item-large:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Grid Table Rules */
.table-container { background: #fff; border-radius: 6px; border: 1px solid var(--border-color); overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }

table {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;         /* Ensures corners are rounded */
}

th {
    background: #f1f5f9;      /* Clearer distinction for headers */
    padding: 1rem;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

.break-row-cell { background-color: #fef3c7; color: #d97706; font-style: italic; }
.off-subject-cell { background-color: #f9fafb; color: #9ca3af; }
.active-subject-cell { background-color: #e0e7ff; color: #4338ca; }
.cell-class-div { font-weight: bold; font-size: 0.85rem; }
.cell-sub-small { font-size: 0.65rem; opacity: 0.8; }
.cell-bldg-small { font-size: 0.6rem; color: #64748b; margin-top: 1px; font-style: italic; }

/* Wizard Input Items */
.period-setup-row { background: #78add6; border: 2px solid var(--border-color); border-radius: 6px; padding: 0.6rem; margin-bottom: 0.5rem; }
.period-time-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; border-bottom: 2px dashed var(--border-color); padding-bottom: 0.25rem; }
.period-time-info strong { color: var(--primary-color); font-size: 0.95rem; }
.period-time-info span { font-size: 0.85rem; color: var(--text-muted); }

.field-group-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; }
.input-stacked-wrap { display: block; }
.select-field-label { display: block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.field-group-row select { padding: 0.25rem; font-size: 0.8rem; border-radius: 4px; height: 34px; width: 100%; }
.break-separator-row { background: #fef3c7; color: #d97706; text-align: center; padding: 0.4rem; font-size: 0.85rem; border-radius: 4px; margin-bottom: 0.5rem; font-weight: 500; }

.wizard-actions { display: flex; justify-content: space-between; margin-top: 0.6rem; gap: 0.4rem; }
.wizard-header { display: flex; justify-content: space-between; align-items: center; }
.day-badge { background: #f59e0b; color: #fff; padding: 0.2rem 0.5rem; border-radius: 10px; font-weight: bold; font-size: 0.85rem; }

.hidden { display: none !important; }
.page { display: none; }
.page.active { display: block; }

/* MEDIA ADAPTATIONS FOR HANDHELDS */
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .nav-links {
        display: flex; flex-direction: column; width: 100%; position: absolute;
        top: 100%; left: 0; background: #ffffff; box-shadow: 0 4px 6px rgba(0,0,0,0.08);
        padding: 0.2rem 0; z-index: 1000;
    }
    .nav-links.mobile-collapsed { display: none; }
    nav .nav-links button { width: 100%; text-align: left; padding: 0.75rem 1rem; border-radius: 0; border-bottom: 1px solid var(--border-color); }
    .field-group-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .status-dropdown-cell { grid-column: span 2; }
    .sat-bar-content { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
    .sat-bar-content select { max-width: 100%; width: 100%; }
}

@media (max-width: 480px) {
    .field-group-row { grid-template-columns: 1fr; gap: 0.3rem; }
    .status-dropdown-cell { grid-column: span 1; }
    .input-stacked-wrap { display: flex; align-items: center; justify-content: space-between; background: #f9fafb; padding: 0.3rem 0.5rem; border-radius: 4px; border: 1px solid #e2e8f0; }
    .select-field-label { margin-bottom: 0; font-weight: 600; min-width: 70px; font-size: 0.85rem; }
    .field-group-row select { width: 65%; height: 32px; padding: 0.15rem; font-size: 0.8rem; }
}