:root{--navy:#142b3d;--green:#087f68;--mint:#e9f6f1;--line:#e6ece9;--muted:#829099;--bg:#f6f8f7;--white:#fff;--amber:#e5a63b;--red:#d95f58;--shadow:0 8px 26px #193b3010}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--navy);font-family:Vazirmatn,Tahoma,"Segoe UI",sans-serif;font-size:14px}button,input,select{font:inherit}button{cursor:pointer}.shell{display:grid;grid-template-columns:248px 1fr;min-height:100vh}.side{background:#fff;border-left:1px solid var(--line);padding:22px 16px;position:sticky;top:0;height:100vh;overflow:auto}.brand{display:flex;align-items:center;gap:11px;padding:0 8px 22px;border-bottom:1px solid var(--line)}.logo{width:42px;height:42px;border-radius:14px;background:var(--green);color:#fff;display:grid;place-items:center;font-weight:900;font-size:19px}.brand b{font-size:16px;letter-spacing:.6px}.brand small{display:block;color:var(--muted);font-size:11px;margin-top:3px}.group-label{font-size:10px;color:#9aa6a8;margin:21px 9px 8px}.nav{display:grid;gap:4px}.nav button{border:0;background:transparent;color:#586a72;text-align:right;padding:11px 12px;border-radius:11px;display:flex;align-items:center;gap:11px;font-size:13px}.nav button:hover,.nav button.active{background:var(--mint);color:var(--green);font-weight:700}.ico{width:21px;text-align:center;font-size:17px}.side-foot{margin-top:25px;padding:14px;background:#f5faf8;border-radius:14px;font-size:11px;color:#71817f;line-height:1.9}.main{min-width:0}.top{height:74px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 30px;position:sticky;top:0;z-index:4}.crumb{font-size:13px;color:#809099}.top-actions{display:flex;gap:10px;align-items:center}.iconbtn,.user{border:1px solid var(--line);background:white;border-radius:11px;padding:9px 12px;color:var(--navy)}.user{display:flex;align-items:center;gap:9px;border:0}.avatar{width:34px;height:34px;border-radius:50%;background:#d9eee6;color:var(--green);display:grid;place-items:center;font-weight:800}.content{padding:28px 30px;max-width:1500px;margin:auto}.heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:22px}.heading h1{margin:0;font-size:22px}.heading p{margin:7px 0 0;color:var(--muted);font-size:12px}.btn{background:var(--green);border:1px solid var(--green);color:#fff;border-radius:10px;padding:10px 15px;font-weight:700;box-shadow:0 4px 12px #087f6820}.btn:hover{filter:brightness(.96)}.btn.soft{background:#fff;color:var(--green);box-shadow:none}.btn.ghost{background:transparent;color:#5d7078;border-color:var(--line);box-shadow:none}.btn.danger{background:#fff3f2;color:var(--red);border-color:#f4d5d2;box-shadow:none}.grid{display:grid;gap:16px}.stats{grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:18px}.card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow)}.stat{display:flex;justify-content:space-between;align-items:flex-start}.stat .label{color:var(--muted);font-size:12px}.stat strong{display:block;font-size:24px;margin:11px 0 5px}.delta{font-size:11px;color:var(--green)}.stat-icon{width:38px;height:38px;border-radius:12px;background:var(--mint);color:var(--green);display:grid;place-items:center;font-size:19px}.dash-grid{grid-template-columns:1.35fr 1fr}.card-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.card-title h3{font-size:14px;margin:0}.sub{font-size:11px;color:var(--muted)}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:12px}th{color:#8a989d;text-align:right;font-weight:500;padding:11px 9px;border-bottom:1px solid var(--line)}td{padding:12px 9px;border-bottom:1px solid #f0f3f2}tbody tr{cursor:pointer}tbody tr:hover{background:#f8fbfa}.person{display:flex;align-items:center;gap:9px}.mini{width:31px;height:31px;border-radius:50%;background:#e6f3ef;color:var(--green);display:grid;place-items:center;font-size:11px}.badge{display:inline-block;border-radius:20px;padding:5px 9px;background:var(--mint);color:var(--green);font-size:10px}.badge.warn{background:#fff5e5;color:#b57a18}.badge.red{background:#fff0ee;color:var(--red)}.tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:14px}.field{padding:10px 12px;border:1px solid var(--line);background:#fff;border-radius:10px;color:var(--navy);min-width:170px;outline:none}.field:focus{border-color:#79b8a7}.search{flex:1;min-width:210px}.wide{grid-column:1/-1}.chart{height:180px;display:flex;align-items:end;gap:10px;padding:15px 8px 0;border-bottom:1px solid var(--line)}.bar{flex:1;background:linear-gradient(#43b89a,#bce8d9);border-radius:7px 7px 0 0;position:relative;min-width:12px}.bar span{position:absolute;bottom:-24px;right:50%;transform:translateX(50%);font-size:10px;color:var(--muted)}.linechart{height:156px;width:100%;background:linear-gradient(180deg,#e9f6f1 0%,#fff 85%);border-radius:12px;position:relative;overflow:hidden}.linechart svg{width:100%;height:100%}.schedule{display:grid;grid-template-columns:110px repeat(5,1fr);min-width:700px;border:1px solid var(--line);border-radius:12px;overflow:hidden}.schedule div{padding:10px;border-left:1px solid var(--line);border-bottom:1px solid var(--line);font-size:11px;min-height:52px}.schedule .head{background:#f6faf8;color:#62737a;font-weight:700}.slot{background:#f0faf6;color:#087f68;border-right:3px solid #44ad92;border-radius:6px;margin:4px;padding:7px!important;min-height:43px!important;cursor:pointer}.slot:hover{background:#dff3eb}.alert{background:#fff8e9;border:1px solid #f3e5c4;color:#8d671d;padding:13px 15px;border-radius:12px;margin-bottom:15px}.tabs{display:flex;gap:5px;border-bottom:1px solid var(--line);margin-bottom:16px;overflow:auto}.tabs button{border:0;background:none;padding:11px 14px;color:#78888e;white-space:nowrap}.tabs button.active{color:var(--green);border-bottom:2px solid var(--green);font-weight:700}.profile-head{display:flex;align-items:center;gap:16px;margin-bottom:18px}.big-avatar{width:64px;height:64px;border-radius:20px;background:#dff1eb;display:grid;place-items:center;color:var(--green);font-size:25px;font-weight:800}.profile-head h2{margin:0 0 6px}.profile-meta{color:var(--muted);font-size:12px}.split{grid-template-columns:1fr 1fr}.beforeafter{height:225px;border-radius:14px;overflow:hidden;position:relative;background:linear-gradient(135deg,#dbbaa8,#a76f60 48%,#d7a993 49%,#e4cabc);cursor:ew-resize}.beforeafter:before{content:'قبل';position:absolute;top:12px;right:12px;background:#fff;padding:5px 9px;border-radius:8px;font-size:11px}.beforeafter:after{content:'بعد';position:absolute;top:12px;left:12px;background:#fff;padding:5px 9px;border-radius:8px;font-size:11px}.face{position:absolute;inset:30px 25%;border-radius:48% 48% 42% 42%;background:linear-gradient(120deg,#c38c74,#e1b6a0);box-shadow:inset -15px -8px 20px #915f5050}.face:after{content:'✦';position:absolute;top:48%;left:43%;font-size:32px;color:#fff9}.sliderline{position:absolute;top:0;bottom:0;left:50%;width:3px;background:white;box-shadow:0 0 5px #555}.sliderline:after{content:'↔';position:absolute;top:50%;left:-14px;width:28px;height:28px;border-radius:50%;background:white;display:grid;place-items:center}.pill{padding:8px 11px;background:#f4f7f6;border-radius:9px;color:#62737a;font-size:11px}.muted{color:var(--muted)}.row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid #eff2f1}.cart-item{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.qty{display:flex;align-items:center;gap:8px}.qty button{border:1px solid var(--line);background:#fff;border-radius:7px;width:25px;height:25px;color:var(--green)}.total{background:#f3faf7;border-radius:12px;padding:14px;margin-top:12px}.smsbox{border:1px solid var(--line);border-radius:12px;padding:14px;min-height:100px;width:100%;resize:vertical}.toast{position:fixed;bottom:22px;left:22px;z-index:20;background:#173b35;color:white;padding:13px 18px;border-radius:12px;box-shadow:var(--shadow);display:none}.modal-bg{position:fixed;inset:0;background:#10251e70;z-index:15;display:none;place-items:center;padding:18px}.modal{background:#fff;border-radius:18px;padding:22px;width:min(480px,100%);box-shadow:0 20px 60px #0003}.modal h3{margin:0 0 12px}.modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:18px}.portal .side{background:#123b35;color:#e9f5f0;border:0}.portal .brand small,.portal .group-label{color:#9bbdb2}.portal .nav button{color:#c8ddd6}.portal .nav button.active,.portal .nav button:hover{background:#20554c;color:#fff}.portal .side-foot{background:#1b4941;color:#c4ddd5}.portal .top{background:#fff}.portal-banner{background:linear-gradient(115deg,#0a8069,#55b69a);color:#fff;padding:24px;border-radius:17px;display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.portal-banner h2{margin:0 0 7px}.portal-banner p{margin:0;color:#d7f1e7;font-size:12px}.loyalty{background:#eaf7f1;color:#17594b;border-radius:14px;padding:17px}.hidden{display:none!important}.empty{text-align:center;padding:42px;color:var(--muted)}@media(max-width:1000px){.shell{grid-template-columns:205px 1fr}.stats{grid-template-columns:repeat(2,1fr)}.dash-grid{grid-template-columns:1fr}.content{padding:22px 18px}}@media(max-width:680px){.shell{display:block}.side{position:fixed;z-index:7;top:auto;bottom:0;height:auto;width:100%;padding:8px;border:0;border-top:1px solid var(--line);overflow-x:auto}.brand,.group-label,.side-foot{display:none}.nav{display:flex;width:max-content;gap:3px}.nav button{display:grid;gap:1px;text-align:center;padding:7px 10px;font-size:9px;min-width:58px}.ico{width:auto;font-size:16px}.top{height:60px;padding:0 14px}.top-actions .hide-mobile{display:none}.content{padding:18px 13px 92px}.heading h1{font-size:19px}.stats{gap:9px}.card{padding:14px}.stat strong{font-size:20px}.stats .card{min-height:115px}.split{grid-template-columns:1fr}.heading{align-items:center}.field{min-width:130px}}

/* Production additive helpers (does NOT alter any demo styles above) */
.logo-img{width:42px;height:42px;border-radius:14px;display:block;flex-shrink:0;object-fit:cover}
.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:20px;background:var(--bg)}
.auth-card{width:min(450px,100%)}
.form-stack{display:grid;gap:11px;margin-top:12px}
.form-stack label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.form-stack .field,.modal .field{width:100%}
.modal{max-height:90vh;overflow:auto}
.modal-wide{width:min(820px,100%)}
.code-box{background:#f4f7f6;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-family:monospace;direction:ltr;text-align:left;font-size:12px;word-break:break-all}
.privacy-lock{background:#f5faf8;border:1px dashed #9fc9bc;border-radius:12px;padding:16px;color:#4a635e;font-size:12px;line-height:1.9}
.color-row{display:flex;align-items:center;gap:10px}
.color-row input[type=color]{width:42px;height:36px;border:1px solid var(--line);border-radius:8px;padding:2px;background:#fff;cursor:pointer}
.mono{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;direction:ltr;unicode-bidi:embed;font-size:11px}
.doc-link{background:none;border:0;padding:0;color:var(--green);font-weight:700;text-decoration:underline;cursor:pointer;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px}
.doc-link:hover{color:#055a49}
.doc-sheet{border:1px solid var(--line);border-radius:14px;padding:18px;background:#fff}
.doc-sheet-hdr{display:flex;justify-content:space-between;align-items:center;gap:12px;border-bottom:2px solid var(--green);padding-bottom:12px;margin-bottom:14px}
.doc-meta-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;background:#f7fbf9;border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-bottom:14px;font-size:12px}
.doc-signs{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:18px;text-align:center}
.doc-sign-box{border:1px dashed #b9ccc5;border-radius:10px;padding:10px;min-height:68px;font-size:11px;color:#586a72}
.med-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:8px}
.med-item{border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fbfdfc;display:grid;gap:6px}
.med-item.high-risk{border-color:#f4d5d2;background:#fff9f8}
.med-item label{display:flex;align-items:center;gap:7px;margin:0;color:var(--navy);font-size:12px;cursor:pointer}
.alert-danger{background:#fff0ee;border:1px solid #f4d5d2;color:var(--red);padding:13px 15px;border-radius:12px;margin-bottom:15px}
.stock-alert-btn{border:1px solid #f3d0c9;background:#fff3f1;color:var(--red);border-radius:11px;padding:8px 12px;font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px}
.sig-canvas{width:100%;height:130px;border:1px dashed #9ab7ae;border-radius:12px;background:#fcfefd;touch-action:none;cursor:crosshair}
.consent-doc{background:#fbfdfc;border:1px solid var(--line);border-radius:12px;padding:14px 16px;font-size:12px;line-height:2;max-height:240px;overflow:auto;color:#283c48}
.consent-doc ul{margin:6px 0;padding-right:20px}
.big-avatar img{width:100%;height:100%;object-fit:cover;border-radius:20px}
@media(max-width:680px){.med-grid,.doc-meta-grid,.doc-signs{grid-template-columns:1fr}}
@media print{.side,.top,.toast,.modal-bg,.no-print{display:none!important}.shell{display:block!important}.content{padding:0!important;max-width:100%!important}}
/* v3 Workflow & Proforma additive helpers */
.schedule-6{grid-template-columns:92px repeat(6,minmax(130px,1fr));min-width:860px}
.slot-stack{display:grid;gap:5px;padding:4px!important}
.slot.provisional{background:#edf4ff;color:#1d4e89;border-right-color:#2f6fed}
.slot.provisional:hover{background:#dceaff}
.slot.checkedin{background:#e9f6f1;color:#087f68;border-right-color:#087f68}
.pending-alert-btn{border:1px solid #bfd7ff;background:#eef5ff;color:#1d4e89;border-radius:11px;padding:8px 12px;font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px}
.billing-alert-btn{border:1px solid #b8e3d6;background:#e9f6f1;color:#087f68;border-radius:11px;padding:8px 12px;font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px}
.exp-alert-btn{border:1px solid #f4d8a8;background:#fff7e6;color:#9b650c;border-radius:11px;padding:8px 12px;font-size:12px;font-weight:700;display:flex;align-items:center;gap:6px}
.badge.blue{background:#e8f1ff;color:#1d4e89}
.badge.purple{background:#f3ecff;color:#6236a8}
.proforma-box{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fbfdfc;margin-top:12px}
.proforma-box.consumable-zone{border-color:#f2d9a7;background:#fffbf2}
.proforma-row{display:grid;grid-template-columns:2fr 90px 1.2fr 1.2fr auto;gap:8px;align-items:center;margin-top:8px}
.proforma-row-item{display:grid;grid-template-columns:2fr 80px 1.2fr 1.3fr auto;gap:8px;align-items:center;margin-top:8px}
.split-pay-row{display:grid;grid-template-columns:1.2fr 1fr 1fr auto;gap:8px;align-items:center;margin-top:8px}
.safety-gate{border:1px solid #f4d5d2;background:#fff6f5;border-radius:12px;padding:12px 14px;margin-bottom:12px}
.safety-gate.ok{border-color:#c2e7da;background:#f2fbf7}
.proforma-card{border:1px solid var(--line);border-radius:12px;padding:11px 13px;background:#fff;display:flex;justify-content:space-between;align-items:center;gap:10px;cursor:pointer;transition:.15s}
.proforma-card:hover,.proforma-card.selected{border-color:var(--green);background:#f3faf7}
@media(max-width:760px){.proforma-row,.proforma-row-item,.split-pay-row{grid-template-columns:1fr}}
/* ==================== v3.2 MODERN MULTI-DEVICE RESPONSIVE LAYER ==================== */
/* Desktop (> 1024px): All mobile/tablet controls stay completely hidden so Desktop UI is 100% untouched */
.menu-toggle-btn,.drawer-backdrop,.drawer-close-btn,.drawer-mobile-actions,.notif-bell-btn,.mobile-dock,.modal-handle,.modal-close-x{display:none}
.modal-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.modal-head h3{margin:0}
body.modal-open,body.drawer-open{overflow:hidden}

/* Tablet & Small Laptop (<= 1024px): Slide-over RTL Drawer + Compact Top Icon Bar */
@media (max-width: 1024px) {
  .shell{display:block;grid-template-columns:1fr}
  .desktop-only{display:none!important}

  /* Sleek RTL Slide-Over Drawer Sidebar */
  .side{
    position:fixed!important;
    top:0!important;
    right:0!important;
    bottom:0!important;
    left:auto!important;
    width:min(300px,84vw)!important;
    height:100dvh!important;
    max-height:100dvh!important;
    z-index:45!important;
    padding:18px 14px calc(20px + env(safe-area-inset-bottom))!important;
    border-top:0!important;
    border-left:1px solid var(--line)!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    display:flex!important;
    flex-direction:column!important;
    transform:translateX(105%);
    transition:transform .28s cubic-bezier(.22,1,.36,1),box-shadow .28s ease;
    box-shadow:none;
    -webkit-overflow-scrolling:touch;
  }
  body.drawer-open .side{
    transform:translateX(0);
    box-shadow:-12px 0 42px rgba(16,37,30,.24);
  }
  .side .brand{display:flex!important;align-items:center;justify-content:space-between;padding:0 4px 16px}
  .side .brand-left{display:flex;align-items:center;gap:10px;min-width:0}
  .side .group-label{display:block!important;margin:16px 8px 6px}
  .side .nav{display:grid!important;width:100%!important;gap:4px!important}
  .side .nav button{
    display:flex!important;
    align-items:center!important;
    text-align:right!important;
    gap:11px!important;
    padding:11px 12px!important;
    font-size:13px!important;
    min-width:0!important;
    width:100%!important;
    min-height:44px;
  }
  .side .ico{width:22px!important;font-size:17px!important}
  .side .side-foot{display:block!important;margin-top:auto}

  .drawer-close-btn{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:10px;
    border:1px solid var(--line);
    background:var(--bg);
    color:var(--navy);
    font-size:18px;
    line-height:1;
    flex-shrink:0;
  }
  .portal .drawer-close-btn{background:#1b4941;border-color:#2a655a;color:#e9f5f0}

  .drawer-mobile-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:14px 0 10px;
    padding-top:12px;
    border-top:1px solid var(--line);
  }
  .portal .drawer-mobile-actions{border-top-color:#255a50;grid-template-columns:1fr}
  .drawer-mobile-actions button{
    padding:10px 10px;
    border-radius:10px;
    font-size:12px;
    font-weight:700;
    min-height:40px;
  }

  .drawer-backdrop{
    display:block;
    position:fixed;
    inset:0;
    z-index:40;
    background:rgba(16,37,30,.46);
    backdrop-filter:blur(3px);
    -webkit-backdrop-filter:blur(3px);
    opacity:0;
    pointer-events:none;
    transition:opacity .25s ease;
  }
  body.drawer-open .drawer-backdrop{opacity:1;pointer-events:auto}

  /* Modern Sticky App Top Bar */
  .top{
    height:64px;
    padding:0 16px;
    gap:10px;
    z-index:20;
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
  }
  .top-right-wrap{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
  .crumb{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:13px;
    font-weight:700;
    color:var(--navy);
  }
  .crumb .crumb-brand{color:var(--muted);font-weight:400}

  .menu-toggle-btn{
    display:grid;
    place-items:center;
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--line);
    background:#fff;
    color:var(--navy);
    flex-shrink:0;
    padding:0;
    transition:background .15s,border-color .15s;
  }
  .menu-toggle-btn:active{background:var(--mint);border-color:var(--green);color:var(--green)}
  .menu-toggle-btn svg{width:20px;height:20px;display:block}

  /* Unified Notification Bell Icon Button */
  .notif-bell-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    position:relative;
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--line);
    background:#fff;
    color:var(--navy);
    padding:0;
    flex-shrink:0;
    transition:background .15s,border-color .15s;
  }
  .notif-bell-btn.has-alerts{
    background:#fff7f5;
    border-color:#f3d0c9;
    color:var(--red);
  }
  .notif-bell-btn svg{width:19px;height:19px;display:block}
  .notif-dot{
    position:absolute;
    top:-5px;
    left:-5px;
    min-width:19px;
    height:19px;
    padding:0 5px;
    border-radius:999px;
    background:var(--red);
    color:#fff;
    font-size:10px;
    font-weight:800;
    display:grid;
    place-items:center;
    border:2px solid #fff;
    box-shadow:0 2px 6px rgba(217,95,88,.35);
  }

  .top-actions{gap:8px}
  .top-actions .pending-alert-btn,
  .top-actions .billing-alert-btn,
  .top-actions .stock-alert-btn,
  .top-actions .exp-alert-btn,
  .top-actions .iconbtn{display:none!important}

  .content{padding:20px 18px 34px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .dash-grid{grid-template-columns:1fr}
  .split{grid-template-columns:1fr}

  /* Sticky Time Column in 6-Day Schedule Matrix for Effortless Horizontal Swiping */
  .schedule-6 > div:nth-child(7n + 1){
    position:sticky;
    right:0;
    z-index:2;
    background:#f6faf8;
    box-shadow:-3px 0 8px rgba(20,43,61,.05);
  }
}

/* Mobile & Phablet (<= 768px): Native App Feel, Floating Bottom Dock, Bottom-Sheet Modals */
@media (max-width: 768px) {
  .top{height:58px;padding:0 12px}
  .crumb .crumb-brand,.crumb .crumb-sep{display:none}
  .user{padding:4px}
  .user span{display:none}
  .avatar{width:36px;height:36px}

  .content{padding:15px 12px calc(90px + env(safe-area-inset-bottom))}
  .heading{flex-direction:column;align-items:stretch;gap:10px;margin-bottom:16px}
  .heading h1{font-size:18px;line-height:1.4}
  .heading p{font-size:11.5px;line-height:1.6}
  .heading > .btn{width:100%;min-height:44px;font-size:13px}

  /* Cards & KPIs */
  .card{padding:14px;border-radius:14px}
  .card-title{flex-wrap:wrap;gap:8px;margin-bottom:12px}
  .card-title h3{font-size:13.5px}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:14px}
  .stats .card{min-height:104px;padding:13px}
  .stat strong{font-size:18px;margin:8px 0 4px}
  .stat .label{font-size:11px}
  .stat .delta{font-size:10px}
  .stat-icon{width:34px;height:34px;border-radius:10px;font-size:16px;flex-shrink:0}

  /* Toolbars & Inputs (prevent iOS Safari auto-zoom & enlarge touch targets) */
  .tools{gap:8px;margin-bottom:12px}
  .tools > .search{flex:1 1 100%;min-width:100%}
  .tools > select.field,.tools > input.field{flex:1 1 calc(50% - 4px);min-width:130px}
  .field{min-height:42px;font-size:15px;padding:9px 11px}
  .btn{min-height:40px;padding:9px 13px;font-size:12.5px}

  /* Smooth Horizontally-Scrollable Tabs */
  .tabs{
    gap:4px;
    padding-bottom:2px;
    margin-bottom:14px;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    scroll-snap-type:x proximity;
  }
  .tabs::-webkit-scrollbar{display:none}
  .tabs button{
    padding:10px 12px;
    font-size:12px;
    scroll-snap-align:start;
    flex-shrink:0;
  }

  /* Crisp Scrollable Data Tables */
  .table-wrap{
    -webkit-overflow-scrolling:touch;
    border-radius:10px;
    background:
      linear-gradient(to left, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) 100% 0,
      radial-gradient(farthest-side at 100% 50%, rgba(20,43,61,.12), rgba(0,0,0,0)),
      radial-gradient(farthest-side at 0 50%, rgba(20,43,61,.12), rgba(0,0,0,0)) 100% 50%;
    background-repeat:no-repeat;
    background-size:32px 100%,32px 100%,10px 100%,10px 100%;
    background-attachment:local,local,scroll,scroll;
  }
  th,td{padding:10px 8px;font-size:11.5px}

  /* Rows & Profile Header */
  .row{flex-wrap:wrap;gap:8px;padding:10px 0}
  .profile-head{flex-wrap:wrap;gap:12px;margin-bottom:14px}
  .profile-head > div:nth-child(2){flex:1 1 calc(100% - 80px);min-width:160px}
  .profile-head .btn{flex:1 1 auto;font-size:12px;padding:8px 10px}
  .big-avatar{width:54px;height:54px;border-radius:16px;font-size:21px}

  /* POS Cart & Proforma Sub-Cards */
  .cart-item{
    grid-template-columns:1fr auto;
    gap:8px;
    padding:11px 0;
  }
  .cart-item > span{grid-column:1 / -1}
  .cart-item .qty{flex-wrap:wrap;gap:6px}
  .cart-item .qty button{width:32px;height:32px;font-size:15px}

  .proforma-box{padding:11px}
  .proforma-row,.proforma-row-item,.split-pay-row{
    grid-template-columns:1fr 1fr;
    gap:7px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:11px;
    padding:9px;
    margin-top:9px;
  }
  .proforma-row > :first-child,
  .proforma-row-item > :first-child{grid-column:1 / -1}
  .proforma-row > .btn.danger,
  .proforma-row-item > .btn.danger,
  .split-pay-row > .btn.danger{grid-column:1 / -1;width:100%;min-height:36px}

  .proforma-card{flex-direction:column;align-items:stretch}
  .proforma-card .btn{width:100%}

  /* Document Sheets, Portal & Alerts */
  .doc-sheet{padding:12px}
  .doc-sheet-hdr{flex-direction:column;align-items:flex-start;gap:8px}
  .doc-meta-grid,.doc-signs,.med-grid{grid-template-columns:1fr}
  .portal-banner{padding:16px;gap:10px}
  .portal-banner h2{font-size:16px}
  .portal-banner > span{font-size:32px!important}
  .alert,.alert-danger{padding:11px 12px;font-size:12px;line-height:1.7}

  /* Native Bottom-Sheet Modals */
  .modal-bg{
    align-items:end;
    padding:0;
    z-index:55;
  }
  .modal,.modal.modal-wide{
    width:100%;
    max-width:100%;
    border-radius:22px 22px 0 0;
    max-height:91dvh;
    padding:10px 15px calc(18px + env(safe-area-inset-bottom));
    animation:clinicSheetUp .24s cubic-bezier(.22,1,.36,1);
  }
  .modal-handle{
    display:block;
    width:42px;
    height:4px;
    border-radius:999px;
    background:#d3dfdb;
    margin:0 auto 10px;
  }
  .modal-close-x{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:10px;
    border:1px solid var(--line);
    background:#f7faf9;
    color:var(--navy);
    font-size:19px;
    line-height:1;
    flex-shrink:0;
  }
  .modal-head h3{font-size:15px}
  .modal-actions{
    position:sticky;
    bottom:-18px;
    background:#fff;
    padding:10px 0 4px;
    border-top:1px solid var(--line);
    margin-top:14px;
  }
  .modal-actions .btn{flex:1}

  /* Floating Glassmorphic Bottom App Dock */
  .mobile-dock{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:2px;
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    z-index:30;
    background:rgba(255,255,255,.94);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--line);
    padding:6px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow:0 -8px 26px rgba(20,43,61,.08);
  }
  .portal .mobile-dock{
    grid-template-columns:repeat(4,minmax(0,1fr));
    background:rgba(18,59,53,.96);
    border-top-color:rgba(255,255,255,.12);
    box-shadow:0 -8px 26px rgba(0,0,0,.22);
  }
  .dock-btn{
    position:relative;
    border:0;
    background:transparent;
    color:#6b7e86;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:3px;
    padding:6px 4px;
    border-radius:12px;
    font-size:10px;
    font-weight:600;
    min-height:50px;
    transition:background .15s,color .15s,transform .12s;
  }
  .dock-btn:active{transform:scale(.95)}
  .dock-btn .dock-ico{font-size:18px;line-height:1.1}
  .dock-btn .dock-lbl{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .dock-btn.active{background:var(--mint);color:var(--green);font-weight:800}
  .portal .dock-btn{color:#b6d3c9}
  .portal .dock-btn.active{background:#21584f;color:#fff}
  .dock-badge{
    position:absolute;
    top:3px;
    left:calc(50% - 22px);
    min-width:16px;
    height:16px;
    padding:0 4px;
    border-radius:999px;
    background:var(--red);
    color:#fff;
    font-size:9px;
    font-weight:800;
    display:grid;
    place-items:center;
    border:1.5px solid #fff;
  }
  .dock-badge.blue{background:#2f6fed}
  .dock-badge.green{background:var(--green)}

  /* Toast positioned safely above mobile bottom dock */
  .toast{
    bottom:calc(78px + env(safe-area-inset-bottom));
    left:12px;
    right:12px;
    text-align:center;
    z-index:65;
    font-size:12.5px;
  }
}

@media (max-width: 390px) {
  .stats{grid-template-columns:1fr}
  .stats .card{min-height:auto}
  .tools > select.field,.tools > input.field{flex:1 1 100%}
}

@keyframes clinicSheetUp{
  from{transform:translateY(32px);opacity:.65}
  to{transform:translateY(0);opacity:1}
}

@media print{
  .mobile-dock,.drawer-backdrop,.menu-toggle-btn,.notif-bell-btn,.drawer-close-btn,.drawer-mobile-actions,.modal-handle,.modal-close-x{display:none!important}
}
