
  :root{
    --navy-deep:#0B1E3E; --navy-mid:#132A52; --gold:#D4A94A; --gold-soft:#E9CB86;
    --ember:#C6491F; --green:#2E7D5B; --amber:#B8860B;
    --paper:#F5F7FB; --line:#E3E7F0; --ink:#16223F; --ink-soft:#6B7690;
  }
  *{box-sizing:border-box; margin:0; padding:0;}
  body{font-family:'IBM Plex Sans Arabic', sans-serif; background:var(--paper); color:var(--ink); min-height:100vh;}
  .display{font-family:'Changa';}

  /* ===== شاشة الدخول ===== */
  #loginView{
    min-height:100vh; display:flex; align-items:center; justify-content:center;
    background:var(--navy-deep); padding:20px;
  }
  .login-card{
    background:#fff; border-radius:16px; padding:28px 22px; width:100%; max-width:340px;
    box-shadow:0 20px 40px rgba(0,0,0,0.3); text-align:center;
  }
  .login-card h1{font-family:'Changa'; font-size:18px; color:var(--navy-deep); margin-bottom:4px;}
  .login-card p{font-size:12.5px; color:var(--ink-soft); margin-bottom:20px;}
  .btn-google{
    width:100%; padding:12px; border-radius:10px; border:1px solid var(--line);
    background:#fff; font-family:inherit; font-size:13.5px; font-weight:600; color:var(--ink);
    display:flex; align-items:center; justify-content:center; gap:8px; cursor:pointer; margin-bottom:14px;
  }
  .divider{display:flex; align-items:center; gap:10px; color:var(--ink-soft); font-size:11.5px; margin:14px 0;}
  .divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--line);}
  .field{margin-bottom:10px; text-align:right;}
  .field label{display:block; font-size:11.5px; color:var(--ink-soft); margin-bottom:5px; font-weight:600;}
  .field input{
    width:100%; padding:10px 12px; border-radius:9px; border:1px solid var(--line);
    font-family:inherit; font-size:13.5px; direction:ltr; text-align:right;
  }
  .btn-primary{
    width:100%; background:linear-gradient(180deg, var(--gold-soft), var(--gold));
    color:var(--navy-deep); font-weight:700; font-size:13.5px; border:none; border-radius:10px;
    padding:11px; cursor:pointer; margin-top:6px;
  }
  .login-error{color:var(--ember); font-size:12px; margin-top:10px; display:none;}

  /* ===== هيكل التطبيق ===== */
  #appShell{display:none; min-height:100vh;}
  .app-flex{display:flex; min-height:100vh;}
  .sidebar{width:76px; background:var(--navy-deep); display:flex; flex-direction:column; align-items:center; padding:16px 0; gap:4px; flex-shrink:0;}
  .sidebar .logo{width:36px;height:36px;border-radius:8px;margin-bottom:14px;object-fit:contain;background:#fff;padding:3px;}
  .nav-item{width:52px; height:52px; border-radius:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:#9FB0D6; cursor:pointer; font-size:9.5px; transition:background .15s ease;}
  .nav-item svg{width:19px;height:19px;}
  .nav-item.active{background:var(--gold); color:var(--navy-deep); font-weight:700;}

  .main{flex:1; min-width:0; display:flex; flex-direction:column;}
  .topbar{background:#fff; border-bottom:1px solid var(--line); padding:14px 18px; display:flex; align-items:center; justify-content:space-between;}
  .topbar h1{font-family:'Changa'; font-size:17px; font-weight:700;}
  .who{display:flex; align-items:center; gap:8px; font-size:12.5px; color:var(--ink-soft); cursor:pointer;}
  .who .avatar{width:30px;height:30px;border-radius:50%;background:var(--gold);color:var(--navy-deep);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:12px;}

  .content{padding:16px; overflow-x:auto;}
  .toolbar{display:flex; gap:8px; margin-bottom:12px; flex-wrap:wrap;}
  .search{flex:1; min-width:140px; background:#fff; border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-size:13px; display:flex; align-items:center; gap:8px; color:var(--ink-soft);}
  .search input{border:none; outline:none; font-family:inherit; font-size:13px; flex:1; background:transparent; color:var(--ink);}
  .grade-select{background:#fff; border:1px solid var(--line); border-radius:9px; padding:9px 12px; font-size:13px; color:var(--ink); font-family:inherit;}
  .filter-row{display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:12px;}
  .filter-label{font-size:11.5px; color:var(--ink-soft); font-weight:600;}
  .filter-sep{width:1px; height:20px; background:var(--line); margin:0 4px;}
  .chip{padding:8px 13px; border-radius:9px; font-size:12.5px; font-weight:600; border:1px solid var(--line); background:#fff; color:var(--ink-soft); cursor:pointer; white-space:nowrap;}
  .chip.active{background:var(--navy-deep); color:#fff; border-color:var(--navy-deep);}
  .btn-add{background:linear-gradient(180deg, var(--gold-soft), var(--gold)); color:var(--navy-deep); font-weight:700; font-size:13px; border:none; border-radius:9px; padding:9px 16px; cursor:pointer; display:flex; align-items:center; gap:6px; white-space:nowrap;}

  table{width:100%; border-collapse:collapse; background:#fff; border-radius:10px; overflow:hidden; box-shadow:0 1px 3px rgba(16,34,63,0.06);}
  thead th{background:var(--navy-mid); color:#fff; font-size:11.5px; font-weight:600; padding:10px 12px; text-align:right; white-space:nowrap;}
  tbody td{padding:11px 12px; font-size:13px; border-bottom:1px solid var(--line); white-space:nowrap;}
  tbody tr:last-child td{border-bottom:none;}
  .badge{display:inline-flex; align-items:center; gap:4px; padding:3px 9px; border-radius:999px; font-size:11px; font-weight:700;}
  .badge.active{background:#E4F3EC; color:var(--green);}
  .badge.withdrawn{background:#FBEAE6; color:var(--ember);}
  .badge.paid-full{background:#E4F3EC; color:var(--green);}
  .badge.paid-partial{background:#FBF3DD; color:var(--amber);}
  .badge.paid-none{background:#FBEAE6; color:var(--ember);}
  .empty-state{padding:40px 20px; text-align:center; color:var(--ink-soft); font-size:13px;}
  .row-menu{width:28px;height:28px;border-radius:7px;border:1px solid var(--line);background:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--ink-soft);font-size:16px;line-height:1;}
  .row-menu:hover{border-color:var(--gold); color:var(--navy-deep);}
  .content-section{background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px;margin-bottom:14px;}
  .content-section h3{font-family:'Changa';font-size:15px;margin-bottom:10px;}
  .content-row{display:flex;gap:8px;margin-bottom:8px;align-items:center;}
  .content-row input, .content-row select{flex:1;padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px;font-family:inherit;}
  .content-row-col{display:flex;flex-direction:column;gap:6px;margin-bottom:10px;padding-bottom:10px;border-bottom:1px dashed var(--line);}
  .content-row-col input, .content-row-col textarea{padding:8px 10px;border:1px solid var(--line);border-radius:8px;font-size:13px;font-family:inherit;}
  .content-category{border:1px solid var(--line);border-radius:10px;padding:12px;margin-bottom:12px;background:var(--paper);}

  /* ===== نافذة إضافة طالب ===== */
  .modal-overlay{display:none; position:fixed; inset:0; background:rgba(11,30,62,0.55); z-index:50; align-items:flex-end; justify-content:center;}
  .modal-overlay.show{display:flex;}
  .modal-box{background:#fff; width:100%; max-width:480px; max-height:88vh; overflow-y:auto; border-radius:18px 18px 0 0; padding:20px;}
  .modal-box h2{font-family:'Changa'; font-size:16px; margin-bottom:14px;}
  .modal-box .field{margin-bottom:12px;}
  .modal-box select{width:100%; padding:10px 12px; border-radius:9px; border:1px solid var(--line); font-family:inherit; font-size:13.5px;}
  .modal-actions{display:flex; gap:8px; margin-top:16px;}
  .btn-ghost-modal{flex:1; padding:11px; border-radius:9px; border:1px solid var(--line); background:#fff; font-family:inherit; font-weight:600; font-size:13px; cursor:pointer;}

  .toast{position:fixed; bottom:20px; left:50%; transform:translateX(-50%); background:var(--navy-deep); color:#fff; padding:11px 20px; border-radius:10px; font-size:13px; z-index:100; display:none;}
