/* ============================
   برنامج توزيع الحصص - Stylesheet
   ============================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --primary-dark: #0e2f44;
    --secondary: #2c3e50;
    --accent: #e67e22;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --bg: #f0f4f8;
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-700: #495057;
    --gray-900: #212529;
    --border: #d1d9e0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius: 8px;
    --radius-lg: 12px;
    --font: 'Cairo', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--gray-900);
    line-height: 1.6;
    direction: rtl;
}

/* ============================
   Schedule Display Page
   ============================ */

.display-body {
    background: var(--white);
    min-height: 100vh;
}

.schedule-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Schedule Header */
.schedule-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
}

.header-right, .header-left {
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right-inner, .header-left-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.header-text-right {
    text-align: center;
}

.header-text-left {
    text-align: center;
}

.header-logo-program {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
}

.header-uni {
    font-size: 0.95rem;
    font-weight: 700;
}

.header-uni-small {
    font-size: 0.7rem;
    opacity: 0.8;
}

.header-uni-fr {
    font-size: 0.65rem;
    opacity: 0.7;
    direction: ltr;
    text-align: right;
}

.header-center {
    text-align: center;
}

.schedule-title {
    font-size: 1.6rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.schedule-subtitle {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
    margin-top: 2px;
}

.schedule-dates {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 8px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.15);
    padding: 6px 20px;
    border-radius: 20px;
}

.schedule-dates strong {
    color: #ffd700;
}

.header-program-ar {
    font-size: 0.95rem;
    font-weight: 700;
}

.header-program-amazigh {
    font-size: 0.7rem;
    opacity: 0.8;
}

.header-program-fr {
    font-size: 0.65rem;
    opacity: 0.7;
    direction: ltr;
    text-align: left;
}

/* Week Navigation */
.week-nav-bar {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.week-nav-top {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 14px;
    gap: 12px;
}

.group-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.group-selector label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.85rem;
}

.group-selector select {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.85rem;
}

.display-actions {
    display: flex;
    gap: 6px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-700);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.2s;
}
.action-btn svg { width: 16px; height: 16px; }
.action-btn:hover { background: var(--primary); color: var(--white); }
.action-pdf:hover { background: #c0392b; color: var(--white); }
.action-excel:hover { background: #27ae60; color: var(--white); }
.action-print:hover { background: var(--success); color: var(--white); }
.action-settings:hover { background: var(--secondary); color: var(--white); }

/* Week Timeline */
.week-timeline {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 6px 0;
}

.week-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s;
}
.week-arrow svg { width: 16px; height: 16px; }
.week-arrow:hover { background: var(--primary-dark); transform: scale(1.1); }
.week-arrow-disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    pointer-events: none;
}

.week-track {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    padding: 4px 8px;
    scrollbar-width: thin;
}

.week-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    flex-shrink: 0;
    transition: all 0.2s;
    position: relative;
}

.week-node-dot {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: all 0.25s;
    border: 2px solid transparent;
}
.week-node-dot svg { width: 18px; height: 18px; }

.week-node-label {
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.2s;
}

.week-node.current .week-node-dot {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(26,82,118,0.15);
    transform: scale(1.15);
}
.week-node.current .week-node-label {
    color: var(--primary);
    font-weight: 800;
}

.week-node.past .week-node-dot {
    background: var(--primary-light);
    color: var(--white);
    border-color: var(--primary-light);
}
.week-node.past .week-node-label {
    color: var(--primary-light);
}

.week-node.future .week-node-dot {
    background: var(--white);
    color: var(--gray-400);
    border-color: var(--gray-300);
}
.week-node.future .week-node-label {
    color: var(--gray-400);
}

.week-node:hover .week-node-dot {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(26,82,118,0.12);
}
.week-node.future:hover .week-node-dot {
    border-color: var(--primary-light);
    color: var(--primary-light);
}
.week-node.future:hover .week-node-label {
    color: var(--primary-light);
}

.week-connector {
    height: 3px;
    flex: 1;
    min-width: 16px;
    max-width: 50px;
    background: var(--gray-200);
    border-radius: 2px;
    margin: 0 2px;
    align-self: center;
    margin-bottom: 18px;
}
.week-connector.done {
    background: var(--primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; }


.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover { background: var(--primary-light); }

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}
.btn-secondary:hover { background: var(--gray-300); }

.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 1rem; }

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}
.btn-sm svg { width: 14px; height: 14px; }

.btn-edit { background: var(--primary-light); color: var(--white); }
.btn-edit:hover { background: var(--primary); }

.btn-delete { background: var(--danger); color: var(--white); }
.btn-delete:hover { opacity: 0.85; }

