:root {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}

body {
    margin: 0;
    padding: 0;
    background: #0b1120;
    color: #e5e7eb;
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

h1 {
    margin: 0 0 12px;
    font-size: 20px;
}

/* ======================
      TABS
====================== */

.tabs {
    display: inline-flex;
    border-radius: 999px;
    padding: 2px;
    background: #020617;
    border: 1px solid #1f2937;
    margin-bottom: 12px;
}

.tab {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.tab.active {
    background: #111827;
    color: #e5e7eb;
}

/* ======================
      LAYOUT / CARDS
====================== */

.layout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card {
    background: #020617;
    border-radius: 12px;
    padding: 12px 14px;
    border: 1px solid #1e293b;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.6);
}


.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-header h2 {
    margin: 0;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

/* ======================
   COLLAPSIBLE PANELS
====================== */

.toolbar-row {
    display: flex;
    justify-content: flex-start;
}

.collapsible-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(-4px);
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    margin-bottom: 0;
    transition:
            max-height 0.25s ease,
            opacity 0.18s ease,
            transform 0.18s ease,
            padding 0.18s ease,
            border-width 0.18s ease,
            margin 0.18s ease;
}

.collapsible-panel.open {
    max-height: none;    /* ← YOU ASKED FOR THIS */
    opacity: 1;
    transform: translateY(0);
    padding-top: 12px;
    padding-bottom: 12px;
    border-width: 1px;
    margin-bottom: 8px;
}

/* ======================
      INPUTS
====================== */

label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: #9ca3af;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 13px;
    box-sizing: border-box;
}

textarea {
    resize: vertical;
    min-height: 60px;
}

input[type="text"]:focus,
textarea:focus {
    outline: 1px solid #3b82f6;
    border-color: #3b82f6;
}

/* ======================
       BUTTONS
====================== */

.btn {
    border-radius: 999px;
    border: 1px solid #374151;
    padding: 6px 10px;
    background: #111827;
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-primary {
    border-color: #2563eb;
    background: #2563eb;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.addDeleteCircle {
    border-radius: 50%;
}

.btn-danger {
    border-color: #b91c1c;
    color: #fecaca;
}

/* Cell alignment */
td .addDeleteCircle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(60, 140, 255, 0.15);
    border: 1px solid rgba(60, 140, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 0 rgba(60, 140, 255, 0);
}

/* Remove default button styles */
td button {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

/* Plus / minus icons */
.addButton,
.deleteButton {
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
    user-select: none;
}

/* Hover glow (same vibe as checkboxes) */
td button:hover .addDeleteCircle {
    background: rgba(60, 140, 255, 0.25);
    border-color: rgba(60, 140, 255, 0.8);
    box-shadow:
            0 0 6px rgba(60, 140, 255, 0.6),
            0 0 14px rgba(60, 140, 255, 0.4);
}

/* Subtle press feedback */
td button:active .addDeleteCircle {
    transform: scale(0.94);
}


/*.resetSitesBtn {*/
/*    align-items: flex-end;*/
/*}*/

/* ======================
     HELPERS
====================== */

.actions-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.small { font-size: 11px; color: #6b7280; }
.hint  { font-size: 10px; color: #6b7280; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mb-1 { margin-bottom: 4px; }

/* ======================
       SITES PILLS
====================== */

.sites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.fullSites {
    padding-top: 10px;
}

.callCentreSites {
    padding-top: 10px;
}

.sitesToDeploy {
    padding-top: 10px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid #1f2937;
    font-size: 11px;
    margin: 2px;
}

.pill span {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill button {
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 11px;
}

/* ======================
      DEPLOYMENTS
====================== */

.deployment-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.deployment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.deployment-title {
    font-size: 13px;
    font-weight: 600;
}

.deployment-meta {
    font-size: 11px;
    color: #6b7280;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    padding: 2px 6px;
    font-size: 10px;
    color: #9ca3af;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
}

.badge-dot.pending { background: #f97316; }

.table-wrapper {
    border-radius: 8px;
    border: 1px solid #111827;
    overflow: auto;
    max-height: 420px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

/* Deployment table cell spacing (larger for 24px checkbox) */
th, td {
    border-bottom: 1px solid #1f2937;
    padding: 10px 8px;  /* ← increased vertical padding */
    text-align: center;
}


th:first-child, td:first-child {
    text-align: left;
    position: sticky;
    left: 0;
    background: #020617;
}

th {
    background: #020617;
    position: sticky;
    top: 0;
    z-index: 1;
}

th a {
    color: white;
    text-decoration: none;
}

/* ======================
   SETUP TEMPLATE EDITOR
====================== */

.setup-template-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-template-row {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    cursor: grab;
}

.setup-template-input {
    flex: 1;
    min-height: 70px;
}

/* ======================
     SETUP CHECKLISTS
====================== */

.setup-checklists-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setup-checklist-card {
    background: #020617;
    border-radius: 10px;
    border: 1px solid #111827;
    padding: 10px;
}

.setup-checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.setup-checklist-title {
    font-size: 13px;
    font-weight: 600;
}

.setup-checklist-meta {
    font-size: 11px;
    color: #6b7280;
}

.setup-tasks-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setup-task {
    border-radius: 10px;
    border: 1px solid #1f2937;
    padding: 8px 10px;
    background: #020617;
    cursor: grab;
}

.setup-task-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.setup-task-header label {
    display: flex;
    align-items: center; /* ← centers checkbox vertically */
    gap: 8px;
    cursor: pointer;
}

/* ===============================
      CUSTOM CHECKBOX (FINAL)
  Applies to ALL checkboxes:
  Setup + Deployments table
=============================== */
/* ============================================
   FINAL CHECKBOX — NO TICK + SOFT GLOW + BIGGER HIT AREA
   ============================================ */
/* ============================================
   FINAL CHECKBOX — NO TICK + BLUE GLOW
   ============================================ */

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid #475569; /* slate-600 */
    background: #0f172a;       /* dark panel background */
    cursor: pointer;
    position: relative;
    margin: 0;
    transition:
            background-color 0.15s ease,
            border-color 0.15s ease,
            box-shadow 0.15s ease;
}

/* Hover: soft indigo glow (your preferred glow) */
input[type="checkbox"]:hover {
    border-color: #a5b4fc; /* light indigo */
    box-shadow: 0 0 0 3px rgba(165, 180, 252, 0.25);
}

/* Checked state: blue fill + blue glow (no tick) */
input[type="checkbox"]:checked {
    background: #3b82f6;    /* Tailwind blue-500 */
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.33); /* soft blue halo */
}

/* Disable tick entirely */
input[type="checkbox"]::after {
    content: none !important;
}

/* Setup: Strike-through text when checked */
.setup-task-header input[type="checkbox"]:checked + .markdown-task {
    opacity: 0.55;
    text-decoration: line-through;
}


/* ======================
      MARKDOWN
====================== */

.markdown-task {
    display: block;
    line-height: 1.4;
    white-space: normal;
}

.markdown-task code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 11px;
    background: #111827;
    padding: 1px 4px;
    border-radius: 4px;
}

.markdown-task h1,
.markdown-task h2,
.markdown-task h3 {
    font-size: 13px;
    margin: 2px 0;
}

.markdown-task ul,
.markdown-task ol {
    margin: 2px 0 2px 18px;
    padding-left: 14px;
}

/* ======================
       JOURNAL
====================== */

.journal-list {
    max-height: 320px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid #111827;
    padding: 8px;
    background: #020617;
}

.journal-entry {
    padding: 4px 0;
    border-bottom: 1px solid #111827;
    font-size: 12px;
}

.journal-entry:last-child {
    border-bottom: none;
}

.journal-entry-meta {
    font-size: 11px;
    color: #6b7280;
}

.journal-entry-message {
    margin-top: 2px;
}



/* Helps sticky behave + keeps borders clean */
.table-wrapper table {
    border-collapse: separate;
    border-spacing: 0;
}

/* Sticky “actions” column on the right */
.table-wrapper th.col-actions,
.table-wrapper td.col-actions {
    position: sticky;
    right: 0;
    z-index: 3; /* above other cells */
    background: rgba(10, 14, 24, 0.92); /* pick a value that matches your table bg */
    backdrop-filter: blur(6px);
    border-left: 1px solid rgba(60, 140, 255, 0.25);
    box-shadow: -10px 0 18px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
}

/* Keep header above cells */
.table-wrapper th.col-actions {
    z-index: 4;
}

/* Layout inside the actions cell */
.table-wrapper td.col-actions {
    text-align: right;
    padding-right: 10px;
}

/* Optional: keep buttons nicely spaced */
.table-wrapper td.col-actions button {
    margin-left: 6px;
}

.popover {
    position: fixed;
    width: 320px;
    background: #0b1022;
    border-radius: 10px;
    padding: 12px;
    box-shadow:
            0 0 0 1px rgba(60, 140, 255, 0.35),
            0 18px 40px rgba(0, 0, 0, 0.55);
    z-index: 10000;
}

.popover.hidden {
    display: none;
}

.popover input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(60, 140, 255, 0.35);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    outline: none;
}

.popover input:focus {
    border-color: rgba(60, 140, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(60, 140, 255, 0.25);
}

.popover-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
}


.row-actions-flyout {
    position: fixed;            /* ✅ key change: not clipped by parents */
    left: 0;
    top: 0;

    width: 72px;
    height: 40px;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;

    background: rgba(10, 14, 24, 0.92);
    border: 1px solid rgba(60, 140, 255, 0.35);
    border-radius: 12px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);

    z-index: 99999;             /* ✅ ensure it sits above everything */
    opacity: 1;
    transition: opacity 0.12s ease;
}

.row-actions-flyout.hidden {
    opacity: 0;
    pointer-events: none;
}

.row-actions-btn {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    border: 1px solid rgba(60, 140, 255, 0.35);
    background: rgba(60, 140, 255, 0.12);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.row-actions-btn:hover {
    border-color: rgba(60, 140, 255, 0.85);
    background: rgba(60, 140, 255, 0.22);
    box-shadow: 0 0 10px rgba(60, 140, 255, 0.35);
}

.row-actions-btn:active {
    transform: scale(0.95);
}

/* ======================
     RESPONSIVE
====================== */

@media (max-width: 900px) {
    .layout { gap: 10px; }
}
