/* ===================================================================
   غصون المستقبل: تصميم وحدة النقل، مستقل عن كود C# داخل *.razor.cs
   الفكرة التعليمية: الصفحة = هيكل Razor، CSS = المظهر، CodeBehind = المنطق.
   =================================================================== */
.tr-page{--forest:#124a38;--soft:#ecf5ef;--ink:#203c35;--muted:#687c73;direction:rtl;font-family:Cairo,Tahoma,sans-serif;min-height:100vh;background:linear-gradient(135deg,#eef5f1 0%,#f8faf8 55%,#edf2ef 100%);padding:28px clamp(14px,3.8vw,55px) 65px;color:var(--ink)}
.tr-page *{box-sizing:border-box}.tr-page a{text-decoration:none;color:inherit}
.tr-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:22px;flex-wrap:wrap}.tr-kicker{font-size:13px;color:#608776;font-weight:700}.tr-title{font-size:clamp(24px,2.6vw,34px);color:#124a38;line-height:1.6;margin:0;font-weight:900}.tr-sub{color:var(--muted);margin:3px 0 0;font-size:14px}.tr-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.tr-btn{appearance:none;border:0;border-radius:11px;padding:10px 19px;cursor:pointer;font-family:inherit;font-size:14px;font-weight:750;transition:transform .15s,background .15s;min-height:42px;display:inline-flex;align-items:center;justify-content:center;gap:6px}.tr-btn:hover{transform:translateY(-1px)}.tr-btn:disabled{opacity:.52;cursor:not-allowed;transform:none}.tr-primary{background:#13724f;color:white!important}.tr-primary:hover{background:#0b5a3f}.tr-light{background:white;color:#245442!important;border:1px solid #d9e6df}.tr-warning{background:#fff4e1;color:#9c6126!important;border:1px solid #f0dfbb}.tr-danger{background:#fff0ed;color:#9d4135!important;border:1px solid #f4d3cc}
.tr-card{background:white;border:1px solid #dce9e0;border-radius:18px;padding:22px;box-shadow:0 6px 24px rgba(12,65,37,.035);margin-bottom:20px}.tr-card h2{font-size:20px;color:#204b37;margin:0 0 13px}.tr-card p{color:var(--muted)}.tr-message{margin-bottom:17px;padding:12px 15px;background:#e7f6ec;color:#156d42;border-right:4px solid #18935e;border-radius:9px}.tr-message.tr-error{background:#fff0ee;color:#a03327;border-color:#c14a42}
.tr-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px}.tr-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.tr-field{display:flex;flex-direction:column;gap:6px;color:#425f51;font-weight:700;font-size:13px;min-width:0}.tr-field input,.tr-field select,.tr-field textarea{border:1px solid #d5e3dc;background:#fbfdfc;outline:none;color:#244c3b;border-radius:10px;padding:10px 12px;font-family:inherit;font-weight:500;min-height:43px;max-width:100%;font-size:14px}.tr-field :is(input,select,textarea):focus{border-color:#2fa777;box-shadow:0 0 0 3px #2fa7771a}.tr-field textarea{min-height:100px}.tr-full{grid-column:1/-1}.tr-form-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:18px}
.tr-table-wrap{width:100%;overflow-x:auto;border-radius:12px;border:1px solid #e4ece7}.tr-table{width:100%;min-width:660px;border-collapse:collapse;text-align:right;font-size:13px}.tr-table th{background:#f0f6f1;color:#37624c;font-weight:850;padding:13px 12px;white-space:nowrap}.tr-table td{padding:13px 12px;border-top:1px solid #edf3ee;vertical-align:middle}.tr-table tbody tr:hover{background:#fbfdfb}.tr-table b{font-weight:800}.tr-small{font-size:12px;color:#7a8f82}.tr-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.tr-section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 15px;flex-wrap:wrap}.tr-section-title h2{margin:0}.tr-pill{display:inline-flex;padding:4px 11px;border-radius:99px;background:#e5f4e8;color:#26714b;font-size:12px;font-weight:800}.tr-pill.pending{background:#fff2dd;color:#94611b}.tr-pill.draft{background:#eff1f1;color:#728077}.tr-pill.rejected{background:#ffece8;color:#9e3b33}.tr-hero{background:linear-gradient(120deg,#12503b,#1d7750);border-radius:20px;padding:28px 30px;color:#fff;display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:18px}.tr-hero h1{color:white;font-size:29px;margin:0 0 4px}.tr-hero p{color:#d5e9da;max-width:650px;margin:0}.tr-hero .tr-btn{background:white;color:#14563d!important}
.tr-nav-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:20px}.tr-nav{border:1px solid #d9e8df;background:white;border-radius:17px;padding:20px;transition:box-shadow .2s;min-height:144px}.tr-nav:hover{box-shadow:0 8px 35px #16412c16}.tr-nav strong{display:block;color:#194c39;font-size:18px;margin:9px 0 3px}.tr-nav p{font-size:13px;color:#6a8175;margin:0;line-height:1.8}.tr-nav-icon{font-size:27px}.tr-metric{background:#fff;border:1px solid #dce9e0;border-radius:17px;padding:20px}.tr-metric small{color:#718b7b;display:block}.tr-metric strong{display:block;font-size:31px;margin:9px 0;color:#13563d;font-weight:900}.tr-info{padding:13px 16px;background:#f0f7f1;border:1px solid #cce6d3;border-radius:10px;color:#315944;font-size:13px;line-height:1.9}.tr-info.warn{background:#fff7e9;border-color:#f0dcad;color:#825d26}.tr-select-inline{padding:10px 12px;border:1px solid #d3e5db;border-radius:10px;font:inherit;background:white;min-width:220px}.tr-div{height:1px;background:#edf1ed;margin:22px 0}.tr-pane{background:#f9fcfa;padding:16px;border:1px solid #e1eee5;border-radius:14px;margin-top:14px}.tr-tab{background:white;border:1px solid #d8e9dc;padding:9px 14px;border-radius:9px;color:#406451;cursor:pointer;font:inherit}.tr-tab.active{background:#165d43;color:white;border-color:#165d43}.tr-footer{font-size:12px;color:#7d9083;margin-top:20px}
@media(max-width:850px){.tr-grid,.tr-nav-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tr-hero{flex-direction:column;align-items:start}}
@media(max-width:560px){.tr-page{padding:15px 12px 40px}.tr-grid,.tr-grid.two,.tr-nav-grid{grid-template-columns:1fr}.tr-card{padding:16px}.tr-title{font-size:24px}.tr-hero{padding:20px}.tr-btn{width:auto}.tr-head{align-items:flex-start}}

/* =====================================================================
   شاشة الباصات واستلام الأطفال (Tablet-first): العرض والتباعد وحالات التقرير
   ===================================================================== */
.tr-ops-metrics{margin-bottom:17px}.tr-ops-buses{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:15px}
.tr-ops-bus{border:1px solid #dfebdf;background:#fff;border-radius:16px;padding:18px;box-shadow:0 3px 13px #133b2810}
.tr-ops-bus-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:16px}
.tr-ops-bus-head strong{display:block;font-size:18px;color:#194d37}.tr-ops-bus-head span:not(.tr-pill){display:block;color:#718a7b;font-size:12px;margin-top:3px}
.tr-grid-compact{grid-template-columns:repeat(3,minmax(0,1fr));gap:11px}.tr-grid-compact .tr-field input,.tr-grid-compact .tr-field select{width:100%}
.tr-ops-bus-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-top:14px;padding-top:13px;border-top:1px solid #edf1ec}
.tr-ops-student-list,.tr-assignment-list{display:flex;flex-direction:column;gap:8px;margin-top:14px}
.tr-ops-student{display:grid;grid-template-columns:minmax(180px,2fr) minmax(165px,1fr) minmax(170px,1fr);align-items:center;gap:12px;padding:13px;border:1px solid #e0ebe2;border-radius:12px}
.tr-ops-student strong,.tr-assignment-item strong{display:block;color:#184b36;font-size:14px}
.tr-assignment-item{display:flex;align-items:center;gap:14px;border:1px solid #e0ece4;border-radius:12px;padding:13px;cursor:pointer}
.tr-assignment-item input{width:20px;height:20px;accent-color:#18774d}.tr-assignment-item small{display:block;color:#85978a;font-size:12px;margin-top:3px}.tr-assignment-item .tr-pill{margin-inline-start:auto}
.tr-monthly-totals{margin:15px 0}.tr-money{font-variant-numeric:tabular-nums;white-space:nowrap;font-weight:750;color:#174f3a}
.tr-monthly-page .tr-table{min-width:960px}
@media(max-width:850px){.tr-grid-compact{grid-template-columns:repeat(2,minmax(0,1fr))}.tr-ops-student{grid-template-columns:1fr 1fr}.tr-ops-student>div:first-child{grid-column:1/-1}}
@media(max-width:600px){.tr-grid-compact{grid-template-columns:1fr 1fr}.tr-ops-buses{grid-template-columns:1fr}.tr-ops-bus{padding:14px}.tr-ops-student{grid-template-columns:1fr}.tr-ops-student>div:first-child{grid-column:auto}.tr-ops-student .tr-select-inline{width:100%}.tr-assignment-item{flex-wrap:wrap}}
@media print{body{background:#fff!important}.tr-no-print,.tr-actions,.tr-form-actions,.nav-link,button{display:none!important}.tr-page{padding:0!important;max-width:100%!important}.tr-card,.tr-metric{box-shadow:none!important;break-inside:avoid}.tr-table{min-width:0!important;font-size:10px!important}.tr-table td,.tr-table th{padding:5px!important}.tr-head{margin-bottom:10px}.tr-monthly-details{break-before:page}}

/* ========================================================
 شاشة الرحلات المرنة — تكبير وتبسيط الإدخال للمشرفات (حتى 18+ رحلة)
 ======================================================== */
.tr-fast-grid { grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); }
.tr-fast-table-wrap { overflow-x:auto; -webkit-overflow-scrolling:touch; max-height:62vh; overflow-y:auto; }
.tr-fast-table { min-width:880px; border-collapse:separate; border-spacing:0; }
.tr-fast-table thead th { position:sticky; top:0; z-index:2; background:#eaf3ed; }
.tr-fast-table tbody tr:nth-child(even) {background:#f7faf8;}
.tr-fast-table td, .tr-fast-table th { white-space:nowrap; padding:10px 12px; }
.tr-fast-table td:nth-child(4) {max-width:210px;overflow:hidden;text-overflow:ellipsis;}
@media(max-width:700px){.tr-fast-grid {grid-template-columns:repeat(2,minmax(0,1fr));}.tr-fast-table-wrap{max-height:55vh;}}

/* شريط اختيار تاريخ التقرير: اختيار من التقويم أو التنقل سريعًا بين الأيام */
.tr-date-tools { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.tr-date-tools input[type=date] { flex:1 1 145px; min-width:135px; }
.tr-date-tools .tr-btn { white-space:nowrap; padding:9px 12px; }
@media(max-width:650px) { .tr-date-tools { display:grid; grid-template-columns:1fr 1fr; } .tr-date-tools input[type=date] { grid-column:1 / -1; width:100%; } }

/* ======================================================================
   شاشة المشرفة المبسطة: 18 باصًا وأكثر في شبكة قابلة للتمرير والبحث.
   ====================================================================== */
.tr-easy-page .tr-easy-head{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.tr-easy-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.tr-easy-form{border:2px solid #bcdccc}
.tr-easy-advanced,.tr-easy-extra-toggle{margin:14px 0}
.tr-easy-picker{margin-bottom:18px;padding:15px;background:#f4faf6;border:1px solid #dbece2;border-radius:15px}
.tr-easy-picker .tr-section-title{margin-bottom:12px}
.tr-easy-buses{display:grid;grid-template-columns:repeat(auto-fill,minmax(130px,1fr));gap:9px;max-height:290px;overflow-y:auto;padding:3px}
.tr-easy-bus{border:1px solid #d3e6d9;border-radius:12px;background:#fff;padding:12px;min-height:94px;display:flex;flex-direction:column;gap:2px;text-align:right;cursor:pointer;font:inherit;color:#1b523e}
.tr-easy-bus strong{font-size:16px}.tr-easy-bus span{font-size:13px}.tr-easy-bus small{font-size:11px;color:#779384;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.tr-easy-bus.selected{border:2px solid #128259;background:#e8f8ed;box-shadow:0 0 0 2px #b6e7c7}
.tr-easy-bus:disabled{opacity:.6;cursor:default}
.tr-easy-entry{border-top:1px solid #e2ebe3;padding-top:15px}
.tr-easy-entry>strong{display:block;margin-bottom:12px;color:#194f38}
.tr-easy-extra{padding:15px;border:1px dashed #bad9c6;background:#f8faf8;border-radius:12px}
@media(max-width:650px){.tr-easy-page .tr-easy-head,.tr-easy-fields{grid-template-columns:1fr}.tr-easy-buses{grid-template-columns:repeat(2,minmax(0,1fr));max-height:250px}.tr-easy-picker .tr-section-title{display:block}.tr-easy-picker .tr-select-inline{width:100%;margin-top:8px}}


/* ========== تحسينات التحقق والحذف والطباعة للفرع ========== */
.tr-field-invalid input,.tr-field-invalid select{border:2px solid #d52727!important;background:#fff1f1!important;box-shadow:0 0 0 3px #ffd5d5!important}
.tr-field-invalid{color:#a71919!important}
.tr-modal-backdrop{position:fixed;inset:0;background:rgba(15,31,24,.68);z-index:4000;display:flex;align-items:center;justify-content:center;padding:20px}
.tr-modal{background:white;border-radius:20px;padding:28px;max-width:500px;width:100%;box-shadow:0 20px 85px #0005;text-align:center;direction:rtl;border-top:5px solid #b82d2d}
.tr-modal h2{color:#9d2929;font-size:21px;margin:8px 0}.tr-modal p{line-height:1.9;color:#495b50}
.tr-modal-symbol{margin:auto;border-radius:50%;width:55px;height:55px;background:#ffe7e4;color:#bc2424;display:grid;place-items:center;font-size:30px;font-weight:900}
.tr-modal-actions{justify-content:center;margin-top:20px}
.tr-print-report{display:none}
@page{size:A4 landscape;margin:11mm}
@media print{
 html,body{background:#fff!important;print-color-adjust:exact;-webkit-print-color-adjust:exact}
 body *{visibility:hidden!important}
 .tr-print-report,.tr-print-report *{visibility:visible!important}
 .tr-print-report{display:block!important;position:absolute!important;top:0;right:0;left:0;width:100%;background:#fff;color:#111;direction:rtl;font-family:Cairo,Tahoma,Arial,sans-serif;font-size:10pt;padding:0}
 .tr-print-title{text-align:center;font-size:20pt;font-weight:900;color:#15513b;margin-bottom:12px;border-bottom:3px solid #17734e;padding-bottom:8px}
 .tr-print-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px;margin-bottom:12px;font-size:10pt}
 .tr-print-table{width:100%;border-collapse:collapse;text-align:center;font-size:8.5pt;table-layout:fixed}
 .tr-print-table th,.tr-print-table td{border:1px solid #555;padding:6px 4px;overflow-wrap:anywhere;vertical-align:middle}
 .tr-print-table thead th{background:#e3f1e7;color:#133e2f}
 .tr-print-table tr{break-inside:avoid}
 .tr-print-totals{display:flex;justify-content:space-around;flex-wrap:wrap;border:1px solid #777;padding:10px;margin-top:12px;gap:10px;font-weight:700}
 .tr-print-signatures{display:flex;justify-content:space-between;margin-top:26px}
 .tr-print-note{text-align:center;font-size:8pt;color:#555;margin-top:20px}
 .tr-page{background:white!important;padding:0!important}
}
