@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');
*{box-sizing:border-box}
body{margin:0;background:#F4F8FE;font-family:'Cairo',Tahoma,sans-serif;color:#0F1B3D}
a{color:#306AF0;text-decoration:none}
button{font-family:inherit;cursor:pointer}
input,select,textarea{font-family:inherit;outline:none}
input::placeholder,textarea::placeholder{color:#9AA6BC}
.app{display:flex;min-height:100vh}
.side{width:242px;flex-shrink:0;background:#fff;display:flex;flex-direction:column;
  padding:26px 0;box-shadow:2px 0 16px rgba(15,27,61,.04);position:sticky;top:0;height:100vh}
.side .logo{padding:0 24px 28px}
.side .logo img{width:168px;display:block}
.nav{display:flex;flex-direction:column;gap:8px;padding:0 14px}
.nav a{display:flex;align-items:center;gap:12px;padding:8px 14px;border-radius:12px;
  color:#556077;font-size:14px;font-weight:600}
.nav a.on{color:#3E6CE7;background:#EBF0FD;font-weight:800}
.nav a .ic{width:30px;height:30px;border-radius:9px;background:#F4F8FE;display:flex;
  align-items:center;justify-content:center;flex-shrink:0}
.nav a.on .ic{background:#fff}
.who{margin:auto 14px 0;padding:14px;border-radius:14px;background:#F4F8FE;
  display:flex;align-items:center;gap:10px}
.who .av{width:38px;height:38px;border-radius:999px;background:#306AF0;color:#fff;
  font-size:14px;font-weight:800;display:flex;align-items:center;justify-content:center}
.main{flex-grow:1;display:flex;flex-direction:column;min-width:0}
.top{padding:24px 32px;background:#fff;box-shadow:0 2px 12px rgba(15,27,61,.03);
  display:flex;align-items:center;justify-content:space-between;gap:16px}
.top h1{margin:0;font-size:22px;font-weight:800}
.top .sub{font-size:13px;color:#52607A;margin-top:2px}
.wrap{padding:28px 32px;display:flex;flex-direction:column;gap:20px}
.card{background:#fff;border-radius:18px;padding:22px;box-shadow:0 6px 24px rgba(15,27,61,.06)}
.card h2{margin:0 0 14px;font-size:15px;font-weight:800}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:1fr 1fr}
.g3{grid-template-columns:repeat(3,1fr)}
.g4{grid-template-columns:repeat(4,1fr)}
.row{display:flex;gap:12px;align-items:center}
.f{display:flex;flex-direction:column;gap:6px}
.f label{font-size:12px;font-weight:700;color:#52607A}
.f input,.f select,.f textarea{height:46px;padding:0 14px;border:1.5px solid #D5DEEE;
  border-radius:12px;background:#F8FAFE;font-size:14px;color:#0F1B3D}
.f textarea{height:auto;padding:12px 14px;resize:vertical}
.btn{height:48px;padding:0 20px;border:none;border-radius:12px;background:#306AF0;
  color:#fff;font-size:14px;font-weight:700;display:inline-flex;align-items:center;
  justify-content:center;gap:8px}
.btn:disabled{background:#B9C4DA;cursor:not-allowed}
.btn.g{background:#fff;color:#0F1B3D;border:1.5px solid #D5DEEE}
.btn{white-space:nowrap;flex-shrink:0}
.btn.sm{height:36px;padding:0 14px;font-size:12px;border-radius:10px}
.btn.dn{background:#FBEAEA;color:#B3261E}
.tag{padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700;white-space:nowrap}
.t-green{background:#E7F6EC;color:#1E7A3C}
.t-amber{background:#FDF3E4;color:#B4791A}
.t-blue{background:#EAF1FE;color:#306AF0}
.t-red{background:#FBEAEA;color:#B3261E}
.t-grey{background:#F4F8FE;color:#7C8AA6}
table{width:100%;border-collapse:collapse}
th{text-align:right;padding:12px 16px;background:#F8FAFE;font-size:12px;
  font-weight:700;color:#7C8AA6}
td{padding:14px 16px;border-top:1px solid #EEF2F9;font-size:14px}
.kpi{background:#fff;border-radius:18px;padding:20px;box-shadow:0 6px 24px rgba(15,27,61,.06);
  display:flex;flex-direction:column;gap:8px}
.kpi .lb{font-size:13px;font-weight:700;color:#52607A}
.kpi .vl{font-size:28px;font-weight:800}
.kpi .nt{font-size:12px;color:#7C8AA6}
.hero{position:relative;padding:36px 40px;display:flex;align-items:center;
  justify-content:space-between;gap:16px;overflow:hidden;color:#fff;
  background:linear-gradient(100deg,#335CCF 0%,#3B68E1 45%,#54A0E9 100%)}
.hero>div,.hero>.row{position:relative}
.hero h1{margin:0;font-size:24px;font-weight:800;color:#fff;line-height:1.4}
.hero .sub{font-size:13px;color:#E3ECFC;margin-top:6px}
.hero .wm{position:absolute;fill:#fff;opacity:.09;pointer-events:none}
.hero .w1{left:9%;top:-34px;width:112px;transform:rotate(-12deg)}
.hero .w2{right:12%;bottom:-38px;width:88px;transform:rotate(14deg)}
.btn.glass{height:46px;padding:0 22px;border-radius:14px;background:rgba(255,255,255,.16);
  border:1.5px solid rgba(255,255,255,.5);color:#fff}
.btn.glass:hover{background:rgba(255,255,255,.26)}
.empty{text-align:center;padding:40px;color:#7C8AA6;font-size:14px}
.muted{font-size:12px;color:#7C8AA6}
.pills{display:flex;gap:6px}
.pill{height:36px;padding:0 14px;border:1.5px solid #D5DEEE;border-radius:10px;
  background:#fff;color:#52607A;font-size:13px;font-weight:600}
.pill.on{background:#306AF0;color:#fff;border-color:#306AF0;font-weight:700}
.slot{height:50px;border:1.5px solid #D5DEEE;border-radius:12px;background:#fff;
  font-size:14px;font-weight:600;color:#0F1B3D}
.slot.on{background:#306AF0;color:#fff;border-color:#306AF0}
.slot:disabled{background:#F4F8FE;color:#C3CCDD;text-decoration:line-through;
  border-color:#EEF2F9;cursor:not-allowed}
.day{height:64px;border:1.5px solid #D5DEEE;border-radius:13px;background:#fff;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.day.on{background:#306AF0;color:#fff;border-color:#306AF0}
.day:disabled{border-style:dashed;background:#F4F8FE;color:#C3CCDD;cursor:not-allowed}
.alert{display:flex;gap:10px;background:#FBEAEA;border-radius:12px;padding:12px 14px;
  color:#7A2A22;font-size:13px}
.thumbs{display:flex;flex-wrap:wrap;gap:10px}
.thumb{position:relative;width:84px;height:84px;border-radius:10px;overflow:hidden;
  border:1.5px solid #E3EAF6}
.thumb img{width:100%;height:100%;object-fit:cover;display:block}
.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);
  background:#0F1B3D;color:#fff;padding:12px 22px;border-radius:12px;font-size:14px;
  font-weight:600;z-index:99;box-shadow:0 8px 28px rgba(0,0,0,.2)}
.login{min-height:100vh;display:flex;align-items:center;justify-content:center}
.login .box{width:390px;background:#fff;border-radius:24px;padding:28px;
  box-shadow:0 10px 30px rgba(15,27,61,.1)}
.banner{border:1.5px solid #306AF0}
.chip{display:flex;align-items:center;gap:12px;background:#EAF1FE;border-radius:12px;padding:10px 14px}
.pp-res{display:flex;flex-direction:column;gap:4px;margin-top:6px}
.pick{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:right;
  padding:8px 12px;border:1.5px solid #EEF2F9;border-radius:10px;background:#fff;font-size:13px;color:#0F1B3D}
.pick:hover{border-color:#306AF0;background:#F4F8FE}

/* ===== home ===== */
.kc{background:#fff;border-radius:18px;padding:20px;box-shadow:0 6px 24px rgba(15,27,61,.06)}
.kc .hd{display:flex;align-items:center;gap:12px}
.kc .hd b{font-size:14px;font-weight:700;color:#18213D}
.ico{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.ico.blue{background:#EBF0FD}.ico.green{background:#E9F5EC}.ico.amber{background:#FBF3E5}.ico.red{background:#FBEAEA}
.kc .vl{font-size:30px;font-weight:800;line-height:1.15;margin-top:16px}
.kc .nt{font-size:12px;color:#7D89A2;margin-top:24px}
.cardhd{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.cardhd h2{margin:0}
.more{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;color:#3E6CE7}
.arow{display:flex;align-items:center;gap:14px;padding:14px 0;border-top:1px solid #F0F3F9}
.cardhd+div>.arow:first-child{margin-top:8px}
.arow.off{opacity:.5}
.av2{width:40px;height:40px;border-radius:999px;display:flex;align-items:center;justify-content:center;
  font-size:15px;font-weight:800;flex-shrink:0}
.av2.green{background:#E9F5EC;color:#1E7A3C}.av2.amber{background:#FBF3E5;color:#B4791A}.av2.blue{background:#EBF0FD;color:#3E6CE7}
.arow .tm{width:46px;font-size:13px;font-weight:800;color:#3E6CE7;flex-shrink:0}
.arow .nm{font-size:14px;font-weight:700;color:#18213D}
.side-col{display:flex;flex-direction:column;gap:18px}
.qa{display:flex;align-items:center;gap:12px;padding:10px 14px;margin-top:10px;background:#F8FAFE;
  border-radius:14px;font-size:13px;font-weight:700;color:#18213D}
.qa:hover{background:#EBF0FD}
.qa .ico{width:32px;height:32px;background:#EBF0FD}
.promo{border-radius:20px;padding:22px;color:#fff;box-shadow:0 10px 28px rgba(55,99,207,.25);
  background:linear-gradient(120deg,#3663CF 0%,#529FDD 60%,#6DD9EB 100%)}
.promo .pl{display:flex;align-items:center;gap:8px;font-size:12px;color:#E3ECFC}
.promo .pt{font-size:16px;font-weight:800;margin:14px 0 10px;line-height:1.5}
.promo .ps{font-size:12px;color:#E3ECFC}
.promo a{color:#fff;font-weight:800;text-decoration:underline}
.kc .nt span:first-child:not(:only-child){margin-inline-end:12px}

/* ===== forms / patients ===== */
.f input:focus,.f select:focus,.f textarea:focus{border-color:#3E6CE7;background:#fff;box-shadow:0 0 0 3px rgba(62,108,231,.12)}
.sec{display:flex;align-items:center;gap:10px;font-size:12px;font-weight:800;color:#3E6CE7;margin-top:4px}
.sec::after{content:'';flex:1;height:1px;background:#EEF2F9}
.f.warnf label{display:flex;align-items:center;gap:6px;color:#B3261E}
.f.warnf input{background:#FEF6F6;border-color:#F1D0CD}
.f.warnf input:focus{border-color:#B3261E;box-shadow:0 0 0 3px rgba(179,38,30,.1);background:#fff}
.search{position:relative;width:300px;max-width:100%}
.search span{position:absolute;inset-inline-start:14px;top:50%;transform:translateY(-50%);display:flex}
.search input{width:100%;height:42px;padding-inline-start:40px;padding-inline-end:14px;border:1.5px solid #D5DEEE;
  border-radius:12px;background:#F8FAFE;font-size:13px;color:#18213D}
.search input:focus{border-color:#3E6CE7;background:#fff;box-shadow:0 0 0 3px rgba(62,108,231,.12)}
.av2.pink{background:#FDECF3;color:#C2417A}.av2.grey{background:#F4F8FE;color:#7D89A2}
.banner{background:linear-gradient(#fff,#F6F9FF)}

/* ===== page sections + premium divider ===== */
.pgsec{display:flex;flex-direction:column;gap:16px}
.sechd{display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.sechd h2.big{margin:0;font-size:24px;font-weight:800;color:#18213D;line-height:1.3}
.sechd .subt{font-size:13px;color:#7D89A2;margin-top:2px}
.ico.lg{width:48px;height:48px;border-radius:14px}
.formcard{padding:26px 28px}
.fg{display:grid;gap:16px}
.fg-a{grid-template-columns:2fr 1.3fr .7fr 1.1fr}
.fg-b{grid-template-columns:repeat(4,1fr)}
.fg-c{grid-template-columns:1fr 1fr}
.fg .f{min-width:0}
.fg .pills{height:46px;align-items:center}
.formfoot{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  padding-top:18px;border-top:1px dashed #DCE6FB}
.divider{display:flex;align-items:center;gap:18px;margin:14px 0 10px}
.divider::before,.divider::after{content:'';flex:1;height:2px;border-radius:2px}
.divider::before{background:linear-gradient(to left,rgba(143,176,245,0),#8FB0F5)}
.divider::after{background:linear-gradient(to right,rgba(143,176,245,0),#8FB0F5)}
.divider .med{width:46px;height:46px;border-radius:999px;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#335CCF,#54A0E9 70%,#6DD9EB);
  box-shadow:0 0 0 6px #EBF0FD,0 0 0 7px #D3E0FB,0 10px 22px rgba(51,92,207,.32)}
.arow .dt{font-size:12px;color:#9AA6BC;width:84px;text-align:center;flex-shrink:0}
@media (max-width:1100px){.fg-a,.fg-b,.fg-c{grid-template-columns:1fr 1fr}}

/* ===== patients v3: compact form + premium records table + modals ===== */
.toast{z-index:200}
.formcard{padding:18px 22px}
.formcard form{display:flex;flex-direction:column;gap:12px}
.fg{gap:12px}
.fg-a{grid-template-columns:2fr 1.2fr 1.6fr .6fr 1fr}
.fg-c{grid-template-columns:1fr 1fr}
.fg-c3{grid-template-columns:1.3fr 1.3fr 190px}
.fg-d{grid-template-columns:1fr 1fr}
.f label{font-size:12px}
.formcard .f input,.formcard .f select,.mdl .f input,.mdl .f select{height:42px}
.fg .pills{height:42px}
.formcard .btn[type=submit]{height:42px;width:100%}
.f input.ltr{direction:ltr;text-align:right}
.ico.red{background:#FBEAEA}

.card.recs{padding:0;overflow:hidden;border:1px solid #E3EAFA;box-shadow:0 16px 44px rgba(15,27,61,.10)}
.recs-hd{display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;
  padding:22px 26px;background:linear-gradient(180deg,#F1F6FF,#fff);border-bottom:1px solid #E3EAFA}
.searchbig{position:relative;flex:1;min-width:300px;max-width:580px}
.searchbig input{width:100%;height:54px;padding-inline-start:60px;padding-inline-end:48px;font-size:15px;color:#18213D;
  background:#fff;border:2px solid #BFD1F7;border-radius:16px;box-shadow:0 8px 22px rgba(62,108,231,.12)}
.searchbig input::placeholder{color:#8A97B1}
.searchbig input:focus{border-color:#3E6CE7;box-shadow:0 0 0 4px rgba(62,108,231,.14),0 8px 22px rgba(62,108,231,.16)}
.searchbig .sic{position:absolute;inset-inline-start:8px;top:50%;transform:translateY(-50%);width:38px;height:38px;
  border-radius:12px;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#335CCF,#54A0E9)}
.searchbig .sclr{position:absolute;inset-inline-end:12px;top:50%;transform:translateY(-50%);width:28px;height:28px;border:none;
  border-radius:999px;background:#EBF0FD;color:#3E6CE7;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center}
.searchbig .sclr[hidden]{display:none}

.tblwrap{overflow-x:auto}
.ptbl{width:100%;min-width:960px;border-collapse:separate;border-spacing:0}
.ptbl th{background:#EAF0FD;color:#41547A;font-size:12px;font-weight:800;text-align:right;padding:14px 20px;
  border-bottom:2px solid #D3E0FB;white-space:nowrap}
.ptbl td{padding:16px 20px;border-top:0;border-bottom:1px solid #EAEFFA;font-size:14px;vertical-align:middle}
.ptbl th+th,.ptbl td+td{border-inline-start:1px solid #EAEFFA}
.ptbl tbody tr:nth-child(even){background:#FAFCFF}
.ptbl tbody tr:hover{background:#EFF5FF}
.ptbl tbody tr:last-child td{border-bottom:0}
.ptbl td.empty{text-align:center;padding:56px 20px}
.pc{display:flex;align-items:center;gap:12px}
.pc .av2{width:44px;height:44px}
.pcn{min-width:0}
.pcn .nm{font-size:14.5px}
.em{direction:ltr;text-align:right;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:#41547A}
.tags{display:flex;gap:6px;flex-wrap:wrap}
.acts{display:flex;align-items:center;gap:8px}
.ib{width:36px;height:36px;border-radius:10px;border:1.5px solid #D5DEEE;background:#fff;display:inline-flex;
  align-items:center;justify-content:center;padding:0;color:#52607A;flex-shrink:0}
.ib:hover{background:#EBF0FD;border-color:#3E6CE7}
.ib.dn{border-color:#F1D0CD;background:#FEF6F6}
.ib.dn:hover{background:#FBEAEA;border-color:#B3261E}

.ovl{position:fixed;inset:0;z-index:100;display:flex;align-items:center;justify-content:center;padding:20px;
  background:rgba(15,27,61,.5);backdrop-filter:blur(3px)}
.mdl{background:#fff;border-radius:22px;width:min(520px,100%);max-height:calc(100vh - 40px);overflow:auto;
  box-shadow:0 30px 80px rgba(15,27,61,.35)}
.mdl.wide{width:min(920px,100%)}
.mdl-hd{display:flex;align-items:center;gap:14px;padding:20px 24px;border-bottom:1px solid #EAEFFA;
  background:linear-gradient(180deg,#F1F6FF,#fff)}
.mdl-hd h3{margin:0;font-size:18px;font-weight:800;color:#18213D}
.mdl-hd .ib{font-size:20px;line-height:1}
.mdl-body{padding:20px 24px 22px;display:flex;flex-direction:column;gap:14px}
.mdl-ft{display:flex;justify-content:flex-end;gap:10px;padding-top:6px}
.delbox{display:flex;flex-direction:column;gap:2px;background:#FEF6F6;border:1.5px solid #F1D0CD;border-radius:14px;padding:12px 16px}
.delmsg{margin:0;font-size:13px;line-height:1.9;color:#52607A}
.delmsg.err{color:#B3261E;font-weight:700;background:#FEF6F6;border-radius:12px;padding:12px 14px}
.btn.dn2{background:#B3261E}
@media (max-width:1100px){.fg-a,.fg-b,.fg-c,.fg-c3,.fg-d{grid-template-columns:1fr 1fr}}

/* جدول المرضى: أعمدة بعرض ثابت عشان الإجراءات تفضل ظاهرة */
.ptbl{table-layout:fixed;min-width:940px}
.ptbl th{padding:14px 12px}
.ptbl td{padding:14px 12px}
.ptbl th:nth-child(2){width:80px}
.ptbl th:nth-child(3){width:88px}
.ptbl th:nth-child(4){width:170px}
.ptbl th:nth-child(5){width:106px}
.ptbl th:nth-child(6){width:104px}
.ptbl th:nth-child(7){width:186px}
.em{max-width:none;width:100%}
.pcn{overflow:hidden}
.acts .btn.sm{padding:0 12px}
.ptbl th:nth-child(2){width:76px}
.ptbl th:nth-child(3){width:84px}
.ptbl th:nth-child(4){width:156px}
.ptbl th:nth-child(5){width:100px}
.ptbl th:nth-child(6){width:100px}
.ptbl th:nth-child(7){width:218px}
.acts{gap:6px}
.ib{width:34px;height:34px}

[hidden]{display:none !important}

/* ===== صفحة الحجز ===== */
.bk-grid{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px;align-items:start}
.bkform{display:flex;flex-direction:column;gap:12px;padding:18px 20px}
.bkform .f input,.bkform .f select{height:42px}
.bkform .btn#confirm{height:50px;width:100%}
.f label .en{color:#9AA6BC;font-weight:600;font-size:11px;margin-inline-start:4px}
.hint{font-size:12px;line-height:1.8}
.pcard{display:flex;align-items:center;gap:12px;background:#F1F6FF;border:1.5px solid #D3E0FB;border-radius:14px;padding:10px 12px}
.pcard .pcn{flex:1;min-width:0}
.pcard .pcn b{font-size:14px;color:#18213D}
.okline{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:#1E7A3C;margin-top:8px}
.newchip{display:flex;align-items:center;gap:8px;background:#FBF3E5;border-radius:12px;padding:10px 12px;color:#7A4F0E;font-size:12.5px;line-height:1.6}
.vt-sel{display:flex;flex-direction:column;gap:10px}
.vt-lock{display:flex;gap:10px;align-items:flex-start;background:#E9F5EC;border:1.5px solid #BFE3C9;border-radius:12px;padding:10px 12px}
.vt-lock b{display:block;color:#14532D;font-size:14px}
.vt-lock span{font-size:11.5px;color:#4B7D5A;line-height:1.6}
.durs{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.dur{height:40px;border:1.5px solid #D5DEEE;border-radius:11px;background:#fff;font-weight:700;font-size:13px;color:#41547A}
.dur:hover{border-color:#3E6CE7}
.dur.on{background:#3E6CE7;border-color:#3E6CE7;color:#fff}
.pk{display:flex;gap:10px;align-items:center;background:#F6F8FC;border:1.5px dashed #D5DEEE;border-radius:14px;padding:10px 12px}
.pk b{display:block;font-size:13px;color:#18213D}
.pk span{font-size:12px;color:#7D89A2}
.pk.on{background:#EBF0FD;border:1.5px solid #3E6CE7}
.pk.on span{color:#41547A}
.gpill{font-size:12px;font-weight:800;border-radius:999px;padding:7px 14px;white-space:nowrap}
.gpill.on{background:#E9F5EC;color:#1E7A3C}
.gpill.off{background:#F1F4FA;color:#7D89A2}
.gpill::before{content:'';display:inline-block;width:8px;height:8px;border-radius:99px;background:currentColor;margin-inline-end:7px}

/* جدول الأسبوع */
.boardcard{padding:16px 16px 14px;min-width:0}
.mdl .boardcard{border:1.5px solid #E3EAFA;border-radius:16px;background:#fff}
.bd-hd,.mtop{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.bd-nav{display:flex;align-items:center;gap:8px}
.bd-range{display:flex;flex-direction:column;align-items:center;min-width:130px;line-height:1.4}
.bd-range b{font-size:15px;font-weight:800;color:#18213D}
.bd-range span{font-size:11.5px;color:#7D89A2}
.legend{display:flex;align-items:center;gap:4px;font-size:11.5px;color:#7D89A2}
.lg{width:12px;height:12px;border-radius:4px;display:inline-block;margin-inline-start:8px}
.lg.free{background:#fff;border:1.5px dashed #9DB9F5}
.lg.bkd{background:#EBF0FD;border-inline-start:3px solid #3E6CE7}
.lg.past{background:#E3E8F2}
.lg.k-green{background:#1E7A3C}.lg.k-amber{background:#B4791A}.lg.k-blue{background:#3E6CE7}.lg.k-grey{background:#8A97B1}
.bd-err{background:#FEF6F6;color:#B3261E;border-radius:10px;padding:8px 12px;font-size:12px;margin-bottom:8px}
.ttwrap{overflow-x:auto}
.tt{--rh:34px;display:grid;grid-template-columns:50px repeat(6,minmax(64px,1fr));grid-template-rows:auto repeat(14,var(--rh));gap:4px;min-width:520px}
.tt.big{--rh:42px;grid-template-columns:64px repeat(6,minmax(100px,1fr))}
.th{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:6px 2px;border-radius:10px;background:#F1F6FF;line-height:1.35}
.th span{font-size:11.5px;font-weight:700;color:#52607A}
.th b{font-size:15px;font-weight:800;color:#18213D}
.th.today{background:linear-gradient(135deg,#335CCF,#54A0E9)}
.th.today span,.th.today b{color:#fff}
.th.old{opacity:.55}
.tl{display:flex;align-items:center;justify-content:center;font-size:11px;color:#41547A;font-weight:700}
.tl.half{color:#9AA6BC;font-weight:500}
.cell{border:1.5px dashed #DCE6FB;border-radius:8px;background:#fff;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}
.cell.free:hover{background:#EBF0FD;border:1.5px solid #3E6CE7}
.cell.free:hover::after{content:'+';color:#3E6CE7;font-weight:800;font-size:16px}
.cell.past{background:repeating-linear-gradient(135deg,#F5F7FB,#F5F7FB 5px,#ECEFF6 5px,#ECEFF6 10px);border-color:transparent;cursor:not-allowed}
.cell.nofit{background:#FAFBFE;border:1.5px dotted #E3E9F6;cursor:not-allowed}
.bk{border-radius:8px;padding:4px 7px;overflow:hidden;border-inline-start:4px solid;display:flex;flex-direction:column;gap:1px;line-height:1.3;min-width:0}
.bk b{font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bk span{font-size:10.5px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.bk.k-green{background:#E9F5EC;border-color:#1E7A3C;color:#14532D}
.bk.k-amber{background:#FBF3E5;border-color:#B4791A;color:#7A4F0E}
.bk.k-blue{background:#EBF0FD;border-color:#3E6CE7;color:#1F3FA8}
.bk.k-grey{background:#F1F4FA;border-color:#8A97B1;color:#3F4B66}
.bk.ext{border-inline-start-style:dashed}
.bk.done{opacity:.72}
.selblock{display:flex;flex-direction:column;justify-content:center;gap:1px;background:linear-gradient(135deg,#335CCF,#54A0E9);color:#fff;
  border-radius:8px;padding:4px 8px;box-shadow:0 6px 16px rgba(51,92,207,.35);z-index:1;min-width:0}
.selblock span{font-size:10.5px;opacity:.9}
.selblock b{font-size:12px}

/* متابعة المرضى */
.atbl{min-width:720px}
.atbl th:nth-child(1){width:auto}
.atbl th:nth-child(2){width:170px}
.atbl th:nth-child(3){width:240px}
.atbl th:nth-child(4){width:120px}
.nx{display:flex;gap:8px;align-items:baseline}
.nx b{color:#1E7A3C}
.nx span{font-weight:800;color:#3E6CE7}
.warnb{background:#FBF3E5;color:#B4791A;border:1.5px solid #F0D9A8;font-weight:800}
.warnb:hover{background:#F8E9C8}

/* تقويم الشهر */
.mcal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.mhd{text-align:center;font-size:12px;font-weight:800;color:#41547A;background:#EAF0FD;border-radius:10px;padding:9px 0}
.mday{min-height:112px;background:#fff;border:1.5px solid #EAEFFA;border-radius:12px;padding:7px;display:flex;flex-direction:column;gap:3px;cursor:pointer;overflow:hidden}
.mday:hover{border-color:#8FB0F5;background:#F8FAFF}
.mday.out{opacity:.4}
.mday.old:not(.today){background:#FAFBFD}
.mday.today{border:2px solid #3E6CE7;box-shadow:0 0 0 4px rgba(62,108,231,.12)}
.mday.fri{background:repeating-linear-gradient(135deg,#F7F8FC,#F7F8FC 6px,#F0F2F8 6px,#F0F2F8 12px);cursor:default}
.mday .dn{display:flex;justify-content:space-between;align-items:center}
.mday .dn b{font-size:14px}
.mday .dn span{font-size:10.5px;color:#9AA6BC}
.mday .dn .cnt{background:#EBF0FD;color:#3E6CE7;border-radius:999px;padding:1px 8px;font-weight:800}
.mchip{font-size:10.5px;font-weight:700;border-radius:6px;padding:2px 6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mchip.k-green{background:#E9F5EC;color:#14532D}.mchip.k-amber{background:#FBF3E5;color:#7A4F0E}
.mchip.k-blue{background:#EBF0FD;color:#1F3FA8}.mchip.k-grey{background:#F1F4FA;color:#3F4B66}
.mchip.ext{outline:1px dashed rgba(62,108,231,.5)}
.mday .more{font-size:10.5px;color:#3E6CE7;font-weight:800}
.drow{display:flex;gap:12px;align-items:center;background:#F8FAFF;border:1.5px solid #EAEFFA;border-inline-start:4px solid #8A97B1;border-radius:12px;padding:10px 12px}
.drow.k-green{border-inline-start-color:#1E7A3C}.drow.k-amber{border-inline-start-color:#B4791A}.drow.k-blue{border-inline-start-color:#3E6CE7}
.drow .dt{display:flex;flex-direction:column;align-items:center;min-width:56px}
.drow .dt b{color:#3E6CE7;font-size:14px}
.drow .dt span{font-size:11px;color:#9AA6BC}

/* نافذة حجز المتابعة */
.mdl.xl{width:min(1120px,100%)}
.fu-top{display:grid;grid-template-columns:1fr 300px;gap:18px;align-items:start}
.mdl .vt-sel{flex-direction:row;flex-wrap:wrap}
.mdl .vt-sel .f{flex:1;min-width:200px}
@media (max-width:1100px){.bk-grid{grid-template-columns:1fr}.fu-top{grid-template-columns:1fr}}

/* ===== تسجيل الدخول ===== */
.wlinks{display:flex;flex-wrap:wrap;gap:4px 10px;margin-top:2px}
.wlinks a{font-size:11px;font-weight:600;color:#7C8AA6}
.wlinks a:hover{color:#3E6CE7}
.loginerr{background:#FEF6F6;color:#B3261E;border:1.5px solid #F1D0CD;border-radius:12px;padding:10px 12px;font-size:13px;font-weight:700;line-height:1.7}
