/* =========================================
   HIGH GATE ACADEMY – MEDIA BOOKING
   Mobile-First · Dual Month · Final
   ========================================= */

:root {
    --navy-900: #0C1B2E;
    --navy-800: #132D4A;
    --navy-700: #1B4D6E;
    --navy-600: #1E5F8B;
    --navy-500: #2574A8;
    --navy-400: #3A8CC4;
    --navy-300: #5DAED6;
    --navy-200: #8ECAE6;
    --navy-100: #C5E4F3;
    --navy-50: #E8F4FA;

    --gold-500: #C8A951;
    --gold-300: #E0CC8A;
    --gold-100: #F5EEDB;
    --gold-50: #FBF8F0;

    --green-500: #22C55E;
    --green-100: #DCFCE7;
    --green-700: #15803D;

    --red-500: #EF4444;
    --red-100: #FEE2E2;
    --red-700: #B91C1C;

    --orange-500: #F97316;
    --orange-100: #FFEDD5;

    --blue-100: #DBEAFE;

    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;

    --bg-primary: #F0F4F8;
    --bg-card: #FFFFFF;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08);
    --shadow-glow: 0 0 15px rgba(37, 116, 168, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    --font-ar: 'Cairo', sans-serif;
    --font-en: 'Inter', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-ar);
    background: var(--bg-primary);
    color: var(--gray-800);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] {
    font-family: var(--font-en);
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px;
}

.hidden {
    display: none !important;
}

/* ===== BACKGROUND DECORATION ===== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.04;
}

.bg-circle-1 {
    width: 400px;
    height: 400px;
    background: var(--navy-500);
    top: -150px;
    right: -100px;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    background: var(--gold-500);
    bottom: -80px;
    left: -80px;
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--navy-700);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-en);
}

[dir="ltr"] .lang-toggle {
    left: auto;
    right: 12px;
}

.lang-toggle:active {
    transform: scale(0.95);
}

/* ===== HEADER ===== */
.header {
    position: relative;
    z-index: 10;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700), var(--navy-600));
    padding: 20px 0 28px;
    overflow: hidden;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-300), var(--gold-500));
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.school-logo {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    object-fit: contain;
    background: rgba(255, 255, 255, 0.12);
    padding: 4px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.school-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: white;
    line-height: 1.3;
}

.dept-name {
    font-size: 0.75rem;
    color: var(--gold-300);
    font-weight: 500;
    margin-top: 2px;
}

.current-month-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-full);
    color: white;
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
}

.month-icon {
    font-size: 0.9rem;
}

/* ===== NOTES SECTION ===== */
.notes-section {
    position: relative;
    z-index: 10;
    margin-top: -16px;
    padding: 0 0 12px;
}

.notes-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--gold-500);
}

.notes-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--gold-50);
    border-bottom: 1px solid var(--gold-100);
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}

.notes-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gold-500);
    color: white;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.notes-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--navy-800);
    flex-grow: 1;
}

.notes-collapse-btn {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    transition: transform var(--transition-base);
    display: flex;
}

.notes-collapse-btn.collapsed {
    transform: rotate(-90deg);
}

.notes-body {
    padding: 16px;
}

.notes-body.collapsed {
    display: none;
}

.notes-content p {
    margin-bottom: 8px;
    color: var(--gray-700);
    font-size: 0.85rem;
    line-height: 1.7;
}

.notes-important {
    background: var(--red-100);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 12px 0;
    border-right: 3px solid var(--red-500);
}

[dir="ltr"] .notes-important {
    border-right: none;
    border-left: 3px solid var(--red-500);
}

.notes-important h3 {
    font-size: 0.85rem;
    color: var(--red-700);
    margin-bottom: 8px;
}

.notes-important ul {
    list-style: none;
}

.notes-important li {
    padding: 3px 0;
    color: var(--gray-700);
    font-size: 0.82rem;
    position: relative;
    padding-right: 16px;
}

[dir="ltr"] .notes-important li {
    padding-right: 0;
    padding-left: 16px;
}

.notes-important li::before {
    content: '•';
    position: absolute;
    right: 0;
    color: var(--red-500);
    font-weight: 900;
    font-size: 1.1rem;
    line-height: 1.4;
}

[dir="ltr"] .notes-important li::before {
    right: auto;
    left: 0;
}

.notes-highlight {
    background: linear-gradient(135deg, var(--navy-50), var(--blue-100));
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-top: 12px;
    border-right: 3px solid var(--navy-500);
}

[dir="ltr"] .notes-highlight {
    border-right: none;
    border-left: 3px solid var(--navy-500);
}

