  :root {
      --nav: #1f2430;
      --nav-hover: #313946;
      --nav-muted: #aeb7c5;
      --bg: #f5f7fb;
      --panel: #fff;
      --text: #111827;
      --muted: #6b7280;
      --line: #d7dde7;
      --head: #e8edf3;
      --blue: #1677ff;
      --green: #0f9d75;
      --red: #d9534f
  }

  * {
      box-sizing: border-box
  }

  body {
      margin: 0;
      font-family: "Segoe UI", Tahoma, sans-serif;
      background: var(--bg);
      color: var(--text)
  }

  a {
      text-decoration: none;
      color: inherit;
  }

  .action-btn,
  .sidebar-link,
  .reset-btn {
      text-decoration: none;
  }

  .app-shell {
      min-height: 100vh;
      display: grid;
      grid-template-columns: 240px 1fr
  }

  body.sidebar-open {
      overflow: hidden
  }

  .sidebar-toggle {
      display: none;
      position: fixed;
      top: 14px;
      left: 14px;
      z-index: 1101;
      width: 48px;
      height: 48px;
      border: 0;
      border-radius: 14px;
      background: var(--nav);
      color: #fff;
      box-shadow: 0 18px 35px rgba(15, 23, 42, .18);
      cursor: pointer;
      padding: 0
  }

  .sidebar-toggle span {
      display: block;
      width: 22px;
      height: 2px;
      border-radius: 999px;
      background: currentColor;
      margin: 0 auto 5px
  }

  .sidebar-toggle span:last-child {
      margin-bottom: 0
  }

  .sidebar-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, .5);
      z-index: 1098
  }

  .sidebar {
      background: var(--nav);
      color: #fff;
      padding: 28px 20px;
      display: flex;
      flex-direction: column;
      gap: 26px;
      position: relative;
      z-index: 1099
  }

  .sidebar-brand {
      font-size: 28px;
      font-weight: 700
  }

  .sidebar-label {
      font-size: 13px;
      letter-spacing: .12em;
      text-transform: uppercase;
      color: var(--nav-muted);
      margin: 1rem 0;
  }

  .sidebar-nav {
      display: grid;
      gap: 10px
  }

  .sidebar-link {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 14px;
      border-radius: 14px;
      color: #dbe2ea;
      transition: .2s
  }

  .sidebar-link.active,
  .sidebar-link:hover {
      background: var(--nav-hover);
      color: #fff
  }

  .sidebar-icon {
      width: 34px;
      height: 34px;
      border-radius: 10px;
      background: rgba(255, 255, 255, .08);
      display: grid;
      place-items: center;
      flex: 0 0 34px
  }

  .sidebar-icon svg {
      width: 18px;
      height: 18px;
      stroke: currentColor;
      fill: none;
      stroke-width: 1.8;
      stroke-linecap: round;
      stroke-linejoin: round
  }

  .sidebar-link strong {
      margin-left: auto;
      font-size: 12px;
      font-weight: 700;
      background: rgba(255, 255, 255, .08);
      padding: 5px 8px;
      border-radius: 999px
  }

  .sidebar-foot {
      margin-top: auto;
      font-size: 13px;
      line-height: 1.6;
      color: #c2c9d4
  }

  .sidebar-home-link {
      display: inline-block;
      margin-top: 10px;
      color: #fff
  }

  .workspace {
      padding: 16px 16px
  }

  .page-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 18px
  }

  .page-head p {
      margin: 0 0 8px;
      color: var(--muted);
      font-size: 12px;
      letter-spacing: .14em;
      text-transform: uppercase
  }

  .page-head h2 {
      margin: 0;
      font-size: 30px
  }

  .page-actions {
      display: flex;
      gap: 12px;
      flex-wrap: wrap
  }

  .action-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 11px 16px;
      border-radius: 8px;
      color: #fff;
      font-weight: 600;
      border: 0;
  }

  .action-btn.secondary {
      background: var(--green)
  }

  .action-btn.primary {
      background: var(--blue)
  }

  .flash,
  .notice,
  .editor-card,
  .table-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 10px
  }

  .flash,
  .notice {
      padding: 14px 16px;
      margin-bottom: 16px
  }

  .flash.success {
      border-color: #bfe3d6;
      color: #18794e;
      background: #edf8f2
  }

  .flash.error,
  .notice {
      border-color: #f0c5c2;
      color: #a1342f;
      background: #fff5f5
  }

  .editor-card,
  .table-card {
      padding: 16px;
      margin-bottom: 18px
  }

  .toolbar-card {
      margin-bottom: 14px
  }

  .search-form {
      display: grid;
      grid-template-columns: minmax(320px, 1.7fr) minmax(160px, .55fr) auto auto;
      gap: 12px;
      align-items: center
  }

  .field input,
  .field select,
  .editor-grid input,
  .editor-grid select,
  .editor-grid textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px 14px;
      font: inherit;
      color: var(--text);
      background: #fff
  }

  .field input::placeholder,
  .editor-grid textarea::placeholder {
      color: #98a1af
  }

  .search-btn,
  .reset-btn,
  .submit-btn {
      border: 0;
      border-radius: 8px;
      padding: 12px 16px;
      font: inherit;
      font-weight: 600;
      cursor: pointer
  }

  .search-btn {
      background: #111827;
      color: #fff
  }

  .reset-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 46px;
      height: 46px;
      border: 1px solid #bfc7d4;
      background: #fff;
      color: #5e6776
  }

  .editor-top,
  .table-top {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 14px
  }

  .editor-top h3,
  .table-top h3 {
      margin: 0;
      font-size: 20px
  }

  .editor-top p,
  .table-top p {
      margin: 6px 0 0;
      color: var(--muted);
      line-height: 1.5
  }

  .editor-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px
  }

  .editor-grid .full {
      grid-column: 1/-1
  }

  textarea {
      min-height: 110px;
      resize: vertical
  }

  .submit-btn {
      background: var(--blue);
      color: #fff;
      padding: 12px 20px
  }

  .form-note {
      margin-top: 12px;
      color: var(--muted);
      font-size: 13px
  }

  .modal {
      position: fixed;
      inset: 0;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 24px;
      z-index: 999
  }

  .modal.is-open {
      display: flex
  }

  .modal-backdrop,
  .modal-backdrop a {
      position: absolute;
      inset: 0
  }

  .modal-backdrop {
      background: rgba(17, 24, 39, .56)
  }

  .modal-card {
      position: relative;
      width: min(760px, 100%);
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 14px;
      box-shadow: 0 30px 80px rgba(15, 23, 42, .24);
      overflow: hidden;
      z-index: 1
  }

  .modal-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 20px 22px 0
  }

  .modal-head h3 {
      margin: 0;
      font-size: 22px
  }

  .modal-head p {
      margin: 6px 0 0;
      color: var(--muted)
  }

  .modal-close,
  .modal-cancel {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--line);
      background: #fff;
      color: #4b5563;
      border-radius: 8px
  }

  .modal-close {
      width: 42px;
      height: 42px;
      font-weight: 700
  }

  .modal-form {
      padding: 22px
  }

  .modal-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12px
  }

  .modal-cancel {
      padding: 12px 16px;
      font-weight: 600
  }

  .table-meta {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-wrap: wrap;
      color: var(--muted);
      font-size: 13px
  }

  .chip {
      display: inline-flex;
      align-items: center;
      padding: 6px 10px;
      border-radius: 999px;
      background: #eef2ff;
      color: #3153af;
      font-weight: 600
  }

  .table-wrap {
      overflow: auto;
      border: 1px solid var(--line)
  }

  table {
      width: 100%;
      border-collapse: collapse;
      background: #fff;
      min-width: 900px
  }

  th,
  td {
      padding: 14px;
      text-align: left;
      border-bottom: 1px solid #e8edf3;
      vertical-align: top;
      font-size: 14px
  }

  th {
      background: var(--head);
      font-weight: 700;
      white-space: nowrap
  }

  tbody tr:hover {
      background: #fafcff
  }

  .status-pill {
      display: inline-flex;
      align-items: center;
      padding: 5px 10px;
      border-radius: 999px;
      background: #eef2ff;
      color: #3153af;
      font-size: 12px;
      font-weight: 700
  }

  .empty-state {
      padding: 48px 20px;
      text-align: center
  }

  .empty-icon {
      width: 58px;
      height: 58px;
      border: 5px solid #8c929b;
      border-radius: 50%;
      margin: 0 auto 16px;
      position: relative
  }

  .empty-icon:after {
      content: "";
      position: absolute;
      width: 24px;
      height: 6px;
      background: #8c929b;
      border-radius: 99px;
      right: -14px;
      bottom: 3px;
      transform: rotate(45deg)
  }

  .empty-state h4 {
      margin: 0 0 10px;
      font-size: 18px
  }

  .empty-state p {
      margin: 0;
      color: var(--muted)
  }

  .muted {
      color: var(--muted)
  }

  @media (max-width:1100px) {
      .app-shell {
          grid-template-columns: 1fr
      }

      .sidebar-toggle {
          display: block
      }

      .sidebar {
          position: fixed;
          top: 0;
          left: 0;
          bottom: 0;
          width: min(280px, 82vw);
          max-width: 100%;
          transform: translateX(-100%);
          transition: transform .25s ease;
          overflow-y: auto;
          box-shadow: 20px 0 48px rgba(15, 23, 42, .24)
      }

      .sidebar.is-open {
          transform: translateX(0)
      }

      .workspace {
          padding: 82px 24px 24px
      }

      .search-form,
      .editor-grid {
          grid-template-columns: 1fr
      }

      .page-head {
          flex-direction: column;
          align-items: flex-start
      }
  }

  @media (max-width:700px) {
      .workspace {
          padding: 78px 18px 18px
      }

      .page-head h2 {
          font-size: 32px
      }

      .table-top,
      .editor-top {
          flex-direction: column;
          align-items: flex-start
      }

      .modal {
          padding: 16px
      }

      .modal-head,
      .modal-actions {
          flex-direction: column;
          align-items: stretch
      }
  }
