/* Bundled locally so the standalone app never depends on Google Fonts or the theme. */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/vazirmatn-arabic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/vazirmatn-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/vazirmatn-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --ew-primary: #0798a3;
  --ew-primary-dark: #087681;
  --ew-primary-soft: #e1f7f7;
  --ew-ink: #132c38;
  --ew-muted: #687d86;
  --ew-bg: #f2f7f8;
  --ew-surface: #fff;
  --ew-border: #dbe7ea;
  --ew-green: #249865;
  --ew-amber: #b77718;
  --ew-rose: #bd4960;
  --ew-violet: #6954c5;
  --ew-shadow: 0 14px 40px rgba(22, 53, 64, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.ew-standalone { margin: 0; color: var(--ew-ink); background: var(--ew-bg); font-family: "Vazirmatn", Tahoma, Arial, sans-serif; font-synthesis: none; line-height: 1.65; }
body.ew-standalone.admin-bar { margin-top: 0; }
body.ew-standalone a { color: inherit; text-decoration: none; }
body.ew-standalone .ew-app, body.ew-standalone .ew-login-shell, body.ew-standalone .ew-modal, body.ew-standalone .ew-drawer { font-family: "Vazirmatn", Tahoma, Arial, sans-serif; }
body.ew-standalone button, body.ew-standalone input, body.ew-standalone select, body.ew-standalone textarea { font: inherit; font-family: "Vazirmatn", Tahoma, Arial, sans-serif; }
body.ew-standalone button { color: inherit; }
.ew-standalone #wpadminbar { display: none !important; }
.ew-icon { width: 1em; height: 1em; display: block; flex: 0 0 auto; overflow: visible; }
.ew-brand { display: inline-flex; align-items: center; gap: 10px; }
.ew-brand > span:last-child { display: flex; flex-direction: column; }
.ew-brand b { font-size: 15px; font-weight: 900; }
.ew-brand small { color: var(--ew-muted); font-size: 10px; }
.ew-brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, #0db3bb, #087a86); color: #fff; font: 900 13px/1 Arial; box-shadow: 0 8px 22px rgba(7, 152, 163, .22); }
.ew-page-kicker, .ew-kicker { color: var(--ew-primary-dark); font-size: 10px; font-weight: 900; letter-spacing: .01em; }
.ew-btn { min-height: 42px; border: 0; border-radius: 11px; padding: 9px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 11px; font-weight: 900; cursor: pointer; transition: .18s ease; }
.ew-btn:hover { transform: translateY(-1px); }
.ew-btn-primary { color: #fff !important; background: linear-gradient(135deg, #0aaab3, #087e8a); box-shadow: 0 8px 20px rgba(7, 152, 163, .18); }
.ew-btn-ghost { background: #fff; border: 1px solid var(--ew-border); color: var(--ew-primary-dark); }
.ew-btn-block { width: 100%; }
.ew-alert { border-radius: 11px; padding: 11px 13px; margin: 13px 0; font-size: 11px; }
.ew-alert-error { background: #fff0f2; color: #a83e53; border: 1px solid #f5cdd5; }
.ew-alert-info { background: #edf7ff; color: #32678d; border: 1px solid #d5e9f7; }
.ew-online-dot { width: 8px; height: 8px; border-radius: 50%; background: #23a66e; box-shadow: 0 0 0 4px rgba(35, 166, 110, .12); flex: 0 0 auto; }
body.is-offline .ew-online-dot { background: #d88822; box-shadow: 0 0 0 4px rgba(216, 136, 34, .12); }

/* Login */
.ew-login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1.15fr) minmax(380px, .85fr); background: #fff; }
.ew-login-visual { position: relative; overflow: hidden; min-height: 100vh; padding: 48px clamp(35px, 5vw, 78px); color: #fff; background: radial-gradient(circle at 20% 20%, rgba(85, 225, 219, .35), transparent 28%), radial-gradient(circle at 85% 80%, rgba(84, 107, 205, .28), transparent 26%), linear-gradient(145deg, #073d4a, #076d76 58%, #063642); display: flex; flex-direction: column; }
.ew-login-visual::before, .ew-login-visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.ew-login-visual::before { width: 430px; height: 430px; left: -170px; top: 25%; }
.ew-login-visual::after { width: 520px; height: 520px; right: -230px; bottom: -240px; }
.ew-brand-light { position: relative; z-index: 1; }
.ew-brand-light small { color: rgba(255,255,255,.65); }
.ew-brand-light .ew-brand-mark { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.2); box-shadow: none; backdrop-filter: blur(10px); }
.ew-login-message { position: relative; z-index: 1; margin: auto 0; max-width: 650px; }
.ew-login-message .ew-kicker { color: #91ece9; }
.ew-login-message h1 { margin: 18px 0 15px; font-size: clamp(34px, 4vw, 58px); line-height: 1.25; letter-spacing: -.03em; }
.ew-login-message p { max-width: 590px; color: rgba(255,255,255,.76); font-size: 14px; }
.ew-login-message ul { list-style: none; margin: 27px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 9px; }
.ew-login-message li { border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); border-radius: 999px; padding: 7px 12px; font-size: 10px; backdrop-filter: blur(8px); }
.ew-login-message li::before { content: "✓"; color: #79e0d5; margin-left: 6px; }
.ew-login-security { position: relative; z-index: 1; color: rgba(255,255,255,.64); font-size: 10px; }
.ew-login-security span { color: #62d5c7; }
.ew-login-panel { display: grid; place-items: center; padding: 48px clamp(26px, 6vw, 90px); background: radial-gradient(circle at 100% 0, #e8f7f8, transparent 35%), #fff; }
.ew-login-card { width: min(100%, 440px); }
.ew-login-card h2 { margin: 5px 0 4px; font-size: 29px; }
.ew-login-card > p { margin: 0 0 23px; color: var(--ew-muted); font-size: 11px; }
.ew-mobile-brand { display: none; align-items: center; gap: 9px; margin-bottom: 28px; }
.ew-login-form { display: grid; gap: 15px; }
.ew-login-form label:not(.ew-remember) { display: grid; gap: 6px; }
.ew-login-form label > span:first-child { font-size: 10px; font-weight: 850; }
.ew-login-form input[type=text], .ew-login-form input[type=password] { width: 100%; height: 48px; border: 1px solid var(--ew-border); border-radius: 11px; background: #fbfdfd; padding: 0 13px; outline: none; }
.ew-login-form input:focus { border-color: #6fc8cb; box-shadow: 0 0 0 4px rgba(7, 152, 163, .09); background: #fff; }
.ew-password-field { position: relative; display: block; }
.ew-password-field button { position: absolute; left: 7px; top: 7px; height: 34px; border: 0; border-radius: 8px; background: #edf6f7; color: var(--ew-primary-dark); font-size: 9px; cursor: pointer; }
.ew-remember { display: flex; align-items: center; gap: 7px; color: var(--ew-muted); font-size: 10px; }
.ew-remember input { accent-color: var(--ew-primary); }
.ew-login-help { border-top: 1px solid var(--ew-border); color: var(--ew-muted); text-align: center; font-size: 9px; margin-top: 25px; padding-top: 17px; }

/* App shell */
.ew-app { min-height: 100vh; isolation: isolate; font-size: 14px; font-weight: 400; text-align: right; direction: rtl; }
.ew-sidebar { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: 244px; display: flex; flex-direction: column; background: rgba(255,255,255,.96); border-left: 1px solid var(--ew-border); box-shadow: -5px 0 24px rgba(23, 55, 66, .03); backdrop-filter: blur(18px); }
.ew-app-brand { min-height: 82px; padding: 17px 22px; border-bottom: 1px solid #edf2f3; }
.ew-app-nav { padding: 16px 11px; display: grid; gap: 4px; overflow-y: auto; }
.ew-app-nav a, .ew-app-nav button, .ew-sidebar-foot > a { width: 100%; min-height: 45px; border: 0; border-radius: 11px; padding: 8px 12px; background: transparent; color: #566d76; display: flex; align-items: center; gap: 11px; font-size: 12px !important; line-height: 1.65; cursor: pointer; }
.ew-app-nav a:hover, .ew-app-nav button:hover, .ew-app-nav .is-active { color: var(--ew-primary-dark); background: linear-gradient(90deg, #e7f7f8, #f3fbfb); }
.ew-app-nav i, .ew-sidebar-foot i { width: 25px; height: 25px; display: grid; place-items: center; font-style: normal; font-size: 18px; }
.ew-app-nav i .ew-icon, .ew-sidebar-foot i .ew-icon { width: 18px; height: 18px; }
.ew-app-nav span, .ew-sidebar-foot > a span { font-size: inherit !important; font-weight: 750; line-height: inherit; }
.ew-sidebar-foot { margin-top: auto; padding: 12px; border-top: 1px solid #edf2f3; }
.ew-sync-card { min-height: 58px; border-radius: 12px; background: #f3f8f8; padding: 10px; display: flex; align-items: center; gap: 10px; }
.ew-sync-card > div { display: flex; flex-direction: column; }
.ew-sync-card b { font-size: 9px; }
.ew-sync-card small { color: var(--ew-muted); font-size: 8px; }
.ew-app-topbar { position: fixed; z-index: 60; top: 0; right: 244px; left: 0; height: 74px; padding: 0 24px; background: rgba(255,255,255,.9); border-bottom: 1px solid rgba(219,231,234,.9); display: flex; align-items: center; gap: 18px; backdrop-filter: blur(18px); }
.ew-mobile-menu { display: none !important; }
.ew-app-search { width: min(520px, 50vw); height: 44px; border: 1px solid var(--ew-border); border-radius: 12px; background: #f7fafa; display: flex; align-items: center; padding: 0 11px; }
.ew-app-search span { color: #7f939b; font-size: 20px; }
.ew-app-search .ew-icon { width: 19px; height: 19px; }
.ew-app-search input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; padding: 0 9px; font-size: 10px; }
.ew-top-actions { position: relative; margin-right: auto; display: flex; align-items: center; gap: 9px; }
.ew-connection-pill { height: 36px; border: 1px solid var(--ew-border); border-radius: 999px; background: #fff; padding: 0 12px; display: flex; align-items: center; gap: 8px; }
.ew-connection-pill b { font-size: 9px; }
.ew-top-new { min-height: 39px; }
.ew-icon-btn { width: 40px; height: 40px; border: 1px solid var(--ew-border); border-radius: 11px; background: #fff; display: grid; place-items: center; cursor: pointer; }
.ew-icon-btn .ew-icon { width: 20px; height: 20px; }
.ew-user-menu { min-width: 150px; height: 48px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ew-avatar { width: 39px; height: 39px; border-radius: 12px; background: linear-gradient(145deg, #daf3f3, #edfafa); color: var(--ew-primary-dark); display: grid; place-items: center; font-size: 12px; font-weight: 900; flex: 0 0 auto; }
.ew-user-menu > span:nth-child(2) { display: flex; flex-direction: column; text-align: right; }
.ew-user-menu b { font-size: 10px; }
.ew-user-menu small { color: var(--ew-muted); font-size: 8px; }
.ew-user-menu i { margin-right: auto; font-style: normal; }
.ew-user-menu i .ew-icon { width: 16px; height: 16px; }
.ew-profile-menu { position: absolute; left: 0; top: 58px; width: 220px; border: 1px solid var(--ew-border); border-radius: 13px; background: #fff; box-shadow: var(--ew-shadow); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-7px); transition: .18s; }
.ew-profile-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.ew-profile-menu > span { display: block; padding: 8px; border-bottom: 1px solid #edf2f3; color: var(--ew-muted); font-size: 9px; direction: ltr; text-align: left; overflow: hidden; text-overflow: ellipsis; }
.ew-profile-menu a { display: block; border-radius: 8px; padding: 8px; font-size: 10px; }
.ew-profile-menu a:hover { background: #f3f8f8; }
.ew-app-main { margin-right: 244px; padding: 102px 24px 70px; min-height: 100vh; }
.ew-welcome-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; scroll-margin-top: 95px; }
.ew-welcome-row h1 { margin: 3px 0; font-size: 25px; line-height: 1.35; }
.ew-welcome-row p { margin: 0; color: var(--ew-muted); font-size: 10px; }
.ew-live-badge { border: 1px solid #d4e7e1; border-radius: 999px; background: rgba(255,255,255,.8); padding: 7px 12px; display: flex; align-items: center; gap: 9px; color: #39725b; font-size: 9px; }
.ew-toast { position: fixed; z-index: 150; top: 88px; left: 24px; width: min(420px, calc(100vw - 28px)); min-height: 48px; border-radius: 13px; box-shadow: var(--ew-shadow); padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 10px; animation: ew-slide-in .24s ease; }
.ew-toast-success { background: #effaf4; border: 1px solid #cae8d8; color: #267452; }
.ew-toast-error { background: #fff0f2; border: 1px solid #f3cbd4; color: #a33d52; }
.ew-toast button { border: 0; background: transparent; font-size: 20px; cursor: pointer; }
@keyframes ew-slide-in { from { opacity: 0; transform: translateY(-8px); } }

/* Dashboard and flow */
.ew-stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 27px; }
.ew-stat-grid article { min-height: 88px; border: 1px solid var(--ew-border); border-radius: 15px; background: rgba(255,255,255,.88); box-shadow: 0 7px 23px rgba(23,55,66,.035); padding: 15px; display: flex; align-items: center; gap: 12px; }
.ew-stat-grid article > i { width: 43px; height: 43px; border-radius: 12px; display: grid; place-items: center; font-style: normal; font-size: 18px; flex: 0 0 auto; }
.ew-stat-grid article > i .ew-icon { width: 21px; height: 21px; }
.is-teal { color: #087e83 !important; background: #dff5f4 !important; }
.is-violet { color: var(--ew-violet) !important; background: #eeeafd !important; }
.is-amber { color: var(--ew-amber) !important; background: #fff3d8 !important; }
.is-green { color: var(--ew-green) !important; background: #e4f6ed !important; }
.is-sky { color: #347bbb !important; background: #e6f3ff !important; }
.ew-stat-grid article > div { min-width: 0; display: flex; flex-direction: column; }
.ew-stat-grid small { color: var(--ew-muted); font-size: 9px; }
.ew-stat-grid b { font-size: 24px; line-height: 1.2; }
.ew-stat-grid span { color: #738790; font-size: 8px; }
.ew-operations, .ew-panel, .ew-customer-orders { scroll-margin-top: 92px; }
.ew-section-title { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.ew-section-title > div:first-child > span, .ew-panel-heading span { color: var(--ew-primary-dark); font-size: 8px; font-weight: 900; }
.ew-section-title h2, .ew-panel-heading h2 { margin: 1px 0; font-size: 19px; }
.ew-section-title p { margin: 0; color: var(--ew-muted); font-size: 9px; }
.ew-filter-group { border: 1px solid var(--ew-border); border-radius: 10px; background: #fff; padding: 3px; display: flex; gap: 2px; }
.ew-filter-group button { min-height: 31px; border: 0; border-radius: 7px; background: transparent; padding: 5px 11px; color: var(--ew-muted); font-size: 9px; cursor: pointer; white-space: nowrap; }
.ew-filter-group .is-active { background: var(--ew-primary-soft); color: var(--ew-primary-dark); font-weight: 900; }
.ew-flow-board { display: grid; grid-template-columns: repeat(4, minmax(245px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.ew-flow-column { min-height: 470px; border: 1px solid var(--ew-border); border-radius: 15px; background: rgba(237,244,245,.78); overflow: hidden; scroll-margin-top: 92px; }
.ew-flow-column > header { height: 48px; border-bottom: 1px solid var(--ew-border); background: rgba(255,255,255,.66); padding: 0 12px; display: flex; align-items: center; justify-content: space-between; font-size: 10px; font-weight: 900; }
.ew-flow-column > header > span { display: flex; align-items: center; gap: 7px; }
.ew-flow-column > header i { width: 9px; height: 9px; border-radius: 50%; padding: 0; }
.ew-flow-column > header > b { min-width: 24px; height: 22px; border-radius: 999px; background: #fff; display: grid; place-items: center; font-size: 9px; }
.ew-flow-column-body { padding: 9px; display: grid; align-content: start; gap: 8px; }
.ew-column-empty { border: 1px dashed #c8d8dc; border-radius: 11px; color: #84979e; padding: 25px 10px; text-align: center; font-size: 9px; }
.ew-order-card { border: 1px solid #dce7e9; border-radius: 13px; background: #fff; box-shadow: 0 5px 15px rgba(16,42,54,.045); padding: 13px; cursor: pointer; outline: none; transition: .18s; }
.ew-order-card:hover, .ew-order-card:focus { border-color: #7ccac8; box-shadow: 0 10px 25px rgba(16,42,54,.08); transform: translateY(-1px); }
.ew-order-card[hidden] { display: none !important; }
.ew-order-top, .ew-order-meta, .ew-order-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ew-order-top small { font: 700 9px/1 "Vazirmatn", Arial, sans-serif; color: #7b8d95; }
.ew-status { display: inline-flex; border-radius: 999px; padding: 4px 7px; font-size: 8px; white-space: nowrap; }
.ew-status.is-received { background: #e7f2ff; color: #3977ad; }
.ew-status.is-diagnosing, .ew-status.is-repairing { background: #eeeafd; color: var(--ew-violet); }
.ew-status.is-waiting_parts, .ew-status.is-waiting_customer, .ew-status.is-waiting_finance { background: #fff3d8; color: var(--ew-amber); }
.ew-status.is-quality_control, .ew-status.is-ready, .ew-status.is-delivered { background: #e4f6ed; color: var(--ew-green); }
.ew-status.is-cancelled { background: #ffebef; color: var(--ew-rose); }
.ew-order-card h3 { margin: 10px 0 4px; font-size: 13px; }
.ew-order-card p { min-height: 35px; margin: 0 0 11px; color: #60747d; font-size: 9px; }
.ew-order-meta { border-top: 1px dashed #e1eaec; padding-top: 8px; color: #71858e; font-size: 8px; }
.ew-order-card footer { justify-content: flex-start; margin-top: 9px; color: #82949c; font-size: 8px; }
.ew-order-card footer time { margin-right: auto; font-size: 7px; }
.ew-avatar-small { width: 26px; height: 26px; border-radius: 8px; font-size: 9px; }
.ew-empty { min-height: 330px; border: 1px dashed #bfd1d5; border-radius: 16px; background: rgba(255,255,255,.65); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; text-align: center; }
.ew-empty i { width: 56px; height: 56px; border-radius: 18px; background: var(--ew-primary-soft); color: var(--ew-primary-dark); display: grid; place-items: center; font-size: 24px; font-style: normal; }
.ew-empty i .ew-icon { width: 26px; height: 26px; }
.ew-empty h3 { margin: 13px 0 2px; }
.ew-empty p { max-width: 430px; margin: 0 0 16px; color: var(--ew-muted); font-size: 10px; }
.ew-empty-compact { min-height: 120px; }

/* Customer portal */
.ew-customer-stats { grid-template-columns: repeat(3, 1fr); }
.ew-customer-orders { display: grid; gap: 12px; margin-bottom: 22px; }
.ew-customer-order, .ew-panel { border: 1px solid var(--ew-border); border-radius: 16px; background: #fff; box-shadow: 0 7px 23px rgba(23,55,66,.035); padding: 18px; }
.ew-customer-order { cursor: pointer; }
.ew-customer-order > header, .ew-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #e9eff1; padding-bottom: 12px; }
.ew-customer-order header span:first-child { color: var(--ew-muted); font: 700 9px/1 "Vazirmatn", Arial, sans-serif; }
.ew-customer-order h3 { margin: 5px 0 0; font-size: 17px; }
.ew-customer-order > p { color: #5f747d; font-size: 10px; }
.ew-order-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.ew-order-facts span { border-radius: 9px; background: #f4f8f8; padding: 9px; color: var(--ew-muted); font-size: 8px; }
.ew-order-facts b { color: var(--ew-ink); }
.ew-history-list { display: grid; }
.ew-history-list button { min-height: 62px; border: 0; border-bottom: 1px solid #edf2f3; background: transparent; display: flex; align-items: center; gap: 11px; text-align: right; cursor: pointer; }
.ew-history-list button:last-child { border-bottom: 0; }
.ew-history-list i { width: 32px; height: 32px; border-radius: 9px; background: #e4f6ed; color: var(--ew-green); display: grid; place-items: center; font-style: normal; }
.ew-history-list i .ew-icon { width: 17px; height: 17px; }
.ew-history-list span { display: flex; flex: 1; flex-direction: column; }
.ew-history-list b { font-size: 10px; }
.ew-history-list small { color: var(--ew-muted); font-size: 8px; }
.ew-history-list strong { font-size: 9px; }

/* Modal, forms and drawer */
.ew-modal { position: fixed; z-index: 130; inset: 0; padding: 20px; display: grid; place-items: center; background: rgba(10,35,43,.42); backdrop-filter: blur(4px); opacity: 0; visibility: hidden; transition: .2s; }
.ew-modal.is-open { opacity: 1; visibility: visible; }
.ew-modal-card { width: min(920px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; background: #f8fbfb; box-shadow: 0 30px 80px rgba(6,32,39,.25); transform: translateY(15px); transition: .2s; }
.ew-modal.is-open .ew-modal-card { transform: none; }
.ew-modal-card > header { position: sticky; z-index: 2; top: 0; min-height: 91px; border-bottom: 1px solid var(--ew-border); background: rgba(255,255,255,.93); padding: 17px 21px; display: flex; align-items: center; justify-content: space-between; backdrop-filter: blur(16px); }
.ew-modal-card > header h2 { margin: 2px 0; font-size: 21px; }
.ew-modal-card > header p { margin: 0; color: var(--ew-muted); font-size: 9px; }
.ew-modal-card > header button { width: 39px; height: 39px; border: 1px solid var(--ew-border); border-radius: 11px; background: #fff; font-size: 22px; cursor: pointer; }
.ew-modal form { padding: 18px 21px; }
.ew-form-section { border: 1px solid var(--ew-border); border-radius: 14px; background: #fff; padding: 15px; margin-bottom: 12px; }
.ew-form-section h3 { margin: 0 0 12px; font-size: 12px; }
.ew-form-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.ew-modal label, .ew-inline-form label, .ew-note-form label { display: grid; gap: 5px; }
.ew-modal label > span, .ew-inline-form label > span, .ew-note-form label > span { color: #4f6770; font-size: 9px; font-weight: 850; }
.ew-modal input, .ew-modal select, .ew-modal textarea, .ew-inline-form select, .ew-note-form textarea { width: 100%; min-height: 42px; border: 1px solid var(--ew-border); border-radius: 9px; background: #fbfdfd; padding: 8px 10px; outline: 0; font-size: 10px; }
.ew-modal textarea, .ew-note-form textarea { resize: vertical; }
.ew-modal input:focus, .ew-modal select:focus, .ew-modal textarea:focus, .ew-inline-form select:focus, .ew-note-form textarea:focus { border-color: #72c9cc; box-shadow: 0 0 0 4px rgba(7,152,163,.08); background: #fff; }
.ew-optional { border: 1px solid var(--ew-border); border-radius: 14px; background: #fff; padding: 0 15px; }
.ew-optional summary { padding: 14px 0; color: var(--ew-primary-dark); font-size: 10px; font-weight: 900; cursor: pointer; }
.ew-optional .ew-form-grid { padding-bottom: 15px; }
.ew-grid-full { grid-column: 1 / -1; }
.ew-modal form > footer { position: sticky; bottom: -18px; margin: 18px -21px -18px; border-top: 1px solid var(--ew-border); background: rgba(255,255,255,.93); padding: 12px 21px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; backdrop-filter: blur(15px); }
.ew-modal form > footer [data-draft-status] { margin-left: auto; color: var(--ew-muted); font-size: 8px; }
.ew-drawer { position: fixed; z-index: 120; top: 0; bottom: 0; left: 0; width: min(560px, 94vw); overflow-y: auto; background: #fff; box-shadow: 20px 0 70px rgba(5,36,43,.2); padding: 32px; transform: translateX(-105%); transition: .27s ease; }
.ew-drawer.is-open { transform: none; }
.ew-drawer-close { position: absolute; top: 17px; left: 17px; width: 38px; height: 38px; border: 1px solid var(--ew-border); border-radius: 11px; background: #fff; font-size: 22px; cursor: pointer; }
.ew-detail > h2 { margin: 5px 0 2px; font-size: 25px; }
.ew-detail-code { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.ew-detail-code > b { font: 800 11px/1 "Vazirmatn", Arial, sans-serif; color: var(--ew-muted); }
.ew-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ew-detail-grid > div { min-height: 64px; border-radius: 10px; background: #f4f8f8; padding: 10px; display: flex; flex-direction: column; }
.ew-detail-grid small { color: var(--ew-muted); font-size: 8px; }
.ew-detail-grid b { font-size: 10px; }
.ew-detail-section { margin-top: 20px; }
.ew-detail-section h3 { margin: 0 0 8px; font-size: 12px; }
.ew-detail-section > p { border: 1px solid var(--ew-border); border-radius: 10px; background: #fbfdfd; padding: 12px; color: #526a74; font-size: 10px; }
.ew-inline-form { margin-top: 18px; border: 1px solid var(--ew-border); border-radius: 12px; background: #f8fbfb; padding: 12px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.ew-timeline { position: relative; display: grid; gap: 14px; }
.ew-timeline::before { content: ""; position: absolute; right: 14px; top: 18px; bottom: 18px; width: 1px; background: #d7e5e7; }
.ew-timeline > div { position: relative; display: flex; gap: 10px; }
.ew-timeline i { z-index: 1; width: 29px; height: 29px; border-radius: 50%; background: var(--ew-primary-soft); color: var(--ew-primary-dark); display: grid; place-items: center; font-style: normal; flex: 0 0 auto; }
.ew-timeline i .ew-icon { width: 15px; height: 15px; }
.ew-timeline span { min-height: 45px; display: flex; flex-direction: column; }
.ew-timeline b { font-size: 10px; }
.ew-timeline small { color: var(--ew-muted); font-size: 8px; }
.ew-muted { color: var(--ew-muted); font-size: 9px; }
.ew-note-form { margin-top: 21px; border-top: 1px solid var(--ew-border); padding-top: 16px; display: grid; gap: 9px; }
.ew-note-form button { justify-self: start; }
.ew-overlay { position: fixed; z-index: 110; inset: 0; background: rgba(6,32,39,.32); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: .2s; }
.ew-overlay.is-open { opacity: 1; visibility: visible; }
.ew-bottom-nav { display: none; }
body.ew-layer-open { overflow: hidden; }

@media (max-width: 1180px) {
  .ew-sidebar { width: 216px; }
  .ew-app-topbar { right: 216px; }
  .ew-app-main { margin-right: 216px; padding-inline: 18px; }
  .ew-flow-board { grid-template-columns: repeat(4, minmax(235px, 1fr)); }
  .ew-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .ew-form-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 800px) {
  .ew-login-shell { grid-template-columns: 1fr; }
  .ew-login-visual { display: none; }
  .ew-login-panel { min-height: 100vh; padding: 35px 22px; }
  .ew-mobile-brand { display: flex; }
  .ew-login-card h2 { font-size: 25px; }
  .ew-sidebar { width: 276px; z-index: 140; transform: translateX(105%); transition: .25s; }
  .ew-sidebar.is-open { transform: none; }
  .ew-app-topbar { right: 0; height: 64px; padding: 0 12px; gap: 8px; }
  .ew-mobile-menu { display: grid !important; flex: 0 0 auto; }
  .ew-app-search { width: auto; flex: 1; height: 40px; }
  .ew-app-search input { font-size: 9px; }
  .ew-connection-pill, .ew-top-new, .ew-user-menu > span:nth-child(2), .ew-user-menu > i { display: none; }
  .ew-user-menu { min-width: 40px; width: 40px; }
  .ew-user-menu .ew-avatar { width: 38px; height: 38px; }
  .ew-profile-menu { top: 50px; }
  .ew-app-main { margin-right: 0; padding: 84px 12px 94px; }
  .ew-welcome-row { align-items: flex-start; flex-direction: column; }
  .ew-live-badge { display: none; }
  .ew-welcome-row h1 { font-size: 21px; }
  .ew-stat-grid, .ew-customer-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ew-stat-grid article { min-height: 79px; padding: 11px; }
  .ew-stat-grid b { font-size: 19px; }
  .ew-section-title { align-items: flex-start; flex-direction: column; }
  .ew-filter-group { width: 100%; overflow-x: auto; }
  .ew-flow-board { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(235px, 78vw); margin-left: -12px; padding-left: 12px; scroll-snap-type: x proximity; }
  .ew-flow-column { min-height: 420px; scroll-snap-align: start; }
  .ew-bottom-nav { position: fixed; z-index: 80; right: 8px; left: 8px; bottom: max(7px, env(safe-area-inset-bottom)); min-height: 64px; border: 1px solid rgba(217,229,232,.92); border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: 0 14px 40px rgba(16,42,54,.17); backdrop-filter: blur(15px); display: flex; align-items: center; justify-content: space-around; padding: 4px; }
	  .ew-bottom-nav a, .ew-bottom-nav button { min-width: 54px; border: 0; background: transparent; color: #778b93; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 8px; }
	  .ew-bottom-nav i { font-style: normal; font-size: 17px; }
	  .ew-bottom-nav i .ew-icon { width: 19px; height: 19px; }
  .ew-bottom-nav .is-active { color: var(--ew-primary-dark); }
  .ew-modal { padding: 0; align-items: end; }
  .ew-modal-card { max-height: 94vh; border-radius: 20px 20px 0 0; }
  .ew-form-grid { grid-template-columns: 1fr 1fr; }
  .ew-drawer { width: 100%; padding: 28px 17px 90px; }
  .ew-detail-grid { grid-template-columns: 1fr 1fr; }
  .ew-order-facts { grid-template-columns: 1fr; }
  .ew-toast { top: 74px; left: 14px; }
  .ew-overlay.menu-open { z-index: 130; }
}

@media (max-width: 460px) {
  .ew-top-actions .ew-user-menu { display: none; }
  .ew-stat-grid, .ew-customer-stats { grid-template-columns: 1fr; }
  .ew-form-grid, .ew-detail-grid { grid-template-columns: 1fr; }
  .ew-grid-full { grid-column: auto; }
  .ew-modal-card > header { padding: 14px; }
  .ew-modal form { padding: 12px; }
  .ew-modal form > footer { margin-inline: -12px; padding-inline: 12px; }
  .ew-inline-form { grid-template-columns: 1fr; }
  .ew-history-list strong { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Easy Workshop 0.2: technician, checklist and order media */
.ew-drawer { width: min(760px, 96vw); }
.ew-detail-v2 { padding-bottom: 40px; }
.ew-detail-hero { padding-left: 48px; }
.ew-detail-quicknav { position: sticky; z-index: 3; top: -32px; margin: 16px -32px 0; border-block: 1px solid var(--ew-border); background: rgba(255,255,255,.94); padding: 8px 32px; display: flex; gap: 6px; overflow-x: auto; backdrop-filter: blur(15px); }
.ew-detail-quicknav a { min-height: 34px; border-radius: 9px; background: #f2f7f7; padding: 7px 11px; color: #536b74; font-size: 9px; font-weight: 850; white-space: nowrap; }
.ew-detail-summary, .ew-module-card { scroll-margin-top: 64px; }
.ew-detail-summary > h3 { margin-top: 18px; }
.ew-card-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin: 17px 0; }
.ew-card-actions .ew-inline-form { margin: 0; }
.ew-claim-form { grid-column: 1 / -1; border: 1px solid #cae7e4; border-radius: 12px; background: #effaf9; padding: 12px; }
.ew-module-card { border: 1px solid var(--ew-border); border-radius: 15px; background: #fbfdfd; padding: 15px; }
.ew-module-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid #e7eff1; padding-bottom: 11px; margin-bottom: 12px; }
.ew-module-heading > div { display: grid; }
.ew-module-heading span { color: var(--ew-primary-dark); font-size: 8px; font-weight: 900; }
.ew-module-heading h3 { margin: 2px 0 0; font-size: 14px; }
.ew-module-heading > b { border-radius: 999px; background: #edf5f5; padding: 6px 9px; color: #5e747d; font-size: 8px; white-space: nowrap; }
.ew-module-empty { border: 1px dashed #cbdadd !important; background: #fff !important; color: var(--ew-muted) !important; text-align: center; }
.ew-report-list { display: grid; gap: 9px; }
.ew-tech-report { border: 1px solid #dfeaec; border-radius: 12px; background: #fff; padding: 12px; }
.ew-tech-report header { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #e2eaec; padding-bottom: 8px; margin-bottom: 9px; }
.ew-tech-report header b { font-size: 10px; }
.ew-tech-report time { color: var(--ew-muted); font-size: 8px; }
.ew-tech-report div { margin-top: 8px; }
.ew-tech-report div small { color: var(--ew-primary-dark); font-size: 8px; font-weight: 900; }
.ew-tech-report div p { margin: 3px 0 0; color: #536a74; font-size: 10px; line-height: 1.8; }
.ew-tech-report footer { margin-top: 9px; color: var(--ew-muted); font-size: 8px; }
.ew-structured-form, .ew-media-form { margin-top: 13px; border: 1px solid #d9e8ea; border-radius: 12px; background: #fff; padding: 13px; display: grid; gap: 10px; }
.ew-form-two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.ew-structured-form label, .ew-media-form label { display: grid; gap: 5px; }
.ew-structured-form label > span, .ew-media-form label > span { color: #4f6770; font-size: 9px; font-weight: 850; }
.ew-structured-form input, .ew-structured-form textarea, .ew-media-form input, .ew-media-form select { width: 100%; min-height: 42px; border: 1px solid var(--ew-border); border-radius: 9px; background: #fbfdfd; padding: 8px 10px; outline: 0; font-size: 10px; }
.ew-structured-form textarea { resize: vertical; }
.ew-checklist-state.is-completed { background: #e4f6ed; color: var(--ew-green); }
.ew-checklist-state.is-draft, .ew-checklist-state.is-new { background: #fff3d8; color: var(--ew-amber); }
.ew-checklist-form { display: grid; gap: 11px; }
.ew-checklist-form fieldset { min-width: 0; margin: 0; border: 1px solid #dfeaec; border-radius: 12px; background: #fff; padding: 10px; }
.ew-checklist-form legend { padding: 0 7px; color: #385963; font-size: 10px; font-weight: 900; }
.ew-check-item { display: grid; grid-template-columns: minmax(150px,1.3fr) minmax(110px,.7fr) minmax(150px,1fr); align-items: center; gap: 8px; border-bottom: 1px solid #edf2f3; padding: 8px 0; }
.ew-check-item:last-child { border-bottom: 0; }
.ew-check-item > div { display: flex; align-items: center; gap: 7px; }
.ew-check-item b { font-size: 9px; }
.ew-check-item small { border-radius: 999px; background: #fff0df; padding: 3px 6px; color: #a76819; font-size: 7px; }
.ew-check-item select, .ew-check-item input { width: 100%; min-height: 38px; border: 1px solid var(--ew-border); border-radius: 8px; background: #fbfdfd; padding: 6px 8px; font-size: 9px; }
.ew-checklist-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ew-checklist-readonly h4 { margin: 13px 0 5px; color: #3b5c65; font-size: 10px; }
.ew-checklist-readonly > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; border-bottom: 1px solid #e9f0f1; padding: 8px 0; font-size: 9px; }
.ew-checklist-readonly > div b { border-radius: 999px; padding: 3px 7px; font-size: 8px; }
.ew-checklist-readonly > div b.is-ok { background: #e4f6ed; color: var(--ew-green); }
.ew-checklist-readonly > div b.is-attention { background: #fff0df; color: #a76819; }
.ew-checklist-readonly > div b.is-not_checked { background: #eef3f4; color: #71868e; }
.ew-checklist-readonly > div small { grid-column: 1 / -1; color: var(--ew-muted); }
.ew-media-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
.ew-media-grid figure { position: relative; margin: 0; overflow: hidden; border: 1px solid #dce8ea; border-radius: 11px; background: #fff; }
.ew-media-grid figure > a { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #edf3f4; }
.ew-media-grid img { width: 100%; height: 100%; object-fit: cover; transition: .18s; }
.ew-media-grid a:hover img { transform: scale(1.025); }
.ew-media-grid figcaption { padding: 8px; display: grid; gap: 2px; }
.ew-media-grid figcaption b { font-size: 8px; }
.ew-media-grid figcaption small, .ew-media-grid figcaption em { overflow: hidden; color: var(--ew-muted); font-size: 7px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.ew-media-grid figcaption em { color: var(--ew-primary-dark); }
.ew-media-grid figure > form { position: absolute; top: 5px; left: 5px; }
.ew-media-grid figure > form button { width: 28px; height: 28px; border: 1px solid rgba(255,255,255,.8); border-radius: 9px; background: rgba(22,38,44,.7); color: #fff; font-size: 18px; cursor: pointer; }
.ew-file-picker { min-height: 82px; border: 1px dashed #8fcfd0; border-radius: 11px; background: #f0fafa; padding: 13px; place-items: center; text-align: center; cursor: pointer; }
.ew-file-picker span { color: var(--ew-primary-dark) !important; font-size: 10px !important; display: inline-flex; align-items: center; gap: 7px; }
.ew-file-picker span .ew-icon { width: 19px; height: 19px; }
.ew-file-picker small { color: var(--ew-muted); font-size: 8px; }
.ew-file-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ew-photo-preview { display: flex; gap: 6px; overflow-x: auto; }
.ew-photo-preview span { width: 82px; flex: 0 0 82px; overflow: hidden; color: var(--ew-muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.ew-photo-preview img { width: 82px; height: 62px; border-radius: 8px; object-fit: cover; display: block; margin-bottom: 3px; }

@media (max-width: 800px) {
  .ew-drawer { width: 100%; }
  .ew-detail-quicknav { top: -28px; margin-inline: -17px; padding-inline: 17px; }
  .ew-card-actions { grid-template-columns: 1fr; }
  .ew-check-item { grid-template-columns: 1fr 1fr; }
  .ew-check-item > div { grid-column: 1 / -1; }
  .ew-check-item input { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .ew-form-two { grid-template-columns: 1fr; }
  .ew-media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-checklist-actions { align-items: stretch; flex-direction: column; }
}

/* 0.8 central dashboard */
.ew-management-dashboard { margin:0 0 18px; scroll-margin-top:80px; }
.ew-management-heading { align-items:flex-start; }
.ew-dashboard-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px; }
.ew-dashboard-range { display:flex; align-items:center; gap:5px; }
.ew-dashboard-range select,.ew-dashboard-range input { min-height:34px; border:1px solid #d9e6e8; border-radius:8px; background:#fff; padding:5px 7px; font:inherit; font-size:7px; }
.ew-dashboard-customizer { margin:0 0 10px; border:1px solid #dce9ea; border-radius:13px; background:#f7fbfb; padding:10px; }
.ew-dashboard-customizer > b,.ew-dashboard-customizer > small { display:block; }
.ew-dashboard-customizer > b { font-size:9px; }
.ew-dashboard-customizer > small { margin-top:2px; color:var(--ew-muted); font-size:6px; }
.ew-dashboard-customizer > div { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.ew-dashboard-customizer label { display:flex; align-items:center; gap:4px; border:1px solid #dce8e9; border-radius:999px; background:#fff; padding:5px 8px; font-size:6.5px; cursor:pointer; }
.ew-management-dashboard .ew-management-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.ew-dashboard-widget { min-width:0; border:1px solid #dce7e9; border-radius:14px; background:#fff; box-shadow:0 6px 22px rgba(19,55,65,.05); padding:11px; cursor:grab; }
.ew-dashboard-widget.is-dragging { opacity:.45; outline:2px dashed var(--ew-primary); }
.ew-dashboard-widget.is-wide { grid-column:span 2; }
.ew-dashboard-widget > header { display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:1px solid #edf2f3; padding-bottom:8px; }
.ew-dashboard-widget > header > span { display:flex; align-items:center; gap:6px; }
.ew-dashboard-widget > header .ew-icon { width:17px; color:var(--ew-primary); }
.ew-dashboard-widget > header b { font-size:8.5px; }
.ew-dashboard-widget > header small { color:var(--ew-muted); font-size:6px; }
.ew-dashboard-widget > a { display:inline-block; margin-top:8px; color:var(--ew-primary-dark); font-size:6.5px; font-weight:850; }
.ew-dashboard-kpis { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-top:8px; }
.ew-dashboard-kpis div { border-radius:9px; background:#f3f8f8; padding:8px; }
.ew-dashboard-kpis small,.ew-dashboard-kpis b { display:block; }
.ew-dashboard-kpis small { color:var(--ew-muted); font-size:6px; }
.ew-dashboard-kpis b { margin-top:3px; color:#20545d; font-size:9px; }
.ew-dashboard-list { margin:7px 0 0; }
.ew-dashboard-list div { display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:1px solid #edf2f3; padding:7px 0; }
.ew-dashboard-list dt { color:var(--ew-muted); font-size:6.5px; }
.ew-dashboard-list dd { margin:0; color:#244e57; font-size:8px; font-weight:900; }
.ew-dashboard-list .is-warning,.ew-dashboard-table .is-warning { color:#b36b16; }
.ew-dashboard-chart { height:125px; display:flex; align-items:flex-end; gap:3px; overflow-x:auto; padding-top:10px; }
.ew-dashboard-chart > div { flex:1 0 17px; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:3px; }
.ew-dashboard-chart i { width:72%; min-height:3px; border-radius:4px 4px 1px 1px; background:linear-gradient(180deg,#28aaa4,#0e8583); }
.ew-dashboard-chart small { color:var(--ew-muted); font-size:5px; writing-mode:vertical-rl; }
.ew-dashboard-table { margin-top:6px; }
.ew-dashboard-table > div { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:8px; border-bottom:1px solid #edf2f3; padding:6px 0; }
.ew-dashboard-table span b,.ew-dashboard-table span small { display:block; }
.ew-dashboard-table span b { font-size:7px; }
.ew-dashboard-table span small { color:var(--ew-muted); font-size:5.5px; }
.ew-dashboard-table strong,.ew-dashboard-table em { font-size:6.5px; font-style:normal; }

/* 0.8 unified persons */
.ew-persons-workspace { margin:22px 0 50px; scroll-margin-top:75px; }
.ew-created-portal { margin:0 0 12px; border:1px solid #9fdcd3; border-radius:14px; background:#eaf9f5; padding:12px; }
.ew-created-portal > div { display:flex; align-items:center; gap:8px; }
.ew-created-portal > div + div { margin-top:9px; }
.ew-created-portal .ew-icon { width:21px; color:var(--ew-primary); }
.ew-created-portal span b,.ew-created-portal span small { display:block; }
.ew-created-portal span b { font-size:9px; }
.ew-created-portal span small { color:#57766f; font-size:6px; }
.ew-created-portal input { flex:1; min-width:0; direction:ltr; border:1px solid #b5ded7; border-radius:8px; background:#fff; padding:8px; font:600 7px/1.5 monospace; }
.ew-person-stats { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; margin-bottom:12px; }
.ew-person-stats article { border:1px solid #dce7e9; border-radius:12px; background:#fff; padding:10px; }
.ew-person-stats small,.ew-person-stats b { display:block; }
.ew-person-stats small { color:var(--ew-muted); font-size:6px; }
.ew-person-stats b { margin-top:4px; color:#27545c; font-size:11px; }
.ew-person-create { margin-bottom:12px; }
.ew-person-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.ew-person-toolbar > label { flex:1; max-width:550px; display:flex; align-items:center; gap:6px; border:1px solid #dce8e9; border-radius:10px; background:#fff; padding:0 9px; }
.ew-person-toolbar .ew-icon { width:16px; color:#789096; }
.ew-person-toolbar input { flex:1; min-width:0; border:0; outline:0; background:transparent; padding:9px 0; font:inherit; font-size:8px; }
.ew-person-toolbar > span { color:var(--ew-muted); font-size:7px; }
.ew-person-list { display:grid; gap:8px; }
.ew-person-card { border:1px solid #dce7e9; border-radius:13px; background:#fff; overflow:hidden; }
.ew-person-card[hidden] { display:none; }
.ew-person-card > summary { list-style:none; display:grid; grid-template-columns:auto minmax(150px,1.5fr) repeat(3,minmax(90px,.7fr)) auto; align-items:center; gap:10px; padding:10px; cursor:pointer; }
.ew-person-card > summary::-webkit-details-marker { display:none; }
.ew-person-card > summary > span small,.ew-person-card > summary > span b { display:block; }
.ew-person-card > summary > span small { color:var(--ew-muted); font-size:6px; }
.ew-person-card > summary > span b { margin-top:2px; font-size:8px; }
.ew-person-card > summary > .ew-icon { width:15px; transition:.2s; }
.ew-person-card[open] > summary > .ew-icon { transform:rotate(180deg); }
.ew-person-name b { font-size:9px !important; }
.ew-person-card .is-debt { color:#b55149; }
.ew-person-body { border-top:1px solid #e4edef; background:#fbfdfd; padding:11px; display:grid; gap:12px; }
.ew-person-profile { display:grid; grid-template-columns:1fr 1.2fr; gap:10px; }
.ew-person-body section { border:1px solid #e2ebed; border-radius:11px; background:#fff; padding:9px; }
.ew-person-body h4 { margin:0 0 7px; font-size:8.5px; }
.ew-person-profile dl { margin:0; }
.ew-person-profile dl div { display:flex; justify-content:space-between; gap:7px; border-bottom:1px solid #edf2f3; padding:5px 0; }
.ew-person-profile dt { color:var(--ew-muted); font-size:6px; }
.ew-person-profile dd { margin:0; font-size:7px; font-weight:800; }
.ew-person-portal-box > p { color:var(--ew-muted); font-size:6px; }
.ew-portal-history { margin-top:6px; display:flex; align-items:center; justify-content:space-between; gap:7px; border-top:1px solid #edf2f3; padding-top:6px; }
.ew-portal-history span b,.ew-portal-history span small { display:block; }
.ew-portal-history span b { font-size:7px; }
.ew-portal-history span small { color:var(--ew-muted); font-size:5.5px; }
.ew-portal-history.is-closed { opacity:.55; }
.ew-person-order-list article,.ew-person-transactions > article { display:flex; align-items:center; gap:8px; border-top:1px solid #edf2f3; padding:7px 0; }
.ew-person-order-list article > span,.ew-person-transactions > article > div { flex:1; min-width:0; }
.ew-person-order-list span b,.ew-person-order-list span small,.ew-person-transactions div b,.ew-person-transactions div small { display:block; }
.ew-person-order-list span b,.ew-person-transactions div b { font-size:7px; }
.ew-person-order-list span small,.ew-person-transactions div small { color:var(--ew-muted); font-size:5.5px; }
.ew-person-order-list em { border-radius:999px; background:#eef5f5; padding:4px 6px; font-size:5.5px; font-style:normal; }
.ew-person-order-list strong,.ew-person-transactions > article > strong { font-size:7px; white-space:nowrap; }
.ew-transaction-type { display:inline-block; margin-bottom:3px; border-radius:999px; background:#e9f6f4; padding:3px 6px; color:var(--ew-primary-dark); font-size:5.5px; }
.ew-person-transactions details { min-width:145px; }
.ew-person-transactions summary { color:var(--ew-primary-dark); font-size:6px; cursor:pointer; }
.ew-person-transactions details form { margin-top:5px; display:grid; gap:5px; }
.ew-person-transactions label span { display:block; color:var(--ew-muted); font-size:5.5px; }
.ew-person-transactions input { width:100%; min-width:0; border:1px solid #dae7e9; border-radius:7px; padding:6px; font:inherit; font-size:6px; }
.ew-person-transfer-history article { display:flex; gap:7px; border-top:1px solid #edf2f3; padding:7px 0; }
.ew-person-transfer-history .ew-icon { width:15px; color:var(--ew-primary); }
.ew-person-transfer-history span b,.ew-person-transfer-history span small,.ew-person-transfer-history span em { display:block; }
.ew-person-transfer-history span b { font-size:7px; }
.ew-person-transfer-history span small,.ew-person-transfer-history span em { margin-top:2px; color:var(--ew-muted); font-size:5.5px; font-style:normal; }

/* View-only 72-hour customer portal */
.ew-token-portal-page { min-height:100vh; background:#eef5f5; }
.ew-token-portal { width:min(1100px,94%); margin:0 auto; padding:18px 0 35px; }
.ew-token-portal-head { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ew-token-expiry { display:flex; align-items:center; gap:7px; border:1px solid #cfe1e3; border-radius:12px; background:#fff; padding:8px 10px; }
.ew-token-expiry .ew-icon { width:19px; color:var(--ew-primary); }
.ew-token-expiry small,.ew-token-expiry b { display:block; }
.ew-token-expiry small { color:var(--ew-muted); font-size:6px; }
.ew-token-expiry b { direction:ltr; margin-top:2px; font-size:9px; }
.ew-token-welcome { margin:18px 0 12px; border-radius:18px; background:linear-gradient(135deg,#133f49,#0c7778); padding:24px; color:#fff; }
.ew-token-welcome span { color:#a7e1da; font-size:7px; font-weight:850; }
.ew-token-welcome h1 { margin:6px 0; font-size:22px; }
.ew-token-welcome p { margin:0; color:#d6eeee; font-size:8px; }
.ew-token-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.ew-token-summary article { border:1px solid #d9e6e8; border-radius:12px; background:#fff; padding:12px; }
.ew-token-summary small,.ew-token-summary b { display:block; }
.ew-token-summary small { color:var(--ew-muted); font-size:6px; }
.ew-token-summary b { margin-top:4px; color:#20525a; font-size:15px; }
.ew-token-orders { margin-top:18px; }
.ew-token-order { margin-bottom:8px; border:1px solid #dbe7e9; border-radius:13px; background:#fff; overflow:hidden; }
.ew-token-order > summary { list-style:none; display:flex; align-items:center; gap:10px; padding:12px; cursor:pointer; }
.ew-token-order > summary::-webkit-details-marker { display:none; }
.ew-token-order > summary > span:first-child { flex:1; }
.ew-token-order > summary small,.ew-token-order > summary b,.ew-token-order > summary em { display:block; }
.ew-token-order > summary small { color:var(--ew-muted); font-size:6px; }
.ew-token-order > summary b { margin-top:2px; font-size:10px; }
.ew-token-order > summary em { margin-top:2px; color:#607981; font-size:7px; font-style:normal; }
.ew-token-order > summary > .ew-icon { width:16px; transition:.2s; }
.ew-token-order[open] > summary > .ew-icon { transform:rotate(180deg); }
.ew-token-order-body { border-top:1px solid #e5edef; background:#fbfdfd; padding:11px; display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.ew-token-order-body > section { border:1px solid #e1eaec; border-radius:10px; background:#fff; padding:10px; }
.ew-token-order-body > section.is-wide { grid-column:1/-1; }
.ew-token-order-body h3 { margin:0 0 7px; font-size:9px; }
.ew-token-order-body p { color:#516b73; font-size:7px; }
.ew-token-order-body dl { margin:0; }
.ew-token-order-body dl div { display:flex; justify-content:space-between; gap:8px; border-top:1px solid #edf2f3; padding:6px 0; }
.ew-token-order-body dt { color:var(--ew-muted); font-size:6px; }
.ew-token-order-body dd { margin:0; font-size:7px; font-weight:850; }
.ew-token-portal-foot { margin-top:14px; display:flex; justify-content:space-between; gap:10px; border-radius:12px; background:#dfeceb; padding:10px; color:#536e74; font-size:6.5px; }
.ew-token-portal-foot span { display:flex; align-items:center; gap:5px; }
.ew-token-portal-foot .ew-icon { width:15px; }
.ew-token-error { width:min(520px,100%); margin:12vh auto; border:1px solid #ead4d2; border-radius:18px; background:#fff; padding:30px; text-align:center; }
.ew-token-error > .ew-icon { width:44px; color:#b25149; }
.ew-token-error h1 { margin:12px 0 6px; }
.ew-token-error p { color:#8a4f4a; }
.ew-token-error small { color:var(--ew-muted); }

@media (max-width: 1100px) {
  .ew-management-dashboard .ew-management-grid { grid-template-columns:1fr 1fr; }
  .ew-person-stats { grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 760px) {
  .ew-dashboard-actions,.ew-dashboard-range { width:100%; justify-content:flex-start; }
  .ew-dashboard-range { flex-wrap:wrap; }
  .ew-person-card > summary { grid-template-columns:auto 1fr auto; }
  .ew-person-card > summary > span:not(.ew-avatar):not(.ew-person-name) { display:none; }
  .ew-person-profile { grid-template-columns:1fr; }
  .ew-created-portal > div + div { align-items:stretch; flex-direction:column; }
  .ew-token-order-body { grid-template-columns:1fr; }
  .ew-token-order-body > section.is-wide { grid-column:1; }
}
@media (max-width: 520px) {
  .ew-management-dashboard .ew-management-grid { grid-template-columns:1fr; }
  .ew-dashboard-widget.is-wide { grid-column:span 1; }
  .ew-person-stats { grid-template-columns:1fr 1fr; }
  .ew-person-order-list article,.ew-person-transactions > article { align-items:flex-start; flex-wrap:wrap; }
  .ew-person-transactions details { flex:1 0 100%; }
  .ew-token-portal-head { align-items:flex-start; flex-direction:column; }
  .ew-token-summary { grid-template-columns:1fr 1fr; }
  .ew-token-summary article:last-child { grid-column:1/-1; }
  .ew-token-welcome { padding:18px; }
  .ew-token-welcome h1 { font-size:17px; }
  .ew-token-portal-foot { flex-direction:column; }
}

/* Finance 0.5 */
.ew-finance-workspace { margin-top: 28px; scroll-margin-top: 84px; }
.ew-currency-badge { align-self: flex-start; display: flex; align-items: center; gap: 8px; border: 1px solid #cfe4e4; border-radius: 13px; background: #f5fbfa; padding: 9px 12px; color: var(--ew-muted); }
.ew-currency-badge .ew-icon { width: 18px; color: var(--ew-primary); }
.ew-currency-badge span { font-size: 8px; }
.ew-currency-badge b { color: var(--ew-primary-dark); font-size: 10px; }
.ew-finance-stat-grid { display: grid; grid-template-columns: repeat(6,minmax(120px,1fr)); gap: 10px; margin-bottom: 16px; }
.ew-finance-stat-grid article { min-width: 0; border: 1px solid var(--ew-border); border-radius: 15px; background: rgba(255,255,255,.92); padding: 14px; box-shadow: var(--ew-shadow-soft); }
.ew-finance-stat-grid small { display: block; color: var(--ew-muted); font-size: 8px; }
.ew-finance-stat-grid b { display: block; margin-top: 7px; color: #16353c; font-size: 13px; overflow-wrap: anywhere; }
.ew-finance-stat-grid .is-due { border-color: #f0d6b4; background: #fffaf2; }
.ew-finance-stat-grid .is-due b { color: #a56618; }
.ew-finance-layout { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(280px,.65fr); gap: 14px; align-items: start; }
[data-finance-readonly] form:not(.ew-finance-filter), [data-finance-readonly] .ew-finance-actions { display: none !important; }
.ew-readonly-note { display: inline-flex; margin-top: 8px; border: 1px solid #bfdbfe; border-radius: 999px; background: #eff6ff; color: #1d4ed8; padding: 5px 10px; font-weight: 700; }
.ew-finance-main,.ew-finance-side { display: grid; gap: 14px; min-width: 0; }
.ew-finance-order-list { display: grid; gap: 7px; }
.ew-finance-order-list > button { width: 100%; border: 1px solid #e1eaec; border-radius: 12px; background: #fbfdfd; padding: 11px; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: center; gap: 9px; color: inherit; text-align: right; cursor: pointer; }
.ew-finance-order-list > button:hover { border-color: #9bcfcd; background: #f3fbfa; }
.ew-finance-order-list span,.ew-finance-order-list span b,.ew-finance-order-list span small { display: block; min-width: 0; }
.ew-finance-order-list span b { font-size: 9px; }
.ew-finance-order-list span small { margin-top: 3px; color: var(--ew-muted); font-size: 7px; }
.ew-finance-order-list em { border-radius: 999px; background: #eef3f4; padding: 5px 8px; color: #667b82; font-size: 7px; font-style: normal; }
.ew-finance-order-list em.is-draft { background: #fff1d9; color: #976117; }
.ew-finance-order-list em.is-final { background: #e1f6ed; color: #1f805a; }
.ew-finance-order-list strong { color: #aa6517; font-size: 8px; white-space: nowrap; }
.ew-supplier-debt-list { display: grid; gap: 10px; }
.ew-supplier-debt-list article { border: 1px solid #eadfcf; border-radius: 13px; background: #fffdf9; padding: 11px; }
.ew-supplier-debt-list article > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ew-supplier-debt-list header span b,.ew-supplier-debt-list header span small { display: block; }
.ew-supplier-debt-list header b { font-size: 9px; }
.ew-supplier-debt-list header small { margin-top: 3px; color: var(--ew-muted); font-size: 7px; }
.ew-supplier-debt-list header strong { color: #a96518; font-size: 11px; }
.ew-supplier-debt-list header em { display: block; margin-top: 4px; color: #8b6a3f; font-size: 7px; font-style: normal; }
.ew-supplier-debt-list article.is-overdue { border-color: #e5afa9; background: #fff7f6; }
.ew-supplier-debt-list article.is-overdue header em { color: #b94d44; font-weight: 800; }
.ew-supplier-debt-list .ew-supplier-pay-form { display: grid; grid-template-columns: repeat(4,minmax(100px,1fr)) auto; gap: 7px; align-items: end; margin-top: 10px; }
.ew-purchase-due-form { display: flex; align-items: end; gap: 7px; margin-top: 8px; border-top: 1px dashed #e4d8c8; padding-top: 8px; }
.ew-purchase-due-form label { flex: 1; }
.ew-supplier-debt-list label,.ew-finance-action form label,.ew-finance-inline-form label { display: grid; gap: 4px; }
.ew-supplier-debt-list label span,.ew-finance-action form label span,.ew-finance-inline-form label span { color: var(--ew-muted); font-size: 7px; }
.ew-supplier-debt-list input,.ew-supplier-debt-list select,.ew-finance-action input,.ew-finance-action select,.ew-finance-action textarea,.ew-finance-inline-form input,.ew-finance-inline-form select { width: 100%; min-height: 36px; border: 1px solid #dfe8ea; border-radius: 8px; background: #fff; padding: 6px 8px; color: var(--ew-text); font: inherit; font-size: 8px; }
.ew-finance-ledger h4 { margin: 14px 0 7px; color: var(--ew-muted); font-size: 8px; }
.ew-finance-ledger h4:first-child { margin-top: 0; }
.ew-finance-ledger > div { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto auto; align-items: center; gap: 8px; border-top: 1px solid #edf2f3; padding: 8px 0; }
.ew-finance-ledger > div:first-of-type { border-top: 0; }
.ew-finance-ledger span b,.ew-finance-ledger span small { display: block; }
.ew-finance-ledger span b { font-size: 8px; }
.ew-finance-ledger span small { margin-top: 2px; color: var(--ew-muted); font-size: 7px; }
.ew-finance-ledger strong { font-size: 9px; white-space: nowrap; }
.ew-finance-ledger strong.is-in { color: #198060; }
.ew-finance-ledger strong.is-out { color: #bd4c42; }
.ew-finance-ledger strong.is-transfer { color: #4e7392; }
.ew-ledger-print,.ew-payment-history a { color: var(--ew-primary-dark); font-size: 7px; text-decoration: none; white-space: nowrap; }
.ew-finance-ledger .is-void { opacity: .52; text-decoration: line-through; }
.ew-finance-ledger details { position: relative; }
.ew-finance-ledger summary { cursor: pointer; color: #b04b42; font-size: 7px; }
.ew-finance-ledger details form { position: absolute; left: 0; z-index: 5; width: 200px; border: 1px solid #efd1cd; border-radius: 9px; background: #fff; padding: 8px; box-shadow: var(--ew-shadow); display: grid; gap: 6px; }
.ew-finance-ledger details input { width: 100%; min-height: 32px; border: 1px solid #e5d7d5; border-radius: 7px; padding: 5px; font-size: 8px; }
.ew-finance-ledger details button { border: 0; border-radius: 7px; background: #b64f46; color: #fff; padding: 6px; font-size: 8px; }
.ew-account-cards { display: grid; gap: 7px; }
.ew-account-cards > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #dce9ea; border-radius: 11px; background: linear-gradient(135deg,#fbfefe,#f1f9f8); padding: 10px; }
.ew-account-cards span b,.ew-account-cards span small { display: block; }
.ew-account-cards span b { font-size: 9px; }
.ew-account-cards span small { color: var(--ew-muted); font-size: 7px; }
.ew-account-cards strong { color: var(--ew-primary-dark); font-size: 10px; text-align: left; }
.ew-finance-action { overflow: hidden; border: 1px solid var(--ew-border); border-radius: 14px; background: rgba(255,255,255,.93); box-shadow: var(--ew-shadow-soft); }
.ew-finance-action > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px; }
.ew-finance-action > summary::-webkit-details-marker { display: none; }
.ew-finance-action > summary > .ew-icon { width: 18px; color: var(--ew-primary); }
.ew-finance-action summary span b,.ew-finance-action summary span small { display: block; }
.ew-finance-action summary span b { font-size: 9px; }
.ew-finance-action summary span small { margin-top: 2px; color: var(--ew-muted); font-size: 7px; }
.ew-finance-action > form { border-top: 1px solid #e8eff0; background: #fbfdfd; padding: 11px; display: grid; gap: 8px; }
.ew-service-mini-list { border-top: 1px solid #e8eff0; padding: 8px 11px; display: grid; gap: 5px; }
.ew-service-mini-list form { display: grid; grid-template-columns: minmax(0,1fr) 100px auto; gap: 5px; }
.ew-service-mini-list input { min-width: 0; min-height: 31px; border: 1px solid #dfe8ea; border-radius: 7px; padding: 4px 6px; font: inherit; font-size: 7px; }
.ew-service-mini-list button { border: 0; border-radius: 7px; background: #e2f2f0; color: var(--ew-primary-dark); padding: 4px 7px; font-size: 7px; cursor: pointer; }
.ew-customer-balance-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ew-customer-balance-list > div { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 4px 8px; border: 1px solid #e1e9eb; border-radius: 10px; background: #fbfdfd; padding: 9px; }
.ew-customer-balance-list span b,.ew-customer-balance-list span small { display: block; }
.ew-customer-balance-list span b { font-size: 8px; }
.ew-customer-balance-list span small { color: var(--ew-muted); font-size: 7px; }
.ew-customer-balance-list strong { font-size: 9px; }
.ew-customer-balance-list em { grid-column: 1 / -1; color: var(--ew-muted); font-size: 7px; font-style: normal; }
.ew-customer-balance-list .is-debtor { border-color: #efd8bc; background: #fffaf3; }
.ew-customer-balance-list .is-debtor strong,.ew-customer-balance-list .is-debtor em { color: #a76518; }
.ew-customer-balance-list .is-creditor { border-color: #cce6dc; background: #f4fbf8; }
.ew-customer-balance-list .is-creditor strong,.ew-customer-balance-list .is-creditor em { color: #21805f; }

.ew-order-finance { border-color: #cfe5e5 !important; background: linear-gradient(180deg,#ffffff,#f9fcfc) !important; }
.ew-invoice-status { border-radius: 999px; padding: 5px 9px; font-size: 7px; }
.ew-invoice-status.is-draft { background: #fff1d9; color: #976117; }
.ew-invoice-status.is-final { background: #dff5eb; color: #1d7b58; }
.ew-invoice-status.is-void { background: #f5e4e2; color: #a74c43; }
.ew-invoice-summary-head { display: flex; align-items: center; gap: 14px; border: 1px solid #e0ebec; border-radius: 12px; background: #f8fbfb; padding: 10px; margin-bottom: 11px; }
.ew-invoice-summary-head span { min-width: 120px; }
.ew-invoice-summary-head span small,.ew-invoice-summary-head span b { display: block; }
.ew-invoice-summary-head span small { color: var(--ew-muted); font-size: 7px; }
.ew-invoice-summary-head span b { margin-top: 3px; font-size: 9px; }
.ew-invoice-summary-head .ew-btn { margin-right: auto; }
.ew-settlement-status { margin: 0 0 10px; border-radius: 9px; padding: 8px 10px; font-size: 8px; font-weight: 800; }
.ew-settlement-status.is-settled { background: #e4f6ed; color: #1e7d59; }
.ew-settlement-status.is-credit { background: #edf1fb; color: #5268a2; }
.ew-settlement-status.is-open { background: #fff2df; color: #a36518; }
.ew-invoice-lines { border: 1px solid #e2eaec; border-radius: 12px; overflow: hidden; }
.ew-invoice-lines > div { display: grid; grid-template-columns: minmax(0,1fr) auto auto; gap: 9px; align-items: center; padding: 9px 10px; border-top: 1px solid #edf2f3; }
.ew-invoice-lines > div:first-child { border-top: 0; }
.ew-invoice-lines > div > span { display: flex; align-items: center; gap: 7px; min-width: 0; }
.ew-invoice-lines i { flex: 0 0 auto; border-radius: 6px; background: #edf4f5; padding: 4px 6px; color: #60767e; font-size: 6px; font-style: normal; }
.ew-invoice-lines i.is-part { background: #e4f2fb; color: #397594; }
.ew-invoice-lines i.is-labor { background: #e4f5ed; color: #257859; }
.ew-invoice-lines b { min-width: 0; font-size: 8px; }
.ew-invoice-lines small { color: var(--ew-muted); font-size: 7px; }
.ew-invoice-lines strong { font-size: 8px; white-space: nowrap; }
.ew-invoice-totals { width: min(100%,380px); margin: 12px 0 0 auto; display: grid; gap: 3px; }
.ew-invoice-totals > div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 8px; font-size: 8px; }
.ew-invoice-totals .is-grand { margin-top: 3px; border-top: 2px solid #19363e; color: var(--ew-primary-dark); font-size: 10px; }
.ew-invoice-totals .is-paid { color: #21805f; }
.ew-invoice-totals .is-due { border-radius: 7px; background: #fff4e3; color: #a56718; }
.ew-credit-note { border-radius: 9px; background: #edf1fb; padding: 8px 10px; color: #5368a2; font-size: 8px; }
.ew-payment-history { margin-top: 12px; }
.ew-payment-history h4 { margin: 0 0 7px; font-size: 9px; }
.ew-payment-history > div { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto auto; align-items: center; gap: 8px; border-top: 1px solid #e8eff0; padding: 7px 0; }
.ew-payment-history span b,.ew-payment-history span small { display: block; }
.ew-payment-history span b { font-size: 8px; }
.ew-payment-history span small { color: var(--ew-muted); font-size: 7px; }
.ew-payment-history strong { color: #1d805f; font-size: 8px; }
.ew-payment-history em { color: #b64f46; font-size: 7px; font-style: normal; }
.ew-payment-history .is-void { opacity: .55; }
.ew-payment-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.ew-finance-inline-form { border: 1px solid #dce9ea; border-radius: 12px; background: #f8fbfb; padding: 10px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ew-finance-inline-form h4 { grid-column: 1 / -1; margin: 0; font-size: 9px; }
.ew-finance-inline-form .ew-btn { align-self: end; }
.ew-danger-zone { margin-top: 12px; border-top: 1px solid #f0d8d5; padding-top: 8px; }
.ew-danger-zone summary { cursor: pointer; color: #aa4d45; font-size: 8px; }
.ew-danger-zone form { margin-top: 7px; display: flex; align-items: end; gap: 7px; }
.ew-danger-zone label { flex: 1; display: grid; gap: 4px; }
.ew-danger-zone label span { color: var(--ew-muted); font-size: 7px; }
.ew-danger-zone input { width: 100%; min-height: 34px; border: 1px solid #edd5d2; border-radius: 8px; padding: 5px 8px; font-size: 8px; }
.ew-invoice-editor { display: grid; gap: 10px; }
.ew-invoice-editor-section { overflow: hidden; border: 1px solid #e1eaec; border-radius: 12px; background: #fff; }
.ew-invoice-editor-section > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f5f9f9; padding: 9px 10px; }
.ew-invoice-editor-section > header span b,.ew-invoice-editor-section > header span small { display: block; }
.ew-invoice-editor-section > header b { font-size: 9px; }
.ew-invoice-editor-section > header small { margin-top: 2px; color: var(--ew-muted); font-size: 7px; }
.ew-invoice-editor-section > header > strong { color: var(--ew-primary-dark); font-size: 10px; }
.ew-invoice-edit-line { display: grid; grid-template-columns: 180px minmax(180px,1fr) 80px 120px 28px; gap: 6px; align-items: end; padding: 9px; border-top: 1px solid #edf2f3; }
.ew-invoice-edit-line.is-other { grid-template-columns: minmax(180px,1fr) 80px 120px 28px; }
.ew-invoice-edit-line label { display: grid; gap: 4px; min-width: 0; }
.ew-invoice-edit-line label span { color: var(--ew-muted); font-size: 7px; }
.ew-invoice-edit-line input,.ew-invoice-edit-line select { width: 100%; min-height: 34px; border: 1px solid #dfe8ea; border-radius: 8px; background: #fff; padding: 5px 7px; color: var(--ew-text); font: inherit; font-size: 8px; }
.ew-invoice-edit-line > button { width: 28px; height: 34px; border: 0; border-radius: 8px; background: #f7e9e7; color: #aa4d45; cursor: pointer; }
.ew-invoice-adjustments { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)); gap: 7px; border: 1px solid #e1eaec; border-radius: 12px; background: #f9fbfb; padding: 10px; }
.ew-invoice-adjustments label { display: grid; gap: 4px; min-width: 0; }
.ew-invoice-adjustments label span { color: var(--ew-muted); font-size: 7px; }
.ew-invoice-adjustments input,.ew-invoice-adjustments select,.ew-invoice-adjustments textarea { width: 100%; min-height: 34px; border: 1px solid #dfe8ea; border-radius: 8px; background: #fff; padding: 5px 7px; color: var(--ew-text); font: inherit; font-size: 8px; }
.ew-invoice-live-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; background: linear-gradient(135deg,#e9f8f5,#f3fbfa); padding: 11px; }
.ew-invoice-live-total span small,.ew-invoice-live-total span b { display: block; }
.ew-invoice-live-total small { color: var(--ew-muted); font-size: 7px; }
.ew-invoice-live-total b { margin-top: 3px; color: var(--ew-primary-dark); font-size: 12px; }
.ew-invoice-editor > footer { display: flex; justify-content: flex-end; gap: 7px; }

@media (max-width: 1200px) {
  .ew-finance-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ew-finance-layout { grid-template-columns: 1fr; }
  .ew-finance-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-finance-side > .ew-panel { grid-column: 1 / -1; }
  .ew-invoice-edit-line { grid-template-columns: 150px minmax(150px,1fr) 70px 105px 28px; }
  .ew-invoice-adjustments { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 800px) {
  .ew-finance-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-finance-side { grid-template-columns: 1fr; }
  .ew-finance-side > .ew-panel { grid-column: auto; }
  .ew-supplier-debt-list .ew-supplier-pay-form { grid-template-columns: 1fr 1fr; }
  .ew-supplier-debt-list .ew-supplier-pay-form .ew-btn { grid-column: 1 / -1; }
  .ew-payment-actions { grid-template-columns: 1fr; }
  .ew-invoice-edit-line,.ew-invoice-edit-line.is-other { grid-template-columns: 1fr 1fr; }
  .ew-invoice-edit-line .ew-service-pick,.ew-invoice-edit-line label:nth-of-type(2) { grid-column: 1 / -1; }
  .ew-invoice-edit-line > button { justify-self: end; }
  .ew-invoice-adjustments { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .ew-finance-stat-grid { grid-template-columns: 1fr 1fr; }
  .ew-finance-stat-grid article { padding: 10px; }
  .ew-finance-order-list > button { grid-template-columns: 1fr auto; }
  .ew-finance-order-list strong { grid-column: 1 / -1; }
  .ew-supplier-debt-list .ew-supplier-pay-form { grid-template-columns: 1fr; }
  .ew-supplier-debt-list .ew-supplier-pay-form .ew-btn { grid-column: auto; }
  .ew-purchase-due-form { align-items: stretch; flex-direction: column; }
  .ew-invoice-summary-head { align-items: flex-start; flex-wrap: wrap; }
  .ew-invoice-summary-head .ew-btn { width: 100%; margin-right: 0; }
  .ew-invoice-lines > div { grid-template-columns: 1fr auto; }
  .ew-invoice-lines > div > small { grid-column: 1; }
  .ew-invoice-lines > div > strong { grid-column: 2; grid-row: 1 / 3; }
  .ew-finance-inline-form,.ew-invoice-adjustments { grid-template-columns: 1fr; }
  .ew-invoice-edit-line,.ew-invoice-edit-line.is-other { grid-template-columns: 1fr; }
  .ew-invoice-edit-line .ew-service-pick,.ew-invoice-edit-line label:nth-of-type(2) { grid-column: auto; }
  .ew-invoice-live-total { align-items: flex-start; flex-direction: column; }
  .ew-invoice-editor > footer { flex-direction: column-reverse; }
  .ew-invoice-editor > footer .ew-btn { width: 100%; }
  .ew-customer-balance-list { grid-template-columns: 1fr; }
  .ew-service-mini-list form { grid-template-columns: 1fr; }
}

/* Inventory 0.4 — isolated, responsive and RTL. */
.ew-inventory-workspace { margin-top: 34px; scroll-margin-top: 88px; }
.ew-inventory-title { align-items: center; }
.ew-inventory-rule { min-width: 210px; border: 1px solid #cfe7e4; border-radius: 14px; background: linear-gradient(135deg,#effaf7,#fff); padding: 10px 12px; display: flex; align-items: center; gap: 10px; color: var(--ew-primary-dark); }
.ew-inventory-rule > .ew-icon { width: 27px; height: 27px; }
.ew-inventory-rule span { display: flex; flex-direction: column; }
.ew-inventory-rule b { font-size: 10px; }
.ew-inventory-rule small { color: var(--ew-muted); font-size: 7px; }
.ew-inventory-stats { margin: 16px 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; }
.ew-inventory-stats article { min-width: 0; border: 1px solid var(--ew-border); border-radius: 14px; background: #fff; padding: 12px; display: flex; align-items: center; gap: 9px; box-shadow: 0 8px 28px rgba(35,71,79,.045); }
.ew-inventory-stats article > i { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; background: var(--ew-primary-soft); color: var(--ew-primary-dark); display: grid; place-items: center; }
.ew-inventory-stats article > i .ew-icon { width: 19px; height: 19px; }
.ew-inventory-stats article.is-warning > i { background: #fff1dd; color: #a96712; }
.ew-inventory-stats article.is-request > i { background: #eeeafd; color: #6351b6; }
.ew-inventory-stats article > span { min-width: 0; display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 4px; }
.ew-inventory-stats small { grid-column: 1 / -1; color: var(--ew-muted); font-size: 7px; }
.ew-inventory-stats b { overflow: hidden; color: #173e47; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.ew-inventory-stats em { color: var(--ew-muted); font-size: 6px; font-style: normal; }
.ew-inventory-tabs { overflow-x: auto; border: 1px solid var(--ew-border); border-radius: 14px 14px 0 0; background: #fff; padding: 7px; display: flex; gap: 5px; scrollbar-width: thin; }
.ew-inventory-tabs button { min-height: 36px; border: 0; border-radius: 9px; background: transparent; padding: 7px 13px; color: #607780; font-family: inherit; font-size: 8px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.ew-inventory-tabs button b { margin-right: 4px; border-radius: 99px; background: #f0eafa; padding: 2px 5px; color: #6d54c2; font-size: 7px; }
.ew-inventory-tabs button.is-active { background: var(--ew-primary-soft); color: var(--ew-primary-dark); box-shadow: inset 0 0 0 1px #c6e7e4; }
.ew-inventory-panel { min-height: 200px; border: 1px solid var(--ew-border); border-top: 0; border-radius: 0 0 16px 16px; background: #f7fafb; padding: 14px; }
.ew-inventory-panel[hidden] { display: none !important; }
.ew-inventory-layout { display: grid; grid-template-columns: 185px minmax(0,1fr); gap: 12px; }
.ew-inventory-groups { border: 1px solid var(--ew-border); border-radius: 13px; background: #fff; padding: 9px; align-self: start; display: grid; gap: 4px; }
.ew-inventory-groups > strong { padding: 6px 7px 10px; color: #284b53; font-size: 9px; }
.ew-inventory-groups button { min-height: 35px; border: 0; border-radius: 8px; background: transparent; padding: 7px 8px; display: flex; justify-content: space-between; align-items: center; color: #607780; font-family: inherit; font-size: 8px; cursor: pointer; }
.ew-inventory-groups button b { border-radius: 999px; background: #eef3f4; padding: 2px 6px; font-size: 7px; }
.ew-inventory-groups button.is-active { background: #e7f5f3; color: var(--ew-primary-dark); font-weight: 900; }
.ew-inventory-stock { min-width: 0; }
.ew-inventory-filters { margin-bottom: 9px; display: grid; grid-template-columns: minmax(220px,1fr) 190px; gap: 8px; }
.ew-inventory-filters label { position: relative; }
.ew-inventory-filters label .ew-icon { position: absolute; right: 11px; top: 10px; width: 16px; height: 16px; color: #80939a; }
.ew-inventory-filters input { padding-right: 36px !important; }
.ew-inventory-filters input,.ew-inventory-filters select,.ew-inventory-form input,.ew-inventory-form select,.ew-inventory-form textarea,.ew-report-part-request input,.ew-report-part-request select,.ew-part-return-form input { width: 100%; min-height: 38px; border: 1px solid #dbe6e8; border-radius: 9px; background: #fff; padding: 7px 9px; color: #244851; font-family: inherit; font-size: 8px; }
.ew-inventory-table-wrap { overflow: auto; border: 1px solid var(--ew-border); border-radius: 12px; background: #fff; }
.ew-inventory-table { width: 100%; min-width: 850px; border-collapse: collapse; font-size: 8px; }
.ew-inventory-table th { position: sticky; top: 0; z-index: 1; border-bottom: 1px solid #dfe9eb; background: #f1f6f7; padding: 10px 9px; color: #59717a; text-align: right; white-space: nowrap; }
.ew-inventory-table td { border-bottom: 1px solid #edf2f3; padding: 10px 9px; color: #4d666f; vertical-align: middle; }
.ew-inventory-table tr:last-child td { border-bottom: 0; }
.ew-inventory-table tr.is-low { background: #fffaf2; }
.ew-inventory-table td b,.ew-inventory-table td strong { display: block; color: #24464e; font-size: 8px; }
.ew-inventory-table td small { display: block; margin-top: 2px; color: var(--ew-muted); font-size: 6.5px; }
.ew-inventory-table [hidden] { display: none; }
.ew-stock-state,.ew-payment-state,.ew-movement-type { display: inline-flex; border-radius: 999px; padding: 4px 7px; font-size: 6.5px; font-weight: 900; white-space: nowrap; }
.ew-stock-state.is-ok,.ew-payment-state.is-paid,.ew-movement-type.is-purchase_in,.ew-movement-type.is-return_in,.ew-movement-type.is-transfer_in { background: #e1f5ea; color: #237552; }
.ew-stock-state.is-low,.ew-payment-state.is-unpaid,.ew-movement-type.is-issue_out,.ew-movement-type.is-transfer_out { background: #fff0dd; color: #a46514; }
.ew-payment-state.is-partial { background: #e9f3fb; color: #2d6f9e; }
.ew-payment-state.is-credit { background: #f0ebfb; color: #6b52b5; }
.ew-inventory-action-card { margin-top: 10px; border: 1px solid var(--ew-border); border-radius: 12px; background: #fff; }
.ew-inventory-action-card > summary { padding: 11px 12px; display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.ew-inventory-action-card > summary::-webkit-details-marker { display: none; }
.ew-inventory-action-card > summary > .ew-icon { width: 20px; height: 20px; color: var(--ew-primary-dark); }
.ew-inventory-action-card > summary span { display: flex; flex-direction: column; }
.ew-inventory-action-card > summary b { color: #274952; font-size: 9px; }
.ew-inventory-action-card > summary small { color: var(--ew-muted); font-size: 7px; }
.ew-inventory-action-card[open] > summary { border-bottom: 1px solid #e7eff0; background: #f4faf9; }
.ew-inventory-form { padding: 12px; display: grid; gap: 10px; }
.ew-inventory-form label,.ew-report-part-request label,.ew-part-return-form label { display: grid; gap: 5px; }
.ew-inventory-form label > span,.ew-report-part-request label > span,.ew-part-return-form label > span { color: #4d676f; font-size: 7px; font-weight: 800; }
.ew-inventory-form .ew-btn { justify-self: start; }
.ew-inventory-panel .ew-panel-heading { margin-bottom: 11px; }
.ew-inventory-panel .ew-panel-heading > b { border-radius: 999px; background: #e9f2f3; padding: 5px 8px; color: #537078; font-size: 7px; }
.ew-inventory-panel .ew-panel-heading > p { margin: 0; color: var(--ew-muted); font-size: 7px; }
.ew-inventory-guidance { margin: 0 0 11px; border: 1px solid #cfe7e4; border-radius: 10px; background: #eef9f7; padding: 9px 11px; color: #487068; font-size: 8px; line-height: 1.8; }
.ew-repair-card-queue { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.ew-inventory-repair-card { width: 100%; border: 1px solid var(--ew-border); border-radius: 13px; background: #fff; padding: 11px; display: grid; grid-template-columns: auto minmax(0,1fr) minmax(110px,.55fr) auto; align-items: center; gap: 10px; color: #36565e; font-family: inherit; text-align: right; cursor: pointer; box-shadow: 0 7px 24px rgba(34,72,80,.04); transition: border-color .15s,transform .15s,box-shadow .15s; }
.ew-inventory-repair-card:hover { border-color: #91cbc5; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(34,72,80,.08); }
.ew-inventory-card-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--ew-primary-soft); color: var(--ew-primary-dark); display: grid; place-items: center; }
.ew-inventory-card-icon .ew-icon { width: 20px; height: 20px; }
.ew-inventory-repair-card > span:not(.ew-inventory-card-icon) { min-width: 0; display: flex; flex-direction: column; }
.ew-inventory-repair-card small,.ew-inventory-repair-card em { overflow: hidden; color: var(--ew-muted); font-size: 7px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.ew-inventory-repair-card b { overflow: hidden; color: #284a52; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ew-inventory-repair-card > strong { display: flex; align-items: center; gap: 4px; color: var(--ew-primary-dark); font-size: 7px; white-space: nowrap; }
.ew-inventory-repair-card > strong .ew-icon { width: 13px; height: 13px; transform: rotate(90deg); }
.ew-request-queue { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ew-request-card { border: 1px solid var(--ew-border); border-radius: 13px; background: #fff; padding: 11px; box-shadow: 0 7px 24px rgba(34,72,80,.04); }
.ew-request-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ew-request-card > header span { display: flex; flex-direction: column; }
.ew-request-card > header b { color: #24464e; font-size: 10px; }
.ew-request-card > header small { color: var(--ew-muted); font-size: 7px; }
.ew-request-card > header em,.ew-order-part-request > header em { border-radius: 999px; background: #fff0dc; padding: 4px 7px; color: #9a601a; font-size: 6.5px; font-style: normal; font-weight: 900; white-space: nowrap; }
.ew-request-card > header em.is-approved { background: #e8f2fb; color: #2f6f9c; }
.ew-request-meta { margin: 9px 0; border-radius: 9px; background: #f4f8f9; padding: 7px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: #6a7f87; font-size: 7px; }
.ew-request-meta b { color: #3e5962; }
.ew-request-item { border-top: 1px solid #edf2f3; padding: 8px 0; display: flex; justify-content: space-between; gap: 8px; }
.ew-request-item span { display: flex; flex-direction: column; }
.ew-request-item b { font-size: 8px; }
.ew-request-item small { color: var(--ew-muted); font-size: 6.5px; }
.ew-request-item strong { color: var(--ew-primary-dark); font-size: 8px; }
.ew-request-card > p { margin: 5px 0; color: #657b83; font-size: 7px; }
.ew-request-card > footer { margin-top: 9px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.ew-request-card > footer form { margin: 0; }
.ew-reject-request { position: relative; margin-right: auto; }
.ew-reject-request > summary { color: #a4474f; font-size: 7px; cursor: pointer; }
.ew-reject-request form { position: absolute; bottom: 24px; left: 0; z-index: 3; width: 230px; border: 1px solid #ead7d9; border-radius: 10px; background: #fff; padding: 8px; box-shadow: 0 12px 30px rgba(77,41,46,.14); display: flex; gap: 5px; }
.ew-reject-request input { min-width: 0; border: 1px solid #e1e8ea; border-radius: 7px; padding: 6px; font-family: inherit; font-size: 7px; }
.ew-reject-request button { border: 0; border-radius: 7px; background: #b5545c; padding: 6px 9px; color: #fff; font-family: inherit; font-size: 7px; }
.ew-inventory-two-columns { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.8fr); gap: 10px; }
.ew-inventory-purchase-layout { display: grid; grid-template-columns: minmax(0,1fr); }
.ew-finance-handoff { margin: 0 12px; border: 1px solid #d8dff0; border-radius: 10px; background: #f5f6fc; padding: 9px 10px; display: flex; align-items: center; gap: 8px; color: #52607f; }
.ew-finance-handoff > .ew-icon { width: 21px; height: 21px; }
.ew-finance-handoff > span { display: flex; flex-direction: column; }
.ew-finance-handoff b { font-size: 8px; }
.ew-finance-handoff small { font-size: 7px; line-height: 1.7; }
.ew-inventory-form-card { margin: 0; }
.ew-inventory-form-card .ew-panel-heading > .ew-icon { width: 25px; height: 25px; color: var(--ew-primary-dark); }
.ew-purchase-lines { display: grid; gap: 7px; }
.ew-purchase-line { border: 1px solid #dce7e9; border-radius: 10px; background: #f8fbfb; padding: 8px; display: grid; grid-template-columns: minmax(180px,2fr) minmax(80px,.6fr) minmax(120px,1fr) 28px; gap: 7px; align-items: end; }
.ew-purchase-line > button { width: 28px; height: 38px; border: 0; border-radius: 8px; background: #f9e9eb; color: #a74c55; font-size: 16px; cursor: pointer; }
.ew-add-purchase-row { justify-self: start; }
.ew-inventory-history { margin-top: 10px; }
.ew-inventory-setup-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ew-inventory-setup-grid .ew-inventory-action-card { margin: 0; align-self: start; }
.ew-group-editor { border-bottom: 1px solid #e7eff0; padding: 9px; display: grid; gap: 5px; }
.ew-group-editor form { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
.ew-group-editor input { min-width: 0; min-height: 34px; border: 1px solid #dbe6e8; border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 8px; }
.ew-group-editor button { border: 1px solid #cfe3e1; border-radius: 8px; background: #edf8f6; padding: 6px 9px; color: var(--ew-primary-dark); font-family: inherit; font-size: 7px; font-weight: 900; cursor: pointer; }

/* Parts on the central repair card. */
.ew-report-part-chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.ew-report-part-chips > span { border: 1px solid #dce8e9; border-radius: 9px; background: #f6fafb; padding: 6px 7px; display: grid; grid-template-columns: auto auto; align-items: center; gap: 1px 5px; }
.ew-report-part-chips .ew-icon { grid-row: 1 / 3; width: 16px; height: 16px; color: var(--ew-primary-dark); }
.ew-report-part-chips b { font-size: 7px; }
.ew-report-part-chips small { color: var(--ew-muted); font-size: 6px; }
.ew-report-part-request { margin-top: 8px; border-top: 1px dashed #dbe7e9; padding-top: 7px; }
.ew-report-part-request > summary { display: flex; align-items: center; gap: 5px; color: var(--ew-primary-dark); font-size: 7px; font-weight: 900; cursor: pointer; list-style: none; }
.ew-report-part-request > summary::-webkit-details-marker { display: none; }
.ew-report-part-request > summary .ew-icon { width: 14px; height: 14px; }
.ew-report-part-request form { margin-top: 7px; display: grid; grid-template-columns: minmax(160px,1.6fr) minmax(100px,.8fr) 85px minmax(120px,1fr) auto; gap: 6px; align-items: end; }
.ew-report-part-request .ew-btn { min-height: 38px; }
.ew-order-part-requests { display: grid; gap: 8px; }
.ew-direct-issue-box { margin-bottom: 12px; overflow: hidden; border: 1px solid #bfe2dd; border-radius: 13px; background: linear-gradient(145deg,#f7fcfb,#fff); }
.ew-direct-issue-heading { border-bottom: 1px solid #dcece9; background: #edf8f6; padding: 10px 12px; display: flex; align-items: center; gap: 9px; color: var(--ew-primary-dark); }
.ew-direct-issue-heading > .ew-icon { width: 23px; height: 23px; }
.ew-direct-issue-heading > span { display: flex; flex-direction: column; }
.ew-direct-issue-heading b { font-size: 9px; }
.ew-direct-issue-heading small { color: #5f7b76; font-size: 7px; line-height: 1.7; }
.ew-direct-issue-form { padding: 11px; display: grid; grid-template-columns: minmax(170px,.55fr) minmax(190px,1fr) auto; align-items: end; gap: 9px; }
.ew-direct-warehouse { grid-column: 1; }
.ew-direct-issue-lines { grid-column: 1 / -1; display: grid; gap: 7px; }
.ew-direct-issue-line { border: 1px solid #dce8e8; border-radius: 10px; background: #fff; padding: 8px; display: grid; grid-template-columns: minmax(210px,1.7fr) minmax(90px,.5fr) minmax(130px,.8fr) 30px; align-items: end; gap: 7px; }
.ew-direct-issue-form label { display: grid; gap: 5px; }
.ew-direct-issue-form label > span { color: #4d676f; font-size: 7px; font-weight: 850; }
.ew-direct-issue-form input,.ew-direct-issue-form select { width: 100%; min-height: 38px; border: 1px solid #dbe6e8; border-radius: 9px; background: #fff; padding: 7px 9px; color: #244851; font-family: inherit; font-size: 8px; }
.ew-direct-issue-line > button { width: 30px; height: 38px; border: 0; border-radius: 8px; background: #f9e9eb; color: #a74c55; font-size: 16px; cursor: pointer; }
.ew-direct-issue-form > .ew-btn[data-add-direct-issue-row] { grid-column: 1; justify-self: start; }
.ew-direct-notes { grid-column: 2; }
.ew-direct-issue-form > .ew-btn[type=submit] { grid-column: 3; }
.ew-legacy-request-actions { align-items: center; border-radius: 9px; background: #fff8e9; padding: 7px; }
.ew-legacy-request-actions > small { width: 100%; color: #97661f; font-size: 6.5px; }
.ew-order-part-request { border: 1px solid #dce7e9; border-right: 4px solid #d8a85c; border-radius: 11px; background: #fff; padding: 10px; }
.ew-order-part-request.is-issued,.ew-order-part-request.is-partially_returned,.ew-order-part-request.is-returned { border-right-color: #51a781; }
.ew-order-part-request > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ew-order-part-request > header > span { display: flex; flex-direction: column; }
.ew-order-part-request > header b { color: #284a52; font-size: 9px; }
.ew-order-part-request > header small { color: var(--ew-muted); font-size: 6.5px; }
.ew-order-part-line { margin-top: 8px; border-top: 1px solid #edf2f3; padding-top: 8px; display: grid; grid-template-columns: minmax(130px,.8fr) minmax(260px,1.5fr) auto; gap: 9px; align-items: center; }
.ew-order-part-line > span { display: flex; flex-direction: column; }
.ew-order-part-line > span b { font-size: 8px; }
.ew-order-part-line > span small { color: var(--ew-muted); font-size: 6.5px; }
.ew-order-part-line dl { margin: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
.ew-order-part-line dl div { border-radius: 7px; background: #f4f8f9; padding: 5px; text-align: center; }
.ew-order-part-line dt { color: var(--ew-muted); font-size: 5.5px; }
.ew-order-part-line dd { margin: 1px 0 0; color: #34545c; font-size: 7px; font-weight: 900; }
.ew-order-part-line > strong { color: var(--ew-primary-dark); font-size: 9px; text-align: left; white-space: nowrap; }
.ew-order-part-line > strong small { margin-right: 2px; color: var(--ew-muted); font-size: 6px; }
.ew-order-part-request > p { margin: 7px 0 0; color: var(--ew-muted); font-size: 7px; }
.ew-order-part-request > footer { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.ew-order-part-request > footer form { margin: 0; }
.ew-btn-danger { border-color: #eccfd2 !important; background: #fff2f3 !important; color: #aa4851 !important; }
.ew-part-return-form { margin-top: 8px; border-radius: 8px; background: #f6faf9; padding: 7px; display: flex; align-items: end; gap: 6px; }
.ew-part-price-form { margin-top: 7px; display: flex; align-items: end; gap: 6px; }
.ew-part-price-form label { max-width: 210px; display: grid; gap: 4px; }
.ew-part-price-form label span { color: var(--ew-muted); font-size: 6.5px; }
.ew-part-price-form input { width: 100%; min-height: 36px; border: 1px solid #dce7e9; border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 8px; }
.ew-part-return-form label { max-width: 180px; }
.ew-part-return-form .ew-btn { min-height: 38px; }
.ew-parts-total { margin-top: 10px; border-radius: 11px; background: linear-gradient(90deg,#eaf7f4,#f8fcfb); padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; }
.ew-parts-total span { color: #587179; font-size: 8px; }
.ew-parts-total b { color: var(--ew-primary-dark); font-size: 13px; }
.ew-parts-total small { font-size: 7px; }

@media (max-width: 1100px) {
  .ew-inventory-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ew-inventory-two-columns { grid-template-columns: 1fr; }
  .ew-report-part-request form { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-report-part-request form .ew-btn { justify-self: start; }
}

@media (max-width: 800px) {
  .ew-inventory-title { align-items: stretch; flex-direction: column; }
  .ew-inventory-rule { min-width: 0; }
  .ew-inventory-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-inventory-layout { grid-template-columns: 1fr; }
  .ew-inventory-groups { overflow-x: auto; display: flex; }
  .ew-inventory-groups > strong { display: none; }
  .ew-inventory-groups button { min-width: max-content; gap: 12px; }
	.ew-request-queue,.ew-inventory-setup-grid,.ew-repair-card-queue { grid-template-columns: 1fr; }
	.ew-inventory-repair-card { grid-template-columns: auto minmax(0,1fr) auto; }
	.ew-inventory-repair-card > span:nth-child(3) { grid-column: 2; }
	.ew-inventory-repair-card > strong { grid-column: 3; grid-row: 1 / 3; }
	.ew-order-part-line { grid-template-columns: 1fr; }
  .ew-order-part-line > strong { text-align: right; }
}

@media (max-width: 620px) {
  .ew-inventory-panel { padding: 9px; }
  .ew-inventory-stats article { padding: 9px; }
  .ew-inventory-stats article > i { width: 32px; height: 32px; flex-basis: 32px; }
  .ew-inventory-stats b { font-size: 13px; }
  .ew-inventory-filters { grid-template-columns: 1fr; }
  .ew-inventory-table-wrap { overflow: visible; border: 0; background: transparent; }
  .ew-inventory-table { min-width: 0; display: block; }
  .ew-inventory-table thead { display: none; }
  .ew-inventory-table tbody { display: grid; gap: 8px; }
  .ew-inventory-table tr { border: 1px solid var(--ew-border); border-radius: 11px; background: #fff; padding: 7px; display: grid; grid-template-columns: 1fr 1fr; }
  .ew-inventory-table td { border: 0; padding: 6px; display: block; }
  .ew-inventory-table td::before { content: attr(data-label); margin-bottom: 2px; display: block; color: #8a9aa0; font-size: 5.5px; }
  .ew-inventory-table td:first-child { grid-column: 1 / -1; border-bottom: 1px solid #edf2f3; }
  .ew-inventory-table td[hidden] { display: none; }
  .ew-purchase-line { grid-template-columns: 1fr 1fr 28px; }
  .ew-purchase-line label:first-child { grid-column: 1 / -1; }
  .ew-purchase-line > button { grid-column: 3; grid-row: 2; }
	.ew-report-part-request form { grid-template-columns: 1fr; }
	.ew-direct-issue-form { grid-template-columns: 1fr; }
	.ew-direct-warehouse,.ew-direct-issue-lines,.ew-direct-issue-form > .ew-btn[data-add-direct-issue-row],.ew-direct-notes,.ew-direct-issue-form > .ew-btn[type=submit] { grid-column: 1; }
	.ew-direct-issue-line { grid-template-columns: 1fr 1fr 30px; }
	.ew-direct-issue-line label:first-child { grid-column: 1 / -1; }
	.ew-direct-issue-line > button { grid-column: 3; grid-row: 2; }
	.ew-order-part-line dl { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-part-return-form { align-items: stretch; flex-direction: column; }
	.ew-part-price-form { align-items: stretch; flex-direction: column; }
	.ew-part-price-form label { max-width: none; }
  .ew-part-return-form label { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ew-media-grid img { transition: none !important; }
}

/* Easy Workshop 0.3: compact card header, automatic repair sessions and health checklist */
.ew-detail-v3 { padding-bottom: 42px; }
.ew-order-compact-header { margin: -8px 0 0; padding: 12px 48px 12px 12px; border: 1px solid var(--ew-border); border-radius: 16px; background: linear-gradient(145deg,#fff,#f5fafa); display: grid; grid-template-columns: 128px minmax(0,1fr); gap: 14px; }
.ew-order-cover { min-height: 128px; overflow: hidden; border-radius: 13px; background: #eaf2f3; }
.ew-order-cover > a, .ew-order-cover > span { width: 100%; height: 100%; min-height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #779099; }
.ew-order-cover img { width: 100%; height: 100%; min-height: 128px; object-fit: cover; display: block; }
.ew-order-cover .ew-icon { width: 34px; height: 34px; }
.ew-order-cover small { font-size: 8px; }
.ew-order-header-body { min-width: 0; }
.ew-order-title-row, .ew-order-identity { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ew-order-title-row h2 { margin: 1px 0 0; font-size: 21px; line-height: 1.35; }
.ew-order-title-row .ew-status { font-size: 9px; padding: 5px 9px; }
.ew-order-identity { margin: 4px 0 9px; color: var(--ew-muted); font-size: 8px; }
.ew-order-identity b { color: #4d6871; font-size: 9px; }
.ew-compact-facts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.ew-compact-facts > div { min-width: 0; border: 1px solid #e4edef; border-radius: 9px; background: rgba(255,255,255,.78); padding: 6px 8px; display: flex; flex-direction: column; }
.ew-compact-facts small { color: var(--ew-muted); font-size: 7px; }
.ew-compact-facts b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ew-detail-v3 .ew-detail-quicknav { margin-top: 12px; }
.ew-card-actions-single { grid-template-columns: 1fr; }
.ew-card-actions-single .ew-inline-form { grid-template-columns: minmax(0,1fr) auto; }
.ew-live-repair-session { margin: 13px 0; border: 1px solid #bfe4df; border-radius: 13px; background: linear-gradient(90deg,#ecfaf7,#f6fcfb); padding: 10px 12px; display: flex; align-items: center; gap: 10px; }
.ew-live-repair-session > i { width: 34px; height: 34px; border-radius: 10px; background: #d7f1ec; color: #19896d; display: grid; place-items: center; font-style: normal; }
.ew-live-repair-session > i .ew-icon { width: 18px; height: 18px; }
.ew-live-repair-session > span { display: flex; flex: 1; flex-direction: column; }
.ew-live-repair-session b { font-size: 9px; }
.ew-live-repair-session small { color: #5f7d76; font-size: 8px; }
.ew-live-repair-session strong { direction: ltr; color: #11765f; font: 900 17px/1.2 "Vazirmatn",Tahoma,sans-serif; letter-spacing: .05em; }
.ew-live-repair-session.is-error { border-color: #efcdd4; background: #fff5f6; }
.ew-live-repair-session.is-error > i { background: #fae6e9; color: var(--ew-rose); }
.ew-live-repair-session.is-complete { border-color: #cae6d5; background: #f0faf4; }
.ew-live-repair-session.is-complete > i { background: #dcf2e5; color: var(--ew-green); }
.ew-live-repair-session.is-complete strong { color: var(--ew-green); font-size: 12px; letter-spacing: 0; }
.ew-owner-statements { display: grid; gap: 12px; }
.ew-owner-statement { overflow: hidden; border: 1px solid #dce8ea; border-radius: 14px; background: #fff; }
.ew-owner-statement > header { min-height: 61px; border-bottom: 1px solid #e7eff1; background: linear-gradient(90deg,#f4faf9,#fbfdfd); padding: 10px 12px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; }
.ew-owner-statement > header > span { width: 31px; height: 31px; border-radius: 10px; background: var(--ew-primary-soft); color: var(--ew-primary-dark); display: grid; place-items: center; font-size: 10px; font-weight: 900; }
.ew-owner-statement > header > div { min-width: 0; }
.ew-owner-statement > header small { color: var(--ew-primary-dark); font-size: 7px; font-weight: 850; }
.ew-owner-statement > header h4 { margin: 0; font-size: 10px; line-height: 1.65; }
.ew-owner-statement > header > b { border-radius: 999px; background: #edf4f5; padding: 4px 7px; color: #607780; font-size: 7px; white-space: nowrap; }
.ew-statement-repairs { display: grid; gap: 8px; padding: 10px; }
.ew-repair-entry { border: 1px solid #e1eaec; border-radius: 11px; background: #fbfdfd; padding: 10px; }
.ew-repair-entry-meta { display: flex; align-items: center; gap: 8px; }
.ew-repair-entry-meta > span:nth-child(2) { display: flex; flex-direction: column; }
.ew-repair-entry-meta b { font-size: 9px; }
.ew-repair-entry-meta small { color: var(--ew-muted); font-size: 7px; }
.ew-repair-entry-meta time { margin-right: auto; border-radius: 999px; background: #e7f6f1; padding: 4px 7px; color: #267a61; font-size: 7px; white-space: nowrap; }
.ew-repair-entry > p { margin: 9px 0 0; border-right: 3px solid #79c9c7; padding-right: 9px; color: #455f69; font-size: 10px; line-height: 1.85; }
.ew-report-photos { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; margin-top: 9px; }
.ew-report-photos a { overflow: hidden; aspect-ratio: 1; border-radius: 8px; background: #eaf1f2; }
.ew-report-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ew-no-repair-yet { margin: 0; padding: 12px; color: var(--ew-muted); font-size: 8px; }
.ew-add-repair-item { border-top: 1px solid #e8eff1; background: #fcfefe; }
.ew-add-repair-item > summary { padding: 11px 12px; display: flex; align-items: center; gap: 7px; color: var(--ew-primary-dark); font-size: 9px; font-weight: 900; cursor: pointer; list-style: none; }
.ew-add-repair-item > summary::-webkit-details-marker { display: none; }
.ew-add-repair-item > summary .ew-icon { width: 17px; height: 17px; }
.ew-add-repair-item[open] > summary { background: #f1f9f9; }
.ew-repair-item-form { margin: 0 10px 10px; }
.ew-file-picker-compact { min-height: 64px; }
.ew-final-report-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ew-final-report-row small { color: var(--ew-muted); font-size: 8px; }
.ew-check-progress { margin: -2px 0 13px; display: grid; grid-template-columns: auto minmax(120px,1fr) auto; align-items: center; gap: 9px; color: var(--ew-muted); font-size: 8px; }
.ew-check-progress > div { height: 7px; overflow: hidden; border-radius: 99px; background: #e9f0f1; }
.ew-check-progress > div i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,#20aa8b,#0a9ca5); }
.ew-check-progress strong { color: var(--ew-primary-dark); font-size: 9px; }
.ew-health-section { overflow: hidden; padding: 0 !important; border-radius: 14px !important; }
.ew-health-section legend { width: 100%; margin: 0; padding: 10px 12px !important; background: linear-gradient(90deg,#edf8f7,#f8fbfb); display: flex; align-items: center; gap: 8px; }
.ew-health-section legend i { width: 28px; height: 28px; border-radius: 9px; background: #daf1ef; color: var(--ew-primary-dark); display: grid; place-items: center; }
.ew-health-section legend i .ew-icon { width: 15px; height: 15px; }
.ew-health-section legend span { font-size: 10px; font-weight: 900; }
.ew-health-section legend b { margin-right: auto; color: var(--ew-muted); font-size: 7px; }
.ew-health-row { padding: 11px 12px; display: grid; grid-template-columns: minmax(135px,.8fr) minmax(280px,1.4fr); align-items: center; gap: 9px 12px; border-top: 1px solid #edf2f3; }
.ew-health-label { display: flex; align-items: center; gap: 7px; }
.ew-health-label b { font-size: 9px; }
.ew-health-label small { border-radius: 999px; background: #fff0df; padding: 3px 6px; color: #a76819; font-size: 6px; }
.ew-health-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
.ew-health-options label { cursor: pointer; }
.ew-health-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ew-health-options span { min-height: 34px; border: 1px solid #dfe8ea; border-radius: 8px; background: #f8fbfb; padding: 6px 4px; display: grid; place-items: center; color: #697d85; font-size: 7px; text-align: center; transition: .15s; }
.ew-health-options .is-ok input:checked + span { border-color: #7bc6a7; background: #e3f6ed; color: #1f8056; box-shadow: 0 0 0 2px rgba(36,152,101,.1); }
.ew-health-options .is-attention input:checked + span { border-color: #e6b877; background: #fff2df; color: #9e6218; box-shadow: 0 0 0 2px rgba(183,119,24,.1); }
.ew-health-options .is-not_checked input:checked + span { border-color: #aebfc4; background: #edf2f3; color: #536a73; }
.ew-health-options .is-not_applicable input:checked + span { border-color: #b5a9df; background: #f0edfb; color: #6652b9; }
.ew-health-options input:focus-visible + span { outline: 2px solid var(--ew-primary); outline-offset: 1px; }
.ew-health-note { grid-column: 2; width: 100%; min-height: 36px; border: 1px solid #e0e9eb; border-radius: 8px; background: #fbfdfd; padding: 6px 9px; font-size: 8px; }
.ew-media-visibility-note { margin: -2px 0 12px; border: 0 !important; background: transparent !important; padding: 0 !important; color: var(--ew-muted) !important; font-size: 8px !important; }

@media (max-width: 800px) {
  .ew-order-compact-header { padding: 11px 44px 11px 11px; grid-template-columns: 105px minmax(0,1fr); }
  .ew-order-cover, .ew-order-cover > a, .ew-order-cover > span, .ew-order-cover img { min-height: 112px; }
  .ew-compact-facts { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-health-row { grid-template-columns: 1fr; }
  .ew-health-note { grid-column: 1; }
}

@media (max-width: 520px) {
  .ew-order-compact-header { padding: 48px 10px 10px; grid-template-columns: 86px minmax(0,1fr); gap: 10px; }
  .ew-order-cover, .ew-order-cover > a, .ew-order-cover > span, .ew-order-cover img { min-height: 96px; }
  .ew-order-title-row { align-items: flex-start; }
  .ew-order-title-row h2 { font-size: 17px; }
  .ew-order-title-row .ew-status { font-size: 7px; }
  .ew-order-identity { align-items: flex-start; flex-direction: column; gap: 2px; }
  .ew-compact-facts { grid-template-columns: 1fr 1fr; }
  .ew-live-repair-session { align-items: flex-start; flex-wrap: wrap; }
  .ew-live-repair-session strong { width: 100%; padding-right: 44px; }
  .ew-owner-statement > header { grid-template-columns: auto minmax(0,1fr); }
  .ew-owner-statement > header > b { display: none; }
  .ew-repair-entry-meta { flex-wrap: wrap; }
  .ew-repair-entry-meta time { width: 100%; margin-right: 34px; }
  .ew-report-photos { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .ew-final-report-row { align-items: stretch; flex-direction: column; }
  .ew-health-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-check-progress { grid-template-columns: 1fr auto; }
  .ew-check-progress > div { grid-column: 1 / -1; grid-row: 2; }
}

/* CRM 0.6 */
.ew-crm-workspace { margin-top: 34px; scroll-margin-top: 92px; }
.ew-crm-live-badge { min-width: 150px; border: 1px solid #dbe8ea; border-radius: 16px; background: linear-gradient(135deg,#fff,#eff9f8); padding: 10px 13px; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1px 8px; box-shadow: 0 12px 34px rgba(41,91,93,.07); }
.ew-crm-live-badge .ew-icon { grid-row: 1 / 3; width: 25px; height: 25px; color: var(--ew-primary); }
.ew-crm-live-badge span { color: var(--ew-muted); font-size: 8px; }
.ew-crm-live-badge b { font-size: 12px; }
.ew-crm-stat-grid { margin: 16px 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 10px; }
.ew-crm-stat-grid article { min-height: 94px; border: 1px solid #e0eaec; border-radius: 16px; background: #fff; padding: 13px; display: flex; flex-direction: column; justify-content: center; box-shadow: 0 10px 28px rgba(39,78,83,.05); }
.ew-crm-stat-grid article.is-overdue { border-color: #f0c9c3; background: linear-gradient(145deg,#fff,#fff2f0); }
.ew-crm-stat-grid small { color: var(--ew-muted); font-size: 8px; }
.ew-crm-stat-grid b { margin: 3px 0; color: #173f49; font-size: 19px; }
.ew-crm-stat-grid span { color: #779097; font-size: 7px; line-height: 1.6; }
.ew-crm-stat-grid .is-overdue b { color: #b43b32; }
.ew-crm-layout { display: grid; grid-template-columns: minmax(0,1fr) 292px; align-items: start; gap: 14px; }
.ew-crm-main,.ew-crm-side { display: grid; gap: 14px; }
.ew-crm-queue-help,.ew-crm-customer-panel > .ew-panel-heading > b { color: var(--ew-muted); font-size: 8px; font-weight: 700; }
.ew-crm-task-list { display: grid; gap: 8px; }
.ew-crm-task-list > article { border: 1px solid #e2eaec; border-right: 4px solid #91c9c5; border-radius: 13px; background: #fbfdfd; padding: 10px; display: grid; grid-template-columns: 104px minmax(0,1fr) auto auto; align-items: center; gap: 10px; }
.ew-crm-task-list > article.is-high { border-right-color: #e0a743; }
.ew-crm-task-list > article.is-urgent,.ew-crm-task-list > article.is-overdue { border-right-color: #d95145; background: #fff9f8; }
.ew-crm-task-date { display: flex; flex-direction: column; }
.ew-crm-task-date small { color: #b34a42; font-size: 7px; font-weight: 850; }
.ew-crm-task-date b { font-size: 8px; }
.ew-crm-task-copy { min-width: 0; }
.ew-crm-task-copy > span { color: var(--ew-primary-dark); font-size: 7px; font-weight: 850; }
.ew-crm-task-copy h4 { margin: 1px 0 2px; font-size: 10px; }
.ew-crm-task-copy p,.ew-crm-task-copy small,.ew-crm-task-copy em { margin: 0; color: var(--ew-muted); font-size: 7px; font-style: normal; line-height: 1.7; }
.ew-crm-task-copy small,.ew-crm-task-copy em { display: block; }
.ew-crm-task-list form { margin: 0; }
.ew-crm-task-list .ew-btn { min-height: 32px; padding: 6px 9px; font-size: 8px; }
.ew-crm-toolbar { margin-bottom: 10px; display: grid; gap: 9px; }
.ew-crm-toolbar > label { position: relative; display: block; }
.ew-crm-toolbar > label .ew-icon { position: absolute; right: 11px; top: 50%; width: 15px; height: 15px; color: #70868e; transform: translateY(-50%); }
.ew-crm-toolbar > label input { width: 100%; min-height: 40px; border: 1px solid #dfe8ea; border-radius: 11px; background: #f9fcfc; padding: 8px 37px 8px 10px; font-size: 9px; }
.ew-crm-segments { display: flex; flex-wrap: wrap; gap: 5px; }
.ew-crm-segments button { border: 1px solid #dde8ea; border-radius: 999px; background: #fff; padding: 6px 10px; color: #5c737b; font: inherit; font-size: 7px; font-weight: 750; cursor: pointer; }
.ew-crm-segments button.is-active { border-color: #7cc4c0; background: #e7f6f5; color: #126f72; }
.ew-crm-customer-list { display: grid; gap: 7px; }
.ew-crm-customer-card { overflow: hidden; border: 1px solid #e2eaec; border-radius: 13px; background: #fff; }
.ew-crm-customer-card[hidden] { display: none; }
.ew-crm-customer-card > summary { min-height: 65px; padding: 9px 11px; display: grid; grid-template-columns: auto minmax(150px,1.2fr) repeat(3,minmax(88px,.7fr)) auto; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.ew-crm-customer-card > summary::-webkit-details-marker { display: none; }
.ew-crm-customer-card[open] > summary { border-bottom: 1px solid #e8eff0; background: linear-gradient(90deg,#f0f9f8,#fff); }
.ew-crm-customer-card > summary > i { transition: .18s; color: #6b8189; }
.ew-crm-customer-card[open] > summary > i { transform: rotate(180deg); }
.ew-crm-customer-name { min-width: 0; display: flex; flex-direction: column; }
.ew-crm-customer-name > b { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ew-crm-customer-name > small { color: var(--ew-muted); font-size: 7px; }
.ew-crm-customer-name > span { display: flex; flex-wrap: wrap; gap: 3px; }
.ew-crm-customer-name em,.ew-crm-tag-cloud span { border: 1px solid color-mix(in srgb,var(--tag-color) 36%,#fff); border-radius: 999px; background: color-mix(in srgb,var(--tag-color) 10%,#fff); padding: 2px 5px; color: var(--tag-color); font-size: 6px; font-style: normal; font-weight: 800; }
.ew-crm-customer-fact { min-width: 0; display: flex; flex-direction: column; }
.ew-crm-customer-fact small { color: var(--ew-muted); font-size: 6px; }
.ew-crm-customer-fact b { overflow: hidden; color: #38555e; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ew-crm-customer-fact b.is-debt { color: #bd4a40; }
.ew-crm-customer-body { padding: 11px; background: #fbfdfd; }
.ew-crm-profile-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.ew-crm-profile-grid > section { min-width: 0; border: 1px solid #e4ecee; border-radius: 11px; background: #fff; padding: 10px; }
.ew-crm-profile-grid h4,.ew-crm-customer-feedback h4 { margin: 0 0 8px; font-size: 9px; }
.ew-crm-profile-grid dl { margin: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.ew-crm-profile-grid dl div { border-radius: 8px; background: #f5f9fa; padding: 6px; display: flex; flex-direction: column; }
.ew-crm-profile-grid dt { color: var(--ew-muted); font-size: 6px; }
.ew-crm-profile-grid dd { overflow: hidden; margin: 1px 0 0; color: #34525b; font-size: 8px; font-weight: 800; text-overflow: ellipsis; }
.ew-crm-profile-grid a { color: var(--ew-primary-dark); }
.ew-crm-vehicles,.ew-crm-mini-tasks,.ew-crm-mini-timeline { display: grid; gap: 5px; }
.ew-crm-vehicles article,.ew-crm-mini-tasks article { border-radius: 8px; background: #f5f9fa; padding: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ew-crm-vehicles span,.ew-crm-mini-tasks span { display: flex; flex-direction: column; }
.ew-crm-vehicles b,.ew-crm-mini-tasks b { font-size: 8px; }
.ew-crm-vehicles small,.ew-crm-mini-tasks small,.ew-crm-vehicles em,.ew-crm-mini-tasks time { color: var(--ew-muted); font-size: 6px; font-style: normal; }
.ew-crm-mini-timeline article { display: grid; grid-template-columns: auto 1fr; gap: 7px; }
.ew-crm-mini-timeline i { width: 8px; height: 8px; margin-top: 4px; border: 2px solid #b4ddda; border-radius: 50%; background: #fff; }
.ew-crm-mini-timeline span { min-width: 0; }
.ew-crm-mini-timeline b { display: block; font-size: 8px; }
.ew-crm-mini-timeline small,.ew-crm-mini-timeline p { margin: 0; color: var(--ew-muted); font-size: 6px; line-height: 1.6; }
.ew-crm-inline-actions { margin-top: 9px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.ew-crm-inline-actions > details { border: 1px solid #dfe9eb; border-radius: 10px; background: #fff; }
.ew-crm-inline-actions > details > summary { padding: 8px; color: var(--ew-primary-dark); font-size: 8px; font-weight: 850; text-align: center; cursor: pointer; list-style: none; }
.ew-crm-inline-actions > details > summary::-webkit-details-marker { display: none; }
.ew-crm-inline-actions > details[open] { grid-column: 1 / -1; }
.ew-crm-inline-actions > details[open] > summary { border-bottom: 1px solid #e7eef0; background: #eef8f7; }
.ew-crm-inline-actions form { padding: 9px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ew-crm-inline-actions label,.ew-crm-action label { display: grid; gap: 4px; }
.ew-crm-inline-actions label > span,.ew-crm-action label > span { color: #597078; font-size: 7px; font-weight: 750; }
.ew-crm-inline-actions .is-wide { grid-column: 1 / -1; }
.ew-crm-inline-actions input,.ew-crm-inline-actions select,.ew-crm-inline-actions textarea,.ew-crm-action input,.ew-crm-action select,.ew-crm-action textarea { width: 100%; min-height: 35px; border: 1px solid #dce7e9; border-radius: 8px; background: #fbfdfd; padding: 6px 8px; font: inherit; font-size: 8px; }
.ew-crm-inline-actions textarea,.ew-crm-action textarea { min-height: 58px; resize: vertical; }
.ew-crm-inline-actions .ew-btn { grid-column: 1 / -1; justify-self: start; }
.ew-crm-tag-actions { padding: 9px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ew-crm-tag-actions form { padding: 0; display: flex; grid-template-columns: none; gap: 5px; }
.ew-crm-tag-actions form:first-child { flex-basis: 100%; }
.ew-crm-tag-actions select { flex: 1; }
.ew-crm-tag-actions form:not(:first-child) button { border: 1px solid color-mix(in srgb,var(--tag-color) 38%,#fff); border-radius: 999px; background: color-mix(in srgb,var(--tag-color) 9%,#fff); padding: 4px 7px; color: var(--tag-color); font: inherit; font-size: 7px; cursor: pointer; }
.ew-crm-customer-feedback { margin-top: 9px; border-top: 1px solid #e3ebed; padding-top: 9px; }
.ew-crm-customer-feedback article { margin-top: 5px; border-radius: 8px; background: #fff; padding: 7px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.ew-crm-customer-feedback span { display: flex; flex-direction: column; }
.ew-crm-customer-feedback b { font-size: 8px; }
.ew-crm-customer-feedback small { color: var(--ew-muted); font-size: 6px; }
.ew-crm-customer-feedback strong { color: #d69a20; font-size: 10px; }
.ew-crm-customer-feedback p { grid-column: 1 / -1; margin: 0; color: #526971; font-size: 7px; }
.ew-crm-contact-ledger { display: grid; gap: 6px; }
.ew-crm-contact-ledger article { border-bottom: 1px solid #e9eff0; padding: 7px 2px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 8px; }
.ew-crm-contact-ledger article:last-child { border-bottom: 0; }
.ew-crm-contact-ledger > article > i { width: 29px; height: 29px; border-radius: 9px; background: #e7f5f4; color: var(--ew-primary-dark); display: grid; place-items: center; }
.ew-crm-contact-ledger .ew-icon { width: 15px; height: 15px; }
.ew-crm-contact-ledger span { min-width: 0; }
.ew-crm-contact-ledger b { display: block; font-size: 8px; }
.ew-crm-contact-ledger small,.ew-crm-contact-ledger p,.ew-crm-contact-ledger em { margin: 0; color: var(--ew-muted); font-size: 6px; font-style: normal; line-height: 1.7; }
.ew-crm-action { overflow: hidden; border: 1px solid #dfe9eb; border-radius: 14px; background: #fff; }
.ew-crm-action > summary { padding: 11px; display: flex; align-items: center; gap: 9px; cursor: pointer; list-style: none; }
.ew-crm-action > summary::-webkit-details-marker { display: none; }
.ew-crm-action > summary > .ew-icon { width: 23px; height: 23px; color: var(--ew-primary); }
.ew-crm-action > summary span { display: flex; flex-direction: column; }
.ew-crm-action > summary b { font-size: 9px; }
.ew-crm-action > summary small { color: var(--ew-muted); font-size: 6px; }
.ew-crm-action[open] > summary { border-bottom: 1px solid #e5edef; background: linear-gradient(90deg,#edf8f7,#fff); }
.ew-crm-action > form { padding: 10px; display: grid; gap: 8px; }
.ew-crm-action .ew-form-grid { gap: 7px; }
.ew-crm-action form > p { margin: 0; color: var(--ew-muted); font-size: 7px; line-height: 1.7; }
.ew-crm-tag-cloud { padding: 0 10px 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.ew-crm-feedback-summary { padding: 12px; }
.ew-crm-feedback-summary article { border-bottom: 1px solid #e8eff0; padding: 8px 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.ew-crm-feedback-summary article:last-child { border-bottom: 0; }
.ew-crm-feedback-summary span { min-width: 0; display: flex; flex-direction: column; }
.ew-crm-feedback-summary b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.ew-crm-feedback-summary small { color: var(--ew-muted); font-size: 6px; }
.ew-crm-feedback-summary strong { color: #d49a24; font-size: 9px; }
.ew-crm-feedback-summary p { grid-column: 1 / -1; margin: 0; color: #536b73; font-size: 7px; }
.ew-customer-care { margin-top: 24px; scroll-margin-top: 92px; }
.ew-customer-care-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.ew-customer-care-grid > section:last-child { grid-column: 1 / -1; }
.ew-customer-approvals { display: grid; gap: 8px; }
.ew-customer-approvals > form { border: 1px solid #ddc9f1; border-radius: 12px; background: linear-gradient(145deg,#fcf9ff,#fff); padding: 11px; display: grid; gap: 9px; }
.ew-customer-approvals header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ew-customer-approvals header span { display: flex; flex-direction: column; }
.ew-customer-approvals header b { font-size: 9px; }
.ew-customer-approvals header small,.ew-customer-approvals header time { color: var(--ew-muted); font-size: 7px; }
.ew-customer-approvals > form > p { margin: 0; border-right: 3px solid #a987d1; padding-right: 8px; color: #526971; font-size: 8px; line-height: 1.8; }
.ew-customer-approvals label { display: grid; gap: 4px; }
.ew-customer-approvals label > span { color: #596f77; font-size: 7px; }
.ew-customer-approvals textarea { width: 100%; border: 1px solid #dfd6e9; border-radius: 9px; background: #fff; padding: 8px; font: inherit; font-size: 8px; resize: vertical; }
.ew-customer-approvals footer { display: flex; gap: 7px; }
.ew-customer-reminders { display: grid; gap: 7px; }
.ew-customer-reminders article { border: 1px solid #e1eaec; border-radius: 11px; background: #f9fcfc; padding: 9px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.ew-customer-reminders > article > i { width: 32px; height: 32px; border-radius: 10px; background: #e6f5f4; color: var(--ew-primary); display: grid; place-items: center; }
.ew-customer-reminders .ew-icon { width: 16px; height: 16px; }
.ew-customer-reminders span { display: flex; flex-direction: column; }
.ew-customer-reminders b { font-size: 9px; }
.ew-customer-reminders small,.ew-customer-reminders time { color: var(--ew-muted); font-size: 7px; }
.ew-customer-feedback-form { border: 1px solid #e0e9eb; border-radius: 12px; background: #f9fcfc; padding: 11px; display: grid; gap: 9px; }
.ew-customer-feedback-form header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ew-customer-feedback-form header b { font-size: 9px; }
.ew-customer-feedback-form header small { color: var(--ew-muted); font-size: 7px; }
.ew-customer-feedback-form fieldset { margin: 0; border: 0; padding: 0; }
.ew-customer-feedback-form legend,.ew-customer-feedback-form label > span { margin-bottom: 5px; color: #526a72; font-size: 8px; }
.ew-rating-picker { display: flex; direction: ltr; justify-content: flex-end; gap: 5px; }
.ew-rating-picker label { cursor: pointer; }
.ew-rating-picker input { position: absolute; opacity: 0; }
.ew-rating-picker span { width: 34px; height: 34px; border: 1px solid #e5d6ad; border-radius: 9px; background: #fff; display: grid; place-items: center; color: #c9a348; font-size: 18px; transition: .15s; }
.ew-rating-picker small { display: none; }
.ew-rating-picker input:checked + span { border-color: #dcae3e; background: #fff5d9; color: #d28e00; box-shadow: 0 0 0 2px rgba(218,160,29,.14); }
.ew-customer-feedback-form textarea { width: 100%; border: 1px solid #dce7e9; border-radius: 9px; padding: 8px; font: inherit; font-size: 8px; resize: vertical; }
.ew-submitted-feedback { margin-top: 9px; border-radius: 10px; background: #eff8f6; padding: 8px; display: flex; align-items: center; gap: 8px; }
.ew-submitted-feedback span,.ew-submitted-feedback small { color: var(--ew-muted); font-size: 7px; }
.ew-submitted-feedback b { color: #d69a20; }
.ew-submitted-feedback small { margin-right: auto; }
.ew-order-crm-module > .ew-module-heading > a { border-radius: 999px; background: #e9f6f5; padding: 6px 9px; color: var(--ew-primary-dark); font-size: 7px; font-weight: 800; text-decoration: none; }
.ew-order-crm-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.ew-order-crm-summary article { border: 1px solid #e2eaec; border-radius: 10px; background: #f8fbfb; padding: 8px; display: flex; flex-direction: column; }
.ew-order-crm-summary small { color: var(--ew-muted); font-size: 6px; }
.ew-order-crm-summary b { font-size: 9px; }
.ew-order-crm-summary b.is-debt { color: #bd4a40; }
.ew-order-crm-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 4px; }
.ew-order-crm-tags span { border: 1px solid color-mix(in srgb,var(--tag-color) 38%,#fff); border-radius: 999px; background: color-mix(in srgb,var(--tag-color) 9%,#fff); padding: 3px 7px; color: var(--tag-color); font-size: 6px; font-weight: 800; }
.ew-order-crm-grid { margin-top: 9px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ew-order-crm-grid > section { border: 1px solid #e4ecee; border-radius: 10px; background: #fff; padding: 9px; }
.ew-order-crm-grid h4 { margin: 0 0 7px; font-size: 8px; }
.ew-order-crm-forms { margin-top: 8px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.ew-order-crm-forms > details { border: 1px solid #dfe9eb; border-radius: 10px; background: #fff; }
.ew-order-crm-forms > details > summary { padding: 8px; color: var(--ew-primary-dark); font-size: 8px; font-weight: 850; text-align: center; cursor: pointer; list-style: none; }
.ew-order-crm-forms > details > summary::-webkit-details-marker { display: none; }
.ew-order-crm-forms > details[open] { grid-column: 1 / -1; }
.ew-order-crm-forms > details[open] > summary { border-bottom: 1px solid #e6edef; background: #edf8f7; }
.ew-order-crm-forms form { padding: 9px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.ew-order-crm-forms label { display: grid; gap: 4px; }
.ew-order-crm-forms label > span { color: #597078; font-size: 7px; font-weight: 750; }
.ew-order-crm-forms .is-wide { grid-column: 1 / -1; }
.ew-order-crm-forms input,.ew-order-crm-forms select,.ew-order-crm-forms textarea { width: 100%; min-height: 35px; border: 1px solid #dce7e9; border-radius: 8px; background: #fbfdfd; padding: 6px 8px; font: inherit; font-size: 8px; }
.ew-order-crm-forms .ew-btn { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 1180px) {
  .ew-crm-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .ew-crm-layout { grid-template-columns: 1fr; }
  .ew-crm-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-crm-feedback-summary { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .ew-crm-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ew-crm-task-list > article { grid-template-columns: 90px minmax(0,1fr) auto; }
  .ew-crm-task-list > article form:last-child { display: none; }
  .ew-crm-customer-card > summary { grid-template-columns: auto minmax(130px,1fr) auto auto; }
  .ew-crm-customer-fact:nth-of-type(2) { display: none; }
  .ew-crm-profile-grid { grid-template-columns: 1fr; }
  .ew-crm-side,.ew-customer-care-grid { grid-template-columns: 1fr; }
  .ew-customer-care-grid > section:last-child { grid-column: 1; }
}

@media (max-width: 520px) {
  .ew-crm-live-badge { display: none; }
  .ew-crm-stat-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .ew-crm-stat-grid article { min-height: 83px; padding: 10px; }
  .ew-crm-stat-grid article:last-child { grid-column: 1 / -1; }
  .ew-crm-task-list > article { grid-template-columns: 1fr auto; }
  .ew-crm-task-date { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
  .ew-crm-task-copy { grid-column: 1 / -1; }
  .ew-crm-customer-card > summary { grid-template-columns: auto minmax(0,1fr) auto; }
  .ew-crm-customer-fact { display: none; }
  .ew-crm-profile-grid dl { grid-template-columns: 1fr 1fr; }
  .ew-crm-inline-actions { grid-template-columns: 1fr; }
  .ew-crm-inline-actions > details[open] { grid-column: 1; }
  .ew-crm-inline-actions form { grid-template-columns: 1fr; }
  .ew-crm-inline-actions .is-wide,.ew-crm-inline-actions .ew-btn { grid-column: 1; }
  .ew-customer-reminders article { grid-template-columns: auto 1fr; }
  .ew-customer-reminders time { grid-column: 2; }
  .ew-order-crm-summary { grid-template-columns: 1fr 1fr; }
  .ew-order-crm-grid,.ew-order-crm-forms { grid-template-columns: 1fr; }
  .ew-order-crm-forms > details[open] { grid-column: 1; }
  .ew-order-crm-forms form { grid-template-columns: 1fr; }
  .ew-order-crm-forms .is-wide,.ew-order-crm-forms .ew-btn { grid-column: 1; }
}

/* Finance 0.7 — managerial reports, FIFO profit, cheques and settlements. */
.ew-finance-v7 { --ew-finance-blue:#3978a7; --ew-finance-green:#258263; --ew-finance-gold:#a66a18; }
.ew-finance-hero { align-items: center; }
.ew-finance-hero-actions { display: flex; align-items: center; gap: 8px; }
.ew-report-range-label { border: 1px solid #d9e5e7; border-radius: 11px; background: #fff; padding: 9px 11px; color: #516a73; font-size: 8px; font-weight: 800; white-space: nowrap; }
.ew-finance-filter { margin: -3px 0 14px; border: 1px solid #dce8ea; border-radius: 15px; background: rgba(255,255,255,.9); padding: 10px; display: grid; grid-template-columns: 150px 150px 150px auto minmax(240px,1fr); align-items: end; gap: 8px; box-shadow: var(--ew-shadow-soft); }
.ew-finance-filter label { display: grid; gap: 4px; }
.ew-finance-filter label span { color: var(--ew-muted); font-size: 7px; font-weight: 800; }
.ew-finance-filter input,.ew-finance-filter select { width: 100%; min-height: 37px; border: 1px solid #dbe6e8; border-radius: 9px; background: #fbfdfd; padding: 6px 8px; color: var(--ew-text); font: inherit; font-size: 8px; }
.ew-export-group { margin-right: auto; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 5px; }
.ew-export-group a,.ew-cheque-register .ew-panel-heading > a,.ew-commission-panel .ew-panel-heading > a { border: 1px solid #cfe4e1; border-radius: 8px; background: #edf8f6; padding: 7px 9px; color: var(--ew-primary-dark); font-size: 7px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.ew-finance-kpis { grid-template-columns: repeat(4,minmax(0,1fr)); }
.ew-finance-kpis article { position: relative; overflow: hidden; min-height: 91px; }
.ew-finance-kpis article::after { content:""; position:absolute; left:-28px; bottom:-38px; width:90px; height:90px; border-radius:50%; background:rgba(55,127,132,.055); }
.ew-finance-kpis article > span { display:block; margin-top:4px; color:var(--ew-muted); font-size:7px; }
.ew-finance-kpis .is-featured { border-color:#b9dcda; background:linear-gradient(140deg,#eff9f7,#fff); }
.ew-finance-kpis .is-profit { border-color:#c9e5d8; background:#f4fbf7; }
.ew-finance-kpis .is-profit b { color:var(--ew-finance-green); }
.ew-finance-kpis .is-loss { border-color:#edcfcc; background:#fff6f5; }
.ew-finance-kpis .is-loss b { color:#b54c44; }
.ew-management-report .ew-panel-heading > small { max-width:300px; color:var(--ew-muted); font-size:6.5px; text-align:left; }
.ew-management-grid { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(250px,.7fr); gap:12px; }
.ew-sales-chart { min-height:235px; overflow-x:auto; border:1px solid #e0e9eb; border-radius:13px; background:linear-gradient(180deg,#f9fcfc,#fff); padding:15px 12px 9px; display:flex; align-items:flex-end; gap:5px; }
.ew-sales-chart > div { min-width:22px; height:205px; display:grid; grid-template-rows:minmax(0,1fr) 22px; align-items:end; justify-items:center; gap:4px; }
.ew-sales-chart > div > span { width:13px; height:var(--bar-height); min-height:3px; border-radius:5px 5px 2px 2px; background:linear-gradient(180deg,#56aaa4,#1f807d); box-shadow:0 5px 12px rgba(26,119,116,.15); }
.ew-sales-chart small { direction:ltr; color:#82959c; font-size:5.5px; transform:rotate(-35deg); white-space:nowrap; }
.ew-position-card { border:1px solid #dce8ea; border-radius:13px; background:#fbfdfd; padding:12px; }
.ew-position-card h4 { margin:0 0 8px; color:#254851; font-size:9px; }
.ew-position-card dl { margin:0; display:grid; gap:2px; }
.ew-position-card dl > div { display:flex; justify-content:space-between; gap:10px; border-bottom:1px solid #e8eff0; padding:7px 0; }
.ew-position-card dt { color:var(--ew-muted); font-size:7px; }
.ew-position-card dd { margin:0; color:#31545c; font-size:8px; font-weight:900; text-align:left; }
.ew-position-card .is-liability dd { color:#a36619; }
.ew-position-card .is-total { margin-top:3px; border:0; border-radius:8px; background:#eaf7f4; padding:9px; }
.ew-position-card .is-total dt,.ew-position-card .is-total dd { color:var(--ew-primary-dark); font-size:9px; font-weight:900; }
.ew-inline-search { min-width:220px; border:1px solid #dce7e9; border-radius:9px; background:#fbfdfd; padding:0 8px; display:flex; align-items:center; gap:6px; }
.ew-inline-search .ew-icon { width:14px; color:#71868e; }
.ew-inline-search input { min-width:0; width:100%; min-height:34px; border:0; outline:0; background:transparent; color:var(--ew-text); font:inherit; font-size:8px; }
.ew-responsive-table { overflow-x:auto; border:1px solid #e2eaec; border-radius:12px; }
.ew-finance-table { width:100%; min-width:850px; border-collapse:collapse; }
.ew-finance-table th { background:#f2f7f8; padding:9px; color:#617881; font-size:7px; text-align:right; white-space:nowrap; }
.ew-finance-table td { border-top:1px solid #edf2f3; padding:9px; color:#405e67; font-size:7.5px; vertical-align:middle; }
.ew-finance-table td b,.ew-finance-table td small { display:block; }
.ew-finance-table td b { color:#274a53; font-size:8px; }
.ew-finance-table td small { margin-top:2px; color:var(--ew-muted); font-size:6px; }
.ew-finance-table td.is-positive { color:#25805f; font-weight:900; }
.ew-finance-table td.is-negative,.ew-account-cards strong.is-negative { color:#b84d45; font-weight:900; }
.ew-cheque-fields { grid-column:1/-1; border:1px dashed #d4c9e8; border-radius:10px; background:#faf8fe; padding:8px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; }
.ew-cheque-fields[hidden] { display:none !important; }
.ew-cheque-fields > p { grid-column:1/-1; margin:0; color:#685b80; font-size:6.5px; line-height:1.8; }
.ew-cheque-list { display:grid; gap:8px; }
.ew-cheque-list > article { border:1px solid #dfe8ea; border-right:4px solid #80959b; border-radius:12px; background:#fff; padding:10px; }
.ew-cheque-list > article.is-pending { border-right-color:#d09a3e; }
.ew-cheque-list > article.is-deposited { border-right-color:#4e85b3; }
.ew-cheque-list > article.is-cleared { border-right-color:#45a077; }
.ew-cheque-list > article.is-bounced,.ew-cheque-list > article.is-overdue { border-color:#e7b5b0; border-right-color:#c45a50; background:#fff8f7; }
.ew-cheque-list > article.is-void { opacity:.56; }
.ew-cheque-list article > header { display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.ew-cheque-list header span b,.ew-cheque-list header span small { display:block; }
.ew-cheque-list header b { font-size:9px; }
.ew-cheque-list header small { margin-top:3px; color:var(--ew-muted); font-size:7px; }
.ew-cheque-list header strong { color:#284d55; font-size:11px; }
.ew-cheque-list article > div { margin-top:8px; border-radius:8px; background:#f4f8f9; padding:7px; display:flex; align-items:center; flex-wrap:wrap; gap:7px 15px; color:#667d85; font-size:7px; }
.ew-cheque-list article > div em { margin-right:auto; border-radius:999px; background:#fff; padding:4px 7px; color:#4e6a73; font-style:normal; font-weight:850; }
.ew-cheque-list article > form { margin-top:8px; display:grid; grid-template-columns:150px minmax(180px,1fr) auto; gap:6px; }
.ew-cheque-list form input,.ew-cheque-list form select { min-width:0; min-height:34px; border:1px solid #dce7e9; border-radius:8px; background:#fff; padding:5px 7px; font:inherit; font-size:7px; }
.ew-commission-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.ew-commission-grid > article { border:1px solid #dde8ea; border-radius:12px; background:linear-gradient(145deg,#fbfdfd,#fff); padding:10px; }
.ew-commission-grid header { display:flex; justify-content:space-between; gap:8px; }
.ew-commission-grid header span b,.ew-commission-grid header span small { display:block; }
.ew-commission-grid header b { font-size:9px; }
.ew-commission-grid header small { color:var(--ew-muted); font-size:7px; }
.ew-commission-grid header em { border-radius:999px; background:#edf5f6; padding:4px 7px; color:#5e747c; font-size:6px; font-style:normal; }
.ew-commission-grid dl { margin:9px 0; display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.ew-commission-grid dl div { border-radius:8px; background:#f1f7f7; padding:7px; }
.ew-commission-grid dt { color:var(--ew-muted); font-size:6px; }
.ew-commission-grid dd { margin:2px 0 0; color:#26525a; font-size:9px; font-weight:900; }
.ew-commission-grid form { display:grid; grid-template-columns:1fr 1fr 1.3fr auto; align-items:end; gap:6px; }
.ew-commission-grid form label { display:grid; gap:3px; }
.ew-commission-grid form label span { color:var(--ew-muted); font-size:6px; }
.ew-commission-grid form input,.ew-commission-grid form select { width:100%; min-width:0; min-height:34px; border:1px solid #dbe7e8; border-radius:8px; padding:5px; font:inherit; font-size:7px; }
.ew-settlement-history { margin-top:12px; border-top:1px solid #e5edef; padding-top:10px; }
.ew-settlement-history h4 { margin:0 0 6px; font-size:8px; }
.ew-settlement-history > div { border-top:1px solid #edf2f3; padding:7px 0; display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:7px; }
.ew-settlement-history span b,.ew-settlement-history span small { display:block; }
.ew-settlement-history span b { font-size:8px; }
.ew-settlement-history span small { color:var(--ew-muted); font-size:6px; }
.ew-settlement-history strong { color:#267c61; font-size:8px; }
.ew-settlement-history .is-void { opacity:.5; text-decoration:line-through; }
.ew-settlement-history summary,.ew-transfer-history summary { color:#a84d46; font-size:6px; cursor:pointer; }
.ew-settlement-history details form,.ew-transfer-history details form { display:flex; gap:4px; }
.ew-settlement-history details input,.ew-transfer-history details input { min-width:90px; border:1px solid #ead6d4; border-radius:6px; padding:4px; font:inherit; font-size:6px; }
.ew-settlement-history details button,.ew-transfer-history details button { border:0; border-radius:6px; background:#b65249; padding:4px 6px; color:#fff; font:inherit; font-size:6px; }
.ew-transfer-history { border-top:1px solid #e6edef; padding:7px 10px; display:grid; gap:4px; }
.ew-transfer-history > div { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:6px; border-top:1px solid #edf2f3; padding:6px 0; }
.ew-transfer-history span b,.ew-transfer-history span small { display:block; }
.ew-transfer-history span b { font-size:7px; }
.ew-transfer-history span small { color:var(--ew-muted); font-size:6px; }
.ew-transfer-history strong { font-size:7px; }
.ew-transfer-history .is-void { opacity:.5; text-decoration:line-through; }
.ew-rate-list { border-top:1px solid #e6edef; padding:8px; display:grid; gap:6px; }
.ew-rate-list form { display:grid; grid-template-columns:minmax(80px,.8fr) minmax(120px,1fr) 70px auto; align-items:center; gap:5px; }
.ew-rate-list form b { font-size:7px; }
.ew-rate-list input,.ew-rate-list select { min-width:0; width:100%; min-height:31px; border:1px solid #dce7e9; border-radius:7px; padding:4px; font:inherit; font-size:6.5px; }
.ew-rate-list button { min-height:31px; border:0; border-radius:7px; background:#e5f4f2; color:var(--ew-primary-dark); font:inherit; font-size:6.5px; font-weight:850; }

@media (max-width: 1200px) {
  .ew-finance-filter { grid-template-columns:repeat(4,minmax(0,1fr)); }
  .ew-export-group { grid-column:1/-1; margin-right:0; justify-content:flex-start; }
  .ew-management-grid { grid-template-columns:1fr; }
  .ew-finance-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

@media (max-width: 800px) {
  .ew-finance-hero { align-items:flex-start; flex-direction:column; }
  .ew-finance-hero-actions { width:100%; justify-content:space-between; }
  .ew-finance-filter { grid-template-columns:1fr 1fr; }
  .ew-finance-filter > .ew-btn { align-self:stretch; }
  .ew-finance-kpis { grid-template-columns:1fr 1fr; }
  .ew-management-report .ew-panel-heading { align-items:flex-start; flex-direction:column; }
  .ew-inline-search { min-width:0; width:100%; }
  .ew-commission-grid { grid-template-columns:1fr; }
  .ew-commission-grid form { grid-template-columns:1fr 1fr; }
  .ew-commission-grid form label:nth-child(3),.ew-commission-grid form .ew-btn { grid-column:1/-1; }
  .ew-cheque-fields { grid-template-columns:1fr 1fr; }
}

@media (max-width: 520px) {
  .ew-finance-hero-actions { align-items:stretch; flex-direction:column; }
  .ew-finance-filter { grid-template-columns:1fr; }
  .ew-export-group { grid-column:1; }
  .ew-finance-kpis { grid-template-columns:1fr 1fr; gap:7px; }
  .ew-finance-kpis article { min-height:85px; }
  .ew-finance-kpis article b { font-size:11px; }
  .ew-position-card { padding:9px; }
  .ew-responsive-table { overflow:visible; border:0; }
  .ew-finance-table { min-width:0; display:block; }
  .ew-finance-table thead { display:none; }
  .ew-finance-table tbody { display:grid; gap:7px; }
  .ew-finance-table tr { border:1px solid #dfe8ea; border-radius:11px; background:#fff; padding:7px; display:grid; grid-template-columns:1fr 1fr; }
  .ew-finance-table td { border:0; padding:5px; }
  .ew-finance-table td::before { content:attr(data-label); display:block; color:#8a9ba1; font-size:5.5px; }
  .ew-finance-table td:nth-child(1),.ew-finance-table td:nth-child(2) { grid-column:1/-1; border-bottom:1px solid #edf2f3; }
  .ew-cheque-list article > header { flex-direction:column; }
  .ew-cheque-list article > form { grid-template-columns:1fr; }
  .ew-cheque-fields { grid-template-columns:1fr; }
  .ew-commission-grid form { grid-template-columns:1fr; }
  .ew-commission-grid form label:nth-child(3),.ew-commission-grid form .ew-btn { grid-column:1; }
  .ew-rate-list form { grid-template-columns:1fr 1fr; }
  .ew-rate-list form b { grid-column:1/-1; }
}

/* 0.8.1 — readable typography, separate module screens and explicit visibility. */
.ew-app [data-app-view][hidden] { display: none !important; }
.ew-app { font-size: var(--ew-base-font,16px); }
.ew-app :where(p,label,span,small,strong,b,em,time,dt,dd,summary,button,input,select,textarea,td,th,li) { font-size: var(--ew-base-font,16px) !important; }
.ew-app h1 { font-size: calc(var(--ew-base-font,16px) + 12px) !important; }
.ew-app h2 { font-size: calc(var(--ew-base-font,16px) + 8px) !important; }
.ew-app h3 { font-size: calc(var(--ew-base-font,16px) + 4px) !important; }
.ew-app h4 { font-size: calc(var(--ew-base-font,16px) + 2px) !important; }
.ew-app .ew-stat-grid article b,.ew-app .ew-finance-kpis article b,.ew-app .ew-cheque-kpis article b { font-size: calc(var(--ew-base-font,16px) + 5px) !important; }
.ew-app .ew-icon { width: 1.15em; height: 1.15em; }
.ew-plate,input[name="plate"],[data-plate] { direction:ltr !important; unicode-bidi:isolate; text-align:left !important; letter-spacing:.04em; font-variant-numeric:tabular-nums; }
.ew-order-meta span:first-child,.ew-order-facts span:first-child,.ew-history-list strong,.ew-person-order-list small,.ew-token-order summary em,.ew-compact-facts > div:nth-child(3) b,.ew-inventory-repair-card > span:nth-child(3) b,.ew-customer-feedback-form header small,.ew-crm-vehicles article small { direction:ltr; unicode-bidi:isolate; text-align:left; }
.ew-visibility-choice,.ew-customer-visibility { border:1px solid #cfe4e1; border-radius:12px; background:#f1faf8; padding:11px 12px; display:flex !important; align-items:flex-start; gap:10px; cursor:pointer; }
.ew-visibility-choice input,.ew-customer-visibility input { width:19px !important; height:19px !important; min-height:0 !important; margin:3px 0 0; accent-color:var(--ew-primary); flex:0 0 auto; }
.ew-visibility-choice > span,.ew-customer-visibility > span { display:grid; gap:2px; }
.ew-visibility-choice small,.ew-customer-visibility small { color:var(--ew-muted); font-weight:500; }
.ew-portal-choice { margin:0 16px 12px; }
.ew-reception-portal { margin-bottom:15px; }
.ew-group-multi { grid-column:1/-1; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.ew-group-multi > span { grid-column:1/-1; color:#526a72; font-weight:800; }
.ew-group-multi label { border:1px solid var(--ew-border); border-radius:9px; background:#fff; padding:8px; display:flex; align-items:center; gap:7px; }
.ew-group-multi input { width:18px; height:18px; min-height:0; accent-color:var(--ew-primary); }
.ew-settings-workspace { max-width:850px; }
.ew-font-setting { border:1px solid var(--ew-border); border-radius:16px; background:#fbfdfd; padding:22px; display:grid; gap:16px; }
.ew-font-setting > label,.ew-font-setting > div { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.ew-font-setting input[type="range"] { width:100%; accent-color:var(--ew-primary); }
.ew-font-setting output { border-radius:999px; background:var(--ew-primary-soft); padding:6px 12px; color:var(--ew-primary-dark); font-weight:900; }
.ew-font-setting .ew-btn { justify-self:start; }
.ew-cheques-workspace { display:grid; gap:14px; }
.ew-cheque-kpis { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.ew-cheque-kpis article { border:1px solid var(--ew-border); border-radius:14px; background:#fff; padding:15px; display:grid; gap:5px; box-shadow:var(--ew-shadow-soft); }
.ew-cheque-kpis small { color:var(--ew-muted); }
.ew-cheque-kpis .is-alert { border-color:#edc3bf; background:#fff8f7; }
.ew-cheque-kpis .is-alert b { color:#b64b43; }
.ew-cheque-create > summary { padding:14px; display:flex; align-items:center; gap:8px; color:var(--ew-primary-dark); font-weight:900; cursor:pointer; }
.ew-cheque-create > form { border-top:1px solid var(--ew-border); padding:14px; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.ew-cheque-create label { display:grid; gap:5px; }
.ew-cheque-create input,.ew-cheque-create select,.ew-cheque-toolbar > select { width:100%; min-height:42px; border:1px solid var(--ew-border); border-radius:10px; background:#fff; padding:7px 9px; }
.ew-cheque-create .ew-btn { align-self:end; }
.ew-cheque-toolbar { flex-wrap:wrap; }
.ew-cheque-toolbar > select { width:auto; min-width:150px; }
.ew-cheque-list [data-cheque-row][hidden] { display:none !important; }
.ew-token-visible-records { margin-top:20px; }
.ew-token-visible-card { margin-top:12px; border:1px solid var(--ew-border); border-radius:16px; background:#fff; overflow:hidden; box-shadow:var(--ew-shadow-soft); }
.ew-token-visible-card > header { border-bottom:1px solid var(--ew-border); background:#f5fafa; padding:13px 15px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ew-token-visible-card > header h3 { margin:2px 0 0; }
.ew-token-visible-card > div { padding:14px; display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ew-token-visible-card section { border:1px solid #e2ebed; border-radius:12px; padding:12px; }
.ew-token-visible-card section.is-wide { grid-column:1/-1; }
.ew-token-visible-card h4 { margin:0 0 9px; }
.ew-token-record { border-top:1px solid #edf2f3; padding:8px 0; display:grid; gap:3px; }
.ew-token-record:first-of-type { border-top:0; }
.ew-token-record p { margin:0; color:#49636c; }
.ew-token-record small { color:var(--ew-muted); }
.ew-token-part,.ew-token-check { grid-template-columns:1fr auto; align-items:center; }
.ew-token-part small,.ew-token-check small { grid-column:1/-1; }
.ew-token-media { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.ew-token-media img { width:100%; aspect-ratio:4/3; border-radius:9px; object-fit:cover; display:block; }

@media (max-width:800px) {
  .ew-group-multi,.ew-cheque-create > form { grid-template-columns:1fr 1fr; }
  .ew-cheque-kpis { grid-template-columns:1fr; }
}
@media (max-width:520px) {
  .ew-group-multi,.ew-cheque-create > form { grid-template-columns:1fr; }
  .ew-cheque-toolbar > select { width:100%; }
  .ew-token-visible-card > div { grid-template-columns:1fr; }
  .ew-token-visible-card section.is-wide { grid-column:1; }
  .ew-token-media { grid-template-columns:1fr 1fr; }
}