.notes-highlight p {
    color: var(--navy-800);
    font-weight: 500;
    margin: 0;
    font-size: 0.85rem;
}

/* ===== SECTION HEADERS ===== */
.section-header {
    text-align: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--navy-800);
    margin-bottom: 4px;
}

.section-subtitle {
    font-size: 0.82rem;
    color: var(--gray-500);
}

/* ===== MONTH TABS ===== */
.month-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    justify-content: center;
}

.month-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: white;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-base);
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

.month-tab.active {
    background: var(--navy-700);
    color: white;
    border-color: var(--navy-700);
    box-shadow: var(--shadow-md);
}

.month-tab:not(.active):active {
    transform: scale(0.97);
    background: var(--gray-50);
}

.tab-badge {
    font-size: 0.58rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--gold-500);
    color: white;
    line-height: 1.4;
}

.month-tab.active .tab-badge {
    background: rgba(255, 255, 255, 0.25);
}

/* ===== CALENDAR ===== */
.calendar-section {
    position: relative;
    z-index: 10;
    padding: 24px 0 16px;
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--gray-600);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-dot.available { background: var(--green-500); }
.legend-dot.partial { background: var(--orange-500); }
.legend-dot.full { background: var(--red-500); }
.legend-dot.blocked { background: var(--gray-300); }

.calendar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.calendar-grid {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 12px;
    border: 1px solid var(--gray-200);
}

.calendar-month-label {
    text-align: center;
    font-size: 1rem;
    font-weight: 800;
    color: var(--navy-700);
    padding: 6px 0 10px;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 6px;
}

.cal-day-name {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--navy-600);
    padding: 6px 2px;
    letter-spacing: 0.3px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.cal-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border: 2px solid transparent;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
}

.cal-day.empty { cursor: default; }

.cal-day.available {
    background: var(--green-100);
    color: var(--green-700);
    border-color: rgba(34, 197, 94, 0.15);
}

.cal-day.available:active {
    background: var(--green-500);
    color: white;
    transform: scale(0.95);
}

.cal-day.partial {
    background: var(--orange-100);
    color: #9A3412;
    border-color: rgba(249, 115, 22, 0.15);
}

.cal-day.partial:active {
    background: var(--orange-500);
    color: white;
    transform: scale(0.95);
}

.cal-day.full {
    background: var(--red-100);
    color: var(--red-700);
    cursor: not-allowed;
    opacity: 0.6;
}

.cal-day.blocked {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
    opacity: 0.4;
}

.cal-day.past {
    background: var(--gray-50);
    color: var(--gray-300);
    cursor: not-allowed;
    opacity: 0.35;
    text-decoration: line-through;
}

.cal-day.selected {
    background: var(--navy-700) !important;
    color: white !important;
    border-color: var(--gold-500) !important;
    transform: scale(1.05);
    box-shadow: var(--shadow-glow), 0 0 0 2px rgba(200, 169, 81, 0.3);
}

.cal-day .slots-indicator {
    font-size: 0.5rem;
    position: absolute;
    bottom: 2px;
    opacity: 0.7;
    font-weight: 600;
}

/* ===== PERIODS PANEL ===== */
.periods-panel {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.periods-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.periods-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.periods-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.85;
}

.selected-date-value {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--gold-300);
}

.close-periods-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.close-periods-btn:active {
    background: rgba(255, 255, 255, 0.25);
}

.periods-grid {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.period-slot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
}

.period-slot.open {
    background: var(--green-100);
    border-color: rgba(34, 197, 94, 0.1);
}

.period-slot.open:active {
    background: var(--green-500);
    color: white;
}

.period-slot.booked {
    background: var(--gray-100);
    color: var(--gray-400);
    cursor: not-allowed;
}

.period-slot.admin-blocked {
    background: #FEF3C7;
    color: #92400E;
    cursor: not-allowed;
    border-color: rgba(234, 179, 8, 0.2);
}

.period-slot.selected-period {
    background: var(--navy-700) !important;
    color: white !important;
    border-color: var(--gold-500) !important;
    box-shadow: var(--shadow-glow);
}

.period-number {
    font-weight: 700;
    font-size: 0.88rem;
}

.period-status {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
}

.period-slot.open .period-status {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-700);
}

.period-slot.booked .period-status {
    background: var(--gray-200);
    color: var(--gray-500);
}

.period-slot.admin-blocked .period-status {
    background: rgba(234, 179, 8, 0.15);
    color: #92400E;
}

.period-slot.selected-period .period-status {
    background: rgba(200, 169, 81, 0.3);
    color: var(--gold-300);
}

