@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
    color-scheme: light;
    --navy-950: #061f35;
    --navy-900: #082946;
    --navy-850: #0b3457;
    --navy-800: #0f3d63;
    --blue-700: #1d5fd1;
    --blue-600: #2563eb;
    --blue-100: #eaf2ff;
    --ink-900: #17233b;
    --ink-700: #34445f;
    --ink-500: #6c7b91;
    --line: #dde5ef;
    --line-soft: #edf2f7;
    --bg: #f5f8fb;
    --panel: #ffffff;
    --danger: #ef4444;
    --danger-bg: #fff1f1;
    --success: #0f9f63;
    --success-bg: #eaf8f1;
    --warning: #9a6700;
    --warning-bg: #fff4db;
    --shadow: 0 12px 34px rgba(14, 30, 55, 0.08);
    --radius: 12px;
    --sidebar: 164px;
    --header: 76px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink-900);
    font-size: 14px;
}

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

a {
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 600;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    background: radial-gradient(circle at 70% -20%, rgba(37, 99, 235, 0.08), transparent 36%), var(--bg);
}

.sidebar-collapsed {
    --sidebar: 88px;
}

.main-shell {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: linear-gradient(180deg, var(--navy-950), #05243d 54%, #061f35);
    color: #dbe8f5;
    display: flex;
    flex-direction: column;
    box-shadow: 9px 0 28px rgba(5, 28, 49, 0.16);
    z-index: 10;
}

.brand {
    height: 106px;
    padding: 27px 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-copy {
    display: block;
}

.brand-mark {
    position: relative;
    width: 30px;
    height: 50px;
    flex: 0 0 auto;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: 3px;
    transform: skewX(-7deg);
    padding: 3px;
}



.brand-mark::before {
    left: 6px;
    height: 8px;
    box-shadow: 8px -4px 0 #fff;
}

.brand-mark::after {
    right: 5px;
    height: 18px;
    background: #4aa5ff;
}

.brand-name {
    display: block;
    color: #ffffff;
    font-size: 31px;
    line-height: 1;
    font-weight: 760;
    letter-spacing: 4px;
}

.brand-tagline {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 7.5px;
    font-weight: 600;
    letter-spacing: 0.25px;
}

.sidebar-nav {
    padding-top: 15px;
}

.nav-item {
    height: 57px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 22px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 650;
    border-left: 3px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.075);
    border-left-color: #4ca0ff;
    color: #ffffff;
    text-decoration: none;
}

.nav-spacer {
    flex: 1;
}

.collapse {
    height: 61px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.84);
    width: 100%;
    background: transparent;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    cursor: pointer;
}

.collapse:hover {
    background: rgba(255, 255, 255, 0.075);
}

.sidebar-collapsed .brand {
    height: 82px;
    padding: 16px 0 12px;
    align-items: center;
    justify-content: center;
}

