:root {
    --bg-1: #f8f9fb;
    --bg-2: #ffffff;
    --muted: #6b6f76;
    --accent: #2b78e4;
    --border: #e6e7ef;
  }
 
  html,body {
    height:100%;
    scroll-behavior: smooth;
  }
 
  /* Disable scroll when modal is open */
  body.modal-open {
    overflow: hidden;
  }
 
  body {
    background: linear-gradient(135deg, #f0f0f0, #e0e0ea);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    margin: 0;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    -webkit-font-smoothing:antialiased;
  }
 
  .container {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 1100px;
    background: var(--bg-2);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(30,35,50,0.08);
    padding: 18px 20px;
    box-sizing: border-box;
  }
 
  .new-test-btn {
    width: fit-content;
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 12px;
    box-shadow: 0 3px 8px rgba(43,120,228,0.18);
  }

  .new-test-btn:hover {
    background: #1a5cd6;
    transition: background-color 0.3s ease;
  }
 
  .table-wrapper {
    margin-top: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-1);
  }
 
  .header-row, .test-row { 
    display: grid;
    grid-template-columns: 80px 3fr 2fr 100px 120px;
    gap: 0;
    align-items: center;
    padding: 12px 16px;
    box-sizing: border-box;
  }
 
  .header-row {
    background: #f7f8fb;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
  }
 
  .header-cell, .cell {
    padding: 4px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
 
  .test-row {
    background: #fff;
    border-bottom: 1px solid rgba(230,231,239,0.8);
    font-size: 14px;
  }
 
  .test-row:nth-of-type(even) {
    background: #fbfbfd;
  }
 
  .test-row:hover {
    background-color: #e9f0ff;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
 
  .cell.id { 
    font-weight: 700; 
    color:#222; 
  }
 
  .cell.status { 
    display:flex; 
    align-items:center; 
  }

  .status { 
    padding:4px 8px; 
    border-radius:12px; 
    font-weight:700; 
    font-size:14px; 
  }

  .status.pass { 
    color:#125a2a; 
    background:#e6f4ea; 
  }

  .status.fail { 
    color:#8a1b1b; 
    background:#fdecea; 
  }

  .status.blocked { 
    color:#8a6a00; 
    background:#fff3cd; 
  }

  .status.notrun { 
    color:#3b3f46; 
    background:#eef2ff; 
  }
 
  .cell.actions { 
    display:flex; 
    gap:8px; 
    justify-content:flex-end; 
  }

  .btn {
    padding:6px 8px;
    border-radius:6px;
    border:1px solid var(--border);
    background:#fff;
    cursor:pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  }

  .btn.edit-btn { 
    background:#fff; 
    color:var(--accent); 
  } 

  .btn.edit-btn:hover {
    background: #1a5cd6;
    color: #fff;
    border-color: #1a5cd6;
  }

  .btn.delete-btn { 
    background:#fff; 
    color:#b22222; 
  }

  .btn.delete-btn:hover {
    background: #a31f1f;
    color: #fff;
    border-color: #a31f1f;
  }
 
   /* MODAL BACKGROUND */
  .modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(6px);
    z-index: 20;
    padding: 20px;
  }

  .modal.active {
    display: flex;
  }
 
  .modal-content {
    max-height: 90vh;
    width: 100%;
    max-width: 550px;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(30px);
    padding: 30px 100px 60px 100px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    color: #1c1c1e;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
  }
 
  .modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
  }
 
  label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #1c1c1e;
  }
 
  input, textarea, select {
    box-sizing: border-box;
    width: 100%;
    padding: 15px 17px;
    border: 1.8px solid #bbb;
    border-radius: 10px;
    font-size: 15px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.8);
    color: #1c1c1e;
    resize: vertical;
  }
 
  .modal-actions button {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #0a84ff;
    color: white;
    transition: background 0.3s ease;
  }

  .modal-actions button.cancel-btn {
    background: #8e8e93;
    margin-right: 10px;
  }
 
  .modal-actions button:hover {
    filter: brightness(0.9);
  }

  /* --- NEW VIEW MODAL STYLES --- */

  /* Wider modal for view */
  .view-modal-content {
    max-width: 90%;
    height: 80vh;
    padding: 30px 40px 40px 40px;
  }

  /* Two-column layout */
  .view-modal-grid {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    color: #1c1c1e;
  }

  .view-left, .view-right {
    flex: 1;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
    min-height: 70vh;
    max-height: 350px;
    overflow-y: auto;
  }

  .view-left p {
    margin: 12px 0;
    font-size: 16px;
  }

  .view-left a {
    color: var(--accent);
    text-decoration: none;
  }

  .view-left a:hover {
    text-decoration: underline;
  }

  .view-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
  }

  /* Close button in top-right corner */
  .close-view-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 30px;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
  }

  .close-view-modal:hover {
    color: #222;
  }