:root {
  --new-header-height: 57px;
  --new-menu-height: 43px;
  --new-table-row-height: 56px;
  --new-table-data-padding-y: 0px;
  --new-table-data-padding-x: 16px;
  --new-content-max-width: 1440px;
  --new-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  --new-main-background-color: #F4F6F9;
}

* {
  box-sizing: border-box;
  font-family: 'Noto Sans JP', 'メイリオ', sans-serif;
}

html, body {
  min-height: 100%;
  margin: 0;
  background: var(--color-page-bg);
  color: var(--color-text-default);
}

body {
  font-size: 14px;
}

.page-new-design {
  .sidebar-backdrop { z-index: 9; }
  input[type="checkbox"]:not(:checked) { appearance: none; width: 13px; height: 13px; border: 1px solid var(--color-input-border); border-radius: 4px; background: var(--white); }
  min-height: 100vh;
  background: var(--color-page-bg);
  &:has(.dashboard-panel, .users-panel-header, .list-panel-header) {
    background: var(--new-main-background-color);
    .main { background: var(--new-main-background-color); }
  }
  .main:has(.dashboard-panel, .users-panel-header, .list-panel-header) { padding-top: 20px; }
  .header {
    position: sticky;
    isolation: isolate;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--new-header-height);
    padding: 0 20px;
    background: var(--gradient-brand-primary);
    box-shadow: var(--new-shadow);
    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image:
        linear-gradient(rgba(255, 255, 255, 0.2) 2px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.2) 2px, transparent 1px);
      background-size: 64px 64px;
      background-position: 0 38px, 0 0;
      opacity: 0.3;
      pointer-events: none;
    }
    > * { position: relative; z-index: 1; }
    .logo {
      color: var(--white);
      font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
      font-size: 16px;
      font-weight: 700;
      line-height: 22px;
      letter-spacing: 0;
      text-decoration: none;
    }
  }
  .user-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    .user-trigger,
    .user-settings-trigger,
    .chat-trigger,
    .help-trigger {
      min-height: 2.4rem;
      padding: 0;
      border: 0;
      background: transparent;
      color: var(--white);
    }
    .help-trigger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.4rem;
      text-decoration: none;
      &:hover, &:focus-visible { opacity: .8; }
      img { display: block; width: 20px; height: 20px; }
    }
    .chat-trigger {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 2.4rem;
      text-decoration: none;
      &:hover, &:focus-visible { opacity: .8; }
      img { display: block; width: 30px; height: 30px; }
    }
    .user-trigger { font-weight: 700; }
    .user-settings-trigger {
      width: 2.4rem;
      font-size: 1.35rem;
      line-height: 1;
      &:hover, &:focus-visible { color: #dff7ff; }
      img { display: block; width: 20px; height: 20px; margin: 0 auto; }
    }
    .user-account-menu {
      position: relative;
      &:hover .user-dropdown,
      &:focus-within .user-dropdown {
        display: block;
      }
    }
    .user-trigger-label {
      display: inline-flex;
      align-items: center;
      gap: .35rem;
      .user-trigger-icon { display: block; width: 30px; height: 30px; }
      .user-chevron { display: block; width: 6px; height: 4px; }
    }
    .user-dropdown {
      position: absolute;
      top: 100%;
      right: 0;
      z-index: 20;
      display: none;
      min-width: 12rem;
      padding: .4rem;
      border: 1px solid var(--color-border);
      border-radius: .65rem;
      background: var(--color-surface);
      box-shadow: var(--new-shadow);
      .user-dropdown-item {
        display: block;
        width: 100%;
        padding: .65rem .75rem;
        border: 0;
        border-radius: .4rem;
        background: transparent;
        color: var(--color-text-default);
        text-align: left;
        &:hover { background: #eef8ff; }
      }
    }
  }
  #menu-bar {
    position: sticky;
    top: var(--new-header-height);
    z-index: 9;
    display: flex;
    align-items: center;
    height: var(--new-menu-height);
    padding: 0 20px 0 0;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-surface);
  }
  #menu-title, #menu-list { display: flex; align-items: stretch; }
  #menu-title { margin-right: 0; }
  #menu-list { margin-left: 2px; padding-left: 4px; border-left: 1px solid var(--color-border-light); }
  #menu-icon { display: none; }
  #menu-group-switcher-area {
    display: flex;
    align-items: center;
    flex: 0 0 50px;
    height: 100%;
    padding-left: 20px;
    cursor: pointer;
    &:hover { background: var(--color-hover-background); }
  }
  #menu-group-switcher {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    min-height: 18px;
    height: 18px;
    margin-right: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    &:hover, &:focus-visible { background: var(--color-hover-background); }
    img { display: block; width: 18px; height: 18px; }
  }
  #menu-title .menu-item,
  #menu-list .menu-item {
    display: flex;
    align-items: center;
    height: 43px;
    min-height: 43px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid var(--color-border-light);
    border-radius: 0;
    background: var(--white);
    color: var(--slate-700);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 17px;
    cursor: pointer;
    &:hover { background: var(--color-hover-background); color: var(--slate-800); }
  }
  #menu-title .menu-item.is-active,
  #menu-list .menu-item.is-active {
    background: var(--color-selected-background);
    border-bottom: 2px solid #0ea5e9;
    color: var(--sky-600);
  }
  .menu-popup {
    position: absolute;
    top: calc(var(--new-header-height) + var(--new-menu-height));
    left: 20px;
    z-index: 20;
    width: 176px;
    height: auto;
    max-height: calc(100vh - var(--new-header-height) - var(--new-menu-height) - 12px);
    max-height: calc(100dvh - var(--new-header-height) - var(--new-menu-height) - 12px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px 0;
    border: 1px solid var(--color-border-light);
    border-radius: 12px;
    background: var(--white);
    box-shadow: none;
  }
  .menu-popup-list,
  .menu-popup-group,
  .menu-popup-children {
    display: block;
  }
  #menu-popup .menu-popup-group-button,
  #menu-popup .menu-popup-child {
    box-sizing: border-box;
    width: 100%;
    border: 0;
    border-radius: 0;
    color: var(--slate-700);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    text-align: left;
    cursor: pointer;
  }
  #menu-popup .menu-popup-group-button {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 6px 12px;
    font-weight: 700;
    .menu-popup-icon { flex: 0 0 13px; width: 13px; height: 13px; }
  }
  .menu-popup-children {
    padding: 1px 0 4px 28px;
  }
  #menu-popup .menu-popup-child {
    width: 146px;
    height: 28px;
    padding: 4px 12px;
  }
  #menu-popup .menu-popup-action:hover {
    background: var(--sky-50);
    color: var(--sky-600);
  }
  #menu-popup .menu-popup-action.is-active {
    background: var(--color-selected-background);
    color: var(--sky-600);
  }
  /* Keep the menu item contract explicit for the Figma-sized group menu. */
  .menu-item {
    min-height: 43px;
    padding: 0 16px;
    border: 0;
    border-bottom: 1px solid var(--color-border-light);
    border-radius: 0;
  }
  .main {
    width: min(var(--new-content-max-width), calc(100% - 40px));
    margin: 0 auto;
    padding: 20px 0 48px;
    .panel { width: 100%; }
  }

  .dashboard-panel {
    .dashboard-panel-header {
      display: flex;
      align-items: center;
      min-height: 40px;
      margin-bottom: 12px;
      > h1 {
        margin: 0;
        color: var(--slate-800);
        font-size: 24px;
        font-weight: 700;
        line-height: 32px;
      }
    }
    .dashboard-news-card {
      overflow: hidden;
      border: 1px solid var(--color-border);
      border-radius: 12px;
      background: var(--white);
      box-shadow: var(--new-shadow);
      > h2 {
        margin: 0;
        padding: 14px 20px 12px;
        border-bottom: 1px solid var(--color-border-light);
        color: var(--slate-800);
        font-size: 14px;
        font-weight: 700;
        line-height: 20px;
      }
    }
    .dashboard-news-list { padding: 0 20px; }
    .dashboard-news-item {
      padding: 14px 0;
      border-bottom: 1px solid var(--color-border-light);
      &:last-child { border-bottom: 0; }
      > h3 {
        margin: 0 0 8px;
        color: var(--slate-700);
        font-size: 14px;
        font-weight: 700;
        line-height: 20px;
      }
      > pre {
        margin: 0;
        color: var(--slate-500);
        font-family: inherit;
        font-size: 12px;
        line-height: 20px;
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }
    }
    .dashboard-news-empty {
      margin: 0;
      padding: 20px;
      color: var(--slate-500);
      font-size: 14px;
      line-height: 20px;
    }
    .dashboard-panel-header { justify-content: space-between; gap: 16px; }
    .dashboard-status-counts {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      min-width: 0;
      padding: 10px;
    }
    .dashboard-status-card {
      display: flex;
      min-width: 0;
      flex-direction: column;
      justify-content: space-between;
      padding: 4px 10px;
      &:not(:first-child) { border-left: 1px solid var(--color-border-light); }
      &:nth-child(3), &:nth-child(4) { padding-top: 12px; border-top: 1px solid var(--color-border-light); }
      &:nth-child(3) { border-left: 0; }
      > h2 { margin: 0 0 8px; color: var(--slate-700); font-size: 12px; line-height: 17px; }
      > dl {
        display: grid;
        gap: 5px;
        margin: 0;
        > div { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; }
        > div > dt { color: var(--slate-600); font-size: 10px; }
        > div > dd { margin: 0; color: var(--slate-800); font-size: 16px; font-weight: 700; white-space: nowrap; }
      }
      > p { margin: 8px 0 0; color: var(--red-500); font-size: 10px; line-height: 14px; }
      &.is-contract > dl { grid-template-columns: 1fr; }
    }
    .dashboard-widgets {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 16px;
    }
    .dashboard-widget-link {
      display: block;
      min-width: 0;
      color: inherit;
      text-decoration: none;
      cursor: pointer;
    }
    .dashboard-widget {
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--color-border);
      border-radius: 12px;
      background: var(--white);
      box-shadow: var(--new-shadow);
      &.dashboard-widget-news { grid-column: 1 / -1; }
    }
    .dashboard-widgets { > .dashboard-widget-is-left-pinned { grid-column: 1; } }
    .dashboard-contract-widget {
      min-width: 0;
      overflow: hidden;
      border: 1px solid var(--color-border);
      border-radius: 12px;
      background: var(--white);
      box-shadow: var(--new-shadow);
    }
    .dashboard-contract-widget-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      min-height: 38px;
      padding: 9px 20px;
      border-bottom: 1px solid var(--color-border-light);
      background: var(--slate-50);
      > h2 { margin: 0; color: var(--slate-800); font-size: 14px; font-weight: 700; line-height: 20px; }
    }
    .dashboard-contract-period {
      display: flex;
      align-items: center;
      gap: 4px;
      color: var(--slate-700);
      font-size: 13px;
      white-space: nowrap;
      > button {
        display: grid;
        width: 24px;
        height: 24px;
        padding: 0;
        place-items: center;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: var(--color-link);
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        &:hover { background: var(--slate-100); }
      }
    }
    .dashboard-contract-widget-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      color: var(--slate-600);
      font-size: 11px;
      > span::before { display: inline-block; width: 8px; height: 8px; margin-right: 4px; content: ""; }
      > .is-original-target::before { background: #176080; }
      > .is-adjusted-target::before { background: #91b6c6; }
      > .is-target::before { background: #176080; }
      > .is-actual::before { background: #ed7133; }
    }
    .dashboard-contract-chart {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      grid-template-rows: minmax(0, 1fr);
      align-items: end;
      gap: 8px;
      height: 190px;
      margin: 0;
      padding: 24px 20px 12px;
      list-style: none;
      > li { display: flex; flex-direction: column; align-items: center; justify-content: end; height: 100%; min-width: 0; }
    }
    .dashboard-contract-bars {
      display: flex;
      align-items: end;
      justify-content: center;
      gap: 4px;
      width: 100%;
      height: 100%;
      border-bottom: 1px solid var(--color-border);
    }
    .dashboard-contract-bar {
      position: relative;
      display: block;
      flex: 0 0 18px;
      height: 100%;
      min-height: 0;
      background: transparent;
      &::before { position: absolute; inset: 0; background: #176080; content: ""; transform: scaleY(var(--bar-scale, 0)); transform-origin: bottom; }
      > span { position: absolute; left: 50%; bottom: 0; color: var(--slate-700); font-size: 10px; line-height: 14px; transform: translate(-50%, -4px); }
      &.is-original-target::before { background: #176080; }
      &.is-adjusted-target::before { background: #91b6c6; }
      &.is-actual::before { background: #ed7133; }
    }
    .dashboard-contract-month { padding-top: 5px; color: var(--slate-600); font-size: 11px; line-height: 16px; }
    .dashboard-widget-header {
      min-height: 38px;
      padding: 9px 20px;
      border-bottom: 1px solid var(--color-border-light);
      background: var(--slate-50);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      > h2 { margin: 0; color: var(--slate-800); font-size: 14px; font-weight: 700; line-height: 20px; }
      > time { color: var(--slate-500); font-size: 12px; line-height: 18px; }
    }
    .dashboard-widget-header-link {
      display: flex;
      flex: 1 1 auto;
      align-items: center;
      min-width: 0;
      color: inherit;
      text-decoration: none;
      > h2 { margin: 0; color: var(--slate-800); font-size: 14px; font-weight: 700; line-height: 20px; }
      &:hover { background: var(--slate-100); }
      &:focus-visible { outline: 2px solid var(--sky-500); outline-offset: -2px; }
    }
    .dashboard-widget-count-settings {
      display: grid;
      flex: 0 0 30px;
      width: 30px;
      height: 30px;
      place-items: center;
      padding: 0;
      border: 0;
      border-radius: 6px;
      background: transparent;
      cursor: pointer;
      > img { display: block; width: 15px; height: 15px; }
      &:hover { background: var(--slate-200); }
      &:focus-visible { outline: 2px solid var(--sky-500); outline-offset: 1px; }
    }
    .dashboard-widget-list { margin: 0; padding: 0 20px; list-style: none; }
    .dashboard-widget-news {
      .dashboard-widget-list { max-height: 230px; overflow-y: auto; }
    }
    .dashboard-featured-table-wrap {
      max-height: none;
      overflow: auto;
      overscroll-behavior: contain;
      .dashboard-widget-table {
        thead { position: sticky; top: 0; z-index: 1; }
        th { background: var(--slate-50); }
      }
    }
    .dashboard-widget-item {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 13px 0;
      border-bottom: 1px solid var(--color-border-light);
      &:last-child { border-bottom: 0; }
      > time { flex: 0 0 auto; color: var(--slate-500); font-size: 11px; line-height: 18px; }
      &.dashboard-widget-news-item {
        align-items: center;
        gap: 12px;
        min-width: 0;
        padding: 9px 0;
        white-space: nowrap;
        > time { width: 94px; overflow: hidden; text-overflow: ellipsis; }
        > h3 { flex: 0 0 22%; min-width: 100px; max-width: 220px; margin: 0; overflow: hidden; color: var(--slate-700); font-size: 12px; font-weight: 600; text-overflow: ellipsis; }
        &:hover { background: var(--slate-50); cursor: pointer; }
        &:focus-visible { outline: 2px solid var(--sky-500); outline-offset: -2px; }
        > p { flex: 1 1 auto; min-width: 0; margin: 0; overflow: hidden; color: var(--slate-500); font-size: 12px; text-overflow: ellipsis; }
      }
    }
    .dashboard-widget-item-copy {
      min-width: 0;
      > h3 { margin: 0; color: var(--slate-700); font-size: 13px; font-weight: 600; line-height: 20px; overflow-wrap: anywhere; }
      > p { margin: 4px 0 0; color: var(--slate-500); font-size: 12px; line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
    }
    .dashboard-widget-empty { margin: 0; padding: 18px 20px; color: var(--slate-500); font-size: 13px; line-height: 20px; &.dashboard-widget-link-text { color: var(--sky-500); } }
    .dashboard-work-logs-input-summary { display: flex; align-items: center; gap: 16px; padding: 18px 20px; > p { margin: 0; font-size: 13px; line-height: 20px; } > .dashboard-widget-link-text { color: var(--sky-500); } > .dashboard-work-logs-last-input { color: var(--slate-500); } }
    .dashboard-widget-table-wrap { overflow-x: auto; }
    .dashboard-widget-table {
      width: 100%;
      border-collapse: collapse;
      color: var(--slate-700);
      font-size: 11px;
      line-height: 16px;
      text-align: left;
      white-space: nowrap;
      th, td { padding: 7px 9px; border-bottom: 1px solid var(--color-border-light); }
      th { color: var(--slate-500); font-weight: 600; }
      tbody > tr:last-child > td { border-bottom: 0; }
      td.is-job-title > span, td.is-job-title > a { display: block; max-width: 18em; overflow: hidden; text-overflow: ellipsis; }
      td.is-job-title > a { color: var(--color-link); text-decoration: none; &:hover, &:focus-visible { color: var(--color-link-hover); text-decoration: underline; } }
      td.is-start-date > span { display: block; max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
    }
    .dashboard-favorite-scope-buttons {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 2px;
      > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        padding: 3px;
        border: 0;
        border-radius: 6px;
        background: transparent;
        cursor: pointer;
        &:hover { background: var(--slate-100); }
        &:focus-visible { outline: 2px solid var(--color-focus-ring); outline-offset: 1px; }
        &:disabled { opacity: .55; cursor: wait; }
        > img { display: block; width: 24px; height: 24px; opacity: .45; }
        &.is-active > img { opacity: 1; filter: invert(55%) sepia(92%) saturate(1444%) hue-rotate(349deg) brightness(103%) contrast(101%); }
      }
    }
    .dashboard-featured-header { cursor: pointer; &:hover { background: var(--slate-100); } &:focus-visible { outline: 2px solid var(--sky-500); outline-offset: -2px; } }
    .dashboard-widget-table tbody > .dashboard-featured-row { cursor: pointer; &:hover > td { background: var(--slate-50); } &:focus-visible { outline: 2px solid var(--sky-500); outline-offset: -2px; } }
    .dashboard-work-logs-summary {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      margin: 0;
      padding: 18px 20px;
      > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
      > div > dt { color: var(--slate-500); font-size: 12px; line-height: 18px; }
      > div > dd { margin: 0; color: var(--slate-800); font-size: 22px; font-weight: 700; line-height: 28px; }
      > div:last-child > dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
      > div.is-alert > dd { color: var(--red-500); }
    }
    .dashboard-work-logs-missing-link { color: var(--color-link); font-size: 12px; font-weight: 500; line-height: 18px; }
    .dashboard-work-logs-dialog {
      width: min(480px, calc(100% - 32px));
      max-height: min(70vh, 640px);
      padding: 0;
      border: 0;
      border-radius: 12px;
      color: var(--slate-700);
      box-shadow: var(--new-shadow);
      &::backdrop { background: rgb(15 23 42 / 35%); }
      > header { padding: 18px 20px; border-bottom: 1px solid var(--color-border-light); }
      > header > h2 { margin: 0; color: var(--slate-800); font-size: 16px; line-height: 24px; }
      > ul { max-height: 50vh; margin: 0; padding: 8px 20px; overflow-y: auto; list-style: none; }
      > ul > li { padding: 8px 0; font-size: 13px; line-height: 20px; }
      > p { margin: 0; padding: 20px; color: var(--slate-500); font-size: 13px; }
      > form { display: flex; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--color-border-light); }
    }
  }
  .dashboard-news-dialog {
    width: min(680px, calc(100% - 32px));
    max-height: min(80vh, 720px);
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--slate-700);
    box-shadow: var(--new-shadow);
    &::backdrop { background: rgb(15 23 42 / 45%); }
    > .dashboard-news-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
    h2 { margin: 0; font-size: 18px; line-height: 26px; overflow-wrap: anywhere; }
    [data-news-dialog-close] { border: 0; background: transparent; color: var(--slate-500); font-size: 24px; cursor: pointer; }
    > time { display: block; margin-top: 8px; color: var(--slate-500); font-size: 12px; }
    > p { margin: 16px 0 0; max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
  }
  .dashboard-count-settings-dialog {
    width: min(420px, calc(100% - 32px));
    padding: 20px 24px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: var(--slate-700);
    box-shadow: var(--new-shadow);
    &::backdrop { background: rgb(15 23 42 / 45%); }
    .dashboard-count-settings-form { display: grid; gap: 16px; }
    .dashboard-count-settings-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; > h2 { margin: 0; color: var(--slate-800); font-size: 17px; line-height: 24px; } }
    > form > .dashboard-count-settings-header > [data-count-settings-close] { border: 0; background: transparent; color: var(--slate-500); font-size: 24px; cursor: pointer; }
    label { display: grid; grid-template-columns: 1fr 88px; align-items: center; gap: 12px; font-size: 13px; }
    input { width: 88px; height: var(--control-height); padding: 6px 8px; border: 1px solid var(--color-input-border); border-radius: 6px; background: var(--white); text-align: right; }
    > form > p { min-height: 18px; margin: 0; color: var(--red-500); font-size: 12px; }
    .dashboard-count-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
  }
  .dashboard-customize-panel {
    .dashboard-customize-header {
      margin-bottom: 16px;
      > div > h1 { margin: 0; color: var(--slate-800); font-size: 24px; line-height: 32px; }
      > div > p { margin: 6px 0 0; color: var(--slate-500); font-size: 13px; line-height: 20px; }
    }
    .dashboard-customize-card { padding: 20px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--white); box-shadow: var(--new-shadow); }
    .dashboard-customize-message { min-height: 20px; margin: 0 0 8px; color: var(--slate-500); font-size: 13px; }
    .dashboard-customize-message.is-error { color: #dc2626; }
    .dashboard-widget-options { margin: 0; padding: 0; list-style: none; }
    .dashboard-widget-option {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      min-height: 58px;
      padding: 8px 12px;
      border: 1px solid var(--color-border-light);
      border-bottom: 0;
      &:first-child { border-radius: 8px 8px 0 0; }
      &:last-child { border-bottom: 1px solid var(--color-border-light); border-radius: 0 0 8px 8px; }
    }
    .dashboard-widget-option-label { display: flex; align-items: center; gap: 10px; color: var(--slate-700); font-size: 14px; }
    .dashboard-widget-option-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; > button { min-height: 34px; padding: 0 12px; } }
    .dashboard-widget-option-left { display: inline-flex; align-items: center; gap: 6px; color: var(--slate-600); font-size: 12px; white-space: nowrap; > input { width: 16px; height: 16px; margin: 0; accent-color: var(--sky-600); } }
    .dashboard-customize-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
  }

  .users-panel-header,
  .list-panel-header {
    margin-bottom: 14px;
    .users-panel-header-row,
    .list-panel-header-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .5rem;
      height: 35px;
    }
    .users-search-bar,
    .list-search-bar {
      flex: 0 0 420px;
      input[type="text"] {
        width: 420px;
        height: 35px;
        padding: .5rem .75rem .5rem 43px;
        border: 1px solid var(--color-input-border);
        border-radius: .5rem;
        background: var(--white) url('/static/img/magnifying-glass.svg') 17px center / 16px 16px no-repeat;
        &::placeholder { color: var(--color-placeholder); opacity: 1; }
        &:focus {
          padding-left: 12px;
          border-color: var(--color-focus);
          outline: var(--input-focus-outline);
          outline-offset: 0;
          background-image: none;
        }
      }
    }
    button[id$="-create"] {
      width: auto;
      height: 33px;
      min-height: 33px;
      padding: 0 1rem;
      font-size: 14px;
    }
  }

  .users-table-card,
  .list-table-card {
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: .75rem;
    background: var(--color-surface);
    box-shadow: var(--new-shadow);
  }

  .new-data-table,
  .list-data-table {
    width: 100%;
    border-collapse: collapse;
    th, td {
      padding: var(--new-table-data-padding-y) var(--new-table-data-padding-x);
      border-bottom: 1px solid #edf1f5;
      text-align: left;
      vertical-align: middle;
    }
    th {
      height: 34px;
      padding: 10px 16px;
      background: var(--slate-50);
      color: var(--slate-400);
      font-size: 11px;
      font-weight: 500;
      line-height: 13px;
      white-space: nowrap;
    }
    td { height: var(--new-table-row-height); background: var(--white); color: var(--slate-500); font-size: 14px; }
    tbody tr { height: var(--new-table-row-height); }
    tbody tr:hover td { background: #f8fcff; }
    tbody tr.is-selected td { background: var(--color-selected-background); }
  }

  .new-data-table .sort-button,
  .list-data-table .sort-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 11px;
    font-weight: 500;
    .sort-indicator { min-width: .9rem; text-align: center; }
    &:not(.is-active) .sort-indicator { color: #CBD5E1; }
  }

  .table-primary-text { color: var(--slate-800); font-weight: 700; }

  .list-pager,
  .users-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 24px 14px;
  }
  .list-page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 3.2rem;
    white-space: nowrap;
    font-weight: 500;
    & > .is-current { color: var(--slate-800); font-weight: 700; }
    & > button {
      padding: 0;
      border: 0;
      background: transparent;
      color: inherit;
      font: inherit;
      cursor: pointer;
      &:hover {
        color: var(--sky-700);
        background: var(--slate-100);
      }
    }
  }
  .pager-info,
  .list-page-number { color: var(--slate-400); }
  .list-pager-actions,
  .users-pager-actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    button {
      width: 28px;
      min-height: 28px;
      border: 1px solid var(--color-border);
      border-radius: .4rem;
      background: var(--white);
      color: var(--color-text-default);
      &:disabled { opacity: .45; }
    }
  }

  .new-data-table .table-actions {
    white-space: nowrap;
    .icon-button {
      width: 2rem;
      min-height: 2rem;
      padding: 0;
      border: 0;
      border-radius: .4rem;
      background: transparent;
      transition: background-color var(--transition-hover-duration) ease-out;
      img { display: block; width: 14px; height: 14px; margin: auto; }
      .icon-hover { display: none; }
      &:hover {
        background: var(--sky-50);
        .icon-hover { display: block; }
        > img:not(.icon-hover) { display: none; }
      }
      &.delete-button:hover { background: var(--red-50); }
    }
  }

  .new-form-modal {
    .modal {
      position: relative;
      width: 520px;
      padding: 32px;
      border: 0;
      border-radius: 16px;
    }
    .modal-header {
      margin-bottom: 24px;
      h2 { color: var(--slate-800); font-size: 14px; font-weight: 700; line-height: 17px; }
      .modal-close {
        position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; justify-content: center;
        width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: var(--slate-100); color: var(--slate-500);
        img { display: block; width: 11px; height: 11px; }
        &:hover { background: var(--slate-200); }
      }
    }
    .modal-body { display: flex; flex-direction: column; gap: 16px; margin: 0; }
    .modal-message { margin: 0; }
    .form-item {
      display: grid; grid-template-columns: 112px 328px; gap: 16px; align-items: center; margin: 0;
      &:has(> textarea) { align-items: flex-start; }
      > label, > .checkbox-group-title { width: 112px; color: var(--slate-600); font-size: 14px; line-height: 17px; }
      .required-mark { margin-left: 3px; color: var(--red-500); font-weight: 700; }
      > input, > textarea { width: 328px; border: 1px solid var(--color-input-border); border-radius: 8px; &:focus { border-color: var(--color-focus); outline: var(--input-focus-outline); outline-offset: 0; } }
      > input { height: var(--control-height); min-height: var(--control-height); padding: 8px 12px; }
      > textarea { min-height: 138px; padding: 8px 12px; resize: vertical; }
      > .password-policy-hint { grid-column: 2; margin: 0; color: var(--slate-400); font-size: 12px; line-height: 17px; }
    }
    .modal-footer {
      margin-top: 24px;
      > .primary-btn, > .secondary-btn, > .cancel-btn { width: 94px; height: 38px; min-height: 38px; padding: 0 32px; font-size: 14px; line-height: 17px; }
    }
  }

  #mail-assign-modal-overlay, #match-request-modal-overlay {
    .modal-body {
      > p { margin: 0 0 16px; color: var(--slate-600); }
      .match-request-form { display: flex; flex-direction: column; gap: 16px; }
      .match-request-field {
        display: flex; flex-direction: column; gap: 6px;
        > label { color: var(--slate-600); font-size: 14px; }
        > input, > select {
          width: 100%; min-height: var(--control-height); padding: 8px 12px;
          border: 1px solid var(--color-input-border); border-radius: 8px;
          background: var(--white); color: var(--slate-700);
        }
        > select {
          box-sizing: border-box; height: var(--control-height);
          -webkit-appearance: none; appearance: none;
          padding-right: 36px;
          background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2364748b' stroke-width='1.5'/%3E%3C/svg%3E");
          background-repeat: no-repeat; background-position: right 12px center;
          &:disabled { color: var(--slate-400); -webkit-text-fill-color: var(--slate-400); opacity: 1; }
        }
      }
    }
  }

  #data-browser-mail-modal-overlay {
    .modal-body {
      pre {
        max-height: min(45vh, 360px);
        overflow: auto;
        margin: 0;
        padding: 12px;
        border: 1px solid var(--slate-200);
        border-radius: 8px;
        background: var(--slate-50);
        color: var(--slate-700);
        white-space: pre-wrap;
        overflow-wrap: anywhere;
      }
    }
  }

  .ticket-types-panel {
    .main { padding-top: 20px; }
    .ticket-types-table {
      tbody > tr > td:nth-child(1),
      tbody > tr > td:nth-child(2) { color: var(--slate-400); }
      tbody > tr > td:nth-child(3) { color: var(--slate-800); }
      tbody > tr > td:nth-child(4) { color: var(--slate-500); }
      th:first-child, td:first-child { width: 44px; }
      th:nth-child(2), td:nth-child(2) {
        width: max-content;
        min-width: calc(19ch + 32px);
        white-space: nowrap;
      }
      th:nth-child(3), td:nth-child(3) { width: 240px; }
      th:nth-child(4), td:nth-child(4) { width: 160px; }
      th:nth-child(5), td:nth-child(5) { width: 360px; }
      tbody > tr > td:nth-child(5) { overflow-wrap: anywhere; }
      th:last-child, td:last-child { width: 124px; }
    }
    #ticket-type-modal-overlay {
      .form-item {
        > span { grid-column: 2; color: var(--slate-500); font-size: 12px; }
      }
    }
  }
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--color-focus-ring);
  outline-offset: 1px;
}
.form-item { margin-bottom: 1rem; }
.form-item label { display: inline-block; width: 8rem; color: var(--color-text-label); }
.password-policy-hint { display: block; color: var(--slate-400); font-size: 12px; line-height: 17px; }
.form-item input:not([type="checkbox"]):not([type="radio"]), .form-item select { height: var(--control-height); min-height: var(--control-height); padding: .45rem .65rem; border: 1px solid var(--color-input-border); border-radius: .45rem; background: var(--white); }
.modal-overlay .modal { border: 1px solid var(--color-border); box-shadow: 0 16px 40px rgba(15, 23, 42, .18); }