.sidebar-collapsed .brand-link {
    justify-content: center;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .collapse span {
    display: none;
}

.sidebar-collapsed .sidebar-nav {
    padding-top: 10px;
}

.sidebar-collapsed .nav-item,
.sidebar-collapsed .collapse {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar-collapsed .collapse .svg {
    transform: rotate(180deg);
}

.topbar {
    height: var(--header);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 29px;
    box-shadow: 0 2px 12px rgba(16, 35, 61, 0.04);
    gap: 16px;
}

.topbar-spacer {
    flex: 1;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-dropdown {
    position: relative;
}

.profile-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.profile-dropdown summary::-webkit-details-marker {
    display: none;
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink-900);
    padding: 8px 0 8px 12px;
    border-radius: 999px;
    background: transparent;
    border: 0;
}

.profile-pill.is-active,
.profile-pill:hover {
    background: transparent;
}

.avatar {
    width: 37px;
    height: 37px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: #0b2c4b;
    font-weight: 800;
    font-size: 16px;
}

.profile-name {
    font-weight: 760;
    line-height: 1.2;
    color: var(--ink-900);
}

.profile-meta {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 600;
    margin-top: 1px;
}

.profile-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(18, 32, 51, 0.12);
    padding: 10px;
    display: grid;
    gap: 6px;
    z-index: 30;
}

.profile-dropdown-menu a,
.profile-dropdown-label {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
}

.profile-dropdown-menu a {
    text-decoration: none;
    color: var(--ink-700);
    background: #fff;
    font-weight: 600;
}

.profile-dropdown-menu a:hover,
.profile-dropdown-menu a.is-active {
    background: #f7f9fd;
    color: var(--blue-600);
}

.profile-dropdown-label {
    color: var(--ink-500);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 2px;
}

.profile-dropdown-logout {
    color: #b42318 !important;
}

.profile-dropdown-logout:hover {
    background: #fff3f2 !important;
    color: #b42318 !important;
}

.page-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.page-title-row {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 26px 10px;
}

.page-title-row-tools-only {
    min-height: auto;
    padding-top: 23px;
    padding-bottom: 0;
}

.page-content {
    padding: 0 26px 29px;
}

body.dashboard-page .page-content {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

body.dashboard-page {
    height: 100vh;
    overflow: hidden;
}

body.dashboard-page .app-shell,
body.dashboard-page .main-shell {
    height: 100vh;
    overflow: hidden;
}

body.dashboard-page .page-body,
body.dashboard-page .page-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

h1,
h2,
h3 {
    margin: 0;
    color: var(--ink-900);
}

h1 {
    font-size: 28px;
    font-weight: 700;
}

h2 {
    font-size: 21px;
    font-weight: 700;
    margin-bottom: 8px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--blue-600);
    font-weight: 700;
    margin: 0 0 6px;
}

.page-tools,
.export-wrap {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.page-tools {
    flex-wrap: wrap;
}

.export-dropdown {
    position: relative;
}

.export-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.export-dropdown summary::-webkit-details-marker {
    display: none;
}

.export-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 260px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(18, 32, 51, 0.12);
    display: grid;
    gap: 6px;
    z-index: 20;
}

.export-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--ink-700);
    font-weight: 600;
    text-decoration: none;
}

.export-menu a:hover {
    background: #f7f9fd;
    color: var(--blue-600);
    text-decoration: none;
}

.panel,
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.card-header p,
.section-copy {
    margin: 6px 0 0;
    color: var(--ink-500);
    line-height: 1.55;
}

.section-copy:first-child {
    margin-top: 0;
}

.button,
button {
    height: 40px;
    min-width: 120px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: var(--blue-600);
    color: #fff;
    padding: 0 20px;
    font-weight: 760;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(15, 41, 72, 0.04);
}

.button:hover,
button:hover {
    background: var(--blue-700);
    text-decoration: none;
}

.button-secondary {
    border-color: #d7e1ed;
    background: #fff;
    color: #173354;
}

.button-secondary:hover {
    background: #f6f9fd;
}

a.button,
a.button-secondary,
a.button-danger {
    text-decoration: none;
}

.button-disabled,
.export-btn[disabled] {
    background: #fff;
    color: #7d8da4;
    border: 1px solid #d3deea;
    box-shadow: 0 4px 14px rgba(15, 41, 72, 0.04);
    cursor: not-allowed;
}

.export-btn {
    height: 43px;
    min-width: 144px;
    padding: 0 20px;
    border-radius: 8px;
    border: 1px solid #d3deea;
    background: #fff;
    color: #0e2f54;
    font-weight: 760;
    box-shadow: 0 4px 14px rgba(15, 41, 72, 0.04);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.export-btn:hover {
    background: #f8fbff;
    text-decoration: none;
}

.flash {
    margin: 0 26px 18px;
    padding: 12px 14px;
    border-radius: 12px;
}

.flash-success {
    background: var(--success-bg);
    color: var(--success);
}

.flash-error {
    background: #fdecec;
    color: #b42318;
}

.muted {
    color: var(--ink-500);
}

label {
    display: block;
    font-size: 13px;
    font-weight: 760;
    color: #253955;
    margin-bottom: 10px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 45px;
    border: 1px solid #d7e1ed;
    border-radius: 7px;
    background: #fff;
    color: #1f2f49;
    outline: none;
    padding: 0 15px;
    box-shadow: inset 0 1px 0 rgba(17, 24, 39, 0.02);
}

textarea {
    min-height: 120px;
    padding: 12px 15px;
}

input::placeholder,
textarea::placeholder {
    color: #667790;
}

.dashboard-filters-card,
.filters {
    padding: 23px 23px 20px;
    margin-bottom: 13px;
}

.dashboard-filter-bar,
.filter-grid {
    display: grid;
    grid-template-columns: 2.1fr 0.82fr 0.82fr 0.86fr 0.98fr;
    gap: 18px;
    align-items: end;
}

.field-wide,
.field {
    min-width: 0;
}

.field-wide .search-field,
.control.with-icon {
    position: relative;
}

.field-wide .search-field input,
.control.with-icon input {
    padding-left: 43px;
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c7d94;
    pointer-events: none;
}

.field-actions,
.filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
    grid-column: 1 / -1;
    flex-wrap: wrap;
}

