@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');
*{box-sizing:border-box}body{margin:0;font-family:Cairo,Tahoma,Arial,sans-serif;background:#f5f7fb;color:#1f2937;direction:rtl}.page{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}.card{width:100%;max-width:620px;background:#fff;border-radius:24px;box-shadow:0 18px 50px rgba(15,23,42,.12);padding:28px;border:1px solid #e5e7eb}.logo{width:140px;height:140px;object-fit:contain;display:block;margin:0 auto 12px}.title{text-align:center;margin:0;color:#111827;font-weight:800;font-size:27px}.subtitle{text-align:center;margin:8px 0 22px;color:#6b7280}.alert{padding:14px 16px;border-radius:14px;margin:14px 0;font-weight:700}.danger{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}.success{background:#dcfce7;color:#166534;border:1px solid #bbf7d0}.warning{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.info{background:#dbeafe;color:#1d4ed8;border:1px solid #bfdbfe}.field{margin-bottom:15px}label{display:block;font-weight:800;margin-bottom:8px}input,select{width:100%;border:1px solid #d1d5db;border-radius:14px;padding:13px 14px;font-size:16px;font-family:inherit;background:#fff}input:focus{outline:none;border-color:#16a34a;box-shadow:0 0 0 4px rgba(22,163,74,.12)}.btn{border:0;border-radius:14px;padding:13px 18px;font-family:inherit;font-weight:800;font-size:16px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:8px}.btn-primary{background:linear-gradient(135deg,#16a34a,#0f766e);color:#fff}.btn-dark{background:#111827;color:#fff}.btn-gold{background:#b98b2f;color:#fff}.btn-red{background:#dc2626;color:#fff}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}.small{font-size:13px;color:#6b7280}.topbar{background:#111827;color:#fff;padding:14px 20px;display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;z-index:2}.topbar a{color:#fff;text-decoration:none;font-weight:700}.container{max-width:1180px;margin:22px auto;padding:0 16px}.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.stat{background:#fff;border-radius:18px;padding:18px;border:1px solid #e5e7eb;box-shadow:0 8px 24px rgba(15,23,42,.06)}.stat b{font-size:30px;display:block;margin-top:6px;color:#111827}.panel{background:#fff;border-radius:20px;padding:20px;border:1px solid #e5e7eb;box-shadow:0 8px 24px rgba(15,23,42,.06);margin-top:16px}.table-wrap{overflow:auto;border-radius:16px;border:1px solid #e5e7eb}table{width:100%;border-collapse:collapse;background:#fff;min-width:780px}th,td{padding:12px;border-bottom:1px solid #e5e7eb;text-align:right;white-space:nowrap}th{background:#f3f4f6;font-weight:800}.badge{display:inline-block;padding:6px 10px;border-radius:999px;font-weight:800;font-size:13px}.b-ok{background:#dcfce7;color:#166534}.b-no{background:#fee2e2;color:#991b1b}.receipt{max-width:760px;margin:28px auto;background:#fff;padding:34px;border:1px solid #111;border-radius:8px;color:#111}.receipt-head{display:flex;align-items:center;justify-content:space-between;border-bottom:2px solid #111;padding-bottom:14px;margin-bottom:18px}.receipt-logo{width:110px;height:110px;object-fit:contain}.receipt-title{text-align:center;flex:1}.receipt-title h1{margin:0;font-size:26px}.receipt-no{font-weight:800;background:#f3f4f6;padding:10px 14px;border-radius:10px;border:1px solid #ddd}.receipt-table{width:100%;min-width:0;border:1px solid #222;margin-top:20px}.receipt-table th,.receipt-table td{border:1px solid #222;padding:14px;font-size:17px}.note{margin-top:25px;padding:16px;border:2px dashed #111;text-align:center;font-size:20px;font-weight:800}.print-only{display:none}@media print{body{background:#fff}.no-print,.topbar{display:none!important}.receipt{box-shadow:none;border:1px solid #111;margin:0;max-width:100%;border-radius:0}.print-only{display:block}@page{size:A4;margin:12mm}}@media(max-width:650px){.card{padding:20px}.title{font-size:22px}.receipt-head{flex-direction:column}.actions .btn{width:100%}}

/* تحسينات الهواتف والطباعة */
.full-btn{width:100%;margin-top:8px}.installer-card{max-width:820px}.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.sep{border:0;border-top:1px solid #e5e7eb;margin:18px 0}.filter-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end}.buttons-field .btn{width:100%}.report-sheet{background:#fff;border:1px solid #111;border-radius:12px;padding:22px;margin:16px 0}.report-head{display:flex;align-items:center;justify-content:center;gap:18px;text-align:center;border-bottom:2px solid #111;padding-bottom:12px;margin-bottom:12px}.report-head img{width:86px;height:86px;object-fit:contain}.report-head h1{margin:0 0 4px;font-size:25px}.report-head p{margin:3px 0;color:#374151;font-weight:700}.report-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:12px 0}.report-stats span{background:#f3f4f6;border:1px solid #e5e7eb;border-radius:12px;padding:10px;text-align:center;font-weight:700}.report-table{min-width:980px}.report-table th,.report-table td{font-size:13px;padding:8px}.report-table td:last-child{min-width:120px}.btn:disabled{opacity:.55;cursor:not-allowed}.mobile-links{display:none}
@media(max-width:800px){
  body{background:#f7f8fb}.page{padding:12px;align-items:flex-start}.card{border-radius:20px;padding:18px;margin-top:10px}.logo{width:112px;height:112px}.title{font-size:21px;line-height:1.45}.subtitle{font-size:14px}.alert{font-size:14px;padding:12px}.btn{width:100%;min-height:46px;font-size:15px}input,select{min-height:48px;font-size:16px;border-radius:12px}.topbar{position:relative;align-items:flex-start;flex-direction:column;padding:12px 14px}.topbar div{display:flex;flex-wrap:wrap;gap:10px}.container{margin:12px auto;padding:0 10px}.grid,.two-col,.filter-grid{grid-template-columns:1fr}.stat{padding:14px}.stat b{font-size:25px}.panel{padding:14px;border-radius:16px}.actions{flex-direction:column}.receipt{margin:10px;padding:18px;border-radius:12px}.receipt-logo{width:90px;height:90px}.receipt-title h1{font-size:20px}.receipt-no{width:100%;text-align:center}.receipt-table th,.receipt-table td{font-size:15px;padding:11px}.note{font-size:16px;padding:12px}.report-sheet{padding:12px;border-radius:10px}.report-head{flex-direction:column;gap:8px}.report-head h1{font-size:19px}.report-stats{grid-template-columns:1fr 1fr}.report-table-wrap{border:0;overflow:visible}.report-table{min-width:0}.report-table thead{display:none}.report-table,.report-table tbody,.report-table tr,.report-table td{display:block;width:100%}.report-table tr{border:1px solid #e5e7eb;border-radius:14px;margin-bottom:10px;padding:8px;background:#fff}.report-table td{border:0;border-bottom:1px dashed #e5e7eb;white-space:normal;text-align:left;padding:9px 8px;min-height:38px}.report-table td:last-child{border-bottom:0;min-width:0}.report-table td::before{content:attr(data-label);float:right;font-weight:800;color:#111827}.table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}table{min-width:720px} .report-table{min-width:0}
}
@media print{.report-container{max-width:none;margin:0;padding:0}.report-sheet{border:0;border-radius:0;margin:0;padding:0}.report-head img{width:70px;height:70px}.report-head h1{font-size:21px}.report-stats{grid-template-columns:repeat(4,1fr)}.report-table{min-width:0;width:100%}.report-table th,.report-table td{font-size:11px;padding:5px}.report-table-wrap{border:0}.panel.no-print,.no-print{display:none!important}@page{size:A4 landscape;margin:8mm}}


/* صفحة الموزع: عرض نتائج البحث كبطاقات واضحة على الهاتف فقط */
@media(max-width:800px){
  .distributor-results{border:0;overflow:visible;background:transparent}
  .distributor-results table,
  .distributor-results tbody,
  .distributor-results tr,
  .distributor-results td{display:block;width:100%;min-width:0}
  .distributor-results table{background:transparent}
  .distributor-results thead{display:none}
  .distributor-results tr{background:#fff;border:1px solid #e5e7eb;border-radius:18px;margin:0 0 14px;padding:12px;box-shadow:0 8px 22px rgba(15,23,42,.08)}
  .distributor-results td{border:0;border-bottom:1px dashed #e5e7eb;padding:10px 6px;text-align:left;white-space:normal;min-height:42px}
  .distributor-results td:last-child{border-bottom:0;padding-top:14px}
  .distributor-results td::before{content:attr(data-label);float:right;font-weight:800;color:#111827;text-align:right;margin-left:10px}
  .distributor-results .badge{font-size:13px}
  .distributor-results form{margin:0}
  .distributor-results .btn{width:100%}
}