/* ===== BOOKING FORM ===== */
.form-section {
    position: relative;
    z-index: 10;
    padding: 0 0 40px;
    animation: slideUp 0.4s ease;
}

.booking-form {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 20px 16px;
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--navy-600);
}

.form-selected-info {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.info-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, var(--navy-50), var(--blue-100));
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--navy-700);
    border: 1px solid var(--navy-100);
    flex: 1;
    min-width: 0;
    justify-content: center;
}

.chip-icon {
    font-size: 0.9rem;
    flex-shrink: 0;
}

.form-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 3px;
}

.required {
    color: var(--red-500);
    font-size: 1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 11px 14px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: all var(--transition-base);
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--navy-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 116, 168, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 32px;
}

[dir="ltr"] .form-group select {
    background-position: right 12px center;
    padding-left: 14px;
    padding-right: 32px;
}

.form-group textarea {
    resize: vertical;
    min-height: 70px;
}

.form-actions {
    display: flex;
    gap: 10px;
    flex-direction: column-reverse;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 48px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 38px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
    color: white;
    border-color: var(--navy-700);
    box-shadow: var(--shadow-sm);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
}

.btn-secondary:active {
    background: var(--gray-50);
}

.btn-danger {
    background: var(--red-500);
    color: white;
    border-color: var(--red-500);
    padding: 6px 12px;
    font-size: 0.75rem;
    min-height: 34px;
}

.btn-danger:active {
    background: var(--red-700);
}

.btn .spinner {
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn.full-width {
    width: 100%;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 9999;
    padding: 0;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-card {
    background: white;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 28px 20px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-icon {
    margin: 0 auto 16px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.success {
    background: var(--green-100);
    color: var(--green-500);
}

.modal-icon.error {
    background: var(--red-100);
    color: var(--red-500);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--gray-800);
}

.modal-message {
    color: var(--gray-500);
    font-size: 0.85rem;
    margin-bottom: 16px;
    line-height: 1.6;
}

.modal-details {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 16px;
    text-align: start;
    font-size: 0.82rem;
    line-height: 1.9;
    color: var(--gray-700);
}

.modal-btn {
    width: 100%;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--navy-800);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all var(--transition-slow);
    max-width: 90%;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== FOOTER ===== */
.footer {
    position: relative;
    z-index: 10;
    background: var(--navy-900);
    padding: 20px 0;
    text-align: center;
}

.footer-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    margin-bottom: 8px;
    object-fit: contain;
    opacity: 0.7;
}

.footer-content p {
    color: var(--gray-400);
    font-size: 0.75rem;
}

.footer-sub {
    margin-top: 2px;
    color: var(--gray-500) !important;
    font-size: 0.7rem !important;
}

/* =========================================
   ADMIN STYLES
   ========================================= */
.admin-body {
    font-family: var(--font-en);
    direction: ltr;
}

.admin-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-xl);
    max-width: 380px;
    width: 100%;
    text-align: center;
    border-top: 3px solid var(--navy-600);
}

.login-logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    object-fit: contain;
}

.login-header h1 {
    font-size: 1.3rem;
    color: var(--navy-800);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--gray-500);
    margin-bottom: 24px;
    font-size: 0.85rem;
}

.admin-header {
    background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
    padding: 14px 0;
    color: white;
}

.admin-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-header h1 {
    font-size: 1rem;
}

.admin-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.admin-main {
    padding: 20px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--navy-700);
}

.stat-label {
    font-size: 0.72rem;
    color: var(--gray-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-section {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px 16px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
}

.admin-section h2 {
    font-size: 1.05rem;
    color: var(--navy-800);
    margin-bottom: 4px;
}

.admin-hint {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-bottom: 14px;
}

.admin-period-controls {
    margin-bottom: 12px;
}

.admin-period-controls .form-group {
    max-width: 250px;
}

.admin-periods-grid {
    animation: slideUp 0.2s ease;
}

.admin-periods-date-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--navy-700);
    margin-bottom: 10px;
}

.admin-periods-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.admin-period-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    border: 1px solid var(--gray-200);
    gap: 8px;
}

.admin-period-row.open {
    background: var(--green-100);
    border-color: rgba(34, 197, 94, 0.2);
}

.admin-period-row.booked {
    background: var(--blue-100);
    border-color: rgba(59, 130, 246, 0.2);
}

.admin-period-row.admin-blocked {
    background: #FEF3C7;
    border-color: rgba(234, 179, 8, 0.2);
}

.admin-period-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.admin-period-label {
    font-weight: 700;
}

