:root{
  color-scheme:light;
  font-family:"IBM Plex Sans Arabic","Segoe UI",Tahoma,sans-serif;
  background:#f5f7f4;color:#17211f;
}
*{box-sizing:border-box}
body{margin:0;background:#f5f7f4;color:#17211f}
button,a{font:inherit}
button{cursor:pointer}
[hidden]{display:none!important}
.dash-topbar{
  position:sticky;top:0;z-index:30;display:flex;align-items:center;
  gap:12px;padding:10px 16px;background:rgba(255,255,255,.97);backdrop-filter:blur(12px);
  border-bottom:1px solid #dfe7e3
}
.dash-nav{display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none;flex:1;min-width:0}
.dash-nav::-webkit-scrollbar{display:none}
.dash-nav a{white-space:nowrap;text-decoration:none;color:#486158;font-size:12px;font-weight:700;padding:8px 10px;border-radius:9px}
.dash-nav a:hover{background:#f0f5f2;color:#174d40}
.dash-nav a.active{background:#e8f2ed;color:#155746}
.dash-brand{display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none}
.dash-brand span{
  display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#0f6b5d;color:white;font-weight:800
}
.dash-brand strong{font-size:17px}
.dash-account{display:flex;align-items:center;gap:8px;min-width:0}
.dash-account span{font-size:12px;color:#61706c;max-width:135px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dash-account button,.ghost{
  border:1px solid #cfdad6;background:white;border-radius:10px;padding:8px 12px;color:#21312d
}
.dash-page{width:min(100%,980px);margin:0 auto;padding:18px 14px 80px}
.dash-hero{
  display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px;border-radius:20px;
  background:linear-gradient(135deg,#0f6b5d,#175f84);color:white;box-shadow:0 10px 30px rgba(20,57,49,.14)
}
.dash-hero small{opacity:.8}
.dash-hero h1{margin:4px 0 6px;font-size:26px}
.dash-hero p{margin:0;line-height:1.7;opacity:.9;max-width:650px}
.dash-hero .ghost{background:rgba(255,255,255,.14);border-color:rgba(255,255,255,.25);color:white;white-space:nowrap}
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:14px 0}
.stats article{background:white;border:1px solid #dfe7e3;border-radius:16px;padding:14px}
.stats small{display:block;color:#66746f;margin-bottom:5px}
.stats strong{font-size:24px;color:#0f6b5d}
.tabs{
  display:flex;gap:8px;overflow:auto;padding:4px 0 10px;position:sticky;top:63px;z-index:10;
  background:#f5f7f4
}
.tab{border:1px solid #d7e1dd;background:white;color:#31433e;border-radius:999px;padding:10px 14px;white-space:nowrap}
.tab.active{background:#0f6b5d;border-color:#0f6b5d;color:white}
.panel{background:white;border:1px solid #dfe7e3;border-radius:18px;padding:14px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.panel-head small{color:#7a8883}
.panel-head h2{margin:2px 0 0;font-size:20px}
.count{display:grid;place-items:center;min-width:36px;height:36px;border-radius:12px;background:#edf6f2;color:#0f6b5d;font-weight:700}
.cards{display:grid;gap:10px}
.card{border:1px solid #dfe7e3;border-radius:16px;padding:14px;background:#fff}
.card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.card h3{margin:0;font-size:17px;line-height:1.45}
.card .meta{color:#6c7b76;font-size:13px;margin-top:3px}
.badge{display:inline-flex;align-items:center;border-radius:999px;background:#edf6f2;color:#0f6b5d;padding:5px 8px;font-size:12px;white-space:nowrap}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.info{background:#f7f9f8;border-radius:11px;padding:9px 10px;min-width:0}
.info span{display:block;color:#77847f;font-size:12px}
.info strong{display:block;margin-top:2px;font-size:14px;overflow-wrap:anywhere}
.actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.primary,.secondary,.danger{
  border:0;border-radius:11px;padding:10px 13px;font-weight:700;text-decoration:none;display:inline-flex;align-items:center;justify-content:center
}
.primary{background:#0f6b5d;color:white}
.secondary{background:#edf6f2;color:#0f6b5d}
.danger{background:#fff1f1;color:#ad3030;border:1px solid #f1c9c9}
.primary:disabled,.secondary:disabled,.danger:disabled{opacity:.5;cursor:not-allowed}
.message{min-height:22px;margin:4px 0 10px;color:#765a00;font-size:13px}
.hint{color:#64716d;line-height:1.6;font-size:13px}
.empty{padding:24px 12px;text-align:center;color:#74817c;background:#f8faf9;border-radius:14px}
.staff-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.staff-row .email{font-weight:700;overflow-wrap:anywhere}
.staff-row small{display:block;color:#78847f;margin-top:3px}
@media(max-width:640px){
  .dash-topbar{padding:9px 10px;gap:8px}
  .dash-brand strong{display:none}
  .dash-nav{order:3;flex-basis:100%;width:100%;padding-top:2px}
  .dash-nav a{font-size:11px;padding:7px 9px}
  .dash-account{margin-inline-start:auto}
  .dash-account span{max-width:92px}
  .dash-page{padding:12px 10px 72px}
  .dash-hero{padding:15px;border-radius:16px}
  .dash-hero h1{font-size:22px}
  .dash-hero p{font-size:13px}
  .stats{gap:7px}
  .stats article{padding:11px;border-radius:13px}
  .stats small{font-size:11px}
  .stats strong{font-size:21px}
  .tabs{top:104px}
  .panel{padding:11px;border-radius:15px}
  .grid{grid-template-columns:1fr}
  .actions>*{flex:1 1 140px}
  .card{padding:12px}
}

.agent-form{display:grid;grid-template-columns:2fr 1fr auto;gap:10px;align-items:end;margin:14px 0 18px;padding:12px;border:1px solid #dfe7e3;border-radius:14px;background:#f8faf9}
.agent-form label{display:grid;gap:6px}
.agent-form label span{font-size:12px;color:#6f7d78}
.agent-form input{width:100%;border:1px solid #cfdad6;border-radius:11px;padding:11px 12px;background:white;font:inherit}
.section-title{margin:20px 0 10px;font-size:17px}
.commission-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin-bottom:10px}
.commission-total{background:#f7f9f8;border-radius:12px;padding:10px}
.commission-total small{display:block;color:#77847f;margin-bottom:3px}
.commission-total strong{color:#0f6b5d}
@media(max-width:640px){
  .agent-form{grid-template-columns:1fr}
  .agent-form button{width:100%}
  .commission-totals{grid-template-columns:1fr}
}

.settlement-card{background:#fbfcfb}
.settlement-card .badge{background:#e8f4ee}
