body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f9;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    flex-direction: column;
    overflow: hidden; /* Prevent scrolling */
    height: 100%; /* Ensure full height */
}
.header {
    width: 100%;
    background-color: #0056b3;
    color: #fff;
    padding: 1rem;
    text-align: left;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000; /* above a workbench overlay (1500), so the top bar's menus open over it */
    display: flex;
    align-items: center;
}
.header img {
    height: 60px;
    vertical-align: middle;
    margin-right: 10px;
}
.header span {
    font-size: 1rem;
}
.logo span {
    font-weight: bold;
}
.signin-container {
    background: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 150px; /* Adjust for header */
}
.signin-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 1rem;
}
.signin-container form {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.form-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    width: 100%;
    text-align: left;
}
.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-group input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}
.btn {
    background-color: #0056b3;
    color: #fff;
    padding: 0.8rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}
.btn:hover {
    background-color: #007bff;
}
.signup-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    text-decoration: none;
    color: #0056b3;
}
.signup-link:hover {
    text-decoration: underline;
}
.header .user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.header .user-info img {
    width: 40px;
    height: 40px;
    margin-right: 40px;
    margin-left: 20px;
    overflow-clip-margin: content-box;
    overflow-x: clip;
    overflow-y: clip;
}

.header .user-info img.help-icon {
    width: 32px;
    height: 32px;
    margin-left: 0;
    margin-right: 24px;
    cursor: pointer;
    opacity: 0.9;
}

.header .user-info img.help-icon:hover {
    opacity: 1.0;
}

.container {
    display: flex;
    width: 100%;
    margin-top: 90px;
    height: calc(100vh - 90px);
}

.sidebar {
    margin-top: 0px;
    width: 70px;
    background: #0056b3;
    padding: 12px 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 1000;
}

.sidebar form {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
}

.sidebar-menu {
    flex: 1 1 auto;
    overflow: visible;
}

.sidebar-footer {
    flex: 0 0 auto;           /* only as tall as its contents */
    margin-bottom: 125px;
}

.tile {
    background: white;
    width: 48px;
    height: 48px;
    padding: 0;
    margin: 8px auto;
    display: flex;
    color: black;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    position: relative;
    font-size: 12px;
    font-family: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: box-shadow 120ms ease, transform 120ms ease;
}

.tile:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
    transform: scale(1.05);
}

/* Hidden + non-interactive when there is no runnable graph on the canvas. */
.tile-disabled {
    display: none !important;
    pointer-events: none;
    opacity: 0.4;
    cursor: default;
}

.tile img {
    width: 28px;
    height: 28px;
    margin: 0;
}

.tile span {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    z-index: 1000;
}

.tile:hover span {
    opacity: 1;
}

/* Custom tooltip — mirrors the .tile span styling so any element
   wrapped in .qntra-tip gets the same dark pill on hover the sidebar
   buttons show. Default anchor is to the RIGHT of the wrapper; add
   .qntra-tip-below on the wrapper to anchor BELOW instead (used by
   the help link in the header, which sits at the far right and would
   overflow if the tip went rightward). The .logo-tip class is kept
   as an alias so the logo wrapper still works without re-edit. */
.qntra-tip,
.logo-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
}
/* Spans inside .header inherit ``font-size: 1rem`` from ``.header span``
   (0,1,1 specificity), which would override a plain ``.qntra-tip-text``
   (0,1,0) rule. Targeting ``span.qntra-tip-text`` matches at 0,1,1
   and wins by source order. */
span.qntra-tip-text,
span.logo-tip-text {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    z-index: 1000;
}
/* Anchor-below modifier: drop the tip under the wrapper, horizontally
   centred, so triggers near the right edge of a container don't
   overflow. */
.qntra-tip-below span.qntra-tip-text {
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
}
.qntra-tip:hover .qntra-tip-text,
.logo-tip:hover .logo-tip-text {
    opacity: 1;
}

.canvas-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.canvas-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.24);
}
.canvas-fab:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.18);
}
.canvas-fab img {
    width: 32px;
    height: 32px;
    pointer-events: none;
}
.canvas-fab span {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease;
    z-index: 1000;
}
.canvas-fab:hover span {
    opacity: 1;
}

