/* ===== TALMID 360 – STYLE SYSTEM ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1B3A6B;
  --navy-dark: #102444;
  --navy-light: #2A5298;
  --sage: #7BA05B;
  --sage-light: #9DC276;
  --sage-dark: #5E7D42;
  --gold: #D4AF37;
  --gold-light: #F0D060;
  --pearl: #F5F4F0;
  --white: #FFFFFF;
  --gray-100: #F8F9FA;
  --gray-200: #E9ECEF;
  --gray-400: #ADB5BD;
  --gray-600: #6C757D;
  --gray-800: #343A40;
  --red: #DC3545;
  --orange: #FD7E14;
  --green: #28A745;
  --sidebar-w: 240px;
  --header-h: 64px;
  --t360-primary: #1B3A6B;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(27,58,107,0.10);
  --shadow-lg: 0 8px 40px rgba(27,58,107,0.18);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

html { font-size: 16px; }
body { font-family: 'Heebo', 'Arial Hebrew', Arial, sans-serif; background: var(--pearl); color: var(--gray-800); direction: rtl; overflow-x: hidden; }

/* ===== SCREENS ===== */
.screen { display: none; width: 100%; min-height: 100vh; }
.screen.active { display: flex; }

/* ===== LOGIN ===== */
#screen-login { align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%); position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; pointer-events: none; }
.login-orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.18; }
.orb1 { width: 500px; height: 500px; background: var(--sage); top: -150px; right: -100px; animation: orb-drift 8s ease-in-out infinite; }
.orb2 { width: 400px; height: 400px; background: var(--gold); bottom: -100px; left: -80px; animation: orb-drift 10s ease-in-out infinite reverse; }
.orb3 { width: 300px; height: 300px; background: var(--navy-light); top: 40%; left: 30%; animation: orb-drift 12s ease-in-out infinite; }
@keyframes orb-drift { 0%,100%{transform:translate(0,0);} 50%{transform:translate(30px,-30px);} }

.login-card { position: relative; z-index: 2; background: rgba(255,255,255,0.96); backdrop-filter: blur(20px); border-radius: 20px; padding: 40px 36px; width: 420px; max-width: 95vw; box-shadow: var(--shadow-lg); }
.logo-wrap { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.logo-icon { width: 54px; height: 54px; }
.logo-icon svg { width: 54px; height: 54px; }
.logo-title { font-size: 1.8rem; font-weight: 900; color: var(--navy); line-height: 1; }
.logo-sub { font-size: 0.82rem; color: var(--sage); font-weight: 500; }
.auth-tabs { display: flex; width: 100%; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.auth-tab { flex: 1; padding: 12px; font-weight: 700; font-size: 0.95rem; color: var(--gray-400); background: none; border: none; border-bottom: 3px solid transparent; cursor: pointer; transition: var(--transition); font-family: inherit; }
.auth-tab.active { color: var(--navy); border-bottom-color: var(--navy); }
.auth-panel { display: none; flex-direction: column; gap: 16px; }
.auth-panel.active { display: flex; }
.login-options { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.85rem; }
.link { color: var(--navy); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--sage); }

/* Demo divider & button */
.demo-divider { position: relative; text-align: center; margin: 10px 0; }
.demo-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: var(--gray-200); }
.demo-divider span { position: relative; background: white; padding: 0 10px; font-size: 0.8rem; color: var(--gray-400); }
.btn-demo { background: var(--gray-100); color: var(--navy); border: 1.5px solid var(--navy); border-radius: 8px; padding: 10px 20px; font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: var(--transition); font-family: inherit;}
.btn-demo:hover { background: var(--navy); color: white; }
.auth-switch-text { text-align: center; font-size: 0.88rem; color: var(--gray-600); margin-top: 10px; }
.login-footer { margin-top: 20px; text-align: center; font-size: 0.78rem; color: var(--gray-400); }
.login-footer a { color: var(--sage); text-decoration: none; }