/* Schedule Table */
.schedule-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    table-layout: fixed;
}

.schedule-table th,
.schedule-table td {
    border: 2px solid var(--primary);
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.time-header {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 12px 8px;
    font-size: 0.95rem;
    font-weight: 700;
    min-width: 120px;
}

.time-header .time-start,
.time-header .time-end {
    display: inline-block;
    margin: 0 6px;
}

.day-header {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    width: 100px;
    min-width: 100px;
}

.day-cell {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    font-weight: 800;
    font-size: 1rem;
    padding: 16px 10px;
    width: 100px;
    min-width: 100px;
}

.slot-cell {
    height: 80px;
    padding: 6px;
    background: var(--white);
    transition: background 0.2s;
}

.slot-cell:hover {
    background: var(--gray-50);
}

.slot-cell.has-entry {
    background: linear-gradient(135deg, #eaf2f8 0%, #d4e6f1 100%);
}

.entry-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 100%;
}

.entry-course {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--primary-dark);
    line-height: 1.3;
}

.entry-professor {
    font-size: 0.8rem;
    color: var(--gray-700);
    font-weight: 500;
}

.entry-room {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    background: rgba(230,126,34,0.1);
    padding: 1px 8px;
    border-radius: 10px;
}

/* Friday Prayer */
.friday-prayer {
    background: var(--gray-200) !important;
    position: relative;
}
.friday-prayer::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 6px,
        rgba(0,0,0,0.04) 6px,
        rgba(0,0,0,0.04) 12px
    );
    pointer-events: none;
}
.prayer-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Professors Section */
.professors-section {
    margin-top: 30px;
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg { width: 20px; height: 20px; }

.professors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}

.prof-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--white);
    border-radius: var(--radius);
    border-right: 3px solid var(--primary);
    box-shadow: var(--shadow);
}

.prof-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--secondary);
}

.prof-spec {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-400);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--gray-500); }
.empty-state p { font-size: 0.95rem; }

/* ============================
   TV Display Mode
   ============================ */

.tv-body {
    background: var(--white);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

.tv-slide {
    display: none;
    height: 100vh;
    padding: 20px 30px;
    flex-direction: column;
}

.tv-slide.active {
    display: flex;
}

.tv-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: var(--white);
    border-radius: var(--radius-lg);
    margin-bottom: 15px;
}

.tv-header-right {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tv-uni { font-size: 1rem; font-weight: 700; }
.tv-uni-sub { font-size: 0.7rem; opacity: 0.8; }
.tv-uni-fr { font-size: 0.65rem; opacity: 0.7; direction: ltr; text-align: center; }

.tv-header-center { text-align: center; }
.tv-header-center h1 { font-size: 1.8rem; font-weight: 900; }
.tv-header-center h2 { font-size: 1rem; font-weight: 600; opacity: 0.9; }

.tv-dates {
    margin-top: 6px;
    font-size: 1.1rem;
    background: rgba(255,255,255,0.15);
    display: inline-block;
    padding: 4px 20px;
    border-radius: 20px;
}
.tv-dates strong { color: #ffd700; }

.tv-logo-program {
    width: 70px;
    height: 70px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 6px;
}

.tv-header-left {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tv-program { font-size: 1rem; font-weight: 700; }
.tv-program-sub { font-size: 0.7rem; opacity: 0.8; }
.tv-program-fr { font-size: 0.65rem; opacity: 0.7; direction: ltr; text-align: left; }

.tv-header-left { text-align: left; }

.tv-table {
    width: 100%;
    border-collapse: collapse;
    flex: 1;
    table-layout: fixed;
}

.tv-table th, .tv-table td {
    border: 2px solid var(--primary);
    text-align: center;
    vertical-align: middle;
}

.tv-time-header {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    color: var(--white);
    padding: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}

.tv-time-header span { margin: 0 8px; }

.tv-day-header {
    background: var(--primary-dark);
    color: var(--white);
    width: 100px;
}

.tv-day-cell {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    padding: 12px;
    width: 100px;
}

.tv-slot-cell {
    padding: 8px;
    background: var(--white);
}

.tv-has-entry {
    background: linear-gradient(135deg, #eaf2f8, #d4e6f1);
}

.tv-entry {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tv-entry strong {
    font-size: 1rem;
    color: var(--primary-dark);
}

.tv-entry span {
    font-size: 0.85rem;
    color: var(--gray-700);
}

.tv-entry small {
    font-size: 0.75rem;
    color: var(--accent);
}

.tv-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.tv-progress {
    display: flex;
    gap: 8px;
}

.tv-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: background 0.3s;
}
.tv-dot.active { background: var(--primary); }

.tv-exit {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    color: var(--white);
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.2rem;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 20;
}
.tv-body:hover .tv-exit { opacity: 1; }

.tv-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 2rem;
    color: var(--gray-400);
}

/* ============================
   Admin Navigation
   ============================ */

.admin-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    padding: 0 24px;
    height: 56px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
}
.nav-brand svg { width: 22px; height: 22px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius);
    transition: all 0.2s;
}
.nav-links a svg { width: 16px; height: 16px; }
.nav-links a:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.nav-links a.active { background: rgba(255,255,255,0.2); color: var(--white); }

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.nav-user span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    opacity: 0.9;
}
.nav-user span svg { width: 16px; height: 16px; }

