:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #183147; background: #dfe9f3; color-scheme: light;
  --navy: #092f50; --blue: #075fa9; --teal: #04b3ad;
  --muted: #7890a3; --border: #e0eaf2; --canvas: #f5f8fc;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app-shell { width: min(100%, 520px); min-height: 100dvh; margin: auto; padding-bottom: env(safe-area-inset-bottom); background: var(--canvas); box-shadow: 0 18px 60px #163c5d1c; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 11px; min-height: 82px; padding: max(14px, env(safe-area-inset-top)) 20px 14px; overflow: hidden; background: linear-gradient(135deg, #073052, #095b9b 76%, #0b7caa); color: white; }
.topbar::after { content: ""; position: absolute; width: 180px; height: 180px; border: 1px solid #ffffff1c; border-radius: 50%; right: -53px; top: -115px; pointer-events: none; }
.brand-mark, .topbar button { position: relative; z-index: 1; display: grid; place-items: center; width: 43px; height: 43px; flex: none; border: 1px solid #ffffff31; border-radius: 14px; background: #ffffff1b; color: #fff; }
.brand-mark { font-size: 30px; font-weight: 700; line-height: 1; color: #7ff7d9; }
.brand-mark svg { width: 24px; height: 24px; }
body[data-step="templates-screen"] .brand-mark, body[data-step="dates-screen"] .brand-mark,
body[data-step="automation-screen"] .brand-mark, body[data-step="report-panel"] .brand-mark { display: none; }
.topbar button { font-size: 24px; }
.topbar button:hover { background: #ffffff30; }
.topbar-title { min-width: 0; flex: 1; position: relative; z-index: 1; }
.topbar h1 { margin: 3px 0 0; font-size: 18px; line-height: 1.15; letter-spacing: -.02em; }
.eyebrow { font-size: 9px; letter-spacing: .14em; font-weight: 800; opacity: .75; }
.progress { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; padding: 0 20px 14px; background: linear-gradient(135deg, #073052, #095b9b 76%, #0b7caa); }
.progress span { height: 4px; border-radius: 4px; background: #ffffff48; }
.progress span.done { background: #5ff0d5; }
#status { margin: 0 18px; color: #aa284b; font-size: 13px; line-height: 1.45; }
#status:not(:empty) { margin-top: 14px; padding: 12px 14px; border: 1px solid #f6d4db; border-radius: 12px; background: #fff0f3; }
.screen { padding: 24px 18px 28px; }
.card { border: 1px solid var(--border); border-radius: 20px; background: #fff; box-shadow: 0 8px 25px #1c42620b; }
.screen-heading { margin-bottom: 20px; }
.screen-heading h2, .screen h2 { margin: 12px 0 7px; color: #102f49; font-size: clamp(25px, 7vw, 29px); line-height: 1.15; letter-spacing: -.035em; }
.screen-heading p, .muted { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.step-mark { display: inline-block; padding: 6px 11px; border: 1px solid #c7eae6; border-radius: 999px; background: #e8f8f5; color: #078b84; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 750; transition: transform .12s, box-shadow .12s, background .12s; }
.primary { border: 1px solid #0863ae; background: linear-gradient(135deg, #075da7, #0b7cbb); color: white; box-shadow: 0 8px 20px #096bb32b; }
.primary:hover { box-shadow: 0 10px 24px #096bb342; }
.primary:active, .secondary:active { transform: scale(.985); }
.secondary { border: 1px solid #c8dfef; background: #fff; color: #0964aa; }
.full { width: 100%; }
button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #58c8e7; outline-offset: 2px; }
label { color: #425a6f; font-size: 12px; font-weight: 700; }
input:not([type=radio]), select { display: block; width: 100%; min-width: 0; height: 49px; margin-top: 7px; padding: 9px 12px; border: 1px solid #cbd9e5; border-radius: 12px; background: #fbfdff; color: #20384d; font-size: 16px; }
input::placeholder { color: #9bacbc; }
input:focus, select:focus { border-color: #1192d0; background: #fff; outline: 3px solid #cfeffe; }
#login-form { margin: max(7vh, 32px) 18px 0; padding: 30px 24px 25px; }
.login-symbol { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 23px; border-radius: 21px; background: linear-gradient(145deg, #e8f7ff, #e2fbf2); color: #0874a7; font-size: 43px; font-weight: 800; }
.login-symbol svg { width: 37px; height: 37px; }
#login-form h2 { max-width: 320px; margin-top: 14px; font-size: 30px; }
#login-form .muted { margin-bottom: 27px; }
#login-form label { display: block; margin-bottom: 16px; }
#login-button { margin-top: 9px; }
#objects-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 100px); }
.search-box { display: flex; align-items: center; gap: 11px; height: 53px; padding: 0 15px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 15px; background: white; box-shadow: 0 5px 16px #1c426208; }
.search-box span { color: #7e9ab0; font-size: 25px; line-height: 1; }
.search-box input { height: 100%; margin: 0; padding: 0; border: 0; outline: 0; background: transparent; font-size: 14px; }
.search-box input:focus { outline: 0; border: 0; }
.list-caption { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 10px; color: #37536a; font-size: 13px; }
.list-caption strong { font-size: 14px; }
.list-caption span { color: #92a6b6; font-size: 12px; }
.tree { flex: 1; min-height: 260px; max-height: calc(100dvh - 332px); padding: 8px 0; overflow: auto; overscroll-behavior: contain; }
.tree ul { margin: 0; padding: 0 0 0 17px; border-left: 1px solid #e4edf3; list-style: none; }
.tree > ul { padding-left: 0; border: 0; }
.tree li { list-style: none; }
.node-line { display: flex; align-items: center; min-height: 48px; padding-right: 9px; }
.expand-toggle { display: grid; place-items: center; flex: none; width: 33px; height: 42px; margin-left: 2px; border: 0; background: transparent; color: #7d95a8; font-size: 22px; line-height: 1; }
.expand-toggle[aria-expanded=true] span { transform: rotate(90deg); }
.expand-toggle span { display: block; transition: transform .15s; }
.expand-placeholder { width: 35px; flex: none; }
.node-select { display: flex; align-items: center; gap: 11px; min-width: 0; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: #233d51; text-align: left; font-size: 14px; }
.node-select:hover { background: #f0f8fd; }
.node-select.selected { border-color: #bce2f6; background: #e5f5ff; color: #075e9f; font-weight: 700; }
.node-select.selected::after { content: "✓"; margin-left: auto; color: #087db1; font-weight: 800; }
.node-select .label { min-width: 0; overflow-wrap: anywhere; }
.icon { width: 19px; height: 19px; flex: none; color: #168fe0; }
.icon.root { color: #07ae98; }
.icon.folder { color: #d7a613; }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; margin: auto -18px -28px; padding: 13px 18px max(17px, env(safe-area-inset-bottom)); border-top: 1px solid #e0e9f1; background: #f9fbfef2; backdrop-filter: blur(14px); }
.selection-note { margin: 0 0 10px; color: #4d6d83; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.tabs { display: flex; gap: 5px; padding: 5px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.tab { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: #7991a4; font-size: 13px; font-weight: 650; }
.tab.active { background: #e9f5ff; color: #0863aa; }
.templates { display: grid; gap: 10px; }
.template-wrap { position: relative; min-width: 0; }
.template-card { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 86px; padding: 15px 58px 15px 14px; border: 1px solid var(--border); border-radius: 17px; background: white; box-shadow: 0 5px 17px #1c426209; color: #28445a; text-align: left; font-size: 13px; line-height: 1.42; }
.template-card:hover { border-color: #8bc7e9; background: #fcfeff; }
.template-name { overflow-wrap: anywhere; }
.pdf-icon { display: grid; place-items: end center; flex: none; width: 42px; height: 51px; padding-bottom: 9px; border-radius: 8px; background: linear-gradient(145deg, #f34955, #db2e61); box-shadow: 0 6px 14px #d4375d2c; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.favorite { position: absolute; top: 8px; right: 9px; display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #d3aa27; font-size: 24px; line-height: 1; }
.favorite.active { color: #e5ae12; }
.card-arrow { position: absolute; right: 17px; bottom: 13px; color: #83a0b5; font-size: 18px; }
.empty { padding: 24px; border: 1px dashed #c9d9e5; border-radius: 15px; color: var(--muted); text-align: center; font-size: 14px; }
#dates-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 100px); }
.selection-card { display: flex; align-items: center; gap: 13px; padding: 13px; margin-bottom: 19px; }
.selection-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: #e8f3fc; color: #0b6ca8; font-size: 23px; }
.selection-card small { display: block; margin-bottom: 3px; color: #8fa5b5; font-size: 11px; }
.selection-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: #2a485f; font-size: 12px; line-height: 1.35; }
.quick-dates { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 18px; }
.quick-dates button { min-height: 39px; border: 1px solid #d4e3ed; border-radius: 11px; background: white; color: #53738a; font-size: 13px; font-weight: 700; }
.quick-dates button.active { border-color: #0e83b5; background: #e6f7fc; color: #0b759d; }
.filters { display: grid; gap: 21px; padding: 18px; }
.filters label { display: block; min-width: 0; }
.date-group { padding-top: 18px; border-top: 1px solid #e6edf3; }
.date-group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #294a62; font-size: 14px; }
.date-dot { width: 9px; height: 9px; border-radius: 50%; }
.date-dot.start { background: #11afa3; }
.date-dot.end { background: #0d76bf; }
.field-row { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); gap: 10px; }
.time-field { min-width: 0; }
.time-picker { display: flex; align-items: center; margin-top: 7px; height: 49px; border: 1px solid #cbd9e5; border-radius: 12px; background: #fbfdff; }
.time-picker select { flex: 1; width: 0; min-width: 0; height: 47px; margin: 0; padding: 7px 2px; border: 0; background: transparent; text-align: center; }
.time-picker > span { flex: none; color: #20384d; }
.action-stack { display: grid; gap: 9px; margin-top: auto; }
.delivery-note { display: flex; align-items: center; gap: 13px; padding: 16px; margin-bottom: 17px; border: 1px solid #bce7e6; border-radius: 17px; background: linear-gradient(135deg, #e7faf7, #f0fbff); }
.delivery-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: #0c9d9c; color: #fff; font-size: 25px; }
.delivery-note strong, .delivery-note small { display: block; }
.delivery-note strong { color: #176b72; font-size: 13px; }
.delivery-note small { margin-top: 4px; color: #5f9297; font-size: 12px; }
#automation-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 100px); }
.frequency-options { overflow: hidden; margin-bottom: 16px; }
.frequency-options label { display: flex; align-items: center; gap: 12px; min-height: 83px; padding: 14px; border-bottom: 1px solid #e9eff4; cursor: pointer; }
.frequency-options label:last-child { border: 0; }
.frequency-options label:has(input:checked) { background: #f0f9ff; }
.frequency-symbol { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 13px; background: #edf4fa; color: #0a75ac; font-size: 22px; }
.frequency-options label:has(input:checked) .frequency-symbol { background: #d7f2f6; }
.frequency-options label > span:nth-child(2) { flex: 1; min-width: 0; }
.frequency-options strong, .frequency-options small { display: block; }
.frequency-options strong { color: #294961; font-size: 14px; }
.frequency-options small { margin-top: 4px; color: #8199aa; font-size: 12px; line-height: 1.35; font-weight: 400; }
.frequency-options input { width: 19px; height: 19px; flex: none; accent-color: #0a79b7; }
.confirmation { padding: 15px; margin-top: 16px; border-color: #b7e6d4; background: #effbf4; color: #197046; font-size: 13px; line-height: 1.5; }
.schedule-section { margin-top: 28px; }
.schedule-section h3 { margin: 0 0 12px; color: #28485f; font-size: 15px; }
.schedule-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; margin-bottom: 9px; font-size: 13px; }
.link-button { min-height: 38px; border: 0; border-radius: 9px; padding: 8px; background: #fff1f3; color: #aa3550; font-size: 12px; }
.report-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.report-body { padding: 16px; }
.report-header { margin-bottom: 18px; text-align: center; }
.report-header h2 { margin: 0 0 8px; color: #183f5b; font-size: 18px; }
.report-header p { margin: 5px 0; color: #72899b; font-size: 12px; }
.report-object { padding: 11px; margin-bottom: 12px; border-radius: 9px; background: #e9f5ff; color: #375873; font-size: 12px; overflow-wrap: anywhere; }
.report-cards { display: grid; gap: 10px; }
.report-data-card { overflow: hidden; border: 1px solid #dbe7ef; border-radius: 13px; background: #fff; }
.report-data-heading { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border-bottom: 1px solid #e4edf3; background: #f2f9fe; color: #204865; }
.report-data-heading span { display: grid; place-items: center; width: 25px; height: 25px; flex: none; border-radius: 8px; background: #d6edfa; color: #0872aa; font-size: 11px; font-weight: 800; }
.report-data-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.report-data-card dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 0 12px; margin: 0; padding: 2px 12px; }
.report-data-card dt, .report-data-card dd { margin: 0; padding: 8px 0; border-bottom: 1px solid #edf1f5; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.report-data-card dt { color: #8095a6; }
.report-data-card dd { color: #28475e; text-align: right; font-weight: 650; }
.report-data-card dt:nth-last-child(2), .report-data-card dd:last-child { border-bottom: 0; }
.report-table-wrap { display: none; overflow-x: auto; }
.report-table { border-collapse: collapse; font-size: 11px; }
.report-table th, .report-table td { border: 1px solid #afc3d2; padding: 8px; text-align: right; white-space: nowrap; }
.report-table th { background: #e4f4ff; }
.report-table th:first-child, .report-table td:first-child { text-align: left; }
.report-empty { padding: 27px 12px; color: var(--muted); text-align: center; font-size: 14px; }
.report-body .table-pdf { position: relative; color: #292d32; font-size: 11px; }
.report-body .report-pdf1 { display: flex; flex-direction: column; align-items: center; gap: 20px; margin-bottom: 24px; text-align: center; }
.report-body .report-pdf h1 { margin: 6px 0 0; font-size: 22px; line-height: 1; letter-spacing: 1.32px; color: #292d32; }
.report-body .report-pdf p { width: 92%; margin: -12px auto 0; color: #6d7c89; font-size: 16px; line-height: 1.5; }
.report-body .report-rate { width: 100%; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; text-align: left; }
.report-body .report-rate h3 { margin: 0; font-size: 12px; }
.report-body .report-rate-times { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.report-body .report-rate-time { display: flex; flex-direction: column; gap: 4px; }
.report-body .report-tree { width: 100%; padding: 4px 24px; border-radius: 3px; background: #c9e5fe; text-align: left; }
.reference-report-scroll { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.report-body .table-pdf table { width: 100%; min-width: 520px; border-collapse: collapse; color: #000; font-size: 11px; }
.report-body .table-pdf th, .report-body .table-pdf td { min-width: 76px; height: 22px; padding: 3px 6px; border: 1px solid #8ea3b8; text-align: center; }
.report-body .table-pdf .report-pdf-table-billing { table-layout: fixed; }
.report-body .table-pdf .report-pdf-table-billing th,
.report-body .table-pdf .report-pdf-table-billing td { min-width: 0; overflow-wrap: anywhere; }
.report-body .table-pdf .report-pdf-table-billing-detail { table-layout: fixed; }
.report-body .table-pdf .report-pdf-table-billing-detail th,
.report-body .table-pdf .report-pdf-table-billing-detail td { min-width: 0; overflow-wrap: anywhere; }
.report-body .table-pdf .reference-report-scroll + .reference-report-scroll { margin-top: 28px; }
.report-body .table-pdf th, .report-body .table-pdf .reference-name, .report-body .table-pdf .reference-total td { background: #c9e5fe; }
.report-body .table-pdf .reference-name { min-width: 150px; padding-left: 16px; text-align: left; }
.report-body .table-pdf .reference-reactive { background: #fec9d6; }
.report-body .table-pdf .reference-total { font-weight: 700; }
@media (max-width: 360px) { .screen { padding-inline: 14px; } .field-row { grid-template-columns: 1fr 105px; gap: 7px; } .filters { padding: 14px; } .sticky-actions { margin-inline: -14px; padding-inline: 14px; } }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  :root, body { background: white; }
  .app-shell { width: 100%; min-height: 0; padding: 0; box-shadow: none; background: white; }
  .topbar, .progress, #status, #login-form, #objects-screen, #templates-screen, #dates-screen, #automation-screen, .report-actions, .report-cards { display: none !important; }
  #report-panel, .report-table-wrap { display: block !important; padding: 0; }
  .report-body { width: 100%; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .reference-report-scroll, .report-table-wrap { width: 100%; overflow: visible; }
  .report-body .table-pdf table, .report-table { width: 100% !important; min-width: 0 !important; table-layout: fixed; }
  .report-body .table-pdf th, .report-body .table-pdf td, .report-table th, .report-table td {
    min-width: 0; height: auto; padding: 2px 3px; font-size: 7.5pt;
    white-space: normal; overflow-wrap: anywhere;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .report-body .table-pdf .reference-name { min-width: 0; padding-left: 3px; }
  .report-body .report-tree { overflow-wrap: anywhere; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
  .report-body .report-pdf1 { break-inside: avoid; }
}