.tile bottom {
    margin-top: auto; /* Pushes it to the bottom */
}

.content {
    flex-grow: 1;
    padding: 20px;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab {
    margin-top: 3px;
    padding: 10px 20px;
    background: #0056b3;
    color: white;
    border-radius: 0px;
    cursor: pointer;
}

/* Modal Styling */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Gray out background */
    justify-content: center;
    align-items: center;
    z-index: 2000; /* Above everything */
    padding: 20px; /* Add padding to prevent modal from touching viewport edges */
}

.modal-content {
    background: white;
    padding: 20px;
    width: 850px;
    max-width: 90vw; /* Responsive width */
    max-height: 90vh; /* Limit to 90% of viewport height */
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content from spilling out */
    transition: all 0.3s ease; /* Smooth transition for fullscreen */
}

.form-group input[type="text"],
.form-group input[type="password"] {
    font-size: 12px;
    font-weight: normal;
    margin-bottom: 0px;
}

.form-group label {
    display: inline-block;
    font-weight: normal;
    font-size: 14px;
    margin-right: 10px;
	margin-left: 10px;
}

.form-group label input[type="radio"],
.form-group label input[type="checkbox"] 
{
    margin-right: 5px;
    width: auto;
    display: inline;
    margin-left: 20px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 20px;
    cursor: pointer;
}

/* Project-selector menu bar (admin-style top-tab nav), toggled per group in
   Members > Groups. Shown on the home page and the project canvas. Negative
   left/right margins cancel the .content horizontal padding so the bar spans
   full width with a bottom border, like the admin tab bar. The top margin is
   -18px so the bar sits flush against the bottom of the fixed 92px header:
   .content starts at 90px (.container margin-top) + 20px top padding = 110px,
   and -18px lifts it to 92px = the header bottom (no gap, no tuck-under). No
   bottom margin so it butts directly against the canvas/workbench below.
   Buttons are solid platform blue (the admin active-tab style). */
/* Floated over the fixed blue header (z-index 1000) so the project tabs sit
   ON the top bar. Container is transparent + click-through; only the buttons
   capture clicks, so the header's logo/account stay usable. Buttons get a
   white border to stand out against the same-blue header. */
.home-project-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 2001; /* over the header (2000): its buttons sit on the top bar */
    height: 92px;
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    justify-content: center;
    margin: 0; padding: 0 16px;
    background: transparent; border-bottom: none;
    pointer-events: none;
}
.home-project-nav a, .home-project-nav .hpn-empty { pointer-events: auto; }
.home-project-nav a {
    font-size: 14px; padding: 6px 14px; border-radius: 4px;
    text-decoration: none; color: #fff; border: 1px solid #fff;
    background: #0056b3; transition: background .15s, color .15s;
}
.home-project-nav a:hover { background: #004899; border-color: #004899; }
/* The project currently on screen: inverted (white fill, blue text). */
.home-project-nav a.active,
.home-project-nav a.active:hover {
    background: #fff; color: #0056b3; border-color: #fff; font-weight: 600;
}
.home-project-nav .hpn-empty { font-size: 13px; color: #94a3b8; }

.modal-buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

/* Delete button */
.delete-btn {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #c82333;
}

/* Cancel button */
.cancel-btn {
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.cancel-btn:hover {
    background-color: #5a6268;
}

/* Form Styling */
.modal-content form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: arial;
    font-size: 14px;
    resize: none;
    box-sizing: border-box;
}

.form-group textarea {
    height: 80px;
}

.btn {
    background-color: #0056b3;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
}

.btn:hover {
    background-color: #007bff;
}

/* Project List Styling */
.project-list {
    width: 100%;
    max-width: 800px;
    margin: auto;
    display: flex;
    flex-direction: column;
}

.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px; /* Keep the description clear of the edit/delete icons */
    padding: 15px 0;
    border-bottom: 1px solid #ddd; /* Soft grey separator */
}

.project-item:last-child {
    border-bottom: none; /* Remove border from last item */
}

.project-details {
    flex-grow: 1;
}

.project-details h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.project-details .description {
    margin: 5px 0;
    font-size: 14px;
    color: #666;
}

.project-details .date {
    font-size: 12px;
    color: #999;
}

.project-actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0; /* Icons keep their size; spacing stays even with long text */
    font-size: 18px; /* Adjust icon size */
}