/* ===== ONBOARDING ===== */
#screen-onboarding { align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-dark), var(--navy)); }
.onboarding-overlay { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 100vh; }
.onboarding-modal { background: white; border-radius: 20px; padding: 40px; width: 500px; max-width: 95vw; box-shadow: var(--shadow-lg); }
.onboarding-steps-indicator { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 32px; }
.step-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--gray-200); color: var(--gray-600); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; transition: var(--transition); }
.step-dot.active { background: var(--navy); color: white; }
.step-dot.done { background: var(--sage); color: white; }
.step-line { flex: 1; height: 2px; background: var(--gray-200); max-width: 60px; }
.onboard-step { display: none; }
.onboard-step.active { display: block; }
.onboard-step h2 { font-size: 1.3rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.step-desc { color: var(--gray-600); margin-bottom: 20px; font-size: 0.9rem; }
.onboard-nav { display: flex; gap: 12px; margin-top: 20px; justify-content: flex-end; }
.eula-box { background: var(--gray-100); border-radius: 10px; padding: 14px; font-size: 0.83rem; color: var(--gray-600); margin-bottom: 14px; max-height: 140px; overflow-y: auto; line-height: 1.6; }

/* ===== APP LAYOUT ===== */
#screen-app { flex-direction: column; }
.ticker-bar { background: var(--navy-dark); color: white; padding: 8px 0; overflow: hidden; font-size: 0.82rem; white-space: nowrap; }
.ticker-content { display: inline-flex; gap: 60px; animation: ticker-scroll 30s linear infinite; padding-right: 100%; }
.ticker-content span { padding: 0 20px; }
@keyframes ticker-scroll { from{transform:translateX(0);} to{transform:translateX(-50%);} }

/* ===== SIDEBAR ===== */
.sidebar { position: fixed; top: 0; right: 0; width: var(--sidebar-w); height: 100vh; background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 70%, var(--navy-light) 100%); display: flex; flex-direction: column; z-index: 200; box-shadow: -4px 0 24px rgba(0,0,0,0.15); padding-top: 32px; transition: transform var(--transition); overflow-y: auto; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.12); }
.logo-icon-sm { width: 32px; height: 32px; }
.logo-icon-sm svg { width: 32px; height: 32px; }
.sidebar-logo-text { color: white; font-weight: 800; font-size: 1.05rem; letter-spacing: 0.3px; }
.user-info-sidebar { display: flex; align-items: center; gap: 10px; padding: 16px 20px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--navy-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.1rem; flex-shrink: 0; }
.user-name { color: white; font-weight: 700; font-size: 0.9rem; }
.user-role { color: rgba(255,255,255,0.65); font-size: 0.76rem; }
.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-item { width: 100%; text-align: right; display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: none; background: transparent; color: rgba(255,255,255,0.78); cursor: pointer; font-family: inherit; font-size: 0.88rem; font-weight: 500; transition: var(--transition); position: relative; }
.nav-item:hover { background: rgba(255,255,255,0.12); color: white; }
.nav-item.active { background: rgba(255,255,255,0.18); color: white; font-weight: 700; }
.nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.badge-new { margin-right: auto; background: var(--gold); color: var(--navy-dark); font-size: 0.65rem; font-weight: 800; padding: 2px 7px; border-radius: 20px; }
.badge-locked { margin-right: auto; background: var(--gray-600); color: white; font-size: 0.65rem; font-weight: 800; padding: 2px 7px; border-radius: 20px; display: none; }
.nav-ai-locked { opacity: 0.5; filter: grayscale(100%); cursor: not-allowed; }
.nav-ai-locked:hover { background: transparent; color: rgba(255,255,255,0.78); }
.nav-divider { height: 1px; background: rgba(255,255,255,0.12); margin: 8px 0; }
.sidebar-bottom { padding: 12px; border-top: 1px solid rgba(255,255,255,0.12); }
.streak-widget { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(212,175,55,0.15); border-radius: 10px; margin-bottom: 8px; }
.streak-fire { font-size: 1.2rem; }
.streak-count { color: var(--gold-light); font-weight: 900; font-size: 1.2rem; }
.streak-label { color: rgba(255,255,255,0.7); font-size: 0.75rem; }

/* ===== MAIN CONTENT ===== */
.main-content { margin-right: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; background: var(--pearl); }

/* ===== HEADER ===== */
.app-header { height: var(--header-h); background: white; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; padding: 0 24px; gap: 16px; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 4px; }
.header-center { flex: 1; }
#page-title { font-size: 1.2rem; font-weight: 800; color: var(--navy); }
.header-date { font-size: 0.78rem; color: var(--gray-400); }
.header-actions { display: flex; gap: 8px; }
.icon-btn { background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; transition: var(--transition); position: relative; }
.icon-btn:hover { background: var(--gray-100); }
.notif-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: var(--red); border-radius: 50%; border: 2px solid white; }

/* ===== VIEWS ===== */
.view { display: none; flex-direction: column; padding: 24px; flex: 1; gap: 20px; }
.view.active { display: flex; }

/* ===== DAILY TIP ===== */
.daily-tip-bar { background: linear-gradient(90deg, var(--sage-dark), var(--sage)); color: white; border-radius: var(--radius); padding: 10px 16px; display: flex; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 500; }
.tip-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ===== CARDS ===== */
.card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-header-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.card-header-row h3 { font-size: 0.95rem; font-weight: 700; color: var(--navy); }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card-attendance { grid-column: span 1; }
.card-swipe { grid-column: span 1; }
.card-climate { grid-column: span 1; }
.card-events { grid-column: span 2; }
.card-ai-tip { grid-column: span 1; }
.card-alert { grid-column: span 1; }

/* ===== ATTENDANCE WIDGET ===== */
.attendance-quick { display: flex; gap: 16px; }
.att-stat { flex: 1; text-align: center; padding: 12px; border-radius: 10px; }
.att-stat.green { background: rgba(40,167,69,0.1); }
.att-stat.red { background: rgba(220,53,69,0.1); }
.att-stat.orange { background: rgba(253,126,20,0.1); }
.att-num { font-size: 2rem; font-weight: 900; line-height: 1; }
.att-stat.green .att-num { color: var(--green); }
.att-stat.red .att-num { color: var(--red); }
.att-stat.orange .att-num { color: var(--orange); }
.att-label { font-size: 0.78rem; color: var(--gray-600); margin-top: 4px; }

/* ===== SWIPE CARD ===== */
.swipe-card { text-align: center; padding: 8px; }
.swipe-student-name { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.swipe-question { font-size: 0.88rem; color: var(--gray-600); margin-bottom: 14px; }
.swipe-scale { display: flex; gap: 8px; justify-content: center; margin-bottom: 10px; }
.scale-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--gray-200); background: white; font-size: 1rem; font-weight: 700; cursor: pointer; transition: var(--transition); font-family: inherit; }
.scale-btn:hover { border-color: var(--sage); background: var(--sage); color: white; transform: scale(1.15); }
.scale-btn.selected { background: var(--navy); color: white; border-color: var(--navy); }
.btn-skip { background: none; border: none; color: var(--gray-400); font-size: 0.82rem; cursor: pointer; text-decoration: underline; font-family: inherit; }

/* ===== INVISIBLE STUDENT ALERT ===== */
.invisible-alert { display: flex; align-items: center; gap: 14px; border-right: 4px solid var(--orange); }
.alert-icon { font-size: 1.6rem; }
.alert-body { flex: 1; }
.alert-body h4 { font-weight: 700; color: var(--navy); font-size: 0.9rem; }
.alert-body p { font-size: 0.82rem; color: var(--gray-600); }