.btn-logout {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px !important;
    background: rgba(231,76,60,0.3) !important;
    border-radius: var(--radius) !important;
    font-size: 0.8rem !important;
}
.btn-logout:hover { background: rgba(231,76,60,0.5) !important; }

.btn-login {
    background: rgba(255,255,255,0.15) !important;
    padding: 6px 16px !important;
}

/* ============================
   Admin Content
   ============================ */

.admin-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    .admin-content { padding: 12px; }
    .card { padding: 16px; overflow: hidden; }
}

.admin-footer {
    text-align: center;
    padding: 16px;
    color: var(--gray-400);
    font-size: 0.8rem;
}

/* Page Header */
.page-header-bar {
    margin-bottom: 20px;
}

.page-header-bar h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
}
.page-header-bar h2 svg { width: 24px; height: 24px; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-100);
}
.card-title svg { width: 18px; height: 18px; color: var(--primary); }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border-right: 4px solid;
}

.stat-blue { border-color: var(--primary-light); }
.stat-green { border-color: var(--success); }
.stat-orange { border-color: var(--accent); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-blue .stat-icon { background: rgba(41,128,185,0.1); color: var(--primary-light); }
.stat-green .stat-icon { background: rgba(39,174,96,0.1); color: var(--success); }
.stat-orange .stat-icon { background: rgba(230,126,34,0.1); color: var(--accent); }

.stat-icon svg { width: 24px; height: 24px; }

.stat-info { display: flex; flex-direction: column; }
.stat-number { font-size: 2rem; font-weight: 800; color: var(--secondary); line-height: 1; }
.stat-label { font-size: 0.85rem; color: var(--gray-500); font-weight: 500; }

/* Info List */
.info-list { display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--gray-200); }
.info-label { font-weight: 600; color: var(--gray-500); }

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.quick-btn:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.quick-btn svg { width: 18px; height: 18px; }

/* Forms */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41,128,185,0.15);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 6px;
}
.form-row .form-group { min-width: 0; }
.form-row .form-group.flex-2 { grid-column: span 2; }

.form-row-2col { grid-template-columns: repeat(2, 1fr); }
.form-row-4col { grid-template-columns: repeat(4, 1fr); }

.form-section-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    margin: 14px 0 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--gray-100);
}
.form-section-title:first-child { margin-top: 0; }

@media (max-width: 900px) {
    .form-row-4col { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .form-row, .form-row-2col, .form-row-4col { grid-template-columns: 1fr; }
    .form-row .form-group.flex-2 { grid-column: span 1; }
}

.inline-form { }

.form-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}
.form-actions .btn svg { width: 16px; height: 16px; }

.inline-delete { display: inline; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.data-table th {
    background: var(--gray-50);
    padding: 12px 14px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--gray-700);
    border-bottom: 2px solid var(--gray-200);
    text-align: right;
    white-space: nowrap;
}

.data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.85rem;
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.date-cell {
    font-size: 0.8rem;
    line-height: 1.4;
    direction: ltr;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ============================
   Login Page
   ============================ */

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}
.login-header h1 { font-size: 1.5rem; color: var(--primary); font-weight: 800; }
.login-header p { color: var(--gray-500); font-size: 0.9rem; margin-top: 4px; }

