:root{
  --mc5-bg:#eef5ff;
  --mc5-panel:#ffffff;
  --mc5-panel-soft:rgba(255,255,255,.72);
  --mc5-text:#12254a;
  --mc5-muted:#6e7e9e;
  --mc5-border:rgba(129,162,222,.22);
  --mc5-primary:#2d6bff;
  --mc5-primary-2:#5f98ff;
  --mc5-teal:#2fb9c6;
  --mc5-purple:#8b77ff;
  --mc5-mint:#64ccb3;
  --mc5-danger:#e15a7f;
  --mc5-shadow:0 24px 70px rgba(28,73,151,.14);
  --mc5-radius:24px;
}
*{box-sizing:border-box}
body{background:linear-gradient(135deg,#eef5ff 0%,#d9e8ff 45%,#edf7ff 100%)}
#mc5-root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;color:var(--mc5-text)}
button,input,textarea,select{font:inherit}
button{cursor:pointer}

.mc5-loading-screen,.mc5-auth-shell{min-height:70vh;display:grid;gap:28px;align-items:stretch}
.mc5-loading-screen{place-items:center}
.mc5-loading-card{padding:32px 38px;background:var(--mc5-panel);border-radius:30px;box-shadow:var(--mc5-shadow);display:flex;align-items:center;gap:16px}
.mc5-spinner{width:24px;height:24px;border-radius:50%;border:3px solid #d0ddff;border-top-color:var(--mc5-primary);animation:mc5spin 1s linear infinite}
@keyframes mc5spin{to{transform:rotate(360deg)}}

.mc5-auth-shell{grid-template-columns:1.15fr .85fr;max-width:1280px;margin:0 auto;padding:28px}
.mc5-auth-hero{background:linear-gradient(155deg,#0d4fbc 0%,#2d6bff 48%,#7db1ff 100%);color:#fff;border-radius:36px;padding:48px;box-shadow:var(--mc5-shadow);position:relative;overflow:hidden}
.mc5-auth-hero:before,.mc5-auth-hero:after{content:"";position:absolute;border-radius:50%;background:rgba(255,255,255,.12)}
.mc5-auth-hero:before{width:320px;height:320px;right:-90px;top:-120px}
.mc5-auth-hero:after{width:260px;height:260px;left:-100px;bottom:-120px}
.mc5-brand-pill{display:inline-block;padding:10px 18px;border-radius:999px;background:rgba(255,255,255,.14);backdrop-filter:blur(12px);font-size:14px;letter-spacing:.08em;text-transform:uppercase}
.mc5-auth-hero h1{font:700 clamp(34px,4vw,58px)/1.05 Georgia,"Times New Roman",serif;margin:24px 0 18px}
.mc5-auth-hero p{max-width:620px;font-size:18px;line-height:1.6;color:rgba(255,255,255,.9);margin:0 0 26px}
.mc5-auth-features{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:26px}
.mc5-auth-features div,.mc5-demo-note{background:rgba(255,255,255,.12);padding:18px;border-radius:22px;backdrop-filter:blur(10px)}
.mc5-auth-features strong{display:block;margin-bottom:8px;font-size:18px}
.mc5-auth-features span,.mc5-demo-note{font-size:14px;line-height:1.5;color:rgba(255,255,255,.92)}
.mc5-demo-note{margin-top:18px}

.mc5-auth-card{background:rgba(255,255,255,.8);backdrop-filter:blur(18px);border:1px solid rgba(255,255,255,.6);padding:26px;border-radius:32px;box-shadow:var(--mc5-shadow);display:flex;flex-direction:column;justify-content:flex-start}
.mc5-auth-tabs{display:flex;gap:10px;margin-bottom:22px;flex-wrap:wrap}
.mc5-auth-tabs button{border:none;background:#edf4ff;color:#5570a3;padding:12px 18px;border-radius:999px;font-weight:600}
.mc5-auth-tabs button.active{background:linear-gradient(135deg,var(--mc5-primary),var(--mc5-primary-2));color:#fff}
.mc5-banner{padding:14px 16px;border-radius:18px;font-size:14px;margin-bottom:16px}
.mc5-banner.success{background:#eaf6ee;color:#1f6f45}
.mc5-form{display:grid;gap:16px}
.mc5-form.compact{max-width:560px}
.mc5-form label{display:grid;gap:8px;font-size:14px;color:var(--mc5-muted);font-weight:600}
.mc5-form input,.mc5-form textarea,.mc5-form select{border:1px solid var(--mc5-border);background:#fff;min-height:52px;border-radius:18px;padding:14px 16px;color:var(--mc5-text);outline:none;box-shadow:0 8px 20px rgba(62,105,195,.04)}
.mc5-form textarea{min-height:104px;resize:vertical}
.mc5-form input:focus,.mc5-form textarea:focus,.mc5-form select:focus{border-color:rgba(45,107,255,.45);box-shadow:0 0 0 4px rgba(45,107,255,.08)}
.mc5-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.mc5-form-grid.one-line{grid-template-columns:1.4fr .6fr}
.mc5-form-status{min-height:22px;font-size:14px;color:var(--mc5-muted)}
.mc5-inline-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}

.mc5-btn{border:none;border-radius:18px;padding:13px 18px;font-weight:700;transition:.2s transform,.2s box-shadow,.2s opacity;box-shadow:0 12px 28px rgba(25,64,138,.08)}
.mc5-btn:hover{transform:translateY(-1px)}
.mc5-btn:disabled{opacity:.55;cursor:not-allowed;transform:none}
.mc5-btn.primary{background:linear-gradient(135deg,var(--mc5-primary),var(--mc5-primary-2));color:#fff}
.mc5-btn.soft{background:#edf4ff;color:#214d99}
.mc5-btn.danger{background:#fff1f5;color:#bc385c}
.mc5-btn.large{width:100%;padding:17px 22px;font-size:16px;border-radius:20px}

.mc5-shell{display:grid;grid-template-columns:280px 1fr;gap:24px;max-width:1420px;margin:0 auto;padding:22px}
.mc5-sidebar{background:linear-gradient(165deg,#0f57c5 0%,#3878ff 55%,#94c0ff 100%);color:#fff;border-radius:34px;padding:24px;box-shadow:var(--mc5-shadow);display:flex;flex-direction:column;gap:24px;position:sticky;top:20px;height:calc(100vh - 40px)}
.mc5-side-brand{display:flex;align-items:center;gap:14px}
.mc5-side-logo{width:52px;height:52px;border-radius:18px;background:rgba(255,255,255,.18);display:grid;place-items:center;font-size:24px;backdrop-filter:blur(10px)}
.mc5-side-title{font-weight:800;font-size:20px}
.mc5-side-sub{font-size:14px;color:rgba(255,255,255,.82)}
.mc5-side-nav{display:grid;gap:10px}
.mc5-side-nav button{border:none;text-align:left;padding:14px 16px;border-radius:18px;background:rgba(255,255,255,.1);color:#fff;font-weight:700}
.mc5-side-nav button.active{background:rgba(255,255,255,.22)}
.mc5-side-card{margin-top:auto;background:rgba(255,255,255,.14);padding:18px;border-radius:22px;line-height:1.6}
.mc5-side-card strong{display:block;font-size:16px;margin-bottom:6px}

.mc5-content-wrap{display:grid;gap:18px}
.mc5-topbar{display:flex;justify-content:space-between;align-items:center;gap:20px;background:var(--mc5-panel-soft);border:1px solid rgba(255,255,255,.6);backdrop-filter:blur(16px);padding:22px 24px;border-radius:28px;box-shadow:var(--mc5-shadow)}
.mc5-topbar-title{font:700 clamp(28px,3vw,40px)/1.1 Georgia,"Times New Roman",serif}
.mc5-topbar-sub{font-size:14px;color:var(--mc5-muted);margin-top:6px}
.mc5-topbar-actions{display:flex;gap:12px;flex-wrap:wrap}
.mc5-main{display:grid;gap:20px}

.mc5-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(320px,.85fr);gap:20px}
.mc5-panel{background:var(--mc5-panel-soft);backdrop-filter:blur(16px);border:1px solid rgba(255,255,255,.66);border-radius:30px;padding:22px;box-shadow:var(--mc5-shadow)}
.mc5-panel-sticky{position:sticky;top:20px;height:max-content}
.mc5-panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.mc5-panel-head h3{margin:0;font-size:22px}
.mc5-panel-head span{font-size:14px;color:var(--mc5-muted)}
.mc5-sets-strip{display:flex;gap:10px;overflow:auto;padding-bottom:10px;margin-bottom:18px}
.mc5-chip{border:none;background:#ebf3ff;color:#2453a3;border-radius:999px;padding:10px 14px;font-weight:700;display:flex;gap:8px;align-items:center;white-space:nowrap}
.mc5-med-list,.mc5-manage-list,.mc5-history-list{display:grid;gap:14px}
.mc5-med-card{border:none;background:#fff;padding:18px;border-radius:26px;text-align:left;box-shadow:0 18px 34px rgba(21,68,148,.08);border:1px solid transparent}
.mc5-med-card.selected{border-color:rgba(45,107,255,.35);box-shadow:0 18px 36px rgba(45,107,255,.15)}
.mc5-med-card-head{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center}
.mc5-med-badge{width:18px;height:18px;border-radius:999px;background:linear-gradient(135deg,#7facff,#2d6bff);box-shadow:0 8px 18px rgba(45,107,255,.18)}
.mc5-med-badge.teal{background:linear-gradient(135deg,#8de7ef,#2fb9c6)}
.mc5-med-badge.purple{background:linear-gradient(135deg,#c9bcff,#8b77ff)}
.mc5-med-badge.mint{background:linear-gradient(135deg,#baf1e2,#64ccb3)}
.mc5-med-badge.slate{background:linear-gradient(135deg,#d6deef,#8aa1c8)}
.mc5-med-title{font-size:18px;font-weight:800}
.mc5-med-meta{font-size:14px;color:var(--mc5-muted);margin-top:4px}
.mc5-check{width:34px;height:34px;border-radius:50%;background:#edf4ff;display:grid;place-items:center;color:#2158b2;font-weight:900}
.mc5-qty-row{display:flex;align-items:center;gap:16px;margin-top:16px}
.mc5-qty-row button{border:none;background:#edf4ff;color:#2158b2;border-radius:14px;width:42px;height:42px;font-size:22px;font-weight:800}
.mc5-time-card{padding:16px 18px;border-radius:22px;background:#fff;border:1px solid var(--mc5-border);display:grid;gap:6px;margin-bottom:14px}
.mc5-time-card div{display:flex;justify-content:space-between;align-items:center;font-size:16px}
.mc5-time-card small{color:var(--mc5-muted)}
.mc5-basket-items{display:grid;gap:10px;margin:12px 0 16px}
.mc5-basket-item{display:flex;justify-content:space-between;gap:12px;padding:14px 16px;background:#fff;border-radius:18px;border:1px solid var(--mc5-border)}
.mc5-basket-item strong,.mc5-manage-main strong,.mc5-history-top strong,.mc5-profile-card strong{display:block}
.mc5-basket-item span,.mc5-manage-main span,.mc5-profile-card span,.mc5-history-top span{font-size:14px;color:var(--mc5-muted)}
.mc5-note-field{display:grid;gap:8px;font-size:14px;color:var(--mc5-muted);font-weight:600;margin-bottom:16px}
.mc5-note-field textarea{border:1px solid var(--mc5-border);background:#fff;min-height:96px;border-radius:18px;padding:14px 16px}
.mc5-empty{background:rgba(255,255,255,.6);border:1px dashed rgba(86,121,188,.25);border-radius:22px;padding:28px;color:var(--mc5-muted);line-height:1.6;text-align:center}
.mc5-empty.compact{padding:18px}

.mc5-meds-screen,.mc5-profile-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.mc5-manage-card,.mc5-history-card,.mc5-profile-card{background:#fff;border:1px solid var(--mc5-border);border-radius:22px;padding:16px;box-shadow:0 14px 32px rgba(22,60,127,.06)}
.mc5-manage-card{display:flex;justify-content:space-between;gap:16px;align-items:flex-start}
.mc5-manage-main{display:flex;gap:14px;align-items:flex-start;flex:1}
.mc5-manage-main em{display:block;color:#6f8dbd;font-style:normal;font-size:13px;margin-top:6px}
.mc5-emoji{width:40px;height:40px;border-radius:14px;background:#edf4ff;display:grid;place-items:center;font-size:18px}
.mc5-manage-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.mc5-history-group h4{margin:10px 0 12px;padding-left:4px;font-size:17px;text-transform:capitalize}
.mc5-history-top{display:flex;justify-content:space-between;gap:14px;align-items:flex-start;margin-bottom:12px}
.mc5-history-items{display:grid;gap:8px;font-size:15px}
.mc5-history-items span{color:var(--mc5-muted)}
.mc5-profile-card{display:grid;gap:16px}

.mc5-set-editor{display:grid;gap:10px;max-height:44vh;overflow:auto;padding-right:4px}
.mc5-set-row{display:grid;grid-template-columns:auto 1fr 110px;align-items:center;gap:12px;background:#fff;border:1px solid var(--mc5-border);padding:14px 16px;border-radius:18px}
.mc5-set-row input[type="checkbox"]{width:18px;height:18px}
.mc5-set-row input[type="number"]{min-height:44px}

.mc5-modal{position:fixed;inset:0;z-index:99999;display:grid;place-items:center;padding:18px}
.mc5-modal-backdrop{position:absolute;inset:0;background:rgba(12,26,53,.42);backdrop-filter:blur(7px)}
.mc5-modal-card{position:relative;z-index:2;width:min(860px,100%);max-height:90vh;overflow:auto;background:linear-gradient(180deg,#ffffff 0%,#f7fbff 100%);border-radius:30px;padding:22px;border:1px solid rgba(255,255,255,.8);box-shadow:0 30px 90px rgba(13,39,85,.28)}
.mc5-modal-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.mc5-modal-head h3{margin:0;font-size:24px}
.mc5-modal-head button{border:none;background:#edf4ff;width:42px;height:42px;border-radius:14px;color:#315aa4;font-size:20px}
.mc5-scanner-wrap{display:grid;gap:10px}
.mc5-scanner-wrap.hidden{display:none}
#mc5-scan-video{width:100%;border-radius:20px;background:#09162f;min-height:220px;object-fit:cover}

.mc5-toast{position:fixed;right:20px;bottom:20px;z-index:999999;padding:14px 18px;border-radius:16px;background:#17366d;color:#fff;box-shadow:0 16px 38px rgba(12,33,71,.25);opacity:0;transform:translateY(10px);transition:.25s}
.mc5-toast.show{opacity:1;transform:translateY(0)}
.mc5-toast.err{background:#a73456}

@media (max-width:1100px){
  .mc5-auth-shell,.mc5-shell,.mc5-grid,.mc5-meds-screen,.mc5-profile-grid{grid-template-columns:1fr}
  .mc5-sidebar{position:relative;top:auto;height:auto}
  .mc5-panel-sticky{position:relative;top:auto}
}
@media (max-width:760px){
  .mc5-auth-shell,.mc5-shell{padding:14px}
  .mc5-auth-hero,.mc5-auth-card,.mc5-sidebar,.mc5-topbar,.mc5-panel{border-radius:26px}
  .mc5-auth-features,.mc5-form-grid,.mc5-form-grid.one-line{grid-template-columns:1fr}
  .mc5-topbar{flex-direction:column;align-items:flex-start}
  .mc5-manage-card,.mc5-history-top,.mc5-inline-actions,.mc5-manage-actions{flex-direction:column;align-items:stretch}
  .mc5-set-row{grid-template-columns:auto 1fr}
  .mc5-set-row input[type="number"]{grid-column:1/-1}
}
