/* Eletroware 2.1 — clean field-operations UI. Overrides the neon-only 2.0 skin. */
:root { color-scheme: light; }
body.ew-v2-collab, body.ew-v2-admin {
  --background: 210 20% 98%; --foreground: 218 24% 17%;
  --card: 0 0% 100%; --card-foreground: 218 24% 17%;
  --popover: 0 0% 100%; --popover-foreground: 218 24% 17%;
  --primary: 174 58% 30%; --primary-foreground: 0 0% 100%;
  --secondary: 210 18% 94%; --secondary-foreground: 218 24% 24%;
  --muted: 210 18% 95%; --muted-foreground: 215 12% 45%;
  --accent: 174 35% 92%; --accent-foreground: 174 58% 22%;
  --destructive: 0 65% 48%; --destructive-foreground: 0 0% 100%;
  --border: 214 18% 87%; --input: 214 18% 87%; --ring: 174 58% 30%;
  --sidebar-background: 0 0% 100%; --sidebar-foreground: 218 24% 24%;
  --sidebar-primary: 174 58% 30%; --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 174 35% 94%; --sidebar-accent-foreground: 174 58% 22%;
  --sidebar-border: 214 18% 89%; --sidebar-ring: 174 58% 30%;
  min-width: 320px; overflow-x: hidden; color: #25313c !important;
  background: #f4f6f8 !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
body.ew-v2-collab::before, body.ew-v2-admin::before { display: none !important; content: none !important; }
body.ew-v2-collab #root, body.ew-v2-admin #root { isolation: isolate; }
body.ew-v2-collab h1, body.ew-v2-collab h2, body.ew-v2-collab h3, body.ew-v2-collab h4,
body.ew-v2-admin h1, body.ew-v2-admin h2, body.ew-v2-admin h3, body.ew-v2-admin h4 {
  color: #202b36; font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
  letter-spacing: -.02em; text-shadow: none !important;
}
body.ew-v2-collab header.sticky, body.ew-v2-admin header.sticky {
  background: rgba(255,255,255,.96) !important; border-color: #e2e7eb !important;
  box-shadow: 0 1px 3px rgba(22,34,48,.06) !important; backdrop-filter: blur(12px) !important;
}
body.ew-v2-collab header.sticky::after, body.ew-v2-admin header.sticky::after { display: none !important; }
body.ew-v2-collab aside[class*="md:flex"] {
  width: 16rem; background: #fff !important; border-color: #e3e8ec !important;
  box-shadow: 1px 0 4px rgba(22,34,48,.035) !important;
}
body.ew-v2-collab aside a, body.ew-v2-admin header div[class*="border-t"] a {
  border: 1px solid transparent; border-radius: 10px; transition: background .15s ease, color .15s ease;
}
body.ew-v2-collab aside a:hover, body.ew-v2-admin header div[class*="border-t"] a:hover {
  transform: none !important; color: #145e59 !important; background: #f1f7f6 !important; border-color: #e1efed !important;
}
body.ew-v2-collab aside a[class*="bg-primary"], body.ew-v2-admin header div[class*="border-t"] a[class*="bg-primary"] {
  color: #145e59 !important; background: #e7f3f1 !important; border-color: #d8ebe8 !important; box-shadow: none !important;
}
body.ew-v2-collab main, body.ew-v2-admin main { position: relative; }
body.ew-v2-collab main > div, body.ew-v2-admin main > div { animation: ew-clean-in .22s ease-out both; }
@keyframes ew-clean-in { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }
body.ew-v2-collab main h1, body.ew-v2-admin main h1 { font-size: clamp(1.35rem,2vw,1.85rem); color: #202b36 !important; }
body.ew-v2-collab main h1 + p, body.ew-v2-admin main h1 + p { color: #63717d !important; }
body.ew-v2-collab main [class*="rounded-lg"][class*="border"], body.ew-v2-collab main [class*="rounded-xl"][class*="border"],
body.ew-v2-admin main [class*="rounded-lg"][class*="border"], body.ew-v2-admin main [class*="rounded-xl"][class*="border"] {
  border-color: #e0e6eb !important; background: #fff !important;
  box-shadow: 0 1px 3px rgba(29,43,57,.045) !important;
}
body.ew-v2-collab main [class*="rounded-lg"][class*="border"]:hover,
body.ew-v2-collab main [class*="rounded-xl"][class*="border"]:hover,
body.ew-v2-admin main [class*="rounded-lg"][class*="border"]:hover,
body.ew-v2-admin main [class*="rounded-xl"][class*="border"]:hover { border-color: #d4dfdf !important; }
body.ew-v2-collab main button, body.ew-v2-admin main button {
  font-family: inherit; letter-spacing: .01em; transition: background .15s ease, border-color .15s ease, color .15s ease;
}
body.ew-v2-collab main button[class*="bg-primary"], body.ew-v2-admin main button[class*="bg-primary"] {
  background: #176e68 !important; color: #fff !important; box-shadow: none !important; border-color: #176e68 !important;
}
body.ew-v2-collab main button[class*="bg-primary"]:hover, body.ew-v2-admin main button[class*="bg-primary"]:hover {
  transform: none !important; background: #125c57 !important; box-shadow: none !important;
}
body.ew-v2-collab input, body.ew-v2-collab textarea, body.ew-v2-collab [role="combobox"],
body.ew-v2-admin input, body.ew-v2-admin textarea, body.ew-v2-admin [role="combobox"] {
  border-color: #d5dde3 !important; background: #fff !important; color: #26333f !important; box-shadow: none !important;
}
body.ew-v2-collab input:focus, body.ew-v2-collab textarea:focus, body.ew-v2-collab [role="combobox"]:focus,
body.ew-v2-admin input:focus, body.ew-v2-admin textarea:focus, body.ew-v2-admin [role="combobox"]:focus {
  border-color: #5b9f99 !important; box-shadow: 0 0 0 3px rgba(23,110,104,.11) !important;
}
body.ew-v2-collab input::placeholder, body.ew-v2-collab textarea::placeholder,
body.ew-v2-admin input::placeholder, body.ew-v2-admin textarea::placeholder { color: #89949e !important; }
body.ew-v2-collab #root > div > div.min-h-screen.flex.items-center.justify-center,
body.ew-v2-admin #root > div > div.min-h-screen.flex.items-center.justify-center { background: #f4f6f8 !important; }
body.ew-v2-collab #root > div > div.min-h-screen.flex.items-center.justify-center > div {
  border-color: #e1e7eb !important; background: #fff !important; box-shadow: 0 12px 36px rgba(31,47,62,.09) !important;
}
body.ew-v2-collab #root > div > div.min-h-screen.flex.items-center.justify-center > div::before { content: none !important; }
body.ew-v2-collab #root > div > div.min-h-screen.flex.items-center.justify-center img { filter: none !important; }
body.ew-v2-collab div[class*="md:hidden"][class*="fixed"][class*="bottom-0"],
body.ew-v2-admin div[class*="md:hidden"][class*="fixed"][class*="bottom-0"] {
  background: rgba(255,255,255,.97) !important; border-color: #e2e7eb !important;
  box-shadow: 0 -3px 12px rgba(22,34,48,.07) !important; backdrop-filter: blur(12px) !important;
}
body.ew-v2-collab div[class*="md:hidden"][class*="fixed"][class*="bottom-0"] a,
body.ew-v2-admin div[class*="md:hidden"][class*="fixed"][class*="bottom-0"] a { min-width: 52px; border-radius: 12px; border-color: transparent; }
body.ew-v2-collab div[class*="md:hidden"][class*="fixed"][class*="bottom-0"] a[class*="bg-primary"],
body.ew-v2-admin div[class*="md:hidden"][class*="fixed"][class*="bottom-0"] a[class*="bg-primary"] {
  background: #e7f3f1 !important; border-color: #d8ebe8 !important; color: #176e68 !important; box-shadow: none !important;
}
body.ew-v2-collab main[class*="pb-mobile-nav"], body.ew-v2-admin main[class*="pb-24"] { padding-bottom: 6.25rem; }
/* The visit card becomes a calm, scannable field-work item. */
body.ew-v2-collab main .ew-visit-card {
  position: relative; margin-bottom: .7rem; border: 1px solid #dfe5e9 !important; border-radius: 14px !important;
  background: #fff !important; box-shadow: 0 2px 6px rgba(28,44,59,.045) !important; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
body.ew-v2-collab main .ew-visit-card:hover { border-color: #b8cfcc !important; box-shadow: 0 5px 14px rgba(28,44,59,.08) !important; }
body.ew-v2-collab main .ew-visit-card:focus-visible { outline: 3px solid rgba(23,110,104,.22); outline-offset: 2px; }
body.ew-v2-collab main .ew-visit-card h4 { color: #202b36 !important; font-size: 1rem !important; font-weight: 650; }
body.ew-v2-collab main .ew-visit-card p { color: #5f6c77; }
body.ew-v2-collab main .ew-visit-card [class*="line-clamp-2"] { color: #46535f !important; line-height: 1.45; }
body.ew-v2-collab .ew-visit-open-hint { display: inline-flex; align-items: center; gap: .25rem; margin-top: .32rem; color: #176e68; font-size: .72rem; font-weight: 650; }
body.ew-v2-collab .ew-visit-open-hint::after { content: "›"; font-size: 1.15rem; line-height: .7; }
body.ew-v2-collab main .ew-visit-card > div > div:last-child { border-color: #e8ecef !important; }
/* Keep urgency visible but measured; status badges retain their own semantic colors. */
body.ew-v2-collab main [class*="border-destructive"][class*="bg-destructive"] { border-color: #f0d5d5 !important; background: #fffafa !important; }
body.ew-v2-collab main h3.text-destructive { color: #a44343 !important; }
/* Existing edit form: plain, organized, readable; no luminous focus treatment. */
body.ew-v2-collab [data-radix-dialog-overlay], body.ew-v2-admin [data-radix-dialog-overlay] {
  z-index: 9000 !important; background: rgba(26,36,47,.42) !important; backdrop-filter: blur(3px) !important;
}
body.ew-v2-collab [role="dialog"], body.ew-v2-admin [role="dialog"] {
  z-index: 9010 !important; border: 1px solid #dce3e8 !important; border-radius: 18px !important;
  background: #fff !important; box-shadow: 0 18px 54px rgba(24,38,52,.2) !important;
}
body.ew-v2-collab [role="dialog"] > div:first-child, body.ew-v2-admin [role="dialog"] > div:first-child {
  position: sticky; top: 0; z-index: 2; padding: 1rem 1.25rem !important;
  border-bottom: 1px solid #e7ecef; background: #fff !important; text-align: left !important;
}
body.ew-v2-collab [role="dialog"] > div:first-child h2, body.ew-v2-admin [role="dialog"] > div:first-child h2 { color: #202b36 !important; font-size: 1.1rem; }
body.ew-v2-collab [role="dialog"] > div:nth-child(2), body.ew-v2-admin [role="dialog"] > div:nth-child(2) {
  display: flex !important; flex-direction: column; gap: 1rem !important; min-height: 0; overflow-y: auto;
  padding: 1rem 1.25rem 1.25rem !important;
}
body.ew-v2-collab [role="dialog"] label, body.ew-v2-admin [role="dialog"] label { color: #46535f !important; font-weight: 600; }
body.ew-v2-collab [role="dialog"] > div:nth-child(2) > button, body.ew-v2-admin [role="dialog"] > div:nth-child(2) > button {
  position: sticky; bottom: -1.25rem; z-index: 2; min-height: 2.75rem; margin: 0 -1.25rem -1.25rem !important;
  border-radius: 0 !important; background: #f8fafb !important; color: #46535f !important;
  border-top: 1px solid #e4e9ec !important; backdrop-filter: blur(10px);
}
body.ew-v2-collab [role="dialog"] > div:nth-child(2) > button:last-child, body.ew-v2-admin [role="dialog"] > div:nth-child(2) > button:last-child {
  color: #fff !important; background: #176e68 !important; border-top-color: transparent !important;
}
body.ew-v2-collab [role="dialog"] > button, body.ew-v2-admin [role="dialog"] > button {
  z-index: 4; top: .75rem !important; right: .85rem !important; color: #596773 !important;
  background: #f5f7f8 !important; border: 1px solid #e3e8ec !important;
}
/* Read-only visit detail sheet, then explicit transition into the existing edit flow. */
body.ew-v2-collab dialog.ew-visit-detail {
  position: fixed; inset: 0; width: min(620px, calc(100vw - 32px)); max-width: none; max-height: min(88dvh, 780px);
  margin: auto; padding: 0; overflow: auto; border: 1px solid #dce3e8; border-radius: 18px;
  background: #fff; color: #25313c; box-shadow: 0 22px 60px rgba(24,38,52,.2);
}
body.ew-v2-collab dialog.ew-visit-detail::backdrop { background: rgba(26,36,47,.44); backdrop-filter: blur(3px); }
.ew-visit-detail-head { display:flex; align-items:flex-start; justify-content:space-between; gap:1rem; padding:1.1rem 1.25rem; border-bottom:1px solid #e8ecef; }
.ew-visit-detail-eyebrow { margin:0 0 .35rem; color:#6a7782; font-size:.68rem; font-weight:700; letter-spacing:.09em; text-transform:uppercase; }
.ew-visit-detail-title { margin:0; color:#202b36; font-size:1.24rem; font-weight:700; line-height:1.25; }
.ew-visit-detail-protocol { margin:.3rem 0 0; color:#6a7782; font-size:.8rem; }
.ew-visit-detail-close { width:2.25rem; height:2.25rem; border:1px solid #e1e6ea; border-radius:10px; background:#f7f9fa; color:#53616c; font-size:1.25rem; cursor:pointer; }
.ew-visit-detail-body { display:grid; gap:1rem; padding:1.1rem 1.25rem 1.3rem; }
.ew-visit-detail-badges { display:flex; flex-wrap:wrap; gap:.45rem; }
.ew-visit-detail-badge { display:inline-flex; align-items:center; padding:.27rem .62rem; border:1px solid #e1e6ea; border-radius:999px; background:#f6f8f9; color:#47545f; font-size:.75rem; font-weight:650; }
.ew-visit-detail-badge.is-urgent { border-color:#f0d5d5; background:#fff5f4; color:#a44343; }
.ew-visit-detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; }
.ew-visit-detail-field { min-width:0; padding:.78rem .85rem; border:1px solid #e7ecef; border-radius:12px; background:#fafbfc; }
.ew-visit-detail-label { display:block; margin-bottom:.25rem; color:#77838d; font-size:.66rem; font-weight:700; letter-spacing:.07em; text-transform:uppercase; }
.ew-visit-detail-value { display:block; color:#26333f; font-size:.9rem; line-height:1.45; overflow-wrap:anywhere; }
.ew-visit-detail-section { padding:.9rem .95rem; border:1px solid #e7ecef; border-radius:12px; background:#fff; }
.ew-visit-detail-section h3 { margin:0 0 .42rem; color:#596773; font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.ew-visit-detail-section p { margin:0; color:#34414c; font-size:.9rem; line-height:1.55; white-space:pre-wrap; }
.ew-visit-detail-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.6rem; padding:1rem 1.25rem; border-top:1px solid #e8ecef; background:#fbfcfc; }
.ew-visit-detail-actions button { min-height:2.65rem; padding:.55rem .9rem; border:1px solid #d8e0e5; border-radius:10px; background:#fff; color:#34414c; font:600 .86rem Inter,system-ui,sans-serif; cursor:pointer; }
.ew-visit-detail-actions button:hover { background:#f4f7f8; }
.ew-visit-detail-actions button[data-action="edit"] { border-color:#176e68; background:#176e68; color:#fff; }
.ew-visit-detail-actions button[data-action="edit"]:hover { background:#125c57; }
body.ew-v2-admin main [class*="grid"] > [class*="rounded"] { transition: box-shadow .15s ease, border-color .15s ease; }
body.ew-v2-admin main [class*="grid"] > [class*="rounded"]:hover { transform:none !important; box-shadow:0 4px 12px rgba(28,44,59,.07) !important; }
body.ew-v2-admin main svg { filter:none !important; }
@media (max-width:767px) {
  body.ew-v2-collab, body.ew-v2-admin { font-size:14px; }
  body.ew-v2-collab header.sticky, body.ew-v2-admin header.sticky { min-height:3.5rem; }
  body.ew-v2-collab main, body.ew-v2-admin main { padding-left:.75rem !important; padding-right:.75rem !important; }
  body.ew-v2-collab main [class*="rounded-lg"][class*="border"], body.ew-v2-admin main [class*="rounded-lg"][class*="border"] { border-radius:14px !important; }
  body.ew-v2-collab main button, body.ew-v2-admin main button { min-height:2.55rem; }
  body.ew-v2-collab main .ew-visit-card { border-radius:13px !important; }
  body.ew-v2-collab main .ew-visit-card > div { padding:.82rem !important; }
  body.ew-v2-collab main .ew-visit-card .ew-visit-open-hint { font-size:.7rem; }
  body.ew-v2-collab [role="dialog"], body.ew-v2-admin [role="dialog"] {
    left:0 !important; right:0 !important; bottom:0 !important; top:auto !important; transform:none !important;
    width:100% !important; max-height:94dvh !important; border-radius:18px 18px 0 0 !important;
  }
  body.ew-v2-collab [role="dialog"] > div:nth-child(2), body.ew-v2-admin [role="dialog"] > div:nth-child(2) {
    padding-left:1rem !important; padding-right:1rem !important; padding-bottom:calc(1rem + env(safe-area-inset-bottom)) !important;
  }
  body.ew-v2-collab [role="dialog"] > div:nth-child(2) > button, body.ew-v2-admin [role="dialog"] > div:nth-child(2) > button { margin-left:-1rem !important; margin-right:-1rem !important; }
  body.ew-v2-collab dialog.ew-visit-detail {
    inset:auto 0 0; width:100%; max-width:none; max-height:90dvh; margin:0; border-radius:18px 18px 0 0;
  }
  .ew-visit-detail-head { padding:.95rem 1rem; }
  .ew-visit-detail-body { gap:.75rem; padding:.9rem 1rem 1rem; }
  .ew-visit-detail-grid { gap:.55rem; }
  .ew-visit-detail-field { padding:.68rem .72rem; }
  .ew-visit-detail-actions { padding:.8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); }
  .ew-visit-detail-actions button { flex:1 1 auto; }
}
@media (prefers-reduced-motion:reduce) { body.ew-v2-collab *, body.ew-v2-admin * { animation-duration:.01ms !important; transition-duration:.01ms !important; } }

/* Admin navigation strip: keep every module readable on the light shell. */
body.ew-v2-admin header div[class*="border-t"] {
  border-color: #e3e8ec !important;
  background: #f8fafb !important;
}
body.ew-v2-admin header div[class*="border-t"] a {
  color: #53616c !important;
}
body.ew-v2-admin header div[class*="border-t"] a[class*="bg-primary"] {
  color: #145e59 !important;
  background: #e7f3f1 !important;
  border-color: #d8ebe8 !important;
  box-shadow: none !important;
}
body.ew-v2-admin header div[class*="border-t"] a:hover {
  color: #145e59 !important;
  background: #edf5f4 !important;
}

/* Store-status module: calm neutral status surface, same underlying controls. */
body.ew-v2-admin main [class*="from-blue-"] {
  border: 1px solid #d7e4e1 !important;
  background: #edf4f2 !important;
  background-image: none !important;
  color: #1e514b !important;
  box-shadow: none !important;
}
body.ew-v2-admin main [class*="from-blue-"] * { color: #1e514b !important; }
body.ew-v2-admin main button[class*="blue-"], body.ew-v2-admin main button[class*="from-blue-"] {
  border-color: #176e68 !important;
  background: #176e68 !important;
  background-image: none !important;
  color: #fff !important;
  box-shadow: none !important;
}
body.ew-v2-admin main button[class*="blue-"]:hover, body.ew-v2-admin main button[class*="from-blue-"]:hover {
  background: #125c57 !important;
  color: #fff !important;
}