.admin-period-detail {
    font-size: 0.72rem;
    color: var(--gray-500);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-add-block {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.admin-add-block h4 {
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.admin-add-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-add-row select,
.admin-add-row input {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    width: 100%;
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.month-selector label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.month-selector input {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
}

.admin-days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
}

.admin-day-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border: 2px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
}

.admin-day-item.active {
    background: var(--green-100);
    border-color: var(--green-500);
    color: var(--green-700);
}

.admin-day-item.inactive {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-500);
}

.admin-day-item input[type="checkbox"] {
    accent-color: var(--green-500);
    width: 16px;
    height: 16px;
}

.table-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.table-filters input,
.table-filters select {
    padding: 8px 12px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.8rem;
    flex: 1;
    min-width: 0;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    -webkit-overflow-scrolling: touch;
}

.bookings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.bookings-table th {
    background: var(--navy-700);
    color: white;
    padding: 10px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.bookings-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--gray-100);
    white-space: nowrap;
}

.bookings-table tr:nth-child(even) td {
    background: var(--gray-50);
}

.bookings-table tr:hover td {
    background: var(--navy-50);
}

/* =========================================
   DESKTOP ENHANCEMENTS
   ========================================= */
@media (min-width: 640px) {
    .container {
        max-width: 900px;
        padding: 0 24px;
    }

    .header {
        padding: 28px 0 36px;
    }

    .school-logo {
        width: 60px;
        height: 60px;
    }

    .school-name {
        font-size: 1.4rem;
    }

    .dept-name {
        font-size: 0.85rem;
    }

    .current-month-badge {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .notes-body {
        padding: 20px;
    }

    .notes-content p {
        font-size: 0.9rem;
    }

    .month-tab {
        padding: 10px 28px;
        font-size: 0.92rem;
    }

    .calendar-grid {
        padding: 20px;
    }

    .cal-day {
        font-size: 1rem;
        min-height: 52px;
    }

    .cal-day-name {
        font-size: 0.75rem;
    }

    .cal-day .slots-indicator {
        font-size: 0.55rem;
    }

    .form-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .form-actions {
        flex-direction: row;
        justify-content: flex-end;
    }

    .btn {
        min-height: 44px;
        width: auto;
    }

    .booking-form {
        padding: 28px;
    }

    .modal-overlay {
        align-items: center;
        padding: 20px;
    }

    .modal-card {
        border-radius: var(--radius-lg);
        max-width: 440px;
        padding-bottom: 28px;
    }

    @keyframes modalSlideUp {
        from { opacity: 0; transform: scale(0.95); }
        to { opacity: 1; transform: scale(1); }
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .admin-add-row {
        flex-direction: row;
        align-items: end;
    }

    .admin-add-row select,
    .admin-add-row input {
        width: auto;
        flex: 1;
    }

    .lang-toggle {
        top: 16px;
        left: 16px;
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    [dir="ltr"] .lang-toggle {
        left: auto;
        right: 16px;
    }

    .cal-day.available:hover {
        background: var(--green-500);
        color: white;
        transform: scale(1.06);
    }

    .cal-day.partial:hover {
        background: var(--orange-500);
        color: white;
        transform: scale(1.06);
    }

    .period-slot.open:hover {
        background: var(--green-500);
        color: white;
    }

    .period-slot.open:hover .period-status {
        background: rgba(255, 255, 255, 0.25);
        color: white;
    }

    .btn-primary:hover {
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .month-tab:not(.active):hover {
        background: var(--gray-50);
        border-color: var(--navy-300);
        color: var(--navy-700);
    }

    .info-chip {
        flex: none;
    }
}

/* ===== SMALL PHONES ===== */
@media (max-width: 380px) {
    .container {
        padding: 0 12px;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .logo-section {
        flex-direction: column;
    }

    .school-name {
        font-size: 1.05rem;
    }

    .calendar-grid {
        padding: 8px;
    }

    .calendar-days {
        gap: 3px;
    }

    .cal-day {
        min-height: 38px;
        font-size: 0.8rem;
        border-width: 1px;
    }

    .cal-day .slots-indicator {
        display: none;
    }

    .month-tab {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .tab-badge {
        font-size: 0.52rem;
    }

    .booking-form {
        padding: 16px 12px;
    }
}

/* ===== PRINT ===== */
@media print {
    .lang-toggle,
    .bg-decoration,
    .notes-collapse-btn,
    .form-actions,
    .footer,
    .toast,
    .month-tabs {
        display: none !important;
    }

    body {
        background: white;
    }

    .header {
        background: white !important;
        color: black !important;
        padding: 10px 0;
    }

    .school-name,
    .dept-name {
        color: black !important;
    }
}