/* Shared screen styling; document and label print layouts stay independent. */
@media screen {
  :root {
    --ink: #202b32;
    --muted: #687780;
    --paper: #f5f7f8;
    --panel: #fff;
    --line: #dfe6e9;
    --green: #087c70;
    --green-dark: #075b53;
    --coral: #bd4944;
    --gold: #d8b35b;
    --sky: #eaf3f7;
  }
  body { background: var(--paper); line-height: 1.5; -webkit-font-smoothing: antialiased; }
  button, input, select, textarea { font-family: inherit; letter-spacing: 0; }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  :where(button, a, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #268fcd; outline-offset: 3px;
  }
  :where(button, .button):disabled { opacity: .45; cursor: not-allowed; }
  :where(input, textarea)::placeholder { color: #84919a; opacity: 1; }
  :where(.admin-main, dialog, .catalog-filters) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) {
    border: 1px solid #cdd8dd; border-radius: 6px; background: #fff;
    color: var(--ink); min-width: 0; max-width: 100%; font-size: 14px;
    padding: 9px 11px; box-shadow: none;
  }
  :where(.admin-main, dialog, .catalog-filters) :where(input, select, textarea):focus {
    border-color: var(--green); outline: 2px solid #087c7026; outline-offset: 1px;
  }
  :where(.admin-main, dialog) :where(input, select, textarea):disabled {
    background: #f3f6f7; color: #55656e;
  }
  :where(input[type="checkbox"], input[type="radio"]) {
    accent-color: var(--green); width: 17px; height: 17px; flex-shrink: 0;
  }
  :where(.admin-main, dialog) label { color: #52626b; font-size: 13px; font-weight: 500; }
  :where(.admin-main, dialog) textarea { resize: vertical; line-height: 1.6; }
  .admin-header.management-header {
    background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: 0 3px 12px #203c4805; padding: 10px 24px; gap: 10px 20px;
  }
  .management-header > a img { width: 112px; max-height: 44px; object-fit: contain; }
  .management-nav { gap: 3px; scrollbar-width: thin; }
  .management-nav a, .management-nav a:last-child {
    color: #53636c; font-size: 13px; padding: 10px 13px;
    border-radius: 5px; border-bottom: 2px solid transparent;
  }
  .management-nav a:hover { color: #243d46; background: #f0f5f6; }
  .management-nav a[aria-current] { color: #086f65; background: #e6f3ef; border-bottom-color: var(--green); }
  .management-header .management-subnav { padding-top: 8px; margin-top: 2px; }
  .management-subnav a { font-weight: 500; }
  .management-profile { border: 1px solid var(--line); background: #fff; padding: 5px 10px 5px 5px; border-radius: 6px; }
  .management-profile:hover { border-color: #9dbdb5; background: #f7fbfa; }
  .management-profile-menu { border-color: var(--line); box-shadow: 0 12px 36px #1c38451c; padding: 6px; }
  .management-profile-menu button { border-radius: 4px; min-height: 40px; }
  .admin-main { padding: 24px 28px 64px; }
  .admin-toolbar { gap: 12px; margin: 16px 0 24px; }
  .admin-toolbar h1 { font-size: 24px; font-weight: 650; }
  .admin-toolbar h1 span { font-size: 16px; font-weight: 400; }
  .admin-toolbar h2, .admin-editor h2 { font-size: 20px; }
  .admin-toolbar.service-action-toolbar { border-color: var(--line); }
  :where(.admin-main, .management-header, dialog) button:not(.category-tree-toggle):not(.avatar-edit-trigger):not(.product-group):not(.admin-product):not(.order-position-link):not(.order-drag-handle) {
    border-radius: 6px;
  }
  .admin-primary, button.admin-primary, .button.primary {
    background: var(--green); color: #fff; border: 1px solid var(--green);
    box-shadow: 0 1px 2px #163e3812;
  }
  .admin-primary:hover:not(:disabled), .button.primary:hover { background: var(--green-dark); border-color: var(--green-dark); }
  :where(.admin-save, .warehouse-header-actions, .category-tree-tools) button:not(.admin-primary):not(:disabled):hover {
    background: #edf4f5; border-color: #b5c9cb;
  }
  .catalog-icon-action { display: inline-flex; align-items: center; justify-content: center; padding: 0; width: 38px; height: 38px; flex: 0 0 38px; }
  .catalog-icon-action svg { display: block; width: 18px; height: 18px; flex: 0 0 18px; margin: 0; }
  .admin-layout.product-browser { gap: 24px; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); }
  .admin-layout.product-browser > .admin-list,
  .admin-layout.product-browser > .product-groups { background: transparent; box-shadow: none; border: 0; border-radius: 0; }
  .product-groups h2, .product-browser > aside h2 { color: #7a8790; font-size: 12px; font-weight: 650; text-transform: uppercase; margin: 0 0 16px; }
  .category-tree-row { margin: 2px 0; }
  .category-tree-row .product-group { border-radius: 5px; font-size: 13px; padding: 9px 8px; line-height: 1.45; background: transparent; }
  .category-tree-row .product-group:hover { background: #eaf0f2; }
  .category-tree-row .product-group[aria-pressed="true"] { background: #dfefe9; color: #075d52; font-weight: 600; }
  .category-tree-branch { border-left-color: #d4dfe1; }
  .category-tree-row .product-group .product-group-count { font-size: 11px; height: 22px; min-width: 26px; }
  .category-tree-tools { gap: 6px; margin-bottom: 16px; }
  .admin-products-table { background: white; border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
  .admin-products-table th { background: #edf2f4; color: #62727c; font-size: 12px; font-weight: 600; text-align: left; padding: 11px 12px; border-bottom: 1px solid #d5e0e5; white-space: nowrap; }
  .admin-products-table td { padding: 12px; border-bottom: 1px solid #e8edef; vertical-align: middle; font-variant-numeric: tabular-nums; }
  .admin-products-table th:first-child, .admin-products-table td:first-child { width: 42px; text-align: center; }
  .admin-products-table tbody tr:hover { background: #f2f8fa; }
  .admin-products-table tbody tr:has(input[type="checkbox"]:checked) { background: #e9f5ef; }
  .admin-table-identity { gap: 12px; }
  .admin-table-identity img { background: #fff; border: 1px solid #edf0f2; border-radius: 5px; object-fit: contain; }
  .admin-table-name { color: #263e49; font-weight: 550; line-height: 1.45; overflow-wrap: anywhere; }
  .admin-table-name:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
  .table-scroll { scrollbar-width: thin; scrollbar-color: #b7c6cd #edf2f4; }
  .product-pagination { gap: 8px; align-items: center; padding-top: 18px; color: var(--muted); font-size: 13px; }
  .product-pagination button { min-height: 36px; min-width: 36px; }
  .product-pagination [aria-current] { color: white; background: var(--green); border-color: var(--green); }
  dialog:not(.product-workspace):not(.embedded-product-dialog):not(.service-workspace-editor):not(.order-price-menu) {
    border-color: var(--line); box-shadow: 0 20px 80px #1d35452b;
  }
  dialog::backdrop { background: #20344066; backdrop-filter: blur(3px); }
  .dialog-corner-close { display: inline-flex; align-items: center; justify-content: center; background: #f1f5f6; color: #61717b; border: 1px solid transparent; }
  .dialog-corner-close:hover { background: #fbeceb; color: #b83e38; }
  .admin-product { border-color: var(--line); border-radius: 6px; box-shadow: none; }
  .admin-product:hover { border-color: #a6c3bd; background: #f2f8f6; }
  .site-header { background: #ffffffed; border-color: var(--line); }
  .site-header .nav a { font-size: 14px; font-weight: 500; }
  .site-header .nav a:hover { color: var(--green); }
  .button { border-radius: 6px; font-weight: 600; }
  .button.secondary { background: #fff; border-color: #c6d7d5; color: #245b52; }
  .product-card { border: 1px solid #e0e8eb; border-radius: 8px; background: white; box-shadow: none; overflow: hidden; }
  .product-card:hover { border-color: #99bdb5; box-shadow: 0 6px 20px #1c413909; }
  .product-card h3 { font-size: 15px; line-height: 1.5; }
  .product-card img { object-fit: contain; }
  .catalog-filters { color: var(--muted); }
  .contact-item { background: #fff; border-color: var(--line); border-radius: 8px; }
  .contact-item .contact-icon { background: #e8f3f0; color: var(--green); }
  .profile-avatar, .employee-avatar { object-fit: cover; aspect-ratio: 1; }
  .team-chat { border-color: var(--line); box-shadow: 0 4px 24px #20394406; }
  .chat-directory { background: #fafcfc; border-right-color: var(--line); }
  .chat-person { border-radius: 6px; }
  .chat-person:hover { background: #edf4f6; }
  .chat-person[aria-current], .chat-person[aria-pressed="true"] { background: #e1f1eb; color: #096b5f; }
  body:has(#login) .admin-main { margin-top: 64px; padding: 32px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 40px #1b3c4608; }
  body:has(#login) #title { font-size: 24px !important; margin: 28px 0 20px; }
  body:has(#login) #login button { min-height: 44px; }
  :where(.admin-main, dialog) h1, :where(.admin-main, dialog) h2, :where(.admin-main, dialog) h3 { letter-spacing: 0; }
  @media (max-width: 800px) {
    .admin-header.management-header { padding: 10px 14px; gap: 8px; }
    .admin-main { padding: 16px 14px 92px; }
    .admin-layout.product-browser { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .management-header > a img { width: 96px; }
    .admin-toolbar h1 { font-size: 21px; }
    .management-nav a, .management-nav a:last-child { padding: 9px 11px; }
    .admin-layout.product-browser > aside { max-height: 280px; overflow: auto; overscroll-behavior: contain; }
    .admin-products-table { min-width: 640px; }
    .admin-products-table td { padding: 10px; }
    .catalog-icon-action { min-width: 42px; width: 42px; height: 42px; flex-basis: 42px; }
    :where(.admin-main, dialog) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) { font-size: 16px; }
    .product-pagination { flex-wrap: wrap; }
    body:has(#login) .admin-main { margin: 24px 14px; padding: 24px; max-width: calc(100% - 28px) !important; }
    .mobile-bottom-nav { border-top-color: var(--line); box-shadow: 0 -4px 20px #183f4508; }
    .mobile-bottom-nav > [aria-current] { background: #e4f3ed; color: var(--green); }
  }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  }
}