/* Universal icon styling */
.icon {
    width: 24px;  /* Adjust icon size */
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, opacity 0.2s;
}

/* Edit icon (Blue) */
.edit-icon {
    opacity: 0.8;
}

.edit-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Delete icon (Red) */
.delete-icon {
    opacity: 0.8;
}

.delete-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
    display: inline-block;
    vertical-align: middle;
}

.clickable-title {
    cursor: pointer;
    color: #0056b3;
    text-decoration: none;
}

.project-name-link {
    text-decoration: underline;
}

#help-tab {
  position: fixed;
  top: 120px;
  right: 0;
  z-index: 9999;
}

#help-handle {
  position: absolute;
  left: -60px;
  width: 60px;
  height: 100px;
  background: #444;
  color: white;
  writing-mode: vertical-rl;
  text-align: center;
  font-weight: bold;
  padding: 10px 0;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
}

/* Fullscreen mode styles - force full width/height */
.modal.fullscreen-active {
    padding: 0;
    display: flex !important; /* Ensure flex is active */
    justify-content: stretch !important; /* Change from center to stretch */
    align-items: stretch !important; /* Change from center to stretch */
}

.modal.fullscreen-active .modal-content {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    border-radius: 0;
    margin: 0;
    padding: 10px;
    flex: 1; /* Allow content to expand fully */
}

/* Make modal body scrollable */
.modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flex children */
    margin: 10px 0;
    padding-right: 10px; /* Space for scrollbar */
}

/* Keep modal header fixed */
.modal-content h2 {
    flex-shrink: 0;
    margin-bottom: 15px;
}

/* Keep modal footer fixed */
.modal-content .modal-footer {
    flex-shrink: 0;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

/* Keep search section fixed if present */
.modal-content .search-section {
    flex-shrink: 0;
    margin-bottom: 15px;
}

/* For large modals, increase max dimensions */
.modal-content.large {
    width: 1200px;
    max-width: 95vw;
    max-height: 95vh;
}

/* Ensure table container fills available space in fullscreen */
.modal.fullscreen-active #table-container {
    height: 100%;
}

/* Add fullscreen toggle button styling */
.fullscreen-toggle {
    transition: background 0.3s ease;
}

.modal.fullscreen-active .fullscreen-toggle {
    background: #dc3545 !important; /* Red color when in fullscreen */
}

/* Settings Modal Styling */
.settings-section {
    text-align: left;
    margin-top: 1rem;
}

.settings-section h3 {
    color: #333;
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.settings-section h3 i {
    margin-right: 0.5rem;
    color: #0056b3;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.settings-info {
    flex: 1;
}

.settings-info strong {
    display: block;
    color: #333;
    margin-bottom: 0.25rem;
}

.settings-info p {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
}

.settings-action {
    margin-left: 1rem;
}

.settings-action .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Shared Project Styling */
.permission-shared {
    background-color: #e2e3e5;
    color: #383d41;
}

.permission-sharing {
    background-color: #d1ecf1;
    color: #0c5460;
}

.permission-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: normal;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.permission-read {
    background-color: #e9ecef;
    color: #495057;
}

.permission-execute {
    background-color: #d4edda;
    color: #155724;
}

.permission-write {
    background-color: #cce5ff;
    color: #004085;
}

/* Project status pills (home page) */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 12px;
    margin-left: 0.5rem;
    vertical-align: middle;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.status-pill-running {
    background-color: #dcfce7;
    color: #166534;
}

.status-pill-running .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #16a34a;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.75); }
}

.status-pill-scheduled {
    background-color: #ede9fe;
    color: #5b21b6;
}

.status-pill-scheduled .status-icon {
    font-size: 0.6rem;
}

/* Share Modal */
.share-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 1rem 0;
}

.share-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #eee;
}

.share-item:last-child {
    border-bottom: none;
}

.share-user-info {
    flex: 1;
}

.share-user-email {
    font-weight: 500;
}

.share-user-name {
    font-size: 0.85rem;
    color: #666;
}

.share-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.share-actions select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.share-actions .btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem;
}

.share-actions .btn-remove:hover {
    color: #c82333;
}