.login-footer {
    text-align: center;
    margin-top: 20px;
}
.login-footer a { color: var(--primary-light); font-size: 0.85rem; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* ============================
   Print Styles
   ============================ */

@media print {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;

    body {
        background: white !important;
        margin: 0;
        padding: 0;
        font-size: 11pt;
    }

    .week-nav-bar, .admin-nav, .admin-footer, .professors-section {
        display: none !important;
    }

    .schedule-page {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Header */
    .schedule-header {
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 8px;
        padding: 12px 20px;
        background: #1a5276 !important;
        color: white !important;
    }

    .header-logo-program {
        width: 50px !important;
        height: 50px !important;
    }

    .schedule-title { font-size: 1.4rem; }
    .schedule-subtitle { font-size: 0.9rem; }
    .schedule-dates {
        font-size: 0.95rem;
        padding: 4px 16px;
        background: rgba(255,255,255,0.15) !important;
    }
    .schedule-dates strong { color: #ffd700 !important; }

    .header-uni { font-size: 0.75rem; }
    .header-uni-small { font-size: 0.6rem; }
    .header-uni-fr { font-size: 0.55rem; }
    .header-program-ar { font-size: 0.75rem; }
    .header-program-amazigh { font-size: 0.6rem; }
    .header-program-fr { font-size: 0.55rem; }

    /* Table */
    .schedule-table-wrapper {
        box-shadow: none;
        border-radius: 0;
        overflow: visible;
    }

    .schedule-table {
        width: 100%;
        border-collapse: collapse;
    }

    .schedule-table th,
    .schedule-table td {
        border: 2px solid #1a5276 !important;
        padding: 0;
    }

    .time-header {
        background: #1a5276 !important;
        color: white !important;
        padding: 8px 6px;
        font-size: 0.85rem;
    }

    .day-header {
        background: #1a5276 !important;
        color: white !important;
    }

    .day-cell {
        background: #1a5276 !important;
        color: white !important;
        font-size: 0.9rem;
        padding: 10px 6px;
    }

    .slot-cell {
        height: auto !important;
        min-height: 55px;
        padding: 4px;
        background: white !important;
    }

    .slot-cell.has-entry {
        background: #eaf2f8 !important;
    }

    .entry-course {
        font-size: 0.8rem;
        color: #0e2f44 !important;
    }

    .entry-professor {
        font-size: 0.7rem;
        color: #333 !important;
    }

    .entry-room {
        font-size: 0.6rem;
    }

    .friday-prayer {
        background: #e8e8e8 !important;
    }
    .friday-prayer::after { display: none; }
    .prayer-label {
        font-size: 0.75rem;
        color: #666 !important;
    }
}

@page {
    size: A3 landscape;
    margin: 8mm;
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1024px) {
    .schedule-header {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        padding: 16px 20px;
    }
    .header-right { order: 1; }
    .header-left { order: 2; }
    .header-center {
        grid-column: 1 / -1;
        order: 3;
    }
    .header-right-inner, .header-left-inner { gap: 6px; }
    .header-logo-program { width: 50px; height: 50px; }
    .header-uni { font-size: 0.8rem; }
    .header-uni-small { font-size: 0.6rem; }
    .header-uni-fr { font-size: 0.55rem; text-align: center; }
    .header-program-ar { font-size: 0.8rem; }
    .header-program-amazigh { font-size: 0.6rem; }
    .header-program-fr { font-size: 0.55rem; text-align: center; }
    .schedule-title { font-size: 1.3rem; }
    .schedule-subtitle { font-size: 0.85rem; }
    .schedule-dates { font-size: 0.9rem; gap: 16px; padding: 4px 14px; }
}

@media (max-width: 768px) {
    .admin-nav {
        flex-direction: column;
        height: auto;
        padding: 12px;
        gap: 8px;
    }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .nav-user { margin-right: 0; padding-right: 0; border-right: none; }
    .schedule-page { padding: 8px; }
    .schedule-header {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 12px 14px;
    }
    .header-right { order: 1; }
    .header-left { order: 2; }
    .header-center { grid-column: 1 / -1; order: 3; }
    .header-logo-program { width: 40px; height: 40px; }
    .header-uni { font-size: 0.7rem; }
    .header-uni-small, .header-program-amazigh { font-size: 0.55rem; }
    .header-uni-fr, .header-program-fr { font-size: 0.5rem; }
    .header-program-ar { font-size: 0.7rem; }
    .schedule-title { font-size: 1.1rem; }
    .schedule-subtitle { font-size: 0.75rem; }
    .schedule-dates { font-size: 0.8rem; gap: 10px; padding: 3px 10px; }
    .week-nav-bar { padding: 10px; }
    .week-nav-top { flex-direction: column; gap: 8px; }
    .display-actions { justify-content: center; margin-right: 0; }
    .week-track { padding: 4px 0; }
    .week-node-dot { width: 30px; height: 30px; font-size: 0.65rem; }
    .week-node-dot svg { width: 14px; height: 14px; }
    .week-node-label { font-size: 0.6rem; }
    .week-connector { min-width: 8px; max-width: 24px; }
    .week-arrow { width: 28px; height: 28px; }
    .week-arrow svg { width: 14px; height: 14px; }
    .cards-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .professors-grid { grid-template-columns: 1fr; }
}