/* ===== CLIMATE BAR ===== */
.climate-score { font-weight: 800; font-size: 1.1rem; }
.green-score { color: var(--sage); }
.climate-bar-wrap { margin-bottom: 10px; }
.climate-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.climate-fill { height: 100%; background: linear-gradient(90deg, var(--sage), var(--sage-light)); border-radius: 4px; transition: width 1s ease; }
.climate-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend-item { font-size: 0.78rem; color: var(--gray-600); display: flex; align-items: center; gap: 4px; }
.green-dot::before { content:''; display:inline-block; width:8px; height:8px; background:var(--green); border-radius:50%; }
.orange-dot::before { content:''; display:inline-block; width:8px; height:8px; background:var(--orange); border-radius:50%; }
.red-dot::before { content:''; display:inline-block; width:8px; height:8px; background:var(--red); border-radius:50%; }

/* ===== EVENTS LIST ===== */
.events-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.event-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 0.85rem; }
.event-item.positive { background: rgba(40,167,69,0.07); }
.event-item.negative { background: rgba(220,53,69,0.07); }
.event-item.neutral { background: var(--gray-100); }
.event-icon { font-size: 1rem; width: 22px; text-align: center; }
.event-student { font-weight: 700; color: var(--navy); min-width: 90px; }
.event-desc { flex: 1; color: var(--gray-600); }
.event-time { font-size: 0.75rem; color: var(--gray-400); }

/* ===== AI TIP CARD ===== */
.ai-tip-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ai-icon-badge { font-size: 1.4rem; }
.ai-tip-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.ai-tip-text { font-size: 0.88rem; color: var(--gray-600); line-height: 1.6; margin-bottom: 12px; }

/* ===== BUTTONS ===== */
.btn-primary { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; border: none; border-radius: 8px; padding: 10px 20px; font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit; transition: var(--transition); box-shadow: 0 2px 8px rgba(27,58,107,0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(27,58,107,0.35); }
.btn-secondary { background: white; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 8px; padding: 10px 20px; font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit; transition: var(--transition); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-warning { background: linear-gradient(135deg, var(--orange), #e5700c); color: white; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; font-size: 0.85rem; cursor: pointer; font-family: inherit; }
.btn-danger { background: var(--red); color: white; border: none; border-radius: 6px; padding: 5px 10px; font-size: 0.78rem; font-family: inherit; cursor: pointer; }
.btn-sm { background: var(--gray-100); color: var(--navy); border: 1px solid var(--gray-200); border-radius: 7px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: var(--transition); }
.btn-sm:hover { background: var(--gray-200); }
.btn-sm.btn-primary { background: linear-gradient(135deg,var(--navy),var(--navy-light)); color: white; border: none; }
.btn-sm.btn-warning { background: var(--orange); color: white; border: none; }
.btn-xs { background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 5px; padding: 3px 8px; font-size: 0.75rem; cursor: pointer; font-family: inherit; }
.btn-xs:hover { background: var(--gray-200); }
.btn-full { width: 100%; }
.full-width { width: 100%; }

/* ===== FORM FIELDS ===== */
.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); }
.field-group input, .field-group select, .field-group textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: 9px; font-family: inherit; font-size: 0.9rem; color: var(--gray-800); background: white; transition: var(--transition); }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
.search-input { padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: 9px; font-family: inherit; font-size: 0.88rem; background: white; width: 280px; }
.search-input:focus { outline: none; border-color: var(--navy); }
.notes-field { width: 100%; padding: 10px; border: 1.5px solid var(--gray-200); border-radius: 9px; font-family: inherit; font-size: 0.88rem; resize: vertical; margin-top: 10px; }

/* ===== VIEW TOOLBAR ===== */
.view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.view-toolbar h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }

/* ===== STUDENTS GRID ===== */
.students-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.student-card { background: white; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); cursor: pointer; transition: var(--transition); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; border: 2px solid transparent; }
.student-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--sage); }
.student-card-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 800; }
.student-card-name { font-weight: 700; color: var(--navy); font-size: 0.95rem; }
.student-card-class { font-size: 0.78rem; color: var(--gray-400); }
.student-card-score { display: flex; gap: 4px; margin-top: 4px; }
.score-dot { width: 8px; height: 8px; border-radius: 50%; }
.student-invisible-tag { font-size: 0.7rem; background: rgba(253,126,20,0.15); color: var(--orange); padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.btn-profile-open { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; border: none; border-radius: 20px; padding: 5px 14px; font-size: 0.78rem; font-weight: 700; cursor: pointer; font-family: inherit; margin-top: 4px; width: 100%; transition: var(--transition); }
.btn-profile-open:hover { opacity: 0.88; transform: translateY(-1px); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 500; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-overlay.hidden { display: none; }
.modal { background: white; border-radius: 18px; padding: 28px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 16px; }
.modal-large { width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.1rem; font-weight: 800; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--gray-400); padding: 4px; }
.modal-close:hover { color: var(--red); }

/* ===== STUDENT PROFILE ===== */
.student-profile-header { display: flex; align-items: center; gap: 14px; }
.student-avatar-lg { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; font-weight: 800; flex-shrink: 0; }
.profile-tabs { display: flex; gap: 8px; border-bottom: 2px solid var(--gray-200); padding-bottom: 0; }
.tab-btn { background: none; border: none; padding: 10px 14px; font-family: inherit; font-size: 0.85rem; font-weight: 600; color: var(--gray-600); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: var(--transition); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-panel { display: none; padding: 16px 0; }
.tab-panel.active { display: block; }
.profile-content { min-height: 200px; }
.profile-footer { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--gray-200); padding-top: 14px; }

/* ===== COMPASS GOALS ===== */
.compass-goals { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.compass-goal { display: flex; align-items: center; gap: 10px; background: var(--gray-100); padding: 10px 14px; border-radius: 9px; }
.goal-num { font-weight: 700; color: var(--navy); width: 22px; height: 22px; background: var(--navy); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.goal-input { flex: 1; background: transparent; border: none; font-family: inherit; font-size: 0.88rem; }
.goal-status { font-size: 0.75rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.gray-dot::before { content:''; display:inline-block; width:8px; height:8px; background:var(--gray-400); border-radius:50%; }
.ai-result-box { background: linear-gradient(135deg, rgba(27,58,107,0.05), rgba(123,160,91,0.08)); border-right: 3px solid var(--sage); border-radius: 10px; padding: 14px; font-size: 0.88rem; line-height: 1.7; margin-top: 14px; }
.ai-result-box.hidden { display: none; }

/* --- AI Visual Panel --- */
.ai-visual-panel { width: 340px; background: white; border-right: 1px solid #eee; display: flex; flex-direction: column; overflow-y: auto; }
.visual-panel-header { padding: 18px 20px; font-weight: bold; color: var(--navy); border-bottom: 1px solid #eee; background: #fafafa; }
.visual-content { padding: 20px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.visual-placeholder { text-align: center; color: #aaa; font-size: 0.9rem; padding: 30px; border: 2px dashed #eee; border-radius: 12px; }

/* --- Graphs and Stats --- */
.bar-chart { margin-top: 15px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-label { width: 80px; font-size: 0.85rem; color: #555; text-align: left; }
.bar-track { flex: 1; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; transition: width 1s ease-out; }
.bar-val { width: 30px; font-size: 0.8rem; font-weight: bold; }
.trend-chart { display: flex; align-items: flex-end; justify-content: space-around; height: 120px; margin-top: 20px; padding-bottom: 25px; border-bottom: 1px solid #eee; position: relative; }
.trend-col { display: flex; flex-direction: column; align-items: center; width: 30px; height: 100%; justify-content: flex-end; position: relative; }
.trend-bar { width: 16px; background: var(--navy); border-radius: 4px 4px 0 0; min-height: 10%; transition: height 1s; }
.trend-label { position: absolute; bottom: -22px; font-size: 0.7rem; color: #666; white-space: nowrap; left: 50%; transform: translateX(-50%); }

/* ===== STRENGTH TAGS ===== */
.strengths-section h3 { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.strength-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.strength-tag { background: linear-gradient(135deg, var(--sage-dark), var(--sage)); color: white; padding: 5px 12px; border-radius: 20px; font-size: 0.82rem; font-weight: 600; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline::before { content:''; position:absolute; right:12px; top:0; bottom:0; width:2px; background:var(--gray-200); }
.timeline-item { display: flex; align-items: flex-start; gap: 14px; position: relative; padding-bottom: 16px; }
.tl-dot { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--gray-200); background: white; flex-shrink: 0; z-index: 1; }
.timeline-item.grade .tl-dot { border-color: var(--navy); background: var(--navy); }
.timeline-item.behavior.positive .tl-dot { border-color: var(--sage); background: var(--sage); }
.timeline-item.behavior.negative .tl-dot { border-color: var(--red); background: var(--red); }
.timeline-item.meeting .tl-dot { border-color: var(--gold); background: var(--gold); }
.tl-content { flex: 1; background: var(--gray-100); border-radius: 8px; padding: 8px 12px; }
.tl-content strong { font-size: 0.88rem; color: var(--navy); display: block; }
.tl-date { font-size: 0.75rem; color: var(--gray-400); }

/* ===== ATTENDANCE ROSTER ===== */
.attendance-header-bar { display: flex; align-items: center; justify-content: space-between; }
.attendance-header-bar h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }
.att-legend { display: flex; gap: 12px; }
.legend-pill { padding: 4px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.legend-pill.green { background: rgba(40,167,69,0.12); color: var(--green); }
.legend-pill.red { background: rgba(220,53,69,0.12); color: var(--red); }
.legend-pill.orange { background: rgba(253,126,20,0.12); color: var(--orange); }
.attendance-roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.att-student-row { background: white; border-radius: 10px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 6px rgba(0,0,0,0.06); }
.att-student-name { flex: 1; font-weight: 600; font-size: 0.88rem; }
.att-btns { display: flex; gap: 6px; }
.att-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--gray-200); background: white; cursor: pointer; font-size: 0.85rem; transition: var(--transition); }
.att-btn.present.active { background: var(--green); border-color: var(--green); color: white; }
.att-btn.absent.active { background: var(--red); border-color: var(--red); color: white; }
.att-btn.late.active { background: var(--orange); border-color: var(--orange); color: white; }
.att-actions { display: flex; gap: 12px; }

/* ===== ASSESSMENT CARDS ===== */
.assessment-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.assessment-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 4px solid var(--sage); }
.assessment-card-title { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.assessment-card-category { font-size: 0.78rem; color: var(--gray-400); margin-bottom: 14px; }
.assessment-scale-row { display: flex; gap: 6px; }
.scale-mini { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gray-200); background: white; font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: var(--transition); font-family: inherit; }
.scale-mini:hover { background: var(--navy); color: white; border-color: var(--navy); }

/* ===== AI ADVISOR ===== */
.ai-advisor-layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; height: calc(100vh - var(--header-h) - 80px); }
.ai-sidebar { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.ai-sidebar h3 { font-size: 0.88rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.ai-context-list { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ai-context-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; cursor: pointer; transition: var(--transition); border: 1.5px solid transparent; }
.ai-context-item:hover { background: var(--gray-100); }
.ai-context-item.active { background: rgba(27,58,107,0.07); border-color: rgba(27,58,107,0.2); }
.ctx-icon { font-size: 1.1rem; }
.ctx-title { font-size: 0.82rem; font-weight: 600; color: var(--navy); }
.ctx-date { font-size: 0.72rem; color: var(--gray-400); }
.ai-chat-main { background: white; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.ai-chat-header { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); padding: 12px 18px; }
.ai-badge { color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 600; }
.quick-prompts-bar { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--gray-200); flex-wrap: wrap; }
.quick-prompt-btn { background: linear-gradient(135deg, rgba(27,58,107,0.07), rgba(123,160,91,0.08)); border: 1px solid rgba(27,58,107,0.15); border-radius: 20px; padding: 5px 12px; font-size: 0.78rem; font-weight: 600; color: var(--navy); cursor: pointer; font-family: inherit; transition: var(--transition); }
.quick-prompt-btn:hover { background: var(--navy); color: white; }
.quick-prompts-profile { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.chat-window { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 200px; max-height: 380px; }
.mini-chat { max-height: 200px; border: 1px solid var(--gray-200); border-radius: 10px; }
.chat-msg { display: flex; gap: 10px; align-items: flex-start; }
.chat-msg.user-msg { flex-direction: row-reverse; }
.chat-avatar-sm { font-size: 1.3rem; flex-shrink: 0; }
.chat-bubble { background: var(--gray-100); border-radius: 12px 12px 12px 0; padding: 12px 16px; font-size: 0.88rem; line-height: 1.6; max-width: 80%; }
.chat-msg.user-msg .chat-bubble { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; border-radius: 12px 12px 0 12px; }
.ai-msg { }
.chat-rlhf { display: flex; gap: 8px; margin-top: 6px; opacity: 0.5; }
.rlhf-btn { background: none; border: none; cursor: pointer; font-size: 1rem; transition: var(--transition); }
.rlhf-btn:hover { opacity: 1; transform: scale(1.2); }
.chat-input-area { border-top: 1px solid var(--gray-200); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-end; }
.chat-textarea { flex: 1; border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 10px 14px; font-family: inherit; font-size: 0.9rem; resize: none; }
.chat-textarea:focus { outline: none; border-color: var(--navy); }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input { flex: 1; border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 8px 12px; font-family: inherit; font-size: 0.88rem; }
.chat-input:focus { outline: none; border-color: var(--navy); }
.btn-send { background: var(--sage); color: white; border: none; border-radius: 8px; padding: 8px 16px; font-weight: 700; font-size: 0.88rem; cursor: pointer; font-family: inherit; }
.btn-send-main { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; border: none; border-radius: 10px; width: 44px; height: 44px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ai-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; }
.ai-loading.hidden { display: none; }
.loading-tree { font-size: 2rem; animation: tree-grow 1s ease-in-out infinite alternate; }
@keyframes tree-grow { from{transform:scale(0.9);}to{transform:scale(1.15);} }
.loading-tips { font-size: 0.82rem; color: var(--gray-400); text-align: center; }

/* ===== CALENDAR ===== */
.calendar-layout { display: flex; flex-direction: column; gap: 14px; }
.calendar-header-bar { display: flex; align-items: center; justify-content: space-between; background: white; border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.calendar-header-bar h3 { font-weight: 800; font-size: 1rem; color: var(--navy); text-align: center; }
.calendar-header-bar h3 span { display: block; }
.calendar-header-bar h3 small { display: block; font-size: 0.72rem; color: var(--sage); font-weight: 600; margin-top: 2px; }
.calendar-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; font-weight: 700; font-size: 0.78rem; color: var(--gray-600); padding: 0 2px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; background: white; border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); }
.cal-day { height: 52px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; transition: var(--transition); position: relative; border: 1.5px solid transparent; gap: 1px; }
.cal-day:hover { background: rgba(27,58,107,0.07); border-color: rgba(27,58,107,0.2); }
.cal-day.today { background: var(--navy); border-color: var(--navy); }
.cal-day.today .cal-greg { color: white; font-weight: 900; }
.cal-day.today .cal-heb { color: rgba(255,255,255,0.75); }
.cal-day.has-event::after { content:''; position:absolute; bottom:3px; left:50%; transform:translateX(-50%); width:5px; height:5px; background:var(--sage); border-radius:50%; }
.cal-day.today.has-event::after { background: var(--gold); }
.cal-day.shabbat { background: rgba(27, 58, 107, 0.05); color: var(--navy); }
.cal-day.empty { opacity: 0; pointer-events: none; }
.cal-greg { font-size: 0.92rem; font-weight: 700; color: var(--navy); line-height: 1; }
.cal-heb  { font-size: 0.65rem; color: var(--sage-dark); font-weight: 600; line-height: 1; }
.calendar-events-panel { background: white; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.calendar-events-panel h4 { font-weight: 700; color: var(--navy); margin-bottom: 10px; font-size: 0.9rem; }
.cal-events-list { display: flex; flex-direction: column; gap: 8px; }
.cal-event-item { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; padding: 6px 0; }
.cal-event-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-400); flex-shrink: 0; }
.ai-dot { background: var(--sage); }
.meet-dot { background: var(--navy); }

/* ===== REPORTS ===== */
.reports-layout { display: flex; flex-direction: column; gap: 16px; }
.report-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: white; padding: 14px; border-radius: var(--radius); box-shadow: var(--shadow); }
.report-filters select, .report-filters input[type=date] { padding: 8px 12px; border: 1.5px solid var(--gray-200); border-radius: 8px; font-family: inherit; font-size: 0.85rem; }
.report-table-wrap { background: white; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.report-table th { background: var(--navy); color: white; padding: 12px 14px; text-align: right; font-weight: 600; }
.report-table td { padding: 10px 14px; border-bottom: 1px solid var(--gray-200); }
.report-table tr:hover td { background: var(--gray-100); }

/* ===== PRINCIPAL ===== */
.principal-layout { display: flex; flex-direction: column; gap: 20px; }
.executive-radar { background: white; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.executive-radar h3 { font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.radar-items { display: flex; flex-direction: column; gap: 10px; }
.radar-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; font-size: 0.88rem; }
.radar-item.red { background: rgba(220,53,69,0.08); }
.radar-item.orange { background: rgba(253,126,20,0.08); }
.radar-item.green { background: rgba(40,167,69,0.08); }
.traffic-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; }
.red-dot { background: var(--red); }
.traffic-dot.red-dot { background: var(--red); }
.traffic-dot.orange-dot { background: var(--orange); }
.traffic-dot.green-dot { background: var(--green); }
.heatmap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.heatmap-cell { border-radius: 12px; padding: 16px; text-align: center; color: white; font-weight: 700; box-shadow: var(--shadow); }
.smart-clipboard { background: white; border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.clipboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.clipboard-header h3 { font-weight: 700; color: var(--navy); }
.clipboard-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.clipboard-list li { padding: 8px 10px; border-radius: 8px; background: var(--gray-100); }

/* ===== SUPER-ADMIN ===== */
.dark-panel { background: #0F1923 !important; color: white; }
.view.dark-panel { background: #0F1923 !important; }
.superadmin-layout { display: flex; flex-direction: column; gap: 16px; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-tab { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.7); border-radius: 8px; padding: 9px 16px; font-size: 0.85rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: var(--transition); }
.admin-tab.active { background: var(--navy); color: white; border-color: var(--navy); }
.admin-panel { display: none; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--radius); padding: 20px; color: rgba(255,255,255,0.85); }
.admin-panel.active { display: block; }
.admin-panel h3 { color: white; font-weight: 700; margin-bottom: 14px; }
.admin-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.admin-table th { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.9); padding: 10px 14px; text-align: right; font-weight: 600; }
.admin-table td { padding: 10px 14px; border-bottom: 1px solid rgba(255,255,255,0.07); color: rgba(255,255,255,0.8); }
.admin-table tr:hover td { background: rgba(255,255,255,0.05); }
.badge { padding: 3px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 700; }
.green-badge { background: rgba(40,167,69,0.2); color: #5ECC7A; }
.orange-badge { background: rgba(253,126,20,0.2); color: var(--orange); }
.red-badge { background: rgba(220,53,69,0.2); color: #FF6B6B; }
.prompt-matrix { display: flex; flex-direction: column; gap: 14px; }
.prompt-textarea { width: 100%; padding: 10px 14px; border: 1px solid rgba(255,255,255,0.2); border-radius: 9px; background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); font-family: inherit; font-size: 0.88rem; resize: vertical; }
.audit-log { display: flex; flex-direction: column; gap: 6px; }
.audit-row { display: grid; grid-template-columns: 140px 180px 120px 1fr; gap: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(255,255,255,0.04); font-size: 0.8rem; }
.audit-row.warn-row { background: rgba(220,53,69,0.1); }
.audit-time { color: var(--gray-400); }
.audit-user { color: var(--sage-light); }
.audit-ip { color: var(--gray-400); }
.audit-action { color: rgba(255,255,255,0.8); }

/* ===== AI FULLSCREEN LOADING ===== */
.ai-fullscreen { position: fixed; inset: 0; background: rgba(27,58,107,0.95); z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.ai-fullscreen.hidden { display: none; }
.tree-animation { font-size: 4rem; animation: tree-grow 1.2s ease-in-out infinite alternate; }
.loading-message { color: white; font-size: 1.1rem; font-weight: 600; }
.rotating-tips { color: rgba(255,255,255,0.6); font-size: 0.88rem; max-width: 400px; text-align: center; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--navy-dark); color: white; padding: 12px 24px; border-radius: 40px; font-size: 0.88rem; font-weight: 600; z-index: 9999; box-shadow: var(--shadow-lg); }
.toast.hidden { display: none; }
.toast.success { background: var(--sage-dark); }
.toast.error { background: var(--red); }

/* ===== IMPERSONATION BANNER ===== */
.impersonation-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--orange); color: white; text-align: center; padding: 8px; font-size: 0.88rem; font-weight: 700; z-index: 9000; }
.impersonation-banner.hidden { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .menu-toggle { display: block; }
  .ai-advisor-layout { grid-template-columns: 1fr; }
  .ai-sidebar { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-events { grid-column: span 1; }
}
@media (max-width: 600px) {
  .view { padding: 14px; }
  .login-card { padding: 28px 20px; }
  .modal { padding: 20px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);} }
.view.active { animation: fadeIn 0.3s ease; }
.card { animation: fadeIn 0.3s ease; }
.student-card { animation: fadeIn 0.25s ease; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== ADMIN PANEL EXTRA STYLES ===== */
.admin-table-wrap { overflow-x: auto; }
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: bold;
  background: #eef2f5;
  color: #6c757d;
  display: inline-block;
}
.badge.premium {
  background: #fff4e5;
  color: #ff8c00;
  border: 1px solid #ffe8cc;
}
.btn-warning { background: #ffc107; color: #000; }
.btn-success { background: #28a745; color: #fff; }
.btn-xs.btn-danger { background: #dc3545; color: white; }

/* ===== PROFESSIONAL AI OUTPUT STYLES ===== */
.chat-bubble {
  font-size: 1rem;
  line-height: 1.6;
}
.ai-msg .chat-bubble {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #2c3e50;
  background: #fdfdfd;
  border: 1px solid #eaeff5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 16px 20px;
}
.chat-bubble b, .chat-bubble strong { color: var(--t360-primary); }
.chat-bubble ul, .chat-bubble ol { margin: 10px 0; padding-right: 20px; }
.chat-bubble li { margin-bottom: 6px; }

/* =========================================================
   פרק 1: מעבדת סימולציה 3D
   ========================================================= */
.sim-layout { display: grid; grid-template-columns: 320px 1fr; gap: 20px; height: calc(100vh - var(--header-h) - 80px); }
.sim-controls-panel { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.sim-panel-header { display: flex; align-items: center; gap: 14px; }
.sim-panel-icon { font-size: 2rem; width: 52px; height: 52px; background: linear-gradient(135deg, var(--navy), var(--navy-light)); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sim-panel-subtitle { font-size: 0.8rem; color: var(--gray-600); line-height: 1.5; margin-top: 2px; }
.sim-controls-panel h3 { font-size: 1rem; font-weight: 800; color: var(--navy); }
.sim-step-indicator { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sim-step-pill { background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; padding: 4px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 700; }
.sim-history-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sim-chip { background: rgba(123,160,91,0.15); color: var(--sage-dark); padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.sim-action-row { display: flex; gap: 8px; flex-wrap: wrap; }
.sim-anon-row { background: rgba(27,58,107,0.05); border-radius: 9px; padding: 8px 12px; }
.sim-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--navy-dark), var(--navy)); border-radius: 12px; padding: 18px; }
.sim-loading.hidden { display: none; }
.sim-loading-orb { width: 40px; height: 40px; border-radius: 50%; background: conic-gradient(var(--sage), var(--gold), var(--sage)); animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-loading-text { color: rgba(255,255,255,0.85); font-size: 0.82rem; text-align: center; animation: pulse-txt 1.8s ease-in-out infinite; }
@keyframes pulse-txt { 0%,100%{opacity:0.7;} 50%{opacity:1;} }
.sim-narrative { background: linear-gradient(135deg, rgba(27,58,107,0.06), rgba(123,160,91,0.08)); border-right: 3px solid var(--sage); border-radius: 10px; padding: 12px 14px; font-size: 0.85rem; line-height: 1.65; min-height: 0; }
.sim-narrative:empty { display: none; }
.sim-narrative-text { color: var(--gray-800); }
.sim-step-tag { background: var(--navy); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; margin-left: 8px; }
.sim-legend { }
.sim-legend h4 { font-size: 0.85rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.sim-legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.sim-legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.78rem; color: var(--gray-800); }
.sim-legend-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.legend-green { background: var(--sage); }
.legend-gold { background: var(--gold); }
.legend-red { background: var(--red); }
.sim-canvas-wrap { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: #1a1f2e; }
#sim-canvas { width: 100%; height: 100%; display: block; }
.sim-scene-badge { position: absolute; top: 16px; right: 16px; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px); color: white; padding: 6px 14px; border-radius: 20px; font-size: 0.82rem; font-weight: 700; z-index: 10; }
.sim-bubbles-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.sim-bubble { position: absolute; transform: translate(-50%, -100%); background: white; border: 2px solid var(--navy); border-radius: 10px; padding: 6px 10px; font-size: 0.75rem; color: var(--navy); line-height: 1.4; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.2); max-width: 160px; white-space: normal; }
.sim-bubble::after { content: ''; position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); border: 5px solid transparent; border-top-color: var(--navy); }
.sim-record-btn.recording { background: var(--red); color: white; border-color: var(--red); animation: pulse-red 1s ease-in-out infinite; }
@keyframes pulse-red { 0%,100%{opacity:1;} 50%{opacity:0.7;} }

/* =========================================================
   פרק 2: מחולל נחת
   ========================================================= */
.modal-nachat-dialog { width: 620px; max-width: 96vw; }
.nachat-modal-header { background: linear-gradient(135deg, var(--navy-dark), var(--navy)); border-radius: 12px; padding: 18px 20px; margin: -28px -28px 0; }
.nachat-modal-header h3 { color: white; }
.nachat-sub { color: rgba(255,255,255,0.7); font-size: 0.82rem; margin-top: 4px; }
.nachat-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; }
.nachat-loading.hidden { display: none; }
.nachat-inbox { display: flex; flex-direction: column; gap: 14px; max-height: 460px; overflow-y: auto; padding: 4px 0; }
.nachat-msg-card { background: white; border: 1.5px solid var(--gray-200); border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: var(--transition); }
.nachat-msg-card:hover { border-color: var(--sage); box-shadow: 0 4px 16px rgba(123,160,91,0.2); }
.nachat-msg-header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--gray-100); border-bottom: 1px solid var(--gray-200); }
.nachat-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; flex-shrink: 0; }
.nachat-info { flex: 1; }
.nachat-info strong { font-size: 0.88rem; color: var(--navy); display: block; }
.nachat-stars { font-size: 0.78rem; }
.nachat-check { font-size: 0.82rem; }
.nachat-msg-body { padding: 14px 16px; font-size: 0.88rem; line-height: 1.7; color: var(--gray-800); min-height: 60px; outline: none; border: 2px solid transparent; transition: var(--transition); }
.nachat-msg-body:focus { border-color: var(--sage); background: rgba(123,160,91,0.04); border-radius: 0 0 10px 10px; }
.nachat-msg-footer { padding: 8px 16px 10px; border-top: 1px solid var(--gray-200); background: var(--gray-100); display: flex; gap: 8px; }
.nachat-footer-bar { display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--gray-200); padding-top: 16px; }

/* =========================================================
   פרק 3: תאום דיגיטלי
   ========================================================= */
.twin-layout { display: grid; grid-template-columns: 260px 1fr; gap: 20px; height: calc(100vh - var(--header-h) - 80px); }
.twin-sidebar { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.twin-intro-card { text-align: center; padding: 20px 12px; background: linear-gradient(135deg, var(--navy-dark), var(--navy)); border-radius: 14px; color: white; }
.twin-icon-badge { font-size: 2.4rem; margin-bottom: 10px; }
.twin-intro-card h3 { font-size: 1.05rem; font-weight: 800; margin-bottom: 8px; }
.twin-intro-card p { font-size: 0.82rem; color: rgba(255,255,255,0.75); line-height: 1.6; }
.twin-stats { display: flex; flex-direction: column; gap: 8px; }
.twin-stat-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--gray-100); border-radius: 9px; font-size: 0.85rem; }
.twin-stat-icon { font-size: 1.1rem; }
.twin-doc-area { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0; overflow-y: auto; }
.twin-doc-header-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; border-bottom: 2px solid var(--gray-200); padding-bottom: 12px; }
.twin-doc-header-bar h3 { font-size: 1rem; font-weight: 800; color: var(--navy); }
.twin-doc-date { font-size: 0.8rem; color: var(--gray-400); }
.twin-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px; }
.twin-loading.hidden { display: none; }
.twin-loading p { font-size: 0.88rem; color: var(--gray-600); }
.twin-document { flex: 1; min-height: 300px; border: 1.5px dashed var(--gray-200); border-radius: 12px; overflow-y: auto; }
.twin-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 260px; color: var(--gray-400); gap: 12px; padding: 30px; }
.twin-ph-icon { font-size: 3rem; }
.twin-placeholder h4 { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.twin-placeholder p { font-size: 0.85rem; text-align: center; }
.twin-doc-content { padding: 24px; font-size: 0.9rem; line-height: 1.8; outline: none; }
.twin-doc-content:focus { background: rgba(123,160,91,0.02); }
.twin-doc-stamp { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; padding: 12px 18px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 16px; }
.twin-section-title { color: var(--navy); font-size: 1rem; font-weight: 800; border-bottom: 2px solid var(--sage-light); padding-bottom: 6px; margin: 16px 0 10px; }
.twin-doc-body li { margin: 6px 0; padding-right: 4px; }

/* =========================================================
   פרק 4: תיעוד קולי – FAB
   ========================================================= */
.voice-fab { position: fixed; bottom: 32px; left: 32px; z-index: 800; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.voice-fab.hidden { display: none; }
.voice-fab-tooltip { background: rgba(0,0,0,0.7); color: white; font-size: 0.75rem; padding: 4px 10px; border-radius: 12px; white-space: nowrap; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.voice-fab:hover .voice-fab-tooltip { opacity: 1; }
#voice-fab-btn { width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--navy), var(--navy-light)); color: white; font-size: 1.5rem; border: none; cursor: pointer; box-shadow: 0 6px 24px rgba(27,58,107,0.4); transition: var(--transition); user-select: none; touch-action: none; display: flex; align-items: center; justify-content: center; }
#voice-fab-btn:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(27,58,107,0.5); }
#voice-fab-btn.recording { background: linear-gradient(135deg, var(--red), #ff4757); box-shadow: 0 6px 24px rgba(220,53,69,0.5); animation: pulse-red 1.2s ease-in-out infinite; }
.voice-wave-anim { display: none; align-items: flex-end; gap: 3px; height: 24px; }
.voice-wave-anim span { display: block; width: 4px; background: var(--sage); border-radius: 2px; animation: wave-bar 0.8s ease-in-out infinite; }
.voice-wave-anim span:nth-child(1) { animation-delay: 0s; }
.voice-wave-anim span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave-anim span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave-anim span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave-anim span:nth-child(5) { animation-delay: 0.4s; }
@keyframes wave-bar { 0%,100%{height:6px;} 50%{height:22px;} }

/* =========================================================
   פרק 5: מכ"ם חצר
   ========================================================= */
.radar-layout { display: flex; flex-direction: column; gap: 20px; }
.radar-header-section { display: flex; align-items: center; justify-content: space-between; background: white; border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow); }
.radar-title-block h3 { font-size: 1rem; font-weight: 800; color: var(--navy); }
.radar-subtitle { font-size: 0.8rem; color: var(--gray-600); margin-top: 4px; }
.radar-controls { display: flex; align-items: center; gap: 12px; }
.radar-timestamp { font-size: 0.78rem; color: var(--gray-400); }
.radar-content-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
.radar-map-section { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.radar-map-section h4 { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 12px; }
.radar-map-container { border-radius: 12px; overflow: hidden; border: 1px solid var(--gray-200); }
.map-zone { transition: filter 0.25s; }
.map-zone:hover { filter: brightness(1.25); }
.radar-zone-detail { background: var(--gray-100); border-radius: 10px; padding: 14px; margin-top: 12px; border-right: 3px solid var(--navy); }
.radar-zone-detail.hidden { display: none; }
.radar-zone-detail h5 { font-size: 0.88rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.radar-zone-stat { display: flex; justify-content: space-between; font-size: 0.83rem; padding: 4px 0; border-bottom: 1px solid var(--gray-200); }
.radar-zone-bar { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.radar-analysis-section { display: flex; flex-direction: column; gap: 16px; }
.radar-alerts-block, .radar-ai-block { background: white; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.radar-alerts-block h4, .radar-ai-block h4 { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.radar-alerts-list { display: flex; flex-direction: column; gap: 8px; }
.radar-alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 0.83rem; line-height: 1.5; }
.radar-alert-red { background: rgba(220,53,69,0.09); border-right: 3px solid var(--red); }
.radar-alert-orange { background: rgba(253,126,20,0.08); border-right: 3px solid var(--orange); }
.radar-alert-green { background: rgba(40,167,69,0.08); border-right: 3px solid var(--green); }
.radar-alert-time { font-size: 0.72rem; color: var(--gray-400); margin-right: auto; float: left; }
.radar-ai-text { font-size: 0.85rem; line-height: 1.7; color: var(--gray-800); }

/* =========================================================
   Responsive for new modules
   ========================================================= */
@media (max-width: 900px) {
  .sim-layout { grid-template-columns: 1fr; height: auto; }
  .sim-canvas-wrap { height: 300px; }
  .twin-layout { grid-template-columns: 1fr; height: auto; }
  .radar-content-grid { grid-template-columns: 1fr; }
  .voice-fab { bottom: 20px; left: 20px; }
}