.companies-filter-bar {
    grid-template-columns: minmax(0, 1fr) auto;
}

.companies-filter-actions {
    grid-column: auto;
    margin-top: 0;
    align-self: end;
}

.inline-toggle,
.btn.marked {
    min-width: 126px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 18px;
    border: 1px solid #d7e1ed;
    border-radius: 7px;
    background: #fff;
    color: #173354;
    font-weight: 760;
    margin-bottom: 0;
}

.inline-toggle input {
    width: 16px;
    min-height: 16px;
    margin: 0;
}

.checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid #cbd6e4;
    border-radius: 4px;
    display: inline-block;
    background: #fff;
}

.dashboard-results-card,
.table-card {
    padding: 18px 22px 20px;
    overflow: hidden;
}

body.dashboard-page .table-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.table-card-tight {
    padding-top: 14px;
}

.dashboard-meta,
.table-meta,
.search-meta,
.pagination,
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-summary,
.meta-left {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.summary-pill,
.meta-pill {
    padding: 0 18px;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid var(--line);
    font-size: 13px;
    color: #203752;
    font-weight: 760;
}

.summary-pill:first-child,
.meta-pill:first-child {
    padding-left: 0;
}

.summary-pill:last-child,
.meta-pill:last-child {
    border-right: 0;
}

.rows-control {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 13px;
    font-weight: 600;
    color: #203752;
}

.rows-select {
    width: auto;
    min-width: 68px;
    height: 36px;
    min-height: 36px;
    border-radius: 7px;
    border: 1px solid #d9e2ee;
    padding: 0 12px;
    color: #162f4f;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

body.dashboard-page .table-wrap {
    height: 100%;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 13px;
}

thead th {
    height: 40px;
    text-align: left;
    color: #28405d;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 820;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

tbody td {
    min-height: 47px;
    height: 47px;
    border-bottom: 1px solid var(--line-soft);
    color: #223650;
    vertical-align: middle;
    font-weight: 560;
    padding: 12px 10px;
}

tbody tr:hover td {
    background: #fafcff;
}

#dashboard-results {
    margin-top: 16px;
}

body.dashboard-page #dashboard-results {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sort-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    min-height: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-transform: inherit;
    letter-spacing: inherit;
    font: inherit;
}

.sort-button:hover,
.sort-button.is-active {
    background: transparent;
    color: #28405d;
}

.sort-indicator {
    position: relative;
    width: 8px;
    height: 14px;
    display: inline-block;
    color: #9aa8b8;
}

.sort-indicator::before,
.sort-indicator::after {
    content: "";
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
}

.sort-indicator::before {
    top: 0;
    border-bottom: 4px solid currentColor;
}

.sort-indicator::after {
    bottom: 0;
    border-top: 4px solid currentColor;
}

.sort-indicator.is-asc,
.sort-indicator.is-desc {
    color: var(--blue-600);
}

.badge,
.project-pill {
    display: inline-block;
    max-width: 100%;
    padding: 7px 13px;
    border-radius: 7px;
    background: #eef1f5;
    color: #1556bd;
    font-weight: 760;
    line-height: 1.28;
}

.project-type-clamp {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

.badge-muted,
.project-pill.muted-project {
    color: #47566a;
    background: #eeeeef;
}

.doc-link,
.mail-link,
.web-link,
.phone,
.phone-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.dash {
    color: #738197;
}

.table-action {
    white-space: nowrap;
}

.action-buttons,
.actions-compact {
    display: inline-flex;
    gap: 9px;
    justify-content: flex-end;
    padding-right: 2px;
}

.inline-form {
    display: inline;
}

.table-actions-cell {
    text-align: right;
}

.table-actions-cell .action-buttons {
    width: 100%;
}

.companies-action-buttons {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.companies-table th:nth-child(1),
.companies-table td:nth-child(1) {
    width: 24%;
}

.companies-table th:nth-child(5),
.companies-table td:nth-child(5) {
    width: 8%;
}

.companies-table th:nth-child(6),
.companies-table td:nth-child(6) {
    width: 10%;
}

.companies-table th:last-child,
.companies-table td:last-child {
    width: 72px;
}

.icon-button {
    width: 31px;
    min-width: 31px;
    height: 31px;
    min-height: 31px;
    border-radius: 6px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #d2dbe6;
    background: #fff;
    color: #0c2847;
    cursor: pointer;
    padding: 0;
}

.icon-button:hover {
    background: #f6f9fd;
}

.icon-button svg {
    width: 14px;
    height: 14px;
}

.icon-button-reanalyze {
    color: #1556bd;
    background: #f8fbff;
    border-color: #d6e2f4;
}

.icon-button-reanalyze:hover {
    background: #edf5ff;
}

.icon-button-hide {
    color: var(--danger);
    border-color: #ffcbcb;
}

.icon-button-hide:hover {
    background: #fff4f4;
}

.icon-button-star.is-active,
.icon-button-star:hover {
    background: #fff7d8;
    color: #bf8b00;
    border-color: #ecd69d;
}

.pagination-links,
.pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 11px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.page-btn,
.page-current,
.pagination-links a {
    width: 36px;
    min-width: 36px;
    height: 36px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    border: 1px solid #dce5ef;
    background: #fff;
    color: #8290a4;
    font-weight: 760;
    padding: 0;
}

.pagination-links a {
    text-decoration: none;
}

.page-current,
.pagination-links a.button {
    background: #0b2c4b;
    border-color: #0b2c4b;
    color: #fff;
    box-shadow: 0 7px 16px rgba(11, 44, 75, 0.22);
}

.pagination-links a.button-secondary {
    background: #fff;
    border-color: #dce5ef;
    color: #8290a4;
    box-shadow: none;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.result-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    background: #fff;
    display: grid;
    gap: 14px;
    box-shadow: var(--shadow);
}

.result-card-header,
.result-card-actions,
.result-grid,
.stack,
.source-run-status {
    display: grid;
    gap: 12px;
}

.result-card-header {
    grid-template-columns: 1fr auto;
    align-items: start;
}

.result-company {
    color: var(--blue-600);
    font-size: 18px;
    font-weight: 760;
}

.result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-item {
    display: grid;
    gap: 4px;
}

.result-item strong {
    color: var(--ink-900);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.checkbox-item input {
    width: auto;
    margin: 0;
    min-height: auto;
}

.schedule-time-row {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.schedule-time-field {
    min-width: 180px;
}

.schedule-time-field label {
    margin-bottom: 8px;
}

.schedule-time-field input[type="time"] {
    min-width: 180px;
}

.schedule-actions {
    margin-top: 8px;
    justify-content: flex-start;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.status-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    box-shadow: var(--shadow);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9eef7;
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--blue-600), #4f8cff);
}

.code-inline {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 13px;
    word-break: break-all;
}

.source-run-status {
    min-width: 220px;
}

.badge-source-run {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-source-run.is-idle {
    background: #f2f5fc;
    color: #77859d;
}

.badge-source-run.is-queued {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-source-run.is-running {
    background: #e8f1ff;
    color: #1d4ed8;
}

.badge-source-run.is-completed {
    background: var(--success-bg);
    color: #087443;
}

.badge-source-run.is-failed {
    background: #fdecec;
    color: #b42318;
}

.source-run-message {
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    max-width: 320px;
}

.view-toggle {
    display: inline-flex;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fafbfe;
}

.view-toggle a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 0 18px;
    text-decoration: none;
    color: #92a0b6;
    font-weight: 600;
}

.view-toggle a.is-active {
    color: var(--blue-600);
    background: #f2f5fb;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.full-span {
    grid-column: 1 / -1;
}

.form-actions-between {
    justify-content: space-between;
}

.form-actions-end {
    justify-content: flex-end;
}

.badge-neutral {
    background: #eef1f5;
    color: #47566a;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.badge-blue {
    background: #eef4ff;
    color: var(--blue-600);
}

.status-message {
    margin: 0;
    color: var(--ink-500);
    line-height: 1.55;
}

.status-card strong {
    color: var(--ink-900);
}

.activity-progress {
    min-width: 140px;
    margin-bottom: 8px;
}

.activity-time-list {
    display: grid;
    gap: 4px;
    min-width: 170px;
}

.activity-time-list span {
    color: var(--ink-500);
    font-size: 12px;
    line-height: 1.35;
}

.button-danger {
    background: #fff;
    color: var(--danger);
    border-color: #ffcbcb;
}

.button-danger:hover {
    background: #fff4f4;
}

.button-group {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group form {
    display: inline-flex;
}

body.auth-page {
    position: relative;
    overflow: hidden;
    background: #091728;
}

body.auth-page .app-shell {
    grid-template-columns: 1fr;
    background: transparent;
}

.auth-page .topbar {
    justify-content: center;
}

.auth-page .page-title-row,
.auth-page .flash {
    display: none;
}

.auth-layout {
    position: relative;
    min-height: calc(100vh - 77px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 32px 16px 48px;
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 22px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
    padding: 28px;
}

.auth-brand {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
    margin-bottom: 6px;
}

.auth-brand .brand-mark {
    width: 58px;
    height: 94px;
    border-width: 3px;
    border-radius: 7px;
    padding: 10px 8px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.auth-brand .brand-mark::before,
.auth-brand .brand-mark::after {
    display: none;
}

.auth-brand .brand-mark svg {
    width: 30px;
    height: 30px;
    display: block;
    flex: 0 0 auto;
    transform: skewX(7deg);
}

.auth-card h1 {
    margin: 0 0 8px;
}

.auth-title-light {
    font-weight: 500;
}

.auth-title-strong {
    font-weight: 900;
}

.auth-card p {
    margin: 0 0 22px;
    color: var(--ink-500);
}

.auth-card .actions {
    margin-top: 20px;
    justify-content: stretch;
}

.auth-card .actions .button,
.auth-card .actions button {
    width: 100%;
    background: #0b1728;
    border-color: #0b1728;
}

.auth-card .actions .button:hover,
.auth-card .actions button:hover {
    background: #13233b;
}

.svg {
    width: 16px;
    height: 16px;
    display: inline-block;
    flex: 0 0 auto;
}

.svg-sm {
    width: 14px;
    height: 14px;
}

@media (max-width: 1280px) {
    :root {
        --sidebar: 88px;
    }

    .brand-name,
    .brand-tagline,
    .nav-label,
    .collapse span {
        display: none;
    }

    .brand {
        align-items: center;
        padding-left: 0;
        padding-right: 0;
    }

    .brand-link,
    .nav-item,
    .collapse {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .dashboard-filter-bar,
    .filter-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .table-wrap {
        overflow-x: auto;
    }

    table {
        min-width: 1540px;
    }
}

@media (max-width: 900px) {
    .page-title-row,
    .page-content,
    .flash {
        padding-left: 18px;
        padding-right: 18px;
    }

    .page-title-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dashboard-filter-bar,
    .filter-grid,
    .result-grid,
    .status-grid,
    .form-grid-2,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 860px) {
    body.dashboard-page {
        height: auto;
        overflow: auto;
    }

    body.dashboard-page .app-shell,
    body.dashboard-page .main-shell,
    body.dashboard-page .page-body,
    body.dashboard-page .page-content {
        height: auto;
        min-height: initial;
        overflow: visible;
    }

    body.dashboard-page .table-card,
    body.dashboard-page #dashboard-results {
        flex: initial;
        min-height: initial;
        height: auto;
        overflow: visible;
    }

    body.dashboard-page .table-wrap {
        flex: initial;
        min-height: initial;
        height: auto;
        overflow-x: auto;
        overflow-y: visible;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        height: 64px;
        padding: 0 16px;
    }

    .page-content {
        padding: 0 16px 16px;
    }

    .page-title-row {
        padding: 16px 16px 0;
    }

    .dashboard-summary,
    .meta-left,
    .dashboard-meta,
    .table-meta,
    .search-meta,
    .pagination,
    .actions,
    .filter-actions,
    .export-wrap,
    .page-tools {
        align-items: stretch;
    }

    .dashboard-meta,
    .table-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .summary-pill,
    .meta-pill {
        border-right: 0;
        padding-left: 0;
    }

    .export-btn {
        width: 100%;
    }

    .filter-actions .button,
    .filter-actions button,
    .filter-actions .btn,
    .inline-toggle {
        width: 100%;
    }
}
