/* DroneCRM interactive demo. The app UI is sized in real pixels and switches to a
   phone layout (bottom tab bar, stacked views) when its container is narrow. */

.demo { container-type: inline-size; }
.dm {
  position: relative; display: grid; grid-template-columns: 196px minmax(0, 1fr); height: 640px; overflow: hidden;
  background: #fff; border: 1px solid #D3D0C9; border-radius: 10px; box-shadow: 0 24px 48px -28px rgba(40, 30, 20, .45);
  font: 400 14px/1.45 var(--sans); color: #1D1D1C; text-align: left;
}
.dm button { font: inherit; color: inherit; }
.dm h3, .dm h4, .dm h5, .dm h6, .dm p { margin: 0; }
.dm :focus-visible { outline: 2px solid #1D1D1C; outline-offset: 2px; }
.dm .w { color: #C2410C; font-weight: 600; }
.dm .r { color: #B42318; font-weight: 600; }

/* Sidebar */
.dm-side { display: flex; flex-direction: column; gap: 2px; padding: 16px 10px 14px; overflow-y: auto; background: #F7F6F3; border-right: 1px solid #E6E3DD; }
.dm-org { display: flex; align-items: center; gap: 8px; padding: 2px 8px 14px; font-weight: 700; }
.dm-org i { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 6px; background: #3A5BA0; color: #fff; font-style: normal; font-size: 11px; }
.dm-nav { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 7px 9px; border: 0; border-radius: 6px; background: none; color: #4A4843; text-align: left; cursor: pointer; }
.dm-nav:hover { background: #EFEDE8; }
.dm-nav[aria-current="page"] { background: #fff; color: #1D1D1C; font-weight: 600; box-shadow: 0 0 0 1px #E3E0DA; }
.dm-nav .n { min-width: 18px; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; color: #8A857C; }
.dm-nav .n.hot { padding: 0 5px; border-radius: 9px; background: #EF5B25; color: #1B1B1A; }
.dm-sep { height: 1px; margin: 8px; background: #E6E3DD; }
.dm-user { margin-top: auto; padding: 12px 8px 0; font-size: 13px; line-height: 1.35; }
.dm-user span { color: #8A857C; }

/* Main column */
.dm-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dm-top { display: flex; align-items: baseline; gap: 12px; padding: 14px 22px 12px; border-bottom: 1px solid #EEECE8; }
.dm-top h3 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.dm-top .date { margin-left: auto; font-size: 13px; color: #8A857C; }
.dm-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 26px; }
.dm-muted { font-size: 13px; color: #8A857C; }

/* Buttons */
.dm-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid #CFCBC3; border-radius: 6px; background: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; cursor: pointer; }
.dm-btn:hover { border-color: #1D1D1C; }
.dm-btn.primary { background: #EF5B25; border-color: #EF5B25; color: #1B1B1A; }
.dm-btn.primary:hover { background: #F2743F; border-color: #F2743F; }
.dm-btn:disabled { opacity: .45; cursor: not-allowed; }
.dm-link { padding: 0; border: 0; background: none; font-size: 13px; color: #4A4843; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.dm-link:hover { color: #1D1D1C; }
.dm-facts .dm-link { margin-left: 6px; }

/* Status tags: a coloured dot and plain text */
.dm-st { white-space: nowrap; }
.dm-st::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #3A6FD8; vertical-align: 1px; }
.dm-st.c-red::before { background: #C03A2B; }
.dm-st.c-orange::before { background: #EF5B25; }
.dm-st.c-green::before { background: #2F8A57; }
.dm-st.c-gray::before { background: #B5B0A6; }

/* Today */
.dm-today { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: start; }
.dm-hello h4 { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.dm-hello p { margin: 3px 0 14px; color: #6C675F; }
.dm-cards { display: grid; gap: 10px; }
.dm-card { padding: 14px 16px; border: 1px solid #E3E0DA; border-radius: 8px; background: #fff; }
.dm-card p { color: #3F3D39; }
.dm-card h5 { margin-bottom: 4px; font-size: 15px; font-weight: 700; }
.dm-card .dm-kind { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--k, #6C675F); }
.dm-kind time { font-weight: 500; color: #9A958C; }
.t-red { --k: #B42318; }
.t-orange { --k: #C2410C; }
.t-blue { --k: #2F5DB8; }
.t-gray { --k: #6C675F; }
.dm-suggest { margin-top: 10px !important; padding: 9px 12px; border-radius: 6px; background: #F6F5F2; }
.dm-suggest b { font-weight: 600; }
.dm-mail { margin-top: 10px; border: 1px solid #E3E0DA; border-radius: 6px; font-size: 13.5px; }
.dm-mail .h { padding: 8px 12px; border-bottom: 1px solid #EEECE8; color: #6C675F; }
.dm-mail .h b { font-weight: 600; color: #1D1D1C; }
.dm-mail .b { display: grid; gap: 8px; padding: 10px 12px; }
.dm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.dm-card.done { padding: 10px 14px; background: #F7F6F3; border-color: #EEECE8; }
.dm-card.done .ok { color: #2F8A57; font-weight: 700; }

.dm-aside h6 { margin-bottom: 4px; font-size: 12.5px; font-weight: 700; color: #6C675F; }
.dm-aside h6.gap { margin-top: 20px; }
.dm-flight { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 1px 10px; width: 100%; padding: 9px 0; border: 0; border-top: 1px solid #EEECE8; background: none; text-align: left; cursor: pointer; }
.dm-flight:hover .c { text-decoration: underline; }
.dm-flight .t { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dm-flight .c { overflow: hidden; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.dm-flight .s { grid-column: 2; font-size: 12.5px; color: #6C675F; }

/* Jobs */
.dm-tabs { display: flex; gap: 18px; margin-top: -6px; overflow-x: auto; border-bottom: 1px solid #E6E3DD; }
.dm-tab { padding: 8px 0; border: 0; background: none; font-size: 13.5px; color: #6C675F; white-space: nowrap; cursor: pointer; }
.dm-tab[aria-pressed="true"] { color: #1D1D1C; font-weight: 600; box-shadow: inset 0 -2px 0 #1D1D1C; }
.dm-tab em { margin-left: 5px; font-style: normal; color: #9A958C; }
.dm-jhead, .dm-jrow { display: grid; grid-template-columns: 2.1fr 1.4fr 1fr 1.4fr 1.1fr .8fr; gap: 12px; align-items: center; }
.dm-jhead { padding: 12px 8px 6px; border-bottom: 1px solid #EEECE8; font-size: 12px; color: #8E8980; }
.dm-jrow { width: 100%; padding: 10px 8px; border: 0; border-bottom: 1px solid #EEECE8; background: none; font-size: 13.5px; text-align: left; cursor: pointer; }
.dm-jrow:hover { background: #FAF9F7; }
.dm-jrow > span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dm .cl b, .dm .cl small { display: block; overflow: hidden; text-overflow: ellipsis; }
.dm .cl b { font-weight: 600; }
.dm .cl small { font-size: 12.5px; color: #8A857C; }
.dm .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Calendar */
.dm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.dm-day { min-width: 0; }
.dm-dayh { margin-bottom: 8px; padding: 2px 4px 8px; border-bottom: 1px solid #E6E3DD; }
.dm-dayh b, .dm-dayh small { display: block; }
.dm-dayh b { font-size: 13px; font-weight: 600; }
.dm-dayh small { font-size: 11.5px; color: #8A857C; }
.dm-day.today .dm-dayh { box-shadow: inset 0 -2px 0 #EF5B25; }
.dm-ev { display: block; width: 100%; margin-bottom: 6px; padding: 7px 8px; border: 0; border-radius: 6px; background: #EAF0FB; font-size: 12.5px; line-height: 1.3; text-align: left; cursor: pointer; }
.dm-ev:hover { box-shadow: inset 0 0 0 1px #1D1D1C; }
.dm-ev b, .dm-ev > span { display: block; overflow-wrap: anywhere; }
.dm-ev b, .dm-ev .cn { font-weight: 600; }
.dm-ev .cn { color: #1D1D1C; }
.dm-ev > span { color: #5B5750; }
.dm-ev.jen { background: #E7F3EC; }
.dm-ev.quote { background: #F1EFEA; }
.dm-ev.hold { background: #FFEFE6; }
.dm-ev.tfr { background: #FDECEA; }
.dm-none { padding: 4px; font-size: 12px; color: #A09B92; }
.dm-legend { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.dm-legend .sw { width: 12px; height: 12px; border-radius: 3px; background: #EAF0FB; }
.dm-legend .sw.jen { margin-left: 10px; background: #E7F3EC; }

/* Drawer */
.dm-drawer { position: absolute; top: 0; right: 0; bottom: 0; z-index: 5; display: flex; flex-direction: column; width: min(430px, 100%); background: #fff; border-left: 1px solid #E3E0DA; box-shadow: -18px 0 40px -24px rgba(40, 30, 20, .4); }
.dm-drawer header { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px 14px; border-bottom: 1px solid #EEECE8; }
.dm-drawer h4 { font-size: 17px; font-weight: 750; }
.dm-drawer .sub { margin-top: 2px; font-size: 13px; color: #6C675F; }
.dm-drawer .x { margin-left: auto; padding: 0 8px; border: 0; border-radius: 4px; background: none; font-size: 22px; line-height: 1.2; cursor: pointer; }
.dm-drawer .x:hover { background: #F1EFEA; }
.dm-dbody { display: grid; gap: 16px; align-content: start; overflow-y: auto; padding: 16px 18px 22px; }
.dm-facts { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.dm-facts dt { color: #8A857C; }
.dm-facts dd { margin: 0; }
.dm-sec h6 { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: #6C675F; }
.dm-sec > .dm-btn { margin-top: 10px; }
.dm-cond { display: grid; gap: 6px; }
.dm-cond div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; background: #F7F6F3; }
.dm-cond div span:first-child { color: #6C675F; }
.dm-timeline { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.dm-timeline li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; }
.dm-timeline time { color: #8A857C; }
.dm-callout { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 12px; border-radius: 6px; background: #F6F5F2; }
.dm-callout.w { background: #FFF3EC; }
.dm-callout.ok { background: #EAF6EF; color: #1F6B40; font-weight: 600; }
.dm-map { margin: 0; }
.dm-map svg { display: block; width: 100%; height: auto; border-radius: 6px; font-family: var(--sans); }
.dm-map figcaption { margin-top: 6px; font-size: 12px; color: #8A857C; }
.dm-field { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.dm-input { width: 100%; padding: 8px 10px; border: 1px solid #CFCBC3; border-radius: 6px; font: 400 13.5px/1.45 var(--sans); color: #1D1D1C; resize: vertical; }
.dm-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; }
.dm-check input { margin-top: 3px; accent-color: #1D1D1C; }

.dm-empty { max-width: 440px; }
.dm-empty h4 { margin-bottom: 6px; font-size: 18px; font-weight: 750; }
.dm-empty p + p { margin-top: 8px; }

.dm-toast { position: absolute; bottom: 18px; left: 50%; z-index: 9; max-width: calc(100% - 32px); padding: 9px 14px; border-radius: 8px; background: #1D1D1C; color: #fff; font-size: 13.5px; transform: translateX(-50%); box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .5); }
.dm-tabbar { display: none; }

/* Phone layout */
@container (max-width: 760px) {
  .dm { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: 620px; }
  .dm-side { display: none; }
  .dm-tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #F7F6F3; border-top: 1px solid #E6E3DD; }
  .dm-tabbar .dm-nav { justify-content: center; gap: 5px; padding: 10px 4px 12px; border-radius: 0; font-size: 13px; }
  .dm-tabbar .dm-nav[aria-current="page"] { background: #fff; box-shadow: inset 0 2px 0 #EF5B25; }
  .dm-top { padding: 12px 14px 10px; }
  .dm-body { padding: 14px 14px 22px; }
  .dm-today { grid-template-columns: minmax(0, 1fr); }
  .dm-jhead { display: none; }
  .dm-jrow { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "cl st" "fl fl"; gap: 2px 10px; }
  .dm-jrow .hm { display: none; }
  .dm-jrow .cl { grid-area: cl; }
  .dm-jrow .fl { grid-area: fl; font-size: 12.5px; color: #6C675F; }
  .dm-jrow .dm-st { grid-area: st; font-size: 12.5px; }
  .dm-week { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .dm-drawer { border-left: 0; }
}
