:root {
      color-scheme: light;
      --ink: #172b4d;
      --muted: #718096;
      --line: #e5eaf0;
      --paper: #ffffff;
      --canvas: #f4f6f8;
      --blue: #2855d9;
      --blue-dark: #1e3fa8;
      --blue-soft: #edf2ff;
      --green: #16845b;
      --green-soft: #e7f6ef;
      --amber: #a76a0b;
      --amber-soft: #fff4dd;
      --red: #c23c47;
      --red-soft: #fff0f0;
      --shadow: 0 14px 36px rgba(26, 43, 72, .07);
      --shadow-card: 0 8px 22px rgba(26, 43, 72, .06);
      font-family: Inter, "Segoe UI", Arial, sans-serif;
    }

    * { box-sizing: border-box; }
    body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
      outline: 3px solid rgba(40, 85, 217, .22);
      outline-offset: 2px;
    }
    .hidden { display: none !important; }
    .app-shell { min-height: 100vh; display: flex; flex-direction: column; }
    .topbar {
      position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.96);
      border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
    }
    .topbar-inner {
      max-width: 1560px; min-height: 76px; margin: 0 auto; padding: 12px 28px;
      display: flex; align-items: center; justify-content: space-between; gap: 20px;
    }
    .brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
    .brand-mark {
      width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
      border-radius: 13px; color: white; font-size: 21px; font-weight: 800;
      background: linear-gradient(145deg, #3767eb, #183eaf);
      box-shadow: 0 7px 15px rgba(40,85,217,.2);
    }
    .brand-title { margin: 0; font-size: 17px; letter-spacing: -.25px; }
    .brand-subtitle { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
    .top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
    .user-account { position: relative; }
    .user-chip {
      display: flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px;
      border: 1px solid var(--line); border-radius: 999px; background: #fff; color: inherit; cursor: pointer; text-align: left;
    }
    .user-chip:hover, .user-chip[aria-expanded="true"] { border-color: #bac8dd; background: #fbfcfe; }
    .user-menu-caret { color: #718096; font-size: 12px; }
    .user-menu { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 205px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(27, 43, 69, .16); }
    .user-menu button { display: block; width: 100%; padding: 10px 11px; border: 0; border-radius: 8px; background: transparent; color: #344762; text-align: left; font-size: 13px; font-weight: 650; cursor: pointer; }
    .user-menu button:hover, .user-menu button:focus-visible { background: #f2f5fb; outline: none; }
    .user-menu button[data-account-action="logout"] { color: var(--red); }
    .user-menu-divider { display: block; height: 1px; margin: 5px 4px; background: var(--line); }
    .account-details { display: grid; gap: 14px; }
    .account-details > div { display: grid; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .account-details > div:last-child { padding-bottom: 0; border-bottom: 0; }
    .account-details strong { overflow-wrap: anywhere; color: #26364d; font-size: 14px; }
    .user-info { display: flex; flex-direction: column; }
    .avatar { overflow: hidden; flex: 0 0 auto; }
    .avatar img, .account-avatar-preview img, .avatar-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
    .account-details .account-avatar-preview { display: flex; align-items: center; gap: 12px; }
    .account-avatar-preview img, .account-avatar-preview > span, .avatar-upload-preview { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 50%; }
    .account-avatar-preview > span, .avatar-upload-preview > span { display: grid; place-items: center; background: #eaf0ff; color: var(--blue); font-weight: 800; }
    .avatar-upload-preview { overflow: hidden; margin: 0 auto 8px; background: #eaf0ff; color: var(--blue); display: grid; place-items: center; font-size: 20px; font-weight: 800; }
    .avatar {
      width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
      background: #eaf0ff; color: var(--blue); font-weight: 800; font-size: 12px;
    }
    .user-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
    .user-role { color: var(--muted); font-size: 10px; margin-top: 2px; }
    .btn {
      border: 1px solid transparent; border-radius: 9px; padding: 9px 13px;
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
      font-weight: 700; font-size: 13px; transition: .16s ease; white-space: nowrap;
    }
    .btn:hover { transform: translateY(-1px); }
    .btn-primary { color: #fff; background: var(--blue); box-shadow: 0 5px 12px rgba(40,85,217,.14); }
    .btn-primary:hover { background: var(--blue-dark); }
    .btn-soft { color: var(--blue); background: var(--blue-soft); border-color: #e0e8ff; }
    .btn-outline { color: #53647c; border-color: var(--line); background: #fff; }
    .btn-outline:hover { border-color: #bac8dd; background: #fbfcfe; }
    .btn-danger-soft { color: var(--red); background: var(--red-soft); border-color: #ffe0e0; }
    .btn-small { padding: 8px 12px; font-size: 12px; border-radius: 8px; }
    .icon-button {
      width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 9px;
      background: white; color: #66758b; border: 1px solid var(--line); font-size: 16px;
    }
    .icon-button:hover { color: var(--blue); border-color: #c9d5eb; }
    .modal-head-actions > .icon-button:hover, .modal-head-actions > .icon-button:focus-visible { color: var(--red); border-color: #ffd0d0; background: var(--red-soft); }
    main { width: 100%; max-width: 1560px; padding: 25px 28px 38px; margin: 0 auto; flex: 1; }
    .page-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 20px; }
    h1 { margin: 0; font-size: clamp(22px, 2.5vw, 29px); letter-spacing: -.8px; white-space: nowrap; }
    .page-actions { display: flex; flex-wrap: wrap; gap: 9px; }
    .stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-width: 0; }
    .stat-card {
      display: flex; align-items: center; box-sizing: border-box; height: 37px; gap: 8px; min-width: 0; padding: 4px 8px; background: var(--paper);
      border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 14px rgba(26,43,72,.025);
    }
    .stat-icon { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border-radius: 7px; font-size: 14px; }
    .stat-icon.blue { color: var(--blue); background: #edf2ff; }
    .stat-icon.green { color: #18815d; background: #eaf7f0; }
    .stat-icon.amber { color: #a76a0b; background: #fff4dd; }
    .stat-icon.purple { color: #7652bc; background: #f2edff; }
    .stat-value { font-size: 16px; line-height: 1; font-weight: 800; letter-spacing: -.5px; }
    .stat-name { color: var(--muted); margin-top: 2px; font-size: 9px; line-height: 1; }
    .filter-panel {
      position: sticky; top: 77px; z-index: 4;
      padding: 15px; background: white; border: 1px solid var(--line); border-radius: 13px;
      box-shadow: 0 4px 14px rgba(26,43,72,.08); margin-bottom: 15px;
    }
    .filter-row { display: grid; grid-template-columns: minmax(150px, 1fr) 90px minmax(0, 3fr) minmax(155px, auto); align-items: center; gap: 9px; }
    .search-wrap { min-width: 0; position: relative; }
    .search-wrap span { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: #95a1b2; }
    .field, .select-field, .textarea-field {
      min-height: 38px; width: 100%; border: 1px solid #dfe5ed; border-radius: 8px;
      background: #fff; color: var(--ink); padding: 9px 11px; font-size: 13px;
    }
    select, .select-field { border: 0; }
    .search-wrap .field { padding-left: 35px; }
    .filter-select { width: 100%; min-width: 0; }
    .month-row { display: grid; min-width: 0; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; container-type: inline-size; }
    .month-label-short { display: none; }
    .month-button {
      min-width: 0; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
      border: 1px solid transparent; border-radius: 7px; background: #f5f7fa; color: #65738a;
      padding: 6px 3px; font-size: 10px; font-weight: 700;
    }
    .month-button:hover { background: #edf2ff; color: var(--blue); }
    .month-button.active { color: #fff; background: var(--blue); }
    @container (max-width: 600px) {
      .month-label-full { display: none; }
      .month-label-short { display: inline; }
    }
    @media (min-width: 781px) and (max-width: 1350px) {
      .month-button { padding: 5px 1px; font-size: 9px; }
    }
    .list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 19px 1px 11px; }
    .list-title { font-size: 13px; font-weight: 800; }
    .result-count { color: var(--muted); font-size: 11px; margin-left: 6px; font-weight: 500; }
    .sort-select { width: auto; min-height: 32px; padding: 6px 8px; font-size: 11px; color: #65738a; }

    .product-list { display: grid; gap: 14px; }
    .product-card {
      display: grid; grid-template-columns: 250px minmax(0,1fr); grid-template-rows: auto; gap: 16px;
      background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
      padding: 12px; box-shadow: 0 5px 17px rgba(26,43,72,.035);
    }
    .compact-layout .product-card { grid-template-columns: 205px minmax(0,1fr); padding: 8px; gap: 10px; }
    .compact-layout .product-photo { height: 110px; }
    .compact-layout .process-grid { gap: 4px; }
    .compact-layout .stage-content { padding: 6px 5px; gap: 4px; }
    .compact-layout .stage-note { min-height: 20px; margin-top: 3px; padding-top: 3px; }
    .product-info { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
    .product-code {
      position: relative; display: flex; align-items: center; justify-content: center; min-width: 0;
      color: white; border-radius: 8px; padding: 9px 12px; background: linear-gradient(110deg,#3260dc,#2149b9);
      font-size: 13px; font-weight: 800; letter-spacing: .6px; text-align: center;
    }
    .product-code > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .product-code .tag-edit-button { position: absolute; right: 8px; color: white; }
    .product-code.status-editing { overflow: hidden; padding: 0; }
    .overall-status-select { flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; min-height: 35px; height: 35px; padding: 2px 8px; border-radius: 8px; background: #e5e7eb; color: #273b58; font-size: 11px; }
    .product-photo {
      width: 100%; height: 150px; object-fit: cover; display: block; margin: 9px 0;
      border-radius: 8px; background: #eef1f5;
    }
    .product-name { margin: 0 0 8px; font-size: 12px; font-weight: 800; }
    .product-meta { display: grid; gap: 6px; font-size: 12px; line-height: 1.4; color: #526178; }
    .meta-line { display: flex; align-items: flex-start; gap: 7px; }
    .meta-icon { width: 15px; flex: 0 0 15px; text-align: center; }
    .meta-line strong { color: #273b58; }
    .product-owner { color: var(--blue); font-weight: 700; }
    .deadline-line { color: #526178; }
    .deadline-line strong { color: #a76a0b; }
    .deadline-line.overdue strong { color: var(--red); }
    .deadline-line.done strong { color: var(--green); }
    .process-summary { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(280px, 1.5fr); align-items: stretch; gap: 9px; margin-top: auto; padding-top: 10px; }
    .process-summary .deadline-line { display: flex; align-items: center; justify-content: flex-start; box-sizing: border-box; min-height: 32px; padding: 3px 0; border: 0; border-radius: 0; background: transparent; font-family: inherit; font-size: 14px; line-height: 1.4; text-align: left; }
    .process-summary .deadline-line strong { font-size: inherit; font-weight: 700; }
    .deadline-date-input { width: 142px; min-width: 0; min-height: 27px; margin-left: 4px; border: 1px solid transparent; border-radius: 6px; padding: 3px 5px; background: transparent; color: #a76a0b; font: inherit; font-size: inherit; font-weight: 700; cursor: pointer; }
    .deadline-date-input:hover, .deadline-date-input:focus-visible { border-color: #d8e2f2; background: #fff; outline: none; }
    .deadline-line.overdue .deadline-date-input { color: var(--red); }
    .deadline-line.done .deadline-date-input { color: var(--green); }
    .disposition-panel { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; justify-content: start; justify-items: start; align-items: center; column-gap: 7px; box-sizing: border-box; min-width: 0; min-height: 32px; padding: 3px 0; border: 0; border-radius: 0; background: transparent; }
    .disposition-panel.has-controls { display: flex; justify-content: flex-end; }
    .disposition-label { color: #526178; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
    .disposition-label strong { color: #273b58; font-weight: 800; }
    .disposition-select { box-sizing: border-box; width: 200px; max-width: 100%; min-width: 0; min-height: 29px; height: 29px; padding: 4px 7px; font-size: 11px; }
    .disposition-state { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; margin-top: 0; color: #14744f; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
    .disposition-state-label { color: #526178; }
    .disposition-panel:not(.has-controls) { grid-template-columns: minmax(0, 1fr); }
    .disposition-panel:not(.has-controls) .disposition-state { width: 100%; }
    .disposition-panel:not(.has-controls) .disposition-state > span:last-child { margin-left: auto; text-align: right; }
    .info-footer { position: relative; margin-top: auto; padding-top: 11px; }
    .info-footer::before { position: absolute; top: 3px; right: 0; left: 0; border-top: 1px solid #dce3ee; content: ""; }
    .product-owner-summary { display: flex; min-width: 0; align-items: center; gap: 11px; }
    .product-owner-avatar { display: grid; width: 44px; height: 44px; flex: 0 0 44px; overflow: hidden; place-items: center; border: 1px solid #d7e0ee; border-radius: 50%; background: #eaf0ff; color: var(--blue); font-size: 13px; font-weight: 800; }
    .product-owner-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .product-owner-avatar span { display: grid; width: 100%; height: 100%; place-items: center; }
    .product-owner-details { display: grid; min-width: 0; gap: 4px; }
    .product-owner-details strong { overflow: hidden; color: #273b58; font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
    .created-at { color: #8793a4; font-size: 11px; font-style: italic; line-height: 1.4; }
    .history-link { margin-top: 8px; border: 0; padding: 0; background: none; color: var(--blue); font-size: 12px; line-height: 1.4; font-weight: 800; }
    .history-link:hover { text-decoration: underline; }
    .process-area { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
    .process-bottom { flex: 0 0 auto; margin-top: auto; }
    .flow-strip {
      display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); min-width: 0; overflow: hidden;
      padding: 3px 0 12px; scrollbar-width: thin;
    }
    .design-flow-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .compact-layout .flow-strip { column-gap: 4px; }
    .flow-step {
      position: relative; height: 48px; min-width: 0; margin-left: 0; padding: 0 34px 0 24px;
      display: flex; align-items: center; justify-content: center; gap: 3px; color: white;
      clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%, 14px 50%);
      white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(10px, 1.25vw, 16px); font-weight: 700;
    }
    .flow-step-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .flow-step .tag-edit-button { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
    .tag-edit-button { display: inline-grid; flex: 0 0 auto; place-items: center; border: 0; border-radius: 4px; padding: 2px; background: transparent; color: inherit; font: inherit; font-size: 11px; line-height: 1; cursor: pointer; }
    .tag-edit-button:hover, .tag-edit-button:focus-visible { background: rgba(255,255,255,.2); outline: none; }
    .tag-edit-button:focus-visible { box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
    .flow-step:first-child { margin-left: 0; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%); }
    .flow-step:last-child { padding-right: 12px; }
    .flow-step.flow-quote { background: #405b9b; }
    .flow-step.flow-design { background: #3d69d9; }
    .flow-step.flow-foam { background: #b77b19; }
    .flow-step.flow-fabric { background: #19815f; }
    .flow-step.flow-pack { background: #118a91; }
    .flow-step.flow-done { background: #475569; }
    .flow-step.current { position: relative; z-index: 1; }
    .process-grid { display: grid; flex: 1 1 auto; min-width: 0; min-height: 0; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; overflow: hidden; padding-bottom: 4px; }
    .design-process-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .process-stage { min-width: 0; display: flex; flex-direction: column; border: 0; border-right: 1px solid #e5eaf0; overflow: hidden; background: #fff; }
    .process-stage:last-child { border-right: 0; }
    .stage-quote { background: #405b9b; }
    .stage-design { background: #3d69d9; }
    .stage-foam { background: #b77b19; }
    .stage-fabric { background: #19815f; }
    .stage-pack { background: #118a91; }
    .stage-done { background: #475569; }
    .process-stage-heading { display: none; }
    .stage-content { display: flex; flex: 1; min-height: 0; flex-direction: column; padding: 8px 7px 7px; gap: 6px; }
    .task-line { display: flex; align-items: center; gap: 4px; min-width: 0; color: #536177; font-size: clamp(9px, 1.05vw, 13px); line-height: 1.35; white-space: nowrap; }
    .task-line > span:nth-child(2) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .task-check { color: #8d99aa; flex: 0 0 auto; }
    .task-check.checked { color: var(--green); font-weight: 900; }
    .task-progress-value { flex: 0 0 auto; color: #273b58; font-weight: 700; white-space: nowrap; }
    .stage-note {
      flex: 1 1 0; min-height: 28px; max-height: none; overflow-y: auto; scrollbar-width: thin;
      margin-top: 6px; padding-top: 6px; border-top: 1px dashed #e6eaf0; color: #778398;
      font-size: 9px; line-height: 1.4;
    }
    .stage-location { color: #516783; font-size: 9px; font-weight: 700; margin-top: 1px; }
    .progress-footer { display: flex; align-items: center; gap: 11px; margin-top: 10px; }
    .overall-progress { flex: 1; min-width: 80px; }
    .progress-label { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #63728a; font-size: 10px; margin-bottom: 5px; }
    .progress-label-start { display: flex; min-width: 0; align-items: center; justify-content: flex-start; gap: 7px; }
    .progress-track { height: 7px; border-radius: 99px; background: #edf0f4; overflow: hidden; }
    .progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#86a0f2,#3f6ae0); }
    .status-pill {
      display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px;
      background: #f0f3f7; color: #65738a; font-size: 9px; font-weight: 800; white-space: nowrap;
    }
    .progress-footer .status-pill, .progress-footer .status-pill.in-progress, .progress-footer .status-pill.done, .progress-footer .status-pill.issue { padding: 0; border-radius: 0; background: transparent; font-size: 12px; }
    .status-pill.in-progress { color: #2450bd; background: #edf2ff; }
    .status-pill.done { color: #14744f; background: #e8f7ef; }
    .status-pill.issue { color: #a05f06; background: #fff4dd; }
    .card-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
    .empty-state {
      padding: 54px 20px; text-align: center; border: 1px dashed #d7dfe9; border-radius: 13px;
      background: rgba(255,255,255,.65); color: var(--muted);
    }
    .empty-icon { font-size: 29px; margin-bottom: 8px; }
    .empty-state strong { display: block; color: #344762; margin-bottom: 5px; font-size: 13px; }
    footer { padding: 16px 22px 21px; text-align: center; color: #8793a4; font-size: 10px; }

    .modal-backdrop {
      position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px;
      background: rgba(15,27,48,.56); backdrop-filter: blur(5px);
    }
    .modal {
      width: min(680px, 100%); max-height: min(88vh, 900px); display: flex; flex-direction: column;
      border: 1px solid rgba(226,232,242,.95); border-radius: 20px; background: white;
      box-shadow: 0 30px 100px rgba(16,32,57,.32); overflow: hidden;
    }
    .modal-wide { width: min(980px, 100%); }
    .modal-head { padding: 22px 26px; border-bottom: 1px solid #e8edf5; background: linear-gradient(120deg, #fff 0%, #f2f6ff 100%); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
    .modal-head-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; }
    .modal-title { margin: 0; font-size: 22px; line-height: 1.25; letter-spacing: -.4px; }
    .modal-subtitle { margin: 7px 0 0; color: #596b85; font-size: 14px; line-height: 1.55; }
    .modal-body { padding: 25px 26px; overflow: auto; }
    .modal-foot { border-top: 1px solid var(--line); padding: 16px 26px; display: flex; justify-content: flex-end; gap: 9px; background: #f8faff; }
    .modal-compact-options .modal-head { padding: 13px 20px; }
    .modal-compact-options .modal-title { font-size: 19px; }
    .modal-compact-options .modal-subtitle { margin-top: 4px; font-size: 12px; line-height: 1.4; }
    .modal-compact-options .modal-body { padding: 13px 20px; }
    .modal-compact-options .admin-tabs { gap: 6px; margin-bottom: 10px; }
    .modal-compact-options .admin-tab { padding: 8px 10px 9px; font-size: 12px; }
    .modal-compact-options .admin-options-grid { gap: 10px; }
    .modal-compact-options .admin-options-grid .form-group { gap: 4px; padding: 10px; border-radius: 10px; }
    .modal-compact-options .admin-options-grid .form-label { font-size: 12px; line-height: 1.25; }
    .modal-compact-options .option-editor { gap: 4px; margin-top: 6px; }
    .modal-compact-options .option-editor-row { grid-template-columns: minmax(0, 1fr) 32px 29px; gap: 5px; }
    .modal-compact-options .option-editor-row .field { min-height: 33px; height: 33px; padding: 5px 8px; border-radius: 7px; font-size: 11px; }
    .modal-compact-options .option-color-picker { width: 32px; height: 32px; border-radius: 7px; }
    .modal-compact-options .option-color-picker span { font-size: 19px; }
    .modal-compact-options .option-editor-row .btn { min-width: 29px; min-height: 29px; height: 29px; padding: 4px; border-radius: 7px; font-size: 15px; }
    .modal-compact-options .option-add-button { min-height: 31px; height: 31px; margin-top: 5px; padding: 5px 10px; border-radius: 7px; font-size: 11px; }
    .modal-compact-options .form-hint { font-size: 10px; line-height: 1.35; }
    .modal-compact-options .admin-options-actions { margin-top: 10px; }
    .modal-compact-options .admin-options-actions .btn { min-height: 34px; height: 34px; padding: 7px 13px; font-size: 12px; }
    .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
    .pack-spec-grid { display: grid; grid-template-columns: minmax(0,3fr) minmax(0,1fr) minmax(0,1fr); gap: 13px; }
    .form-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
    .form-group.full { grid-column: 1 / -1; }
    .form-label { color: #344762; font-size: 13px; font-weight: 750; line-height: 1.4; }
    .form-hint { color: #64748b; font-size: 12px; line-height: 1.55; }
    .modal .field, .modal .select-field, .modal .textarea-field { min-height: 43px; padding: 10px 12px; border-color: #d6dfec; border-radius: 10px; font-size: 14px; transition: border-color .16s ease, box-shadow .16s ease; }
    .modal .field:focus, .modal .select-field:focus, .modal .textarea-field:focus { border-color: #809bea; box-shadow: 0 0 0 4px rgba(40,85,217,.09); outline: 0; }
    .modal .btn { min-height: 42px; padding: 10px 16px; border-radius: 10px; font-size: 14px; }
    .textarea-field { min-height: 78px; resize: vertical; }
    .check-row { display: flex; align-items: center; gap: 7px; color: #526178; font-size: 11px; }
    .section-label { margin: 20px 0 11px; color: #65748b; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; }
    .attachment-list { display: grid; gap: 8px; min-width: 0; }
    .attachment-stage { display: grid; gap: 7px; margin-bottom: 8px; }
    .attachment-upload { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
    .attachment-upload .btn { min-height: 36px; padding: 7px 11px; }
    .attachment-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 1px solid #e5eaf0; border-radius: 9px; background: #fbfcff; }
    .attachment-name { flex: 1; min-width: 0; overflow: hidden; color: #344762; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
    .attachment-size { flex: 0 0 auto; color: #718096; font-size: 11px; }
    .attachment-row .btn { flex: 0 0 auto; min-height: 32px; padding: 6px 9px; }
    .attachment-error { color: var(--red); }
    .task-editor { display: grid; gap: 10px; }
    .task-editor-row { display: grid; grid-template-columns: minmax(120px,1fr) minmax(100px,2fr) 38px; gap: 10px; align-items: center; }
    .task-editor-row label { font-size: 11px; color: #526178; }
    .task-editor-row input[type="range"] { width: 100%; accent-color: var(--blue); }
    .range-value { color: var(--blue); font-size: 11px; font-weight: 800; text-align: right; }
    .history-list { display: grid; gap: 0; }
    .history-entry { position: relative; padding: 0 0 17px 22px; border-left: 1px solid #dfe6f0; margin-left: 6px; }
    .history-entry:last-child { border-left-color: transparent; padding-bottom: 0; }
    .history-entry::before { content: ""; position: absolute; width: 9px; height: 9px; left: -5px; top: 3px; border-radius: 50%; background: #7693e9; border: 2px solid white; box-shadow: 0 0 0 1px #cdd9f5; }
    .history-time { color: #8591a3; font-size: 9px; }
    .history-message { margin-top: 4px; color: #344762; font-size: 11px; line-height: 1.5; }
    .history-author { color: var(--blue); font-weight: 800; }
    .request-list { display: grid; gap: 12px; }
    .request-card { padding: 17px 18px; border: 1px solid #e1e8f2; border-radius: 13px; background: linear-gradient(145deg, #fff 0%, #fbfcff 100%); box-shadow: 0 3px 12px rgba(29,51,84,.035); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
    .request-card:hover { border-color: #cbd7ee; box-shadow: var(--shadow-card); transform: translateY(-1px); }
    .request-choice-grid { display: grid; gap: 8px; }
    .request-choice-row { display: grid; grid-template-columns: 20px minmax(80px, .6fr) minmax(190px, 1.4fr); align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
    .request-choice-row:has(input[type="checkbox"]:checked) { border-color: #b8c9f5; background: #f8faff; }
    .request-choice-title { color: #344762; font-size: 11px; font-weight: 800; }
    .request-choice-date { display: flex; align-items: center; gap: 9px; color: #718096; font-size: 10px; }
    .request-choice-date .field { max-width: 190px; }
    .request-choice-date input:disabled { background: #f5f6f8; color: #a0a9b7; }
    .request-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .request-code { color: #2148bd; font-weight: 800; font-size: 14px; }
    .request-type { display: inline-block; margin-left: 8px; border-radius: 99px; padding: 4px 9px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 800; }
    .request-description { margin: 10px 0; color: #52647e; font-size: 13px; line-height: 1.6; }
    .request-meta { color: #697991; font-size: 12px; line-height: 1.55; }
    .request-card .status-pill { padding: 6px 10px; font-size: 11px; }
    .registration-role-choice { display: flex; align-items: center; gap: 12px; margin-top: 12px; color: #435570; font-weight: 700; }
    .registration-role-choice .select-field { width: min(100%, 270px); min-height: 38px; padding: 7px 11px; font-size: 13px; }
    .registration-review-meta { margin-top: 8px; color: #53647c; }
    .request-reply { margin-top: 10px; padding: 12px; border-radius: 9px; background: #f5f7fb; color: #465872; font-size: 12px; line-height: 1.6; }
    .request-actions { display: flex; gap: 8px; margin-top: 13px; }
    .request-actions .btn:disabled { cursor: not-allowed; opacity: .48; transform: none; }
    .admin-tabs { display: flex; gap: 10px; border-bottom: 1px solid var(--line); margin-bottom: 17px; }
    .admin-tab { border: 0; padding: 11px 13px 12px; background: none; color: #687991; font-size: 13px; font-weight: 800; border-bottom: 3px solid transparent; transition: color .16s ease, background .16s ease; }
    .admin-tab:hover { color: var(--blue); background: #f7f9ff; }
    .admin-tab.active { color: var(--blue); border-color: var(--blue); }
    .admin-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
    .admin-options-grid .form-group { padding: 16px; border: 1px solid #e4eaf4; border-radius: 12px; background: linear-gradient(145deg, #fff, #fbfcff); }
    .admin-options-grid .form-label { color: #344762; font-size: 13px; }
    .admin-options-list { min-height: 150px; line-height: 1.65; font-size: 13px; }
    .option-editor { display: grid; gap: 8px; margin-top: 10px; }
    .option-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) 38px 34px; gap: 7px; align-items: center; }
    .option-editor-row .field { min-width: 0; }
    .option-color-picker { position: relative; display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #d9e1ec; border-radius: 9px; background: #fff; cursor: pointer; }
    .option-color-picker span { font-size: 22px; font-weight: 900; line-height: 1; }
    .option-color-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
    .option-add-button { margin-top: 9px; }
    .option-editor-row .btn { min-width: 34px; padding: 6px; font-size: 18px; line-height: 1; }
    .admin-options-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
    .table-wrap { overflow-x: auto; }
    .data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .data-table th { color: #61718a; text-align: left; font-weight: 800; padding: 12px 11px; border-bottom: 1px solid var(--line); background: #f8faff; font-size: 12px; }
    .data-table td { padding: 12px 11px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
    .data-table tbody tr { transition: background .15s ease; }
    .data-table tbody tr:hover { background: #f8faff; }
    .data-table .select-field { min-height: 40px; padding: 8px 11px; font-size: 13px; }
    .data-table .user-email-field { min-width: 190px; min-height: 40px; padding: 8px 11px; font-size: 13px; }
    .data-table .form-hint { color: #60718b; font-size: 12px; }
    .notice { background: linear-gradient(120deg, #f4f7ff, #f8faff); border: 1px solid #dce6fb; color: #405778; border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.65; }
    .modal:has(.admin-tabs) .modal-body { padding-top: 20px; }
    .modal:has(.admin-tabs) .modal-foot .btn { min-height: 40px; padding: 9px 15px; }
    .modal:has(#password-reset-form) { width: min(560px, 100%); max-height: calc(100vh - 28px); }
    .modal:has(#password-reset-form) .modal-head { padding: 13px 20px; }
    .modal:has(#password-reset-form) .modal-title { font-size: 20px; }
    .modal:has(#password-reset-form) .modal-subtitle { margin-top: 4px; font-size: 12px; }
    .modal:has(#password-reset-form) .modal-body { padding: 14px 20px; overflow: hidden; }
    .modal:has(#password-reset-form) .login-form { gap: 8px; }
    .modal:has(#password-reset-form) .form-group { gap: 3px; }
    .modal:has(#password-reset-form) .form-label { font-size: 12px; }
    .modal:has(#password-reset-form) .field { min-height: 36px; padding: 7px 10px; font-size: 13px; }
    .modal:has(#password-reset-form) .btn { min-height: 36px; padding: 7px 13px; font-size: 13px; }
    .modal:has(#password-reset-form) .reset-code-row { gap: 8px; }
    .modal:has(#password-reset-form) .reset-code-row .btn { min-width: 96px; min-height: 36px; }
    .modal:has(#password-reset-form) .form-hint { font-size: 11px; line-height: 1.35; }
    .modal:has(#password-reset-form) .login-error { min-height: 15px; font-size: 11px; }
    .toast {
      position: fixed; z-index: 40; right: 24px; bottom: 24px; max-width: min(380px, calc(100vw - 32px));
      padding: 12px 15px; border-radius: 10px; background: #19345b; color: white; box-shadow: var(--shadow);
      font-size: 11px; animation: toast-in .18s ease;
    }
    .toast.error { background: #9e3039; }
    @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    .login-screen {
      min-height: 100vh; display: grid; place-items: center; padding: 24px;
      background: radial-gradient(ellipse at top left, #e9efff 0, transparent 44%), #f3f5f8;
    }
    .login-card { width: min(410px, 100%); padding: 32px; border: 1px solid #e6eaf1; border-radius: 18px; background: white; box-shadow: 0 22px 65px rgba(26,43,72,.1); }
    .login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 25px; }
    .login-brand .brand-mark { width: 54px; height: 54px; font-size: 25px; border-radius: 16px; margin-bottom: 13px; }
    .login-brand h1 { font-size: 21px; margin: 0; letter-spacing: -.5px; }
    .login-brand p { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
    .login-form { display: grid; gap: 13px; }
    .login-form .btn { width: 100%; min-height: 42px; margin-top: 4px; }
    .login-form .form-label { font-size: 13px; }
    .login-form .field { min-height: 44px; font-size: 15px; }
    .reset-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
    .reset-code-row .btn { width: auto; min-width: 112px; min-height: 44px; margin: 0; }
    .forgot-button { display: block; margin: 12px auto 0; border: 0; background: none; color: var(--blue); font-size: 12px; font-weight: 700; }
    .demo-access { margin-top: 21px; border-top: 1px solid #edf0f4; padding-top: 15px; color: #78859a; font-size: 11px; line-height: 1.7; }
    .demo-access strong { color: #4b5e7a; }
    .login-error { min-height: 18px; color: var(--red); font-size: 12px; }
    .login-error.success { color: #18794e; }

    @media (max-width: 1100px) {
      .product-card { grid-template-columns: 210px minmax(0,1fr); gap: 12px; }
      .process-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
      .design-process-grid { grid-template-columns: repeat(5,minmax(0,1fr)); }
    }
    @media (max-width: 780px) {
      .topbar-inner { padding: 10px 15px; min-height: 66px; }
      .filter-panel { top: 67px; }
      .brand-mark { width: 38px; height: 38px; }
      .brand-title { max-width: 220px; font-size: 13px; }
      .brand-subtitle { display: none; }
      .top-actions { gap: 6px; }
      .user-chip { padding-right: 7px; }
      .user-info { display: none; }
      .user-menu-caret { display: none; }
      .account-avatar-preview img, .account-avatar-preview > span { width: 54px; height: 54px; flex-basis: 54px; }
      .user-menu { right: -5px; }
      main { padding: 19px 14px 30px; }
      .filter-row { grid-template-columns: minmax(0, 1fr) auto; }
      .search-wrap { grid-column: 1; }
      #year-filter { grid-column: 2; }
      .month-row { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4, minmax(0, 1fr)); }
      #status-filter { grid-column: 1 / -1; grid-row: 3; }
      .page-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
      .stats-grid { grid-column: 1 / -1; grid-row: 2; grid-template-columns: repeat(4,minmax(0,1fr)); }
      .product-card { grid-template-columns: 1fr; }
      .compact-layout .product-card { grid-template-columns: 1fr; }
      .product-info { display: grid; grid-template-columns: minmax(135px, .8fr) minmax(150px,1fr); gap: 0 12px; }
      .product-code { grid-column: 1 / -1; }
      .product-photo { grid-row: span 3; height: 132px; }
      .product-name { margin-top: 10px; }
      .product-meta { align-content: start; }
      .info-footer { grid-column: 1 / -1; margin-top: 9px; }
      .product-card { max-height: none; }
      .process-grid, .design-process-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; overflow: visible; }
      .process-stage { min-height: 0; border: 1px solid #e5eaf0; border-radius: 8px; }
      .stage-content { padding: 8px; gap: 6px; }
      .task-line { font-size: clamp(10px, 2.8vw, 13px); }
      .flow-strip { display: none; }
      .process-stage-heading { position: relative; display: flex; align-items: center; justify-content: center; min-height: 32px; padding: 7px 29px; color: #fff; font-size: clamp(10px, 3vw, 13px); font-weight: 700; line-height: 1.2; text-align: center; }
      .process-stage-heading .tag-edit-button { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); }
      .process-summary { grid-template-columns: 1fr; }
      .card-actions { flex-wrap: wrap; justify-content: flex-end; }
    }
    @media (max-width: 480px) {
      .brand-title { max-width: 150px; font-size: 11px; }
      .brand-mark { width: 34px; height: 34px; font-size: 17px; }
      .top-actions > .btn-soft { display: none; }
      .user-chip { padding-right: 7px; }
      .avatar { width: 27px; height: 27px; }
      .user-label { max-width: 74px; overflow: hidden; text-overflow: ellipsis; }
      main { padding-left: 10px; padding-right: 10px; }
      .page-actions { width: 100%; }
      .page-actions .btn { flex: 1; }
      .page-heading { grid-template-columns: 1fr; }
      .page-actions { grid-row: 2; }
      .stats-grid { grid-row: 3; grid-template-columns: repeat(2,minmax(0,1fr)); }
      .stat-card { padding: 4px 6px; gap: 5px; }
      .stat-icon { width: 24px; height: 24px; flex-basis: 24px; }
      .stat-value { font-size: 15px; }
      .filter-row { gap: 5px; }
      .filter-panel { padding: 10px; }
      .month-button { padding: 5px 7px; font-size: 9px; }
      .product-card { padding: 9px; }
      .product-info { grid-template-columns: 1fr 1fr; }
      .product-photo { height: 118px; }
      .progress-footer { flex-wrap: wrap; }
      .overall-progress { flex-basis: 100%; }
      .card-actions { margin-left: auto; }
      .form-grid { grid-template-columns: 1fr; }
      .form-group.full { grid-column: auto; }
      .task-editor-row { grid-template-columns: 98px minmax(70px,1fr) 30px; gap: 7px; }
      .request-choice-row { grid-template-columns: 18px 1fr; }
      .request-choice-date { grid-column: 2; align-items: flex-start; flex-direction: column; gap: 5px; }
      .request-choice-date .field { max-width: none; }
      .modal-head, .modal-body { padding-left: 15px; padding-right: 15px; }
      .modal-head { padding-top: 16px; padding-bottom: 16px; }
      .modal-body { padding-top: 17px; padding-bottom: 17px; }
      .attachment-row { gap: 6px; padding: 7px; }
      .attachment-row .btn { padding: 5px 7px; font-size: 11px; }
      .modal-foot { padding: 12px 15px; }
      .admin-tabs { gap: 2px; overflow-x: auto; }
      .admin-tab { flex: 0 0 auto; padding: 10px 9px 11px; font-size: 12px; }
      .data-table { min-width: 560px; }
      .admin-options-grid { grid-template-columns: 1fr; gap: 12px; }
      .request-card { padding: 14px; }
      .request-card-top { flex-wrap: wrap; }
      .registration-role-choice { align-items: flex-start; flex-direction: column; gap: 6px; }
      .registration-role-choice .select-field { width: 100%; }
    }
