:root {
    --bg: #07111f;
    --bg2: #0f172a;
    --card: #ffffff;
    --soft: #f8fafc;
    --text: #172033;
    --muted: #64748b;
    --line: #e2e8f0;
    --accent: #0f766e;
    --accent2: #14b8a6;
    --gold: #c08a45;
    --danger: #b91c1c;
    --page-max-width: 92vw;
    --compact-row-height: 34px;
    --compact-font-size: 12.5px;
  }
  
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background:
      radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 28%),
      linear-gradient(180deg, #f8fafc, #eef2f7);
    color: var(--text);
    direction: rtl;
  }
  
  .app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
  }
  
  .sidebar {
    background: linear-gradient(180deg, var(--bg), var(--bg2));
    color: #ffffff;
    padding: 22px 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    box-shadow: 10px 0 30px rgba(15, 23, 42, 0.18);
  }
  
  .brand {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 22px;
    padding: 18px;
    margin-bottom: 18px;
  }
  
  .brand h1 {
    margin: 0 0 8px;
    font-size: 24px;
  }
  
  .brand p {
    margin: 0;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.8;
  }
  
  .brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent2), var(--gold));
    margin-bottom: 10px;
    font-weight: 900;
    color: #ffffff;
  }
  
  .side-link,
  .side-section {
    width: 100%;
    border: 0;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 13px;
    border-radius: 14px;
    margin: 5px 0;
    font-family: Tahoma, Arial, sans-serif;
  }
  
  .side-section {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f3c77b;
    font-weight: 800;
    cursor: pointer;
  }
  
  .side-group.collapsed {
    display: none;
  }
  
  .side-link {
    color: #e5e7eb;
    text-decoration: none;
    font-size: 14px;
  }
  
  .side-link:hover,
  .side-link.active {
    background: rgba(20, 184, 166, 0.2);
    color: #ffffff;
    transform: translateX(-3px);
  }
  
  .main {
    width: min(var(--page-max-width), 1320px);
    margin-inline: auto;
    padding: 24px;
    min-width: 0;
  }
  
  .topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 16px 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
  }
  
  .topbar h2 {
    margin: 0;
    font-size: 26px;
    color: #0f172a;
  }
  
  .note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    margin: 6px 0 0;
  }
  
  .badge {
    display: inline-flex;
    background: #ecfdf5;
    color: #115e59;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
  }
  
  .card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  }
  
  .card h3 {
    margin: 0 0 14px;
    color: #115e59;
    display: flex;
    gap: 8px;
    align-items: center;
  }
  
  .card h3::before {
    content: "";
    width: 9px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent2), var(--gold));
  }
  
  .mode-box,
  .field-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
  }
  
  label {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 7px;
  }
  
  input,
  select,
  textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 9px 10px;
    font-family: Tahoma, Arial, sans-serif;
    background: #ffffff;
    color: #172033;
  }
  
  input:focus,
  select:focus,
  textarea:focus {
    border-color: var(--accent2);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.14);
    outline: none;
  }
  
  input[readonly] {
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
    color: #334155;
    font-weight: 900;
  }
  
  textarea {
    min-height: 68px;
    resize: vertical;
  }
  
  .toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
  }
  
  button,
  .btn {
    border: 0;
    border-radius: 14px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 900;
    font-family: Tahoma, Arial, sans-serif;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .primary {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #ffffff;
  }
  
  .secondary {
    background: linear-gradient(135deg, #475569, #334155);
    color: #ffffff;
  }
  
  .gold {
    background: linear-gradient(135deg, #a86f2d, #c08a45, #f3c77b);
    color: #ffffff;
  }
  
  .danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: #ffffff;
  }
  
  .schema-note {
    background: linear-gradient(90deg, #ecfdf5, #f8fafc);
    border: 1px dashed #99f6e4;
    border-radius: 16px;
    padding: 13px 15px;
    color: #475569;
    margin: 10px 0 16px;
  }
  
  .list-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 10px;
    background: linear-gradient(90deg, #f8fafc, #ffffff);
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  
  .search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 260px;
  }
  
  .search-box input {
    border-radius: 999px;
  }
  
  .pager {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .pager-info {
    color: #475569;
    font-weight: 700;
    font-size: 13px;
  }
  
  .btn-pill {
    border-radius: 999px;
    padding: 9px 14px;
  }
  
  .btn-disabled {
    opacity: 0.45;
    pointer-events: none;
  }
  
  .table-wrap {
    max-height: 58vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
  }
  
  table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1200px;
    table-layout: auto;
  }
  
  th,
  td {
    border-bottom: 1px solid var(--line);
    padding: 6px 8px;
    line-height: 1.35;
    text-align: right;
    vertical-align: middle;
    font-size: var(--compact-font-size);
  }
  
  th {
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    color: #334155;
    font-weight: 900;
  }
  
  tbody tr {
    height: var(--compact-row-height);
  }
  
  td {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #334155;
  }
  
  td:hover {
    white-space: normal;
    overflow: auto;
    max-width: 320px;
    background: #f8fafc;
  }
  
  .lookup-ready {
    border-color: rgba(20, 184, 166, 0.65);
    background: linear-gradient(180deg, #ffffff, #f0fdfa);
  }
  
  .lookup-fallback {
    border-color: #f59e0b;
    background: #fffbeb;
  }
  
  .lookup-hint {
    font-size: 11px;
    color: #0f766e;
    margin-top: 4px;
  }
  
  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    padding: 0;
    margin: 2px;
  }
  
  .play {
    background: #dcfce7;
    color: #166534;
  }
  
  .pause {
    background: #fef3c7;
    color: #92400e;
  }
  
  .stop {
    background: #fee2e2;
    color: #991b1b;
  }
  
  .mobile-top {
    display: none;
    background: #07111f;
    color: #ffffff;
    padding: 12px 16px;
    align-items: center;
    justify-content: space-between;
  }
  
  @media (max-width: 1100px) {
    .field-grid {
      grid-template-columns: repeat(2, minmax(160px, 1fr));
    }
  }
  
  @media (max-width: 860px) 
  {
    .mobile-top {
      display: flex;
    }
  
    .app {
      grid-template-columns: 1fr;
    }
  
    .sidebar {
      position: fixed;
      inset: 0 auto 0 0;
      width: 310px;
      z-index: 50;
      transform: translateX(-105%);
      transition: 0.22s ease;
      height: 100vh;
    }
  
    .sidebar.open {
      transform: translateX(0);
    }
  
    .main {
      width: 100%;
      padding: 14px;
    }
  
    .topbar {
      flex-direction: column;
      align-items: flex-start;
    }
  
    .mode-box,
    .field-grid {
      grid-template-columns: 1fr;
    }
  }

  .dual-list{
    display:grid;
    grid-template-columns:minmax(360px, 1fr) 110px minmax(420px, 1.25fr);
    gap:20px;
    align-items:stretch;
    width:100%;
    margin-top:14px;
  }
  
  .dual-list-box{
    display:flex;
    flex-direction:column;
    min-width:0;
  }
  
  .dual-list-box label{
    font-size:14px;
    font-weight:900;
    color:#115e59;
    margin-bottom:8px;
  }
  
  .dual-list-box select{
    width:100%;
    height:55vh;
    min-height:460px;
    max-height:720px;
    overflow:auto;
    font-size:13px;
    line-height:1.7;
    padding:10px;
    border-radius:16px;
    background:#ffffff;
  }
  
  .dual-list-box select option{
    padding:8px 10px;
    border-bottom:1px solid #eef2f7;
    white-space:normal;
  }
  
  .dual-list-actions{
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:12px;
  }
  
  .dual-list-actions button{
    min-width:88px;
    border-radius:999px;
  }
  
  #ideaSearchInput{
    margin-bottom:12px;
    border-radius:999px;
  }
  
  @media(max-width:1200px){
    .dual-list{
      grid-template-columns:1fr;
    }
  
    .dual-list-actions{
      flex-direction:row;
      justify-content:center;
      flex-wrap:wrap;
    }
  
    .dual-list-box select{
      height:42vh;
      min-height:340px;
    }
  }
  
  @media(max-width:700px){
    .dual-list-box select{
      height:36vh;
      min-height:280px;
      font-size:12px;
    }
  
    .dual-list-actions button{
      width:100%;
    }
  }