@media (max-width: 768px) {
  .page-new-design {
    .header { padding: 0 1rem; }
    #menu-bar { padding: 0 1rem; overflow-x: auto; }
    .main { width: calc(100% - 2rem); padding-top: 1rem; }
    .dashboard-panel {
      .dashboard-panel-header > h1 { font-size: 20px; }
      .dashboard-status-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .dashboard-widgets { grid-template-columns: minmax(0, 1fr); }
      .dashboard-widget { &.dashboard-widget-news { grid-column: auto; } }
      .dashboard-widget-item { &:not(.dashboard-widget-news-item) { flex-direction: column; gap: 4px; } }
      .dashboard-panel-header > button { padding: 0 10px; font-size: 12px; }
    }
    .users-panel-header, .list-panel-header {
      .users-panel-header-row, .list-panel-header-row { align-items: stretch; flex-direction: column; height: auto; }
      .users-search-bar, .list-search-bar { flex-basis: auto; input[type="text"] { width: 100%; } }
      button[id$="-create"] { width: 100%; }
    }
    .users-table-card, .list-table-card { overflow-x: auto; }
    .new-data-table { min-width: 760px; }
    .new-form-modal .modal { width: min(520px, calc(100vw - 2rem)); padding: 24px; .form-item { grid-template-columns: 96px minmax(0, 1fr); > label, > .checkbox-group-title { width: 96px; } > input, > textarea { width: 100%; } } }
  }
}
