:root {
    --bg: #f5f7fb;
    --surface: #fff;
    --surface-2: #f1f4f9;
    --border: #e5e9f2;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #0b6ea8;
    --primary-2: #0a5f91;
    --primary-3: #074a71;
    --shadow: 0 10px 25px #02182b14;
    --shadow-2: 0 6px 16px #02182b1a;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;
    --ring: 0 0 0 4px #0b6ea824;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    margin: 0
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea {
    font: inherit
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 22px 22px 40px
}

.topbar {
    z-index: 1000;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0
}

.topbar-inner {
    align-items: center;
    gap: 14px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex
}

.brand {
    align-items: center;
    gap: 10px;
    min-width: 220px;
    display: flex
}

.brand img {
    width: auto;
    height: 34px
}

.nav {
    flex: 1;
    align-items: center;
    gap: 18px;
    display: flex
}

.nav a,
.nav button {
    color: var(--text);
    cursor: pointer;
    background: 0 0;
    border: 0;
    border-radius: 10px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex
}

.nav a:hover,
.nav button:hover {
    background: var(--surface-2)
}

.nav .active {
    color: var(--primary)
}

.nav .caret {
    opacity: .7;
    font-size: 12px
}

.right {
    align-items: center;
    gap: 12px;
    display: flex
}

.icon-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    border-radius: 12px;
    place-items: center;
    width: 40px;
    height: 40px;
    display: grid;
    box-shadow: 0 1px #02182b05
}

.icon-btn:hover {
    box-shadow: var(--shadow-2)
}

.badge {
    position: relative
}

.badge .dot {
    color: #fff;
    border: 2px solid var(--surface);
    background: #ef4444;
    border-radius: 999px;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    display: grid;
    position: absolute;
    top: -4px;
    right: -4px
}

.user-pill {
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    display: flex;
    box-shadow: 0 1px #02182b05
}

.user-pill:hover {
    box-shadow: var(--shadow-2)
}

.avatar {
    background: linear-gradient(135deg, #0b6ea840, #0b6ea80d);
    border: 1px solid #0b6ea840;
    border-radius: 999px;
    width: 34px;
    height: 34px
}

.dropdown {
    position: relative
}

.menu {
    background: var(--surface);
    border: 1px solid var(--border);
    min-width: 210px;
    box-shadow: var(--shadow);
    border-radius: 14px;
    padding: 8px;
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0
}

.menu.right {
    left: auto;
    right: 0
}

.menu a,
.menu button {
    text-align: left;
    cursor: pointer;
    width: 100%;
    color: var(--text);
    background: 0 0;
    border: 0;
    border-radius: 10px;
    align-items: center;
    gap: 10px;
    padding: 10px;
    font-weight: 600;
    display: flex
}

.menu a:hover,
.menu button:hover {
    background: var(--surface-2)
}

.menu .sep {
    background: var(--border);
    height: 1px;
    margin: 6px
}

.menu.open {
    display: block
}

.page-title {
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    display: flex
}

.breadcrumb {
    color: var(--muted);
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600
}

.hr {
    background: var(--border);
    height: 1px;
    margin: 18px 0 22px
}

.grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    display: grid
}

@media (width<=1100px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .brand {
        min-width: 160px
    }
}

@media (width<=720px) {
    .grid-4 {
        grid-template-columns: 1fr
    }

    .nav {
        display: none
    }

    .brand {
        min-width: auto
    }
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px #02182b05
}

.metric {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-2);
    border-radius: 16px;
    padding: 22px
}

.metric .value {
    letter-spacing: .2px;
    font-size: 34px;
    font-weight: 900
}

.metric .label {
    opacity: .92;
    margin-top: 6px;
    font-weight: 700
}

.section {
    border-radius: var(--radius);
    padding: 22px
}

.section h3 {
    margin: 0 0 10px;
    font-size: 16px
}

.section p {
    color: var(--muted);
    margin: 0;
    font-weight: 600;
    line-height: 1.55
}

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

.btn {
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    color: var(--primary);
    border-radius: 12px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    font-weight: 800;
    display: inline-flex;
    box-shadow: 0 1px #02182b05
}

.btn:hover {
    box-shadow: var(--shadow-2)
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: #0000
}

.btn.primary:hover {
    background: var(--primary-2)
}

.btn.danger {
    color: #b91c1c
}

.btn.small {
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px
}

.pill2 {
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800
}
.pill2.warn {
    color: #92400e;
    border-color: #fde68a;
    background: #fffbeb
}
.pill2.ok {
    color: #065f46;
    background: #10b98124;
    border: 1px solid #10b98140
}

.pill2.bad {
    color: #991b1b;
    border-color: #fecaca;
    background: #fff1f2
}

.table-wrap {
    border-radius: var(--radius);
    overflow: auto
}

.table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    min-width: 860px
}

.table th {
    text-align: left;
    color: var(--muted);
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 900
}
/* Make the session column wider */
.table th.job-session-id,
.table td.job-session-id {
  min-width: 150px; /* or a fixed width like 160px */
  max-width: 200px;
  white-space: nowrap;  /* prevent wrapping */
  overflow: hidden;
  text-overflow: ellipsis; /* keep neat with ellipsis if too long */
}
.table td {
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    padding: 12px 14px;
    font-weight: 700
}

