:root {
      --ink: #20262c;
      --muted: #6e7a84;
      --line: #d7dee5;
      --panel: #ffffff;
      --soft: #edf3f0;
      --green: #238653;
      --green-dark: #17633d;
      --green-soft: #58b985;
      --charcoal: #2c3338;
      --blue: #2f7ebc;
      --amber: #d99a25;
      --red: #bf4242;
      --shadow: 0 8px 24px rgba(22, 34, 44, .12);
    }

    * { box-sizing: border-box; }

    body {
      margin: 0;
      background: #e9eef2;
      color: var(--ink);
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      letter-spacing: 0;
    }

    button, input, select {
      font: inherit;
    }

    button {
      border: 0;
      cursor: pointer;
    }

    .app {
      min-height: 100vh;
      display: grid;
      grid-template-rows: auto 1fr;
    }

    .topbar {
      min-height: 64px;
      background: var(--green);
      color: #fff;
      display: grid;
      grid-template-columns: auto auto minmax(190px, 270px) 1fr;
      align-items: stretch;
      gap: 10px;
      padding: 0 20px;
      box-shadow: 0 2px 10px rgba(0,0,0,.2);
      position: sticky;
      top: 0;
      z-index: 100;
      overflow: visible;
    }

    .brand {
      display: flex;
      align-items: center;
      white-space: nowrap;
      min-width: 136px;
    }

    .brand-logo {
      width: 126px;
      height: 44px;
      border-radius: 4px;
      background: #fff;
      object-fit: contain;
      padding: 4px;
      box-shadow: inset 0 0 0 1px rgba(35,134,83,.12);
    }

    .branch-menu {
      position: relative;
      align-self: stretch;
      display: flex;
      align-items: center;
      min-width: 132px;
      color: #fff;
      font-weight: 700;
    }

    .branch-button {
      min-height: 64px;
      padding: 0 10px;
      color: #fff;
      background: transparent;
      border-left: 1px solid rgba(255,255,255,.18);
      font-weight: 700;
      white-space: nowrap;
    }

    .branch-button span {
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .search {
      align-self: center;
      display: grid;
      grid-template-columns: 1fr 44px;
      min-width: 0;
    }

    .search input {
      width: 100%;
      height: 38px;
      border: 1px solid rgba(255,255,255,.9);
      border-right: 0;
      border-radius: 4px 0 0 4px;
      padding: 0 12px;
      outline: 0;
    }

    .search button {
      height: 38px;
      border-radius: 0 4px 4px 0;
      background: var(--green-dark);
      color: #fff;
      font-size: 18px;
      font-weight: 700;
    }

    .nav {
      display: flex;
      justify-content: flex-start;
      align-items: stretch;
      min-width: 0;
      overflow: visible;
    }

    .menu {
      position: relative;
      display: grid;
      align-items: stretch;
      overflow: visible;
    }

    .menu > button,
    .menu > summary {
      min-height: 64px;
      padding: 0 10px;
      color: #fff;
      background: transparent;
      font-weight: 700;
      white-space: nowrap;
      border-left: 1px solid rgba(255,255,255,.18);
      display: flex;
      gap: 6px;
      align-items: center;
      list-style: none;
      cursor: pointer;
    }

    .menu > summary::-webkit-details-marker {
      display: none;
    }

    .nav .menu.has-dropdown > button::after,
    .nav .menu.has-dropdown > summary::after {
      content: "";
      display: inline-block;
      width: 0;
      height: 0;
      margin-left: 6px;
      vertical-align: middle;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 7px solid #fff;
    }

    .menu:hover > button,
    .menu:hover > summary,
    .menu.open > button,
    .menu[open] > summary,
    .menu > button.active {
      background: var(--green-dark);
    }

    .dropdown {
      display: none;
      position: absolute;
      top: 64px;
      left: 0;
      min-width: 196px;
      background: #fff;
      color: var(--ink);
      border: 1px solid var(--line);
      box-shadow: var(--shadow);
      z-index: 200;
    }

    .menu:hover .dropdown,
    .menu:focus-within .dropdown,
    .menu[open] .dropdown {
      display: grid;
    }

    .menu.open .dropdown,
    .menu > button[aria-expanded="true"] + .dropdown {
      display: grid;
    }

    .nav-link {
      min-height: 64px;
      padding: 0 10px;
      color: #fff;
      background: transparent;
      font-weight: 700;
      white-space: nowrap;
      border-left: 1px solid rgba(255,255,255,.18);
    }

    .nav-link:hover,
    .nav-link.active {
      background: var(--green-dark);
    }

    .dropdown button {
      min-height: 40px;
      padding: 0 12px;
      text-align: left;
      background: #fff;
      color: var(--ink);
      border-bottom: 1px solid #edf1f4;
    }

    .dropdown button:hover {
      background: var(--soft);
      color: var(--green-dark);
      font-weight: 700;
    }

    .admin-password-panel {
      display: grid;
      gap: 6px;
      padding: 8px;
      border-bottom: 1px solid #edf1f4;
      background: #f7faf8;
    }

    .admin-password-panel.hidden {
      display: none;
    }

    .admin-password-panel input {
      width: 100%;
      min-height: 34px;
      border: 1px solid #cbd4dc;
      border-radius: 4px;
      padding: 0 9px;
    }

    .admin-password-panel button {
      min-height: 34px;
      border-radius: 4px;
      background: var(--green);
      color: #fff;
      font-weight: 700;
    }

    .superadmin-banner {
      display: none;
      max-width: 1250px;
      margin: 0 auto 12px;
      padding: 10px 14px;
      border: 1px solid #b9dbc9;
      background: #e9f7ef;
      color: #17633d;
      font-weight: 700;
    }

    .superadmin-banner.active {
      display: block;
    }

    .emergency-screen {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9999;
      background: #fff;
      color: #111;
      place-items: center;
      font-size: 22px;
      font-weight: 700;
      text-transform: lowercase;
    }

    .emergency-screen.active {
      display: grid;
    }

    .login-screen {
      position: fixed;
      inset: 0;
      z-index: 10000;
      background: #e9eef2;
      display: none;
      place-items: center;
      padding: 24px;
    }

    .login-screen.active {
      display: grid;
    }

    .login-panel {
      width: min(420px, 100%);
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: var(--shadow);
      border-radius: 6px;
      padding: 24px;
    }

    .login-logo {
      width: 160px;
      height: 58px;
      object-fit: contain;
      display: block;
      margin: 0 auto 18px;
    }

    .login-panel h1 {
      font-size: 24px;
      text-align: center;
      margin-bottom: 18px;
    }

    .login-error {
      display: none;
      margin-top: 12px;
      color: var(--red);
      font-weight: 700;
      text-align: center;
    }

    .login-error.active {
      display: block;
    }

    .user-lock-screen {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 10002;
      background: #fff;
      color: #111;
      place-items: center;
      padding: 28px;
      text-align: center;
    }

    .user-lock-screen.active {
      display: grid;
    }

    .user-lock-panel {
      display: grid;
      gap: 18px;
      justify-items: center;
    }

    .user-lock-message {
      max-width: 620px;
      font-size: 22px;
      font-weight: 700;
      line-height: 1.4;
    }

    .alert-button {
      min-width: 46px;
      color: #fff;
      background: #c52936;
      font-size: 20px;
      font-weight: 800;
    }

    .content {
      min-width: 0;
      padding: 24px 28px 38px;
    }

    .notice {
      max-width: 1250px;
      margin: 0 auto 18px;
      background: #dff0f8;
      border: 1px solid #c6e0ec;
      color: #37677a;
      padding: 11px 14px;
    }

    .view {
      max-width: 1250px;
      margin: 0 auto;
    }

    .home-credits {
      margin: 46px 0 0;
      padding: 16px 0 0;
      color: #8a949d;
      font-size: 12px;
      text-align: center;
    }

    .hidden { display: none; }

    .breadcrumb {
      color: var(--muted);
      font-size: 13px;
      margin: 0 0 14px;
    }

    .top-dashboard {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 10px;
      align-items: stretch;
      margin-bottom: 22px;
    }

    .quick-actions {
      display: grid;
      grid-template-columns: 70px 210px;
      gap: 10px;
    }

    .add-button {
      width: 70px;
      min-height: 100px;
      border-radius: 4px;
      background: var(--charcoal);
      color: #fff;
      font-size: 42px;
      line-height: 1;
      display: grid;
      place-items: center;
    }

    .add-button.small-add {
      width: 42px;
      min-height: 42px;
      height: 42px;
      font-size: 28px;
      flex: 0 0 auto;
    }

    .date-tile {
      min-height: 100px;
      border-radius: 4px;
      background: var(--charcoal);
      color: #fff;
      padding: 18px;
      display: grid;
      align-content: center;
      gap: 5px;
    }

    .date-tile strong {
      font-size: 18px;
    }

    .stats {
      display: grid;
      grid-template-columns: repeat(6, minmax(116px, 1fr));
      box-shadow: var(--shadow);
      min-width: 0;
    }

    .stat {
      min-height: 100px;
      padding: 13px 14px;
      color: #fff;
      background: var(--charcoal);
      border-right: 1px solid rgba(255,255,255,.2);
      display: grid;
      align-content: space-between;
      gap: 6px;
    }

    .stat.clients {
      background: #202428;
      text-align: center;
      place-content: center;
    }

    .stat.total { background: var(--green-soft); }
    .stat.used { background: #4f5b66; }
    .stat.new { background: #59616a; }
    .stat.accessories { background: #69727b; }

    .amount {
      font-size: 18px;
      font-weight: 800;
      white-space: nowrap;
    }

    .stat span {
      display: block;
      color: rgba(255,255,255,.9);
      line-height: 1.35;
    }

    .section-title {
      background: var(--charcoal);
      color: #fff;
      padding: 12px 16px;
      font-size: 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      border-radius: 4px 4px 0 0;
    }

    .section-title span {
      display: inline-flex;
      align-items: center;
      gap: 10px;
    }

    .mini-add {
      width: 32px;
      height: 32px;
      border-radius: 4px;
      color: #fff;
      background: var(--green);
      font-size: 24px;
      line-height: 1;
    }

    .worklist, .table-wrap, .form-panel, .chart-panel {
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: 0 8px 20px rgba(27,39,51,.08);
      margin-bottom: 22px;
    }

    .todo-row {
      display: grid;
      grid-template-columns: 34px 76px minmax(140px, 1fr) auto;
      align-items: center;
      gap: 12px;
      min-height: 44px;
      padding: 0 12px;
      border-bottom: 1px solid #edf1f4;
    }

    .todo-row.done .todo-text,
    .todo-row.done strong {
      color: #828b94;
      text-decoration: line-through;
    }

    .check {
      width: 23px;
      height: 23px;
      border-radius: 3px;
      background: #dce6ee;
      color: #fff;
      display: grid;
      place-items: center;
      font-weight: 800;
    }

    .todo-row.done .check {
      background: var(--blue);
    }

    .todo-text {
      min-height: 30px;
      display: flex;
      align-items: center;
      padding: 4px 6px;
      border: 1px solid transparent;
      border-radius: 4px;
      outline: 0;
    }

    .todo-text:focus {
      border-color: #99c8e7;
      background: #f7fbff;
    }

    .tag {
      padding: 4px 8px;
      border-radius: 99px;
      background: #edf2f6;
      color: #46515b;
      font-size: 12px;
      white-space: nowrap;
    }

    .delete-task {
      width: 28px;
      height: 28px;
      border-radius: 4px;
      background: #eef2f5;
      color: #5b6670;
      font-weight: 800;
    }

    .delete-task:hover {
      background: #f7e2e2;
      color: var(--red);
    }

    .toolbar {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      justify-content: space-between;
      align-items: center;
      background: #fff;
      border: 1px solid var(--line);
      padding: 12px;
      margin-bottom: 12px;
    }

    .filters {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      align-items: center;
    }

    .filters input {
      min-height: 40px;
      border: 1px solid #cbd4dc;
      border-radius: 4px;
      background: #fff;
      padding: 0 10px;
      color: var(--ink);
    }

    select, input[type="date"], .field input, .field textarea {
      min-height: 36px;
      border: 1px solid #cbd4dc;
      border-radius: 4px;
      background: #fff;
      padding: 0 10px;
      color: var(--ink);
    }

    .primary {
      min-height: 36px;
      padding: 0 14px;
      border-radius: 4px;
      background: var(--blue);
      color: #fff;
      font-weight: 700;
    }

    .ghost {
      min-height: 36px;
      padding: 0 12px;
      border-radius: 4px;
      background: #eef3f6;
      color: var(--ink);
      font-weight: 700;
    }

    .chart-panel {
      padding: 14px;
    }

    .chart-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(130px, 1fr));
      gap: 10px;
      margin-bottom: 14px;
    }

    .summary-box {
      border-left: 5px solid var(--green);
      background: #f8fbf9;
      padding: 12px;
      min-height: 70px;
    }

    .summary-box strong {
      display: block;
      font-size: 19px;
      margin-bottom: 4px;
    }

    .chart-wrap {
      width: 100%;
      height: 280px;
      border: 1px solid #edf1f4;
      background: linear-gradient(#fff, #f9fbfc);
      padding: 10px;
    }

    canvas {
      display: block;
      width: 100%;
      height: 100%;
    }

    h1 {
      margin: 0;
      font-size: 34px;
      line-height: 1.1;
    }

    .page-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      min-width: 900px;
    }

    th {
      background: var(--charcoal);
      color: #fff;
      text-align: left;
      padding: 12px;
    }

    td {
      padding: 12px;
      border-bottom: 1px solid #edf1f4;
      vertical-align: middle;
    }

    tr:hover td { background: #f7fafc; }

    .status {
      display: inline-block;
      min-width: 110px;
      text-align: center;
      border-radius: 4px;
      padding: 5px 8px;
      color: #fff;
      font-size: 12px;
      font-weight: 700;
    }

    .status.repaired { background: var(--green); }
    .status.waiting { background: var(--amber); }
    .status.working { background: #2f7ebc; }
    .status.lab2 { background: #5b5fc7; }
    .status.suspended { background: var(--red); }
    .status.rejected { background: #7b8794; }
    .status.completed { background: #4f5b66; }
    .status.worked { background: var(--green); }
    .status.no-show { background: var(--red); }

    .user-status {
      display: inline-block;
      min-width: 92px;
      text-align: center;
      border-radius: 4px;
      padding: 6px 10px;
      color: #fff;
      font-size: 12px;
      font-weight: 800;
    }

    .user-status.unlocked {
      background: var(--green);
    }

    .user-status.locked {
      background: var(--red);
    }

    .warranty-status {
      display: inline-block;
      min-width: 110px;
      text-align: center;
      border-radius: 4px;
      padding: 6px 10px;
      color: #fff;
      font-size: 12px;
      font-weight: 900;
    }

    .warranty-status.active {
      background: var(--green);
    }

    .warranty-status.expiring {
      background: var(--amber);
    }

    .row-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .inline-search-label {
      min-height: 40px;
      display: inline-flex;
      align-items: center;
      color: var(--muted);
      font-size: 13px;
      font-weight: 900;
    }

    .section-heading {
      margin: 22px 0 10px;
      font-size: 18px;
      color: var(--ink);
    }

    .actions-menu {
      position: relative;
      display: inline-block;
    }

    .actions-menu summary {
      width: 36px;
      height: 32px;
      display: grid;
      place-items: center;
      border-radius: 4px;
      background: #eef3f6;
      color: var(--ink);
      font-size: 18px;
      font-weight: 900;
      list-style: none;
      cursor: pointer;
    }

    .actions-menu summary::-webkit-details-marker {
      display: none;
    }

    .actions-dropdown {
      position: absolute;
      right: 0;
      top: calc(100% + 4px);
      z-index: 50;
      min-width: 230px;
      display: grid;
      border: 1px solid var(--line);
      background: #fff;
      box-shadow: var(--shadow);
    }

    .archive-action {
      min-height: 36px;
      padding: 0 12px;
      text-align: left;
      background: #fff;
      color: var(--ink);
      border-bottom: 1px solid #edf1f4;
      font-weight: 700;
    }

    .status-action {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .status-action.waiting { color: #8a5a00; }
    .status-action.working { color: #2f7ebc; }
    .status-action.lab2 { color: #5b5fc7; }
    .status-action.repaired { color: var(--green-dark); }
    .status-action.suspended { color: var(--red); }
    .status-action.worked { color: var(--green-dark); }
    .status-action.no-show { color: var(--red); }

    .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      display: inline-block;
      flex: 0 0 auto;
    }

    .status-dot.waiting { background: var(--amber); }
    .status-dot.working { background: #2f7ebc; }
    .status-dot.lab2 { background: #5b5fc7; }
    .status-dot.repaired { background: var(--green); }
    .status-dot.suspended { background: var(--red); }
    .status-dot.worked { background: var(--green); }
    .status-dot.no-show { background: var(--red); }

    .archive-action:hover {
      background: var(--soft);
      color: var(--green-dark);
    }

    .split {
      display: grid;
      grid-template-columns: 1.15fr .85fr;
      gap: 18px;
    }

    .form-panel {
      padding: 18px;
    }

    .repair-sheet {
      padding: 0;
      overflow: hidden;
    }

    .repair-section-title {
      background: var(--charcoal);
      color: #fff;
      padding: 12px 16px;
      font-size: 18px;
      font-weight: 700;
    }

    .repair-form-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 14px;
      padding: 18px;
    }

    .form-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .field {
      display: grid;
      gap: 6px;
    }

    .field.full { grid-column: 1 / -1; }

    .repair-form-grid .field.full {
      grid-column: 1 / -1;
    }

    label {
      color: #49535d;
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
    }

    .money-input {
      display: grid;
      grid-template-columns: 1fr 38px;
      align-items: center;
    }

    .money-input input {
      border-radius: 4px 0 0 4px;
      border-right: 0;
    }

    .money-input span {
      min-height: 36px;
      display: grid;
      place-items: center;
      border: 1px solid #cbd4dc;
      border-radius: 0 4px 4px 0;
      background: #eef3f6;
      color: #49535d;
      font-weight: 800;
    }

    .field-help {
      color: var(--muted);
      font-size: 12px;
      line-height: 1.2;
    }

    textarea {
      min-height: 92px;
      padding: 9px 10px;
      resize: vertical;
    }

    .medium-area {
      min-height: 86px;
    }

    .large-area {
      min-height: 150px;
    }

    .extra-large-area {
      min-height: 300px;
    }

    .repair-actions {
      justify-items: end;
      padding-top: 6px;
    }

    .test-layout {
      position: relative;
      padding: 18px;
    }

    .test-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(220px, 1fr));
      gap: 14px 120px;
      padding: 10px 90px 22px 0;
    }

    .detail-tests-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(220px, 1fr));
      gap: 12px 80px;
      padding: 12px;
      border: 1px solid #edf1f4;
      background: #fbfcfd;
    }

    .test-row {
      min-height: 28px;
      display: grid;
      grid-template-columns: minmax(160px, 1fr) 24px;
      align-items: center;
      gap: 12px;
      color: #49535d;
      font-size: 13px;
      font-weight: 700;
      text-transform: none;
    }

    .test-row input {
      width: 18px;
      height: 18px;
      min-height: 18px;
      padding: 0;
    }

    .test-warning {
      width: min(360px, 100%);
      margin-bottom: 8px;
      border: 2px solid #d33b3b;
      padding: 8px;
      background: #fff;
    }

    .test-select-all {
      position: absolute;
      top: 18px;
      right: 18px;
    }

    .test-actions {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding-top: 10px;
      border-top: 1px solid #edf1f4;
    }

    .print-toolbar {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .daily-date-picker {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .daily-date-picker.hidden {
      display: none;
    }

    .daily-date-picker input {
      width: 132px;
      min-height: 38px;
    }

    .print-sheet {
      display: grid;
      gap: 18px;
    }

    .print-page {
      width: min(210mm, 100%);
      min-height: 297mm;
      margin: 0 auto;
      background: #fff;
      border: 1px solid var(--line);
      box-shadow: 0 8px 20px rgba(27,39,51,.08);
      padding: 14mm;
      page-break-after: always;
      font-size: 13px;
      line-height: 1.34;
    }

    .repair-work-copy,
    .repair-work-terms-page {
      height: 296mm;
      min-height: 296mm;
      overflow: hidden;
      page-break-inside: avoid;
      break-inside: avoid;
    }

    .repair-work-copy {
      padding: 8mm;
      font-size: 11px;
      line-height: 1.24;
    }

    .repair-work-copy .print-header {
      grid-template-columns: 1fr 230px;
      gap: 18px;
      margin-bottom: 8px;
    }

    .repair-work-copy .print-work-data h2 {
      margin-bottom: 7px;
      font-size: 20px;
    }

    .repair-work-copy .print-work-data p,
    .repair-work-copy .print-store-data p {
      margin: 1px 0;
      line-height: 1.16;
    }

    .repair-work-copy .print-store-data img {
      width: 136px;
      max-height: 54px;
      margin-bottom: 4px;
    }

    .repair-work-copy .print-store-data h3 {
      margin-bottom: 4px;
      font-size: 16px;
    }

    .repair-work-copy .print-store-data h1 {
      margin-top: 8px;
      font-size: 23px;
    }

    .print-header {
      display: grid;
      grid-template-columns: 1fr 280px;
      gap: 28px;
      align-items: start;
      margin-bottom: 18px;
    }

    .print-work-data h2 {
      margin: 0 0 12px;
      font-size: 24px;
    }

    .print-work-data p,
    .print-store-data p {
      margin: 3px 0;
      line-height: 1.25;
    }

    .print-store-data {
      text-align: right;
    }

    .print-store-data img {
      width: 170px;
      max-height: 74px;
      object-fit: contain;
      margin-bottom: 8px;
    }

    .print-store-data h3 {
      margin: 0 0 8px;
      font-size: 20px;
    }

    .print-store-data h1 {
      margin: 18px 0 0;
      font-size: 30px;
      font-weight: 900;
      text-transform: uppercase;
    }

    .daily-report-header {
      grid-template-columns: 250px 1fr;
      gap: 32px;
    }

    .daily-report-header .print-store-data {
      text-align: left;
    }

    .daily-report-header .print-store-data img {
      width: 150px;
      margin-left: 0;
      margin-right: auto;
    }

    .daily-report-title {
      text-align: center;
      align-self: start;
      display: grid;
      place-items: center;
      min-height: 120px;
    }

    .daily-report-title h2 {
      margin: 0;
      font-size: 30px;
      line-height: 1.2;
      font-weight: 900;
    }

    .daily-report-table {
      width: 100%;
      min-width: 0;
      border-collapse: collapse;
      font-size: 12px;
    }

    .daily-report-table th {
      padding: 7px;
      background: #2d3338;
      color: #fff;
    }

    .daily-report-table td {
      padding: 7px;
      border-bottom: 1px solid #e3e7eb;
    }

    .daily-report-totals {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 10px;
      margin-top: 18px;
      border-top: 2px solid #333;
      padding-top: 12px;
    }

    .daily-report-totals div {
      border: 1px solid #dfe7ec;
      padding: 10px;
      background: #fbfcfd;
    }

    .daily-report-totals span {
      display: block;
      color: #46515b;
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
    }

    .daily-report-totals strong {
      display: block;
      margin-top: 6px;
      font-size: 18px;
    }

    .center-title {
      text-align: center;
      font-weight: 900;
    }

    .declaration-title {
      font-size: 22px;
    }

    .payment-inline-input {
      font-weight: 900;
      text-decoration: underline;
    }

    .used-purchase-form p {
      line-height: 2.2;
      font-size: 15px;
    }

    .used-purchase-print {
      font-size: 18px;
      line-height: 1.75;
      padding: 46px;
    }

    .used-purchase-print h2 {
      margin: 0 0 34px;
      font-size: 34px;
      line-height: 1.18;
      text-transform: uppercase;
    }

    .used-purchase-print p {
      margin: 0 0 26px;
    }

    .used-purchase-print .declaration-title {
      margin: 34px 0 14px;
      font-size: 26px;
      line-height: 1.25;
    }

    .used-purchase-print .underlined-payment {
      font-weight: 900;
      text-decoration: underline;
    }

    .used-purchase-print .signature-pair {
      margin-top: 58px;
    }

    .inline-input {
      width: 180px;
      min-height: 30px;
      display: inline-block;
      margin: 0 4px;
      vertical-align: middle;
    }

    .wide-inline {
      width: 320px;
    }

    .signature-pair {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 80px;
      margin: 34px 0 18px;
    }

    .signature-pair div {
      min-height: 70px;
      border-top: 1px solid #333;
      padding-top: 8px;
      text-align: center;
      font-weight: 800;
    }

    .document-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
      gap: 14px;
      margin: 12px 0 22px;
    }

    .document-card {
      margin: 0;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: #fff;
    }

    .document-card img,
    .document-placeholder {
      width: 100%;
      aspect-ratio: 4 / 3;
      object-fit: contain;
      display: grid;
      place-items: center;
      background: var(--soft);
      border: 1px solid var(--line);
    }

    .document-card figcaption {
      margin: 8px 0;
      font-weight: 800;
      word-break: break-word;
    }

    .download-link {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
    }

    .print-block,
    .print-box {
      margin-top: 14px;
      border-top: 2px solid #909090;
      padding-top: 8px;
    }

    .print-block h3,
    .print-box h3 {
      margin: 0 0 8px;
      font-size: 17px;
    }

    .print-test-table {
      min-width: 0;
      width: 100%;
      border-collapse: collapse;
      column-count: 2;
    }

    .print-test-table tbody {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0 30px;
    }

    .print-test-table tr {
      display: grid;
      grid-template-columns: 1fr 26px;
      border-bottom: 1px solid #e3e7eb;
    }

    .print-test-table td {
      border: 0;
      padding: 5px 6px;
    }

    .print-test-table td:last-child {
      text-align: center;
      font-weight: 800;
    }

    .print-note {
      margin: 8px 0 0;
      color: #444;
      font-weight: 700;
    }

    .warranty-duration-box {
      margin-top: 18px;
      border: 2px solid #333;
      padding: 14px 18px;
      text-align: center;
      font-size: 20px;
      font-weight: 800;
    }

    .warranty-duration-box span {
      font-size: 16px;
      font-weight: 700;
    }

    .print-box p {
      min-height: 44px;
      margin: 0;
      white-space: pre-wrap;
    }

    .repair-work-copy .print-block,
    .repair-work-copy .print-box {
      margin-top: 7px;
      border-top-width: 1px;
      padding-top: 4px;
    }

    .repair-work-copy .print-block h3,
    .repair-work-copy .print-box h3 {
      margin-bottom: 4px;
      font-size: 13px;
    }

    .repair-work-copy .print-test-table {
      font-size: 9.8px;
    }

    .repair-work-copy .print-test-table tbody {
      gap: 0 16px;
    }

    .repair-work-copy .print-test-table tr {
      grid-template-columns: 1fr 18px;
    }

    .repair-work-copy .print-test-table td {
      padding: 2.4px 3px;
      line-height: 1.08;
    }

    .repair-work-copy .print-box p {
      min-height: 20px;
      line-height: 1.2;
      max-height: 46px;
      overflow: hidden;
    }

    .repair-work-copy .print-total {
      padding-top: 4px;
      margin-top: 5px;
      line-height: 1.18;
      font-size: 12px;
      font-weight: 900;
    }

    .repair-work-copy .print-total span,
    .repair-work-copy .print-total strong {
      font-weight: 900;
    }

    .print-total {
      display: flex;
      justify-content: space-between;
      gap: 18px;
      border-top: 1px solid #e3e7eb;
      padding-top: 5px;
      margin-top: 5px;
    }

    .print-terms-preview {
      margin-top: 14px;
      font-size: 11px;
      line-height: 1.25;
      white-space: pre-wrap;
    }

    .repair-work-copy .print-terms-preview {
      margin-top: 22px;
      font-size: 10px;
      line-height: 1.16;
    }

    .repair-work-copy .print-terms-preview p {
      margin: 0;
    }

    .signature-box {
      margin-top: 34px;
      display: grid;
      grid-template-columns: 1fr 360px;
      align-items: end;
      gap: 18px;
    }

    .signature-box span {
      grid-column: 2;
      text-align: center;
      font-weight: 700;
    }

    .signature-box div {
      grid-column: 2;
      height: 58px;
      border-bottom: 2px solid #333;
    }

    .repair-work-copy .signature-box {
      margin-top: 14px;
      grid-template-columns: 1fr 280px;
    }

    .repair-work-copy .signature-box div {
      height: 38px;
    }

    .repair-terms-page h2 {
      margin: 0 0 18px;
      font-size: 22px;
    }

    .terms-text {
      white-space: pre-wrap;
      font-size: 12px;
      line-height: 1.32;
    }

    .repair-work-terms-page {
      padding: 8mm;
    }

    .repair-work-terms-page .terms-text {
      column-count: 2;
      column-gap: 8mm;
      font-size: 9.8px;
      line-height: 1.16;
      text-align: justify;
    }

    @page {
      size: A4;
      margin: 0;
    }

    @media print {
      body {
        background: #fff;
      }

      .topbar,
      .nav,
      .notice,
      .no-print,
      .superadmin-banner {
        display: none !important;
      }

      .content {
        padding: 0;
      }

      .view.hidden {
        display: none !important;
      }

      .print-sheet {
        display: block;
      }

      .print-page {
        width: 210mm;
        min-height: 296mm;
        border: 0;
        box-shadow: none;
        padding: 14mm;
        page-break-after: always;
        break-after: page;
      }

      .print-page:last-child {
        page-break-after: auto;
        break-after: auto;
      }

      .repair-work-copy,
      .repair-work-terms-page {
        height: 296mm;
        min-height: 296mm;
        padding: 8mm;
        overflow: hidden;
        page-break-inside: avoid;
        break-inside: avoid;
      }
    }

    .search-note {
      color: var(--muted);
      margin-bottom: 12px;
    }

    @media (max-width: 1120px) {
      .topbar {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
      }

      .brand { min-width: 0; }
      .nav { justify-content: flex-start; }
      .menu > button { min-height: 46px; }
      .dropdown { top: 46px; left: 0; right: auto; }
      .top-dashboard { grid-template-columns: 1fr; }
      .quick-actions { grid-template-columns: 70px 1fr; }
      .stats { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
    }

    @media (max-width: 720px) {
      .content { padding: 18px 14px 28px; }
      h1 { font-size: 26px; }
      .stats, .chart-summary { grid-template-columns: 1fr 1fr; }
      .todo-row { grid-template-columns: 30px 58px minmax(120px, 1fr) 28px; }
      .split, .form-grid, .repair-form-grid, .test-grid, .print-header { grid-template-columns: 1fr; }
      .field.full { grid-column: auto; }
      .test-select-all { position: static; margin-bottom: 12px; }
      .print-store-data { text-align: left; }
      .print-test-table tbody { grid-template-columns: 1fr; }
      .table-wrap { overflow-x: auto; }
    }
