html, body { font-family: 'Cairo', system-ui, sans-serif; }
body { min-height: 100vh; }
.card { background: #fff; border-radius: 14px; box-shadow: 0 1px 3px rgba(15,23,42,.08); border: 1px solid #e2e8f0; }
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .9rem; border-radius: 10px; font-weight: 600; font-size: .9rem; transition: .15s; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: #4f46e5; color: #fff; } .btn-primary:hover:not(:disabled) { background: #4338ca; }
.btn-ghost { background: #fff; color: #334155; border-color: #cbd5e1; } .btn-ghost:hover { background: #f1f5f9; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; } .btn-danger:hover { background: #fef2f2; }
.btn-success { background: #059669; color: #fff; } .btn-success:hover { background: #047857; }
.btn-sm { padding: .3rem .6rem; font-size: .8rem; border-radius: 8px; }
.input, .select, .textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: .5rem .75rem; background: #fff; font-size: .92rem; font-family: inherit; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid #c7d2fe; border-color: #6366f1; }
.label { display: block; font-size: .82rem; font-weight: 600; color: #475569; margin-bottom: .25rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { background: #f8fafc; text-align: right; padding: .65rem .8rem; color: #475569; font-weight: 700; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.tbl td { padding: .6rem .8rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.tbl tbody tr:hover { background: #f8fafc; }
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.b-green { background: #dcfce7; color: #166534; } .b-red { background: #fee2e2; color: #991b1b; }
.b-amber { background: #fef3c7; color: #92400e; } .b-blue { background: #dbeafe; color: #1e40af; }
.b-gray { background: #e2e8f0; color: #334155; } .b-purple { background: #ede9fe; color: #5b21b6; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; border-radius: 10px; color: #cbd5e1; font-weight: 600; font-size: .92rem; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: #4f46e5; color: #fff; }
.nav-link i { width: 1.2rem; text-align: center; }
/* قائمة فرعية: تظهر عند تمرير الفأرة على القسم أو عند فتح إحدى صفحاته */
.nav-sub { max-height: 0; overflow: hidden; transition: max-height .2s ease; padding-inline-start: 1.4rem; display: flex; flex-direction: column; gap: .25rem; }
.nav-group:hover .nav-sub, .nav-group:focus-within .nav-sub, .nav-group.open .nav-sub { max-height: 12rem; margin-top: .25rem; }
.nav-child { font-size: .85rem; padding: .45rem .8rem; }
.nav-child i { width: 1rem; }
.nav-caret { width: auto !important; font-size: .65rem; opacity: .6; transition: transform .2s; }
.nav-group:hover .nav-caret, .nav-group.open .nav-caret { transform: rotate(180deg); }
#toast-root { position: fixed; bottom: 1rem; left: 1rem; z-index: 100; display: flex; flex-direction: column; gap: .5rem; }
.toast { padding: .7rem 1rem; border-radius: 10px; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: slide .2s; max-width: 22rem; }
@keyframes slide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-bg { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 60; display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 2rem 1rem; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 38rem; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.wide { max-width: 60rem; }
.stat { display: flex; align-items: center; gap: .9rem; padding: 1rem; }
.stat .ico { width: 2.9rem; height: 2.9rem; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.tab { padding: .5rem 1rem; border-bottom: 2px solid transparent; font-weight: 700; color: #64748b; cursor: pointer; white-space: nowrap; }
.tab.active { color: #4f46e5; border-color: #4f46e5; }
.tt-cell { min-height: 3.6rem; border: 1px solid #e2e8f0; border-radius: 8px; padding: .3rem .45rem; font-size: .8rem; background: #fff; }
.bar { height: .55rem; border-radius: 999px; background: #e2e8f0; overflow: hidden; } .bar > i { display: block; height: 100%; background: #4f46e5; }
.att-btn { padding: .25rem .6rem; border-radius: 8px; border: 1px solid #cbd5e1; font-size: .8rem; font-weight: 700; cursor: pointer; background: #fff; }
.att-btn.on-present { background: #16a34a; color: #fff; border-color: #16a34a; }
.att-btn.on-absent { background: #dc2626; color: #fff; border-color: #dc2626; }
.att-btn.on-late { background: #d97706; color: #fff; border-color: #d97706; }
.att-btn.on-excused { background: #2563eb; color: #fff; border-color: #2563eb; }
.empty { text-align: center; color: #94a3b8; padding: 2.5rem 1rem; }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; }
@media print {
  aside, header, .no-print, #toast-root { display: none !important; }
  main { padding: 0 !important; margin: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