/* Only the job ID cells get the hover highlight */
.job-id-cell {
  color: #2563eb;         /* a clear blue, e.g. Tailwind blue-600 */
  text-decoration: none;  /* no underline by default */
  font-weight: 600;       /* semi-bold for emphasis */
  cursor: pointer;
  transition: color 0.2s ease;
}

.job-id-cell:hover,
.job-id-cell:focus {
  color: #1e40af;         /* darker blue on hover/focus */
  text-decoration: underline;  /* underline on hover/focus */
  outline: none;          /* remove default focus outline if you add custom styles */
}

.table tr:hover td {
    background: #f1f4f9b3
}

.kbd {
    font-family: var(--mono);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--muted);
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 800
}

.toolbar {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    display: flex
}

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

.label {
    color: #fff;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 900
}

.input,
select,
textarea {
    border: 1px solid var(--border);
    background: var(--surface);
    width: 100%;
    color: var(--text);
    border-radius: 12px;
    outline: none;
    padding: 11px 12px;
    font-weight: 700
}

.input:focus,
select:focus,
textarea:focus {
    box-shadow: var(--ring);
    border-color: #0b6ea873
}

.row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    display: grid
}

@media (width<=820px) {
    .row {
        grid-template-columns: 1fr
    }

    .table {
        min-width: 720px
    }
}

.modal-backdrop {
    z-index: 2000;
    background: #0f172a99;
    justify-content: center;
    align-items: center;
    padding: 22px;
    display: none;
    position: fixed;
    inset: 0
}

.modal-backdrop.open {
    display: flex
}

.modal {
    background: var(--surface);
    width: min(920px, 100%);
    box-shadow: var(--shadow);
    border: 1px solid #ffffff24;
    border-radius: 18px;
    overflow: hidden
}

.modal-header {
    border-bottom: 1px solid var(--border);
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    display: flex
}

.modal-title {
    font-weight: 900
}

.modal-body {
    padding: 16px
}

.modal-footer {
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 16px;
    display: flex
}

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

.tab {
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    color: var(--muted);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 900
}

.tab.active {
    color: var(--primary);
    background: #0b6ea81f;
    border-color: #0b6ea840
}

.toast-wrap {
    z-index: 3000;
    flex-direction: column;
    gap: 10px;
    display: flex;
    position: fixed;
    bottom: 18px;
    right: 18px
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: 14px;
    min-width: 260px;
    max-width: 360px;
    padding: 12px 14px
}

.toast .t {
    font-weight: 900
}

.toast .m {
    color: var(--muted);
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35
}

.split {
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 16px;
    display: grid
}

@media (width<=980px) {
    .split {
        grid-template-columns: 1fr
    }
}

.side {
    padding: 16px
}

.side .item {
    border: 1px solid var(--border);
    cursor: pointer;
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 10px;
    font-weight: 800
}

.side .item.active {
    box-shadow: var(--ring);
    border-color: #0b6ea859
}

.panel {
    padding: 16px
}

.logbox {
    border: 1px solid var(--border);
    background: var(--surface);
    height: 520px;
    font-family: var(--mono);
    color: #0b1220;
    border-radius: 16px;
    padding: 14px;
    font-size: 12px;
    line-height: 1.45;
    overflow: auto
}

.switch-container {
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    display: flex
}

.switch-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: color .3s
}

.switch {
    width: 50px;
    height: 24px;
    display: inline-block;
    position: relative
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.slider {
    cursor: pointer;
    background-color: #ccc;
    border-radius: 24px;
    transition: all .4s;
    position: absolute;
    inset: 0
}

.slider:before {
    content: "";
    background-color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    transition: all .4s;
    position: absolute;
    bottom: 3px;
    left: 3px;
    box-shadow: 0 2px 4px #0003
}

input:checked+.slider {
    background-color: var(--primary, #007bff)
}

input:checked+.slider:before {
    transform: translate(26px)
}

input:not(:checked)~.switch-label.left,
input:checked~.switch-label.right {
    color: var(--text)
}

.drop-zone-mini {
    border: 2px dashed var(--border);
    text-align: center;
    cursor: pointer;
    background: #ffffff05;
    border-radius: 8px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 80px;
    padding: 12px;
    transition: all .2s;
    display: flex
}

.drop-zone-mini.drag-over {
    border-color: var(--primary, #007bff);
    background: #007bff14;
    transform: scale(1.02)
}

.drop-zone-mini p,
.drop-zone-mini span {
    color: var(--muted);
    pointer-events: none;
    font-size: 13px
}

.treeview {
    color: var(--text);
    font-family: Segoe UI, system-ui, sans-serif;
    font-size: 13px
}

.tree-item {
    cursor: pointer;
    border-radius: 4px;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    transition: background .2s;
    display: flex
}

.tree-item:hover {
    background: #ffffff0d
}

.tree-item.folder {
    color: var(--primary, #007bff);
    font-weight: 600
}

.tree-children {
    border-left: 1px solid var(--border);
    margin-left: 20px;
    padding-left: 4px;
    display: none
}

.tree-icon {
    text-align: center;
    width: 16px;
    font-size: 10px
}

.tree-label {
    flex-grow: 1
}

.tree-date {
    color: var(--muted);
    font-family: monospace;
    font-size: 11px
}

.navigation.disabled {
    color: #888;
    opacity: .6;
    pointer-events: none;
    cursor: default;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    display: inline-flex
}