:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-muted: #f8f9fc;
    --line: #e6e8ef;
    --text: #1f2430;
    --text-muted: #6b7280;
    --completed: #16a34a;
    --completed-soft: #edf9f0;
    --pending: #8b2c7d;
    --pending-soft: #f8eef7;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    --tile-shadow: 0 2px 6px rgba(15, 23, 42, 0.05), 0 14px 28px rgba(15, 23, 42, 0.08);
    --shell-max-width: 1440px;
    --shell-padding-x: 16px;
    --card-padding: 24px;
    --control-height: 50px;
    --control-radius: 14px;
    --control-padding-x: 14px;
    --font-base: 16px;
    --font-ui: 14px;
    --topbar-sticky-top: 0px;
    --topbar-min-height: 78px;
    --topbar-padding-y: 14px;
    --topbar-height: calc(var(--topbar-min-height) + (var(--topbar-padding-y) * 2));
    --secondary-sticky-top: calc(var(--topbar-sticky-top) + var(--topbar-height));
    --topbar-gap: 28px;
    --topbar-item-gap: 10px;
    --topbar-item-min-height: 32px;
    --topbar-menu-toggle-size: 44px;
    --topbar-menu-toggle-radius: 14px;
    --topbar-menu-panel-item-size: 1.7rem;
    --topbar-menu-panel-pill-size: 0.98rem;
    --topbar-nav-icon-size: 0.72em;
    --topbar-search-field-icon-size: 1.15rem;
    --topbar-search-panel-max-height: 320px;
    --topbar-search-panel-padding-top: 20px;
    --topbar-search-panel-padding-bottom: 24px;
    --topbar-menu-panel-gap: 18px;
    --topbar-menu-panel-padding: 22px 24px 36px;
    --section-card-radius: 16px;
    --section-panel-padding: 18px;
    --section-panel-gap: 14px;
    --section-panel-min-height: 220px;
    --switch-tray-bg: #f1f2f8;
    --switch-tray-gap: 10px;
    --switch-tray-padding: 8px;
    --switch-tray-radius: 28px;
    --switch-tab-min-height: 48px;
    --switch-tab-mobile-min-height: 38px;
    --switch-tab-padding-x: 18px;
    --switch-tab-mobile-padding-x: 12px;
    --space-block: 20px;
    --space-block-lg: 28px;
    --space-block-sm: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    font-variation-settings: "opsz" 32;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", sans-serif;
    font-size: var(--font-base);
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: -0.011em;
    background: var(--bg);
    color: var(--text);
}

.portal-page {
    background: #ffffff;
}

a {
    color: inherit;
}

.login-body {
    min-height: 100vh;
}

.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 32px;
}

.login-links {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.login-card h1,
.page-title {
    margin: 0;
    font-size: 2rem;
}

.section-title,
.card h2,
.modal-panel h2 {
    margin: 0;
    font-size: 1.25rem;
}

.muted {
    color: var(--text-muted);
}

.section-heading {
    display: grid;
    gap: 6px;
    margin-bottom: 18px;
}

.app-shell {
    width: 100%;
    max-width: var(--shell-max-width);
    margin: 0 auto;
    padding: 0 var(--shell-padding-x) 24px;
    display: flex;
    flex-direction: column;
    gap: var(--space-block);
    overflow: visible;
}

.admin-console-page .app-shell {
    max-width: var(--shell-max-width);
    padding: 0 var(--shell-padding-x) 24px;
}

.admin-console-page .topbar {
    margin-bottom: 0;
}

.admin-console-page .topbar-brand {
    padding-top: 0;
    padding-left: 0;
    gap: 12px;
}

.admin-console-page .topbar-brand .muted {
    font-size: 1.05rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.admin-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-block);
}

.admin-sidebar {
    position: sticky;
    top: 24px;
    padding: 20px;
}

.admin-sidebar-header {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-sidebar-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.admin-sidebar-nav {
    display: grid;
    gap: 12px;
}

.admin-nav-group {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.admin-nav-group.is-active-group {
    border-color: #c7d2e3;
    background: #f5f8fd;
    box-shadow: 0 10px 24px rgba(31, 36, 48, 0.06);
}

.admin-nav-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.012em;
}

.admin-nav-group.is-active-group .admin-nav-summary {
    color: var(--text);
}

.admin-nav-summary::-webkit-details-marker {
    display: none;
}

.admin-nav-summary-icon::before {
    content: "\203A";
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
}

.admin-nav-group[open] .admin-nav-summary-icon::before {
    content: "\2304";
}

.admin-nav-links {
    display: grid;
    gap: 6px;
    padding: 0 12px 12px 18px;
}

.admin-nav-link {
    display: block;
    padding: 13px 16px;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-nav-link:hover {
    background: #eef2f8;
    color: var(--text);
    transform: translateX(2px);
}

.admin-nav-link.is-active {
    background: var(--text);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 36, 48, 0.18);
}

.admin-nav-group.is-active-group .admin-nav-link:not(.is-active) {
    color: #4b5563;
}

.admin-page .grid-two,
.admin-page .data-tools-grid {
    grid-template-columns: 1fr;
}

.admin-page .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.admin-page .app-shell {
    padding: 0 16px 24px;
}

.admin-page .topbar {
    margin-bottom: 0;
}

.admin-page .topbar-brand {
    padding-top: 0;
    padding-left: 0;
    gap: 12px;
}

.admin-page .topbar-brand .muted {
    font-size: 1.1rem;
}

.admin-page .admin-collapsible-card,
.admin-console-page .admin-collapsible-card {
    display: block;
    padding: 0;
    overflow: hidden;
}

.admin-page .admin-card-toggle,
.admin-console-page .admin-card-toggle {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 0;
    padding: 20px 24px;
    border: 0;
    border-radius: 0;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
}

.admin-page .admin-card-toggle-copy,
.admin-console-page .admin-card-toggle-copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.admin-page .admin-card-toggle-title,
.admin-console-page .admin-card-toggle-title {
    font-size: 1.1rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.admin-page .admin-card-toggle-subtitle,
.admin-console-page .admin-card-toggle-subtitle {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-page .admin-card-toggle .drawing-panel-toggle,
.admin-console-page .admin-card-toggle .drawing-panel-toggle {
    flex-shrink: 0;
}

.admin-page .admin-collapsible-content,
.admin-console-page .admin-collapsible-content {
    padding: 0 24px 24px;
    border-top: 1px solid var(--line);
}

.admin-page .admin-collapsible-card.is-collapsed .admin-collapsible-content,
.admin-console-page .admin-collapsible-card.is-collapsed .admin-collapsible-content {
    display: none;
}

.admin-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-label-open,
.admin-console-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-label-open {
    display: none;
}

.admin-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-label-closed,
.admin-console-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-label-closed {
    display: inline;
}

.admin-page .admin-collapsible-card:not(.is-collapsed) .drawing-panel-toggle-label-closed,
.admin-console-page .admin-collapsible-card:not(.is-collapsed) .drawing-panel-toggle-label-closed {
    display: none;
}

.admin-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-icon::before,
.admin-console-page .admin-collapsible-card.is-collapsed .drawing-panel-toggle-icon::before {
    content: "\2193";
}

.admin-page .admin-collapsible-card:not(.is-collapsed) .drawing-panel-toggle-icon::before,
.admin-console-page .admin-collapsible-card:not(.is-collapsed) .drawing-panel-toggle-icon::before {
    content: "\2191";
}

.admin-page .admin-collapsible-card .section-heading:first-child,
.admin-page .admin-collapsible-card .table-toolbar:first-child,
.admin-page .admin-collapsible-card .table-filter-form:first-child,
.admin-page .admin-collapsible-card form:first-child,
.admin-page .admin-collapsible-card .stats-grid:first-child,
.admin-page .admin-collapsible-card .admin-list:first-child,
.admin-page .admin-collapsible-card .quick-switch-grid:first-child,
.admin-console-page .admin-collapsible-card .section-heading:first-child,
.admin-console-page .admin-collapsible-card .table-toolbar:first-child,
.admin-console-page .admin-collapsible-card .table-filter-form:first-child,
.admin-console-page .admin-collapsible-card form:first-child,
.admin-console-page .admin-collapsible-card .stats-grid:first-child,
.admin-console-page .admin-collapsible-card .admin-list:first-child,
.admin-console-page .admin-collapsible-card .quick-switch-grid:first-child {
    margin-top: 20px;
}

.page-sticky-shell {
    position: sticky;
    top: 0;
    z-index: 70;
    display: grid;
    gap: 0;
    overflow: visible;
    background: #ffffff;
}

.page-secondary-sticky {
    position: relative;
    top: auto;
    z-index: 70;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(var(--shell-padding-x), calc((100vw - var(--shell-max-width)) / 2 + var(--shell-padding-x)));
    padding-right: max(var(--shell-padding-x), calc((100vw - var(--shell-max-width)) / 2 + var(--shell-padding-x)));
    background: #ffffff;
    overflow: visible;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.topbar {
    position: relative;
    top: auto;
    z-index: 71;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: var(--topbar-min-height);
    padding: var(--topbar-padding-y) 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(var(--shell-padding-x), calc((100vw - var(--shell-max-width)) / 2 + var(--shell-padding-x)));
    padding-right: max(var(--shell-padding-x), calc((100vw - var(--shell-max-width)) / 2 + var(--shell-padding-x)));
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
}

.topbar::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    height: 1px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    box-shadow:
        inset 0 1px 0 rgba(31, 36, 48, 0.08),
        0 1px 2px rgba(15, 23, 42, 0.08);
    pointer-events: none;
}

.attendance-page .topbar {
    margin-bottom: 0;
    box-shadow: none;
}

.topbar-brand {
    display: grid;
    align-content: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    overflow: visible;
}

.topbar-brand-inline {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 6px;
    width: max-content;
    max-width: 100%;
    overflow: visible;
}

.topbar-brand-inline .page-title,
.topbar-brand-inline .page-subtitle-inline {
    margin: 0;
    padding: 0;
    justify-self: start;
    text-align: left;
}

.topbar-brand .page-title,
.topbar-brand-inline .page-title {
    display: block;
    line-height: 1.14;
    padding-top: 0;
    padding-bottom: 0.04em;
    overflow: visible;
}

.topbar-brand > .muted,
.topbar-brand > .page-subtitle-inline {
    margin: 0;
    padding: 0;
    justify-self: start;
    text-align: left;
}

.page-subtitle-inline {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.2;
    font-weight: 500;
    display: block;
}

.btn-row,
.stat-row,
.title-row,
.detail-row,
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--topbar-gap);
    flex-wrap: wrap;
    font-size: 1rem;
    line-height: 1;
}

.topbar-search,
.topbar-search-toggle,
.topbar-right .btn,
.topbar-right .pill,
.topbar-user-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--topbar-item-gap);
    line-height: 1;
    align-self: center;
}

.topbar-search,
.topbar-search-toggle,
.topbar-user-pill {
    min-height: var(--topbar-item-min-height);
}

.topbar-search-toggle,
.topbar-right .btn,
.topbar-right .pill,
.topbar-user-pill {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-weight: 500;
    letter-spacing: -0.01em;
    box-shadow: none;
    white-space: nowrap;
}

.topbar-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: var(--topbar-menu-toggle-size);
    height: var(--topbar-menu-toggle-size);
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--topbar-menu-toggle-radius);
    background: #ffffff;
    color: #243041;
    box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.35);
    cursor: pointer;
}

.topbar-menu-toggle:not(.topbar-menu-close) {
    flex-direction: column;
    gap: 4px;
}

.topbar-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.topbar-menu-panel {
    display: contents;
}

.topbar-menu-panel-head,
.topbar-menu-panel-label {
    display: none;
}

.topbar-menu-close {
    position: relative;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.topbar-menu-close span {
    position: absolute;
    width: 22px;
}

.topbar-menu-close span:first-child {
    transform: rotate(45deg);
}

.topbar-menu-close span:last-child {
    transform: rotate(-45deg);
}

.topbar-search {
    position: static;
    order: 1;
}

.topbar-search-toggle {
    width: auto;
    height: auto;
    cursor: pointer;
    list-style: none;
    flex: 0 0 auto;
    transform: none;
}

.topbar-search.is-open .topbar-search-toggle,
.topbar-search.is-active .topbar-search-toggle,
.topbar-search-toggle:hover {
    color: var(--text);
}

.topbar-search-panel {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100vw;
    padding: 0;
    max-height: 0;
    opacity: 0;
    border-top: 0 solid transparent;
    border-bottom: 0 solid transparent;
    background: #ffffff;
    box-shadow: none;
    z-index: 40;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-50%) scaleY(0.02);
    transform-origin: top center;
    transition:
        max-height 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.16s ease,
        transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.34s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.topbar-search.is-open .topbar-search-panel {
    max-height: var(--topbar-search-panel-max-height);
    opacity: 1;
    padding: var(--topbar-search-panel-padding-top) 0 var(--topbar-search-panel-padding-bottom);
    border-top-width: 0;
    border-top-color: transparent;
    border-bottom-width: 1px;
    border-bottom-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 22px -18px rgba(15, 23, 42, 0.2);
    overflow: visible;
    pointer-events: auto;
    transform: translateX(-50%) scaleY(1);
}

.topbar-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.topbar-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 56px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-muted);
}

.topbar-search-input-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--topbar-search-field-icon-size);
    height: var(--topbar-search-field-icon-size);
    flex: 0 0 var(--topbar-search-field-icon-size);
}

.topbar-search-input {
    width: 100%;
    min-height: 56px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: -0.014em;
    color: var(--text);
}

.topbar-search-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: none;
}

.topbar-search-input::placeholder {
    color: #9aa3b2;
}

.topbar-search-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar-search-hints {
    display: grid;
    gap: 8px;
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.topbar-search-panel > * {
    max-width: var(--shell-max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--shell-padding-x);
    padding-right: var(--shell-padding-x);
}

.topbar-search-hints div::before {
    content: "\2192";
    margin-right: 10px;
    color: var(--text-muted);
}

.topbar-right .btn {
    min-height: 0;
}

.topbar-right .btn:hover {
    color: var(--text);
    background: transparent;
}

.topbar-right .btn-current {
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.018em;
    background: transparent;
}

.topbar-right .pill {
    min-height: 0;
    font-size: 1rem;
}

.topbar-user-pill {
    color: var(--text-muted);
    white-space: nowrap;
    order: 2;
}

.topbar-menu-panel > a.btn:last-child,
.topbar-menu-panel > .logout-form:last-child {
    order: 3;
}

.topbar-inline-icon {
    display: block;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
    flex: 0 0 1em;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: center;
    transform: translateY(0);
}

.topbar-nav-icon {
    width: var(--topbar-nav-icon-size);
    height: var(--topbar-nav-icon-size);
    min-width: var(--topbar-nav-icon-size);
    min-height: var(--topbar-nav-icon-size);
    flex-basis: var(--topbar-nav-icon-size);
}

.topbar-search-field-icon {
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    min-height: 1.15rem;
    flex-basis: 1.15rem;
}

.topbar-search-toggle .topbar-inline-icon {
    opacity: 0.84;
}

.topbar-user-pill .topbar-inline-icon,
.topbar-search-input-icon .topbar-inline-icon {
    opacity: 0.8;
}

.topbar-search-toggle > span,
.topbar-right .btn > span,
.topbar-right .pill > span,
.topbar-user-pill > span {
    display: block;
    line-height: 1;
}

.topbar-search-panel .btn {
    min-height: 50px;
    padding: 13px 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #d7dce5;
    color: var(--text);
    font-weight: 600;
    box-shadow: none;
}

.topbar-search-panel .btn:hover {
    background: #fff;
    color: var(--text);
}

.context-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 24px;
    flex-wrap: wrap;
}

.context-trail {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-muted);
}

.context-trail a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}

.context-trail a:hover {
    color: var(--pending);
}

.context-trail strong {
    color: var(--text);
}

.quick-switch-card {
    padding: 20px 24px;
}

.attendance-page .attendance-toolbar-card,
.attendance-page .attendance-month-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
}

.attendance-page .attendance-toolbar-card {
    padding-top: 28px;
    padding-bottom: 18px;
}

.attendance-page .attendance-month-card {
    padding-top: 4px;
    padding-bottom: 0;
}

.quick-switch-grid {
    display: grid;
    gap: 12px;
}

.attendance-scope-grid {
    display: grid;
    width: calc(100% - 144px);
    max-width: 1420px;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 72px;
}

.attendance-scope-grid.is-single {
    width: calc(100% - 288px);
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.attendance-scope-group {
    display: grid;
    gap: 12px;
    width: 100%;
    justify-items: stretch;
}

.attendance-scope-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text);
    text-align: center;
}

.attendance-company-card .quick-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border-radius: 999px;
    background: #f1f2f8;
    overflow-x: auto;
    scrollbar-width: none;
}

.attendance-company-card .quick-switch-grid {
    gap: 14px;
}

.attendance-company-card .quick-switch-row::-webkit-scrollbar {
    display: none;
}

.attendance-company-card .quick-switch-tab {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    color: #2b303b;
    white-space: nowrap;
}

.attendance-company-card .quick-switch-tab:hover {
    background: rgba(255, 255, 255, 0.56);
    border-color: transparent;
}

.attendance-company-card .quick-switch-tab.is-active {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18);
    font-weight: 700;
}

@media (max-width: 1180px) {
    .attendance-scope-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.quick-switch-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.quick-switch-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
    text-align: center;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.quick-switch-tab:hover {
    border-color: #cbd5e1;
    background: #f2f5fb;
}

.quick-switch-tab.is-active {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    border-color: #7c2392;
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18);
}

.btn.btn-back {
    gap: 10px;
    padding: 12px 18px;
    border-radius: 16px;
    border-color: var(--text);
    background: linear-gradient(135deg, #1f2430 0%, #384152 100%);
    color: #fff;
    box-shadow: 0 12px 24px rgba(31, 36, 48, 0.14);
}

.btn.btn-back:hover {
    border-color: var(--text);
    background: linear-gradient(135deg, #161b24 0%, #2f3848 100%);
    color: #fff;
}

.btn.btn-back.btn-back-compact {
    min-height: 0;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(31, 36, 48, 0.12);
}

.btn.btn-back.btn-back-compact .btn-back-icon {
    width: 24px;
    height: 24px;
    font-size: 14px;
}

.btn-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 16px;
    line-height: 1;
}

.frame-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, var(--surface-muted) 100%);
}

.frame-summary-stats-grid {
    margin-top: 8px;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: -0.01em;
}

.grid-two {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-block);
}

.admin-grid {
    align-items: stretch;
}

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

.project-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
}

.project-stats-grid-with-cost {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.portal-shell {
    padding-top: 0;
    padding-bottom: 40px;
}

.portal-stage {
    display: grid;
    gap: 32px;
    padding: 44px;
    border-radius: 34px;
    border: 1px solid #efeff2;
    background: #f4f4f6;
    box-shadow: none;
}

.portal-stage-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.portal-stage-heading {
    margin-bottom: 0;
    max-width: 820px;
}

.portal-stage-heading h2 {
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    line-height: 1.03;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.portal-stage-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.portal-card {
    display: grid;
    gap: 0;
    min-height: 320px;
    padding: 0;
    border-radius: 28px;
    border: 1px solid #ececf0;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    overflow: hidden;
}

.portal-card:hover {
    transform: translateY(-4px) scale(1.015);
    border-color: #e2e7f0;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.1);
}

.portal-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 28px 24px 10px;
}

.portal-card-icon,
.portal-admin-icon-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    height: 124px;
    border-radius: 22px;
    background: #ffffff;
    border: 0;
    color: #6f2e90;
    font-size: 2.7rem;
    font-weight: 700;
    overflow: hidden;
}

.portal-card-icon.has-image,
.portal-admin-icon-preview.has-image {
    background: #fff;
}

.portal-card-icon img,
.portal-admin-icon-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-card-body {
    display: grid;
    gap: 12px;
    padding: 0 24px 24px;
}

.portal-card-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.portal-card-title-row h2 {
    margin: 0;
    font-size: 1.65rem;
    line-height: 1.08;
}

.portal-card-body p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.45;
    font-size: 1rem;
}

.portal-card-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(124, 35, 146, 0.08);
    color: #6f2e90;
    font-size: 1.15rem;
}

.portal-admin-icon-preview {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
}

.empty-state-card {
    display: grid;
    gap: 16px;
    max-width: 640px;
}

.admin-grid > .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.metric-card,
.mini-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--tile-shadow);
}

.metric-card-with-icon {
    position: relative;
    padding-right: 72px;
}

.metric-card-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 999px;
}

.metric-card-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.metric-card-icon-pending {
    color: var(--pending);
    border: 2px solid rgba(145, 41, 132, 0.38);
    background: rgba(250, 240, 248, 0.72);
}

.metric-card-icon-completed {
    color: var(--completed);
    border: 2px solid rgba(22, 163, 74, 0.32);
    background: rgba(237, 249, 240, 0.82);
}

.metric-label,
.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.metric-value,
.mini-card strong {
    display: block;
    margin-top: 8px;
    font-size: 1.75rem;
}

.metric-card-completed {
    background: var(--completed-soft);
    border-color: #cdeed7;
}

.metric-card-completed .metric-label,
.metric-card-completed .metric-value {
    color: var(--completed);
}

.metric-card-pending {
    background: var(--pending-soft);
    border-color: #edd8e8;
}

.metric-card-pending .metric-label,
.metric-card-pending .metric-value {
    color: var(--pending);
}

.metric-card-danger {
    background: var(--danger-soft);
    border-color: #f3ceca;
}

.metric-card-danger .metric-label,
.metric-card-danger .metric-value {
    color: var(--danger);
}

.metric-card-total {
    background: var(--surface-muted);
}

.metric-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.metric-card-link:hover,
.metric-card-link:focus-visible {
    box-shadow: 0 12px 26px rgba(31, 36, 48, 0.14);
}

.metric-card-link:hover {
    transform: translateY(-1px);
}

.metric-card-link.is-active {
    border-color: transparent;
    box-shadow: 0 14px 30px rgba(31, 36, 48, 0.12);
    filter: saturate(1.04);
}

.metric-card-progress {
    background: linear-gradient(180deg, #ffffff 0%, var(--surface-muted) 100%);
}

.metric-progress {
    margin-top: 12px;
}

.guest-app-shell {
    padding-bottom: 40px;
}

.guest-app-shell .context-bar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.guest-app-shell .guest-context-bar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        "back trail actions"
        "back pill actions";
    align-items: center;
    gap: 16px 20px;
}

.guest-app-shell .guest-context-bar .btn-back {
    grid-area: back;
    justify-self: start;
    width: auto;
}

.guest-app-shell .context-trail {
    grid-area: trail;
    justify-self: center;
}

.guest-app-shell .guest-context-pill-row {
    grid-area: pill;
    justify-self: center;
}

.guest-app-shell .guest-context-pill-row .table-context-pill {
    pointer-events: none;
}

.guest-app-shell .portal-intro-actions,
.guest-app-shell .guest-context-actions {
    grid-area: actions;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.guest-stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.guest-top-grid {
    align-items: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guest-top-grid > .card {
    height: 100%;
}

.guest-metric-negative {
    background: var(--danger-soft);
    border-color: #f7d4d1;
}

.guest-metric-negative .metric-label,
.guest-metric-negative .metric-value {
    color: var(--danger);
}

.guest-create-form,
.guest-settings-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-width: 0;
}

.guest-settings-form textarea,
.guest-settings-form .form-submit,
.guest-create-form .form-submit {
    grid-column: 1 / -1;
}

.guest-settings-switch,
.guest-settings-template-panel {
    grid-column: 1 / -1;
}

.guest-settings-switch {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
    gap: 0;
    padding: var(--switch-tray-padding);
    border-radius: var(--switch-tray-radius);
    background: var(--switch-tray-bg);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.guest-settings-switch::-webkit-scrollbar {
    display: none;
}

.guest-settings-switch .quick-switch-tab {
    width: 100%;
    min-width: 140px;
    min-height: 38px;
    padding: 9px 12px;
    border: 0 !important;
    border-radius: 999px;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 500;
    color: #2b303b;
    line-height: 1.15;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.guest-settings-switch .quick-switch-tab:hover {
    background: rgba(255, 255, 255, 0.56) !important;
    border-color: transparent !important;
}

.guest-settings-switch .quick-switch-tab.is-active,
.guest-settings-switch .quick-switch-tab.is-active:hover {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%) !important;
    border-color: transparent !important;
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18) !important;
    font-weight: 700;
}

.guest-settings-template-panel {
    display: none;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 16px;
}

.guest-settings-template-panel.is-active {
    display: grid;
}

.guest-settings-template-panel label {
    display: grid;
    gap: 10px;
}

.guest-settings-template-body-label,
.guest-settings-template-body {
    grid-column: 1 / -1;
}

.guest-filter-form {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.guest-filter-form .guest-filter-search {
    grid-column: span 2;
}

.guest-create-form input,
.guest-settings-form input,
.guest-settings-form textarea,
.guest-filter-form input,
.guest-filter-form select {
    width: 100%;
}

.guest-empty-state {
    padding: 8px 4px 0;
}

.guest-empty-state h3 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.guest-empty-state p {
    margin: 0;
    color: var(--text-muted);
    max-width: 760px;
}

.guest-table-card {
    min-width: 0;
    overflow: hidden;
}

.guest-table-card .table-toolbar,
.guest-table-card .table-toolbar-frame,
.guest-table-card .section-heading {
    min-width: 0;
}

.metric-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--pending);
    overflow: hidden;
}

.metric-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--completed);
}

.metric-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.page-stack {
    display: grid;
    gap: var(--space-block);
}

.weld-management-stack {
    display: grid;
    gap: var(--space-block);
}

.assembly-page-stack {
    gap: var(--space-block);
}

.page-stack > *,
.weld-management-stack > *,
.assembly-page-stack > * {
    min-width: 0;
    max-width: 100%;
}

.project-list {
    display: grid;
    gap: var(--space-block);
}

.dashboard-search-card {
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.dashboard-search-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
}

.dashboard-search-spacer {
    display: block;
    min-width: 0;
}

.project-card {
    display: grid;
    gap: 6px;
}

.project-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.project-card-header .section-heading {
    margin-bottom: 0;
}

.project-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.project-card-link:hover {
    color: var(--text);
    transform: translateX(1px);
}

.project-card-link:focus-visible {
    outline: 2px solid rgba(31, 36, 48, 0.18);
    outline-offset: 4px;
    border-radius: 8px;
}

.project-card-link-arrow {
    font-size: 1.2em;
    line-height: 1;
}

.project-card > .section-heading {
    margin-bottom: 0;
}

.project-card > .section-list {
    margin-top: 28px;
}

.project-card-completed {
    background: linear-gradient(180deg, #f4fbf6 0%, #eef9f1 100%);
    border-color: #cdeed7;
}

.project-card-completed .section-heading .muted {
    color: #4a7b5a;
}

.section-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 16px;
    align-items: start;
}

.section-item {
    display: contents;
}

.section-card {
    order: 1;
    border: 1px solid var(--line);
    border-radius: var(--section-card-radius);
    background: var(--surface-muted);
    overflow: hidden;
    box-shadow: var(--tile-shadow);
    position: relative;
    z-index: 1;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.section-card:hover {
    border-color: #cfd5e1;
    transform: translateY(-1px);
    box-shadow: var(--tile-shadow);
}

.section-card-button {
    display: block;
    width: 100%;
    padding: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
    appearance: none;
    transition: background-color 0.18s ease;
}

.section-card-button:hover {
    box-shadow: var(--tile-shadow);
}

.section-card-button.is-active {
    background: #fff;
    box-shadow: var(--tile-shadow);
}

.section-panel-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--section-panel-gap);
    padding: var(--section-panel-padding);
    list-style: none;
    min-height: var(--section-panel-min-height);
}

.section-panel-summary::-webkit-details-marker {
    display: none;
}

.section-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.section-panel-title-row h2 {
    margin: 0;
}

.section-panel-complete-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 2px solid rgba(22, 163, 74, 0.32);
    color: var(--completed);
    background: rgba(237, 249, 240, 0.88);
}

.section-panel-complete-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.section-panel-deadline {
    min-height: 24px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.section-panel-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-panel-cost {
    display: grid;
    gap: 4px;
    padding-top: 4px;
}

.section-list-with-costs {
    grid-auto-rows: auto;
    align-items: stretch;
}

.section-card-with-costs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-card-button.section-card-with-costs {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-panel-summary-with-costs {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 260px;
}

.section-panel-summary-with-costs .section-panel-cost {
    margin-top: auto;
}

.section-panel-cost span {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.section-panel-cost strong {
    font-size: 18px;
    line-height: 1.2;
    color: var(--text);
}

.section-panel-cost .muted {
    font-size: 12px;
}

.section-panel-progress {
    display: grid;
    gap: 8px;
}

.section-panel-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--pending);
    overflow: hidden;
}

.section-panel-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--completed);
}

.section-panel-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.section-panel-stats .status-badge,
.assembly-meta .status-badge {
    min-height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.section-panel-body {
    padding: 24px;
    min-width: 0;
}

.section-detail-panel {
    order: 2;
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, var(--surface-muted) 100%);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-scroll-indicator,
.dashboard-scroll-cue {
    display: none;
}

.dashboard-section-switch-grid,
.assembly-switch-grid {
    gap: 14px;
    min-width: 0;
}

.dashboard-scroll-shell,
.assembly-scroll-shell {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.dashboard-section-switch-grid .quick-switch-row,
.assembly-switch-grid .quick-switch-row {
    display: grid;
    grid-template-columns: repeat(6, minmax(180px, 1fr));
    align-items: center;
    gap: var(--switch-tray-gap);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: var(--switch-tray-padding);
    border-radius: var(--switch-tray-radius);
    background: var(--switch-tray-bg);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.dashboard-section-switch-grid .quick-switch-row::-webkit-scrollbar,
.assembly-switch-grid .quick-switch-row::-webkit-scrollbar {
    display: none;
}

.dashboard-assembly-tab,
.assembly-switch-tab {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: var(--switch-tab-min-height);
    padding: 10px var(--switch-tab-padding-x);
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
    font-weight: 600;
    color: #2b303b;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-assembly-tab:hover,
.assembly-switch-tab:hover {
    background: rgba(255, 255, 255, 0.56);
    border-color: transparent;
}

.dashboard-assembly-tab.is-active:hover,
.assembly-switch-tab.is-active:hover {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18);
}

.dashboard-section-switch-grid {
    gap: 12px;
}

.dashboard-section-switch-grid .quick-switch-row,
.assembly-switch-grid .quick-switch-row {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    align-items: stretch;
    gap: 10px;
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.dashboard-assembly-card {
    --assembly-progress-color: var(--completed);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(78px, 34%);
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    color: var(--text);
    text-align: left;
    text-decoration: none;
    white-space: normal;
    letter-spacing: 0;
}

.dashboard-assembly-card:hover {
    border-color: #d8dce7;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}

.dashboard-assembly-card.is-active,
.dashboard-assembly-card.is-active:hover {
    border-color: rgba(139, 44, 125, 0.62);
    background: linear-gradient(180deg, #fff1ff 0%, #fdf6ff 100%);
    color: var(--text);
    box-shadow: 0 12px 24px rgba(139, 44, 125, 0.14);
}

.dashboard-assembly-card[data-progress-tone="warning"] {
    --assembly-progress-color: #f07a24;
}

.dashboard-assembly-card[data-progress-tone="danger"] {
    --assembly-progress-color: #dc3b25;
}

.dashboard-assembly-card-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
    min-width: 0;
}

.dashboard-assembly-card-heading {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dashboard-assembly-card-title,
.dashboard-assembly-card-subtitle {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dashboard-assembly-card-title {
    font-size: 13px;
    line-height: 1.16;
    font-weight: 800;
    color: var(--text);
}

.dashboard-assembly-card-subtitle {
    font-size: 12px;
    line-height: 1.16;
    font-weight: 700;
    color: var(--text);
}

.dashboard-assembly-card.is-active .dashboard-assembly-card-title {
    color: var(--pending);
}

.dashboard-assembly-card.is-active .dashboard-assembly-card-percent {
    color: var(--pending);
}

.dashboard-assembly-card-percent {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: center;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
}

.dashboard-assembly-card-progress {
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: stretch;
    display: block;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: var(--pending);
    overflow: hidden;
}

.dashboard-assembly-card-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--assembly-progress-color);
}

body.topbar-menu-lock {
    overflow: hidden;
}

.assembly-list {
    display: grid;
    gap: 12px;
}

.assembly-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
}

.assembly-main {
    display: grid;
    gap: 4px;
}

.assembly-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.assembly-title {
    font-size: 16px;
    font-weight: 600;
}

.assembly-link.btn.btn-back.btn-back-compact {
    min-height: 36px;
    padding: 0 8px 0 14px;
    border-radius: 999px;
    font-size: 14px;
    white-space: nowrap;
}

.assembly-link.btn.btn-back.btn-back-compact .btn-back-icon {
    width: 26px;
    height: 26px;
    font-size: 14px;
}

.assembly-item {
    display: grid;
    gap: 10px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title title"
        "meta action";
    align-items: start;
}

.assembly-main {
    display: contents;
}

.assembly-title {
    font-size: 15px;
    grid-area: title;
}

.assembly-meta {
    grid-area: meta;
    gap: 6px;
    flex-wrap: nowrap;
}

.assembly-meta .status-badge {
    min-height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

.assembly-link.btn.btn-back.btn-back-compact {
    grid-area: action;
    justify-self: end;
    align-self: center;
    min-height: 32px;
    padding: 0 8px 0 12px;
    font-size: 13px;
}

.assembly-link.btn.btn-back.btn-back-compact .btn-back-icon {
    width: 22px;
    height: 22px;
    font-size: 13px;
}

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

.form-field {
    display: grid;
    gap: 8px;
    align-content: start;
    min-width: 0;
}

.form-field > label {
    margin: 0;
}

.form-field-span-2,
.form-field-span-3 {
    grid-column: 1 / -1;
}

.admin-form {
    flex: 1;
    align-content: start;
}

.form-submit {
    margin-top: auto;
    padding-top: 8px;
}

.admin-actions-wrap {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 8px;
}

label {
    font-size: var(--font-ui);
    font-weight: 600;
    letter-spacing: -0.008em;
}

input,
textarea,
select,
button {
    width: 100%;
    padding: 13px var(--control-padding-x);
    min-height: var(--control-height);
    border-radius: var(--control-radius);
    border: 1px solid #d7dce5;
    background: #fff;
    color: var(--text);
    font-size: var(--font-ui);
    font-family: inherit;
    font-weight: 400;
    line-height: 1.4;
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
    padding: 0;
}

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

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #b9c1cf;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: var(--control-height);
    padding: 13px var(--control-padding-x);
    text-decoration: none;
    cursor: pointer;
    background: #fff;
    color: var(--text);
    border: 1px solid #d7dce5;
    border-radius: var(--control-radius);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.012em;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-block {
    width: 100%;
}

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

.btn-secondary {
    background: #fff;
    color: var(--text);
}

.btn-danger {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #f0c7c2;
}

.btn-sm {
    min-height: 0;
    padding: 10px 12px;
    border-radius: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.012em;
}

.text-link::after {
    content: "->";
    color: var(--text-muted);
    transition: transform 0.15s ease;
}

.text-link:hover::after {
    transform: translateX(2px);
}

.alert {
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    transform-origin: top center;
    max-height: 120px;
    overflow: hidden;
    animation: alert-auto-hide 4.2s ease forwards;
}

.alert-success {
    color: var(--completed);
    background: var(--completed-soft);
    border-color: #cdeed7;
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: #f7d4d1;
    animation-duration: 5.2s;
}

.form-help-text {
    margin: -2px 0 2px;
    font-size: 14px;
    line-height: 1.5;
}

.alert:hover {
    animation-play-state: paused;
}

@keyframes alert-auto-hide {
    0%,
    78% {
        opacity: 1;
        transform: translateY(0);
        margin-bottom: 16px;
        padding-top: 14px;
        padding-bottom: 14px;
        max-height: 120px;
        border-width: 1px;
    }
    100% {
        opacity: 0;
        transform: translateY(-8px);
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        max-height: 0;
        border-width: 0;
    }
}

.progress-wrap {
    margin-top: 18px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--pending);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: var(--completed);
}

.drawing-frame {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    background: #fff;
}

.drawing-image {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    border: 0;
}

.drawing-image-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.drawing-panel {
    display: grid;
    gap: 16px;
}

.drawing-panel-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.drawing-panel-summary::-webkit-details-marker {
    display: none;
}

.drawing-panel-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.drawing-panel-toggle-label-closed {
    display: none;
}

.drawing-panel-toggle-icon::before {
    content: "\2191";
    font-size: 16px;
    line-height: 1;
}

.drawing-panel:not([open]) .drawing-panel-toggle-label-open,
.section-panel:not([open]) .drawing-panel-toggle-label-open {
    display: none;
}

.drawing-panel:not([open]) .drawing-panel-toggle-label-closed,
.section-panel:not([open]) .drawing-panel-toggle-label-closed {
    display: inline;
}

.drawing-panel:not([open]) .drawing-panel-toggle-icon::before,
.section-panel:not([open]) .drawing-panel-toggle-icon::before {
    content: "\2193";
}

.drawing-gallery {
    display: grid;
    gap: 16px;
}

.drawing-gallery.is-single {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
}

.drawing-gallery.is-dual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawing-item {
    width: 100%;
    max-width: 960px;
}

.drawing-modal-panel {
    max-width: min(92vw, 1440px);
    max-height: calc(100vh - 48px);
    padding: 56px 24px 24px;
    overflow: auto;
}

.drawing-modal-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
}

.detail-list {
    display: grid;
    gap: 0;
}

.detail-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
    border-bottom: 0;
}

.card-divider {
    height: 1px;
    margin: 24px 0;
    background: var(--line);
}

.machine-module-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.machine-module-page-stack {
    gap: 18px;
}

.machine-module-overview-view > .context-bar,
.machine-module-overview-view > .machine-overview-hero-card,
.machine-module-overview-view > .machine-overview-list-card {
    background: transparent;
    border: 0;
    box-shadow: none;
}

.machine-overview-hero-card,
.machine-detail-hero-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    background:
        radial-gradient(circle at top right, rgba(219, 234, 254, 0.65), transparent 34%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.98), #ffffff 220px);
}

.machine-overview-hero-head,
.machine-detail-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.machine-tiles-toolbar,
.machine-detail-toolbar {
    align-items: flex-start;
    gap: 16px;
}

.machine-group-switch {
    margin: 20px 0 22px;
}

.machine-group-switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border-radius: 999px;
    background: #f1f2f8;
    overflow-x: auto;
    scrollbar-width: none;
}

.machine-group-switch-row::-webkit-scrollbar {
    display: none;
}

.machine-group-switch-tab {
    flex: 1 0 150px;
    min-width: max-content;
    min-height: 48px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #2b303b;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.machine-group-switch-tab:hover {
    background: rgba(255, 255, 255, 0.56);
    border-color: transparent;
}

.machine-group-switch-tab.is-active {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18);
    font-weight: 700;
}

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

.machine-tile {
    display: grid;
    gap: 16px;
    min-width: 0;
    position: relative;
    padding: 24px;
    border: 0;
    border-radius: 26px;
    background: var(--surface);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.machine-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.1);
}

.machine-tile.is-selected {
    box-shadow: 0 0 0 2px rgba(41, 98, 255, 0.08), 0 22px 48px rgba(15, 23, 42, 0.1);
}

.machine-tile-card {
    overflow: hidden;
    isolation: isolate;
}

.machine-tile-card > :not(.machine-tile-link-cover) {
    position: relative;
    z-index: 2;
}

.machine-tile-link-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.machine-tile-topline,
.machine-tile-head,
.machine-active-loan-head,
.machine-attachment-group-head,
.machine-document-item,
.machine-recent-attachment,
.machine-history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.machine-tile-copy,
.machine-loan-summary-copy,
.machine-recent-attachment-copy,
.machine-document-copy,
.machine-history-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.machine-tile-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.machine-tile-copy h3 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.12;
}

.machine-tile-badges,
.machine-detail-toolbar-actions,
.machine-active-loan-actions,
.machine-loan-actions,
.machine-document-actions,
.machine-recent-attachment-actions,
.machine-history-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.machine-module-overview-view .machine-tile-badges .status-completed,
.machine-module-overview-view .machine-tile-badges .status-total {
    display: none;
}

.machine-status-available {
    background: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
}

.machine-status-broken {
    background: var(--danger-soft);
    border-color: #f3ceca;
    color: var(--danger);
}

.machine-status-on-job {
    background: #fff7e5;
    border-color: #f0deb0;
    color: #b7791f;
}

.machine-status-at-customer {
    background: #eef4ff;
    border-color: #d7e5ff;
    color: #2556b8;
}

.location-badge {
    background: #f3f7ff;
    border-color: #d7e4fb;
    color: #35527a;
}

.loan-status-active {
    background: #eef4ff;
    border-color: #d7e5ff;
    color: #2556b8;
}

.loan-status-returned {
    background: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
}

.loan-status-damaged {
    background: var(--danger-soft);
    border-color: #f3ceca;
    color: var(--danger);
}

.loan-status-closed {
    background: var(--surface-muted);
    border-color: var(--line);
    color: var(--text-muted);
}

.machine-tile-meta {
    display: grid;
    gap: 10px;
}

.machine-tile-meta-row,
.machine-status-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.machine-tile-meta-row span,
.machine-status-label,
.machine-recent-attachment-copy span,
.machine-document-copy span,
.machine-loan-summary-copy span,
.machine-history-copy span {
    color: var(--text-muted);
}

.machine-tile-meta-row strong,
.machine-status-line strong {
    color: var(--text);
    text-align: right;
}

.machine-tile-foot {
    padding: 14px 16px;
    border: 0;
    border-radius: 18px;
    background: rgba(248, 250, 252, 0.9);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.machine-tile-foot-active {
    background: rgba(239, 246, 255, 0.92);
    color: #1d4ed8;
}

.machine-tile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.machine-detail-card {
    display: grid;
    gap: 18px;
}

.machine-detail-hero-copy {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.machine-detail-hero-copy h2 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.55rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.machine-detail-hero-actions {
    display: grid;
    gap: 10px;
    justify-items: end;
}

.machine-detail-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(239, 246, 255, 0.9);
    border: 1px solid rgba(191, 219, 254, 0.9);
    color: #1e40af;
}

.machine-inline-note {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid #f0deb0;
    background: #fff7e5;
    color: #8a6417;
}

.machine-detail-grid,
.machine-loan-grid,
.machine-return-grid,
.weld-machine-form-grid,
.weld-loan-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.machine-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.95fr);
    gap: 18px;
    align-items: start;
}

.machine-group-select-form {
    display: grid;
    gap: 12px;
}

.machine-detail-main,
.machine-detail-side,
.machine-detail-section,
.machine-side-card {
    display: grid;
    gap: 18px;
}

.machine-detail-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.machine-profile-card {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(226, 232, 240, 0.92);
    background: rgba(248, 250, 252, 0.86);
}

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

.machine-summary-card {
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.86);
}

.machine-summary-card strong {
    display: inline-flex;
    margin-top: 6px;
}

.machine-summary-label {
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.machine-panel {
    min-width: 0;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.machine-panel.machine-panel-nested,
.machine-active-loan-card,
.machine-document-item,
.machine-recent-attachment,
.machine-custom-field-row {
    background: var(--surface);
}

.machine-subheading {
    margin-bottom: 14px;
}

.machine-status-stack,
.machine-recent-attachments,
.machine-loan-list,
.machine-document-list,
.machine-history-list,
.machine-custom-fields-rows,
.machine-attachment-group {
    display: grid;
    gap: 12px;
}

.machine-status-line-note {
    align-items: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.machine-active-loan-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.machine-loan-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-muted);
    overflow: hidden;
}

.machine-loan-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.machine-loan-summary::-webkit-details-marker {
    display: none;
}

.machine-loan-panel:not([open]) .drawing-panel-toggle-label-open {
    display: none;
}

.machine-loan-panel:not([open]) .drawing-panel-toggle-label-closed {
    display: inline;
}

.machine-loan-panel:not([open]) .drawing-panel-toggle-icon::before {
    content: "\2193";
}

.machine-loan-summary-copy strong {
    font-size: 1rem;
}

.machine-loan-summary-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.machine-loan-body {
    padding: 0 20px 20px;
}

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

.machine-image-thumb {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    cursor: zoom-in;
}

.machine-image-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.machine-document-item,
.machine-recent-attachment,
.machine-history-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.machine-history-item {
    background: var(--surface-muted);
}

.machine-history-stamp {
    color: var(--text-muted);
    font-size: 14px;
    white-space: nowrap;
}

.machine-side-card {
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.weld-machine-modal-panel,
.weld-loan-modal-panel {
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
}

.weld-machine-modal-panel {
    max-width: min(980px, 100%);
}

.weld-loan-modal-panel {
    max-width: min(920px, 100%);
}

.machine-custom-field-shell {
    gap: 12px;
}

.machine-custom-field-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.machine-custom-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.55fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.machine-custom-field-remove {
    white-space: nowrap;
}

.machine-custom-field-row.is-system-field {
    background: var(--surface-muted);
}

.machine-return-shell {
    padding: 16px;
    border: 1px dashed #d7dfed;
    border-radius: 16px;
    background: var(--surface-muted);
}

.machine-return-shell.is-hidden {
    display: none;
}

.machine-inline-empty {
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed #d8deea;
    background: var(--surface);
    color: var(--text-muted);
}

.table-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.welds-table {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}

.welds-col-weld {
    width: 92px;
}

.welds-col-status {
    width: 190px;
}

.welds-col-welder {
    width: 190px;
}

.welds-col-date {
    width: 150px;
}

.welds-col-note {
    width: 200px;
}

.welds-col-param {
    width: 200px;
}

.welds-col-detail {
    width: 150px;
}

.table-card th,
.table-card td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.table-card th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--surface-muted);
}

.table-card tr:last-child td {
    border-bottom: 0;
}

.inline-edit-hint {
    display: block;
    margin-top: 6px;
    margin-left: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.admin-inline-note {
    font-size: 13px;
}

.inline-edit-cell {
    position: relative;
}

.inline-edit-input,
.inline-edit-select {
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.2;
}

.inline-edit-input {
    min-width: 140px;
}

.inline-edit-select {
    min-width: 132px;
}

.inline-status-select {
    font-weight: 600;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 20px) calc(50% - 3px),
        calc(100% - 14px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.inline-status-select.inline-status-select-completed {
    background-color: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--completed) 50%),
        linear-gradient(135deg, var(--completed) 50%, transparent 50%);
}

.inline-status-select.inline-status-select-pending {
    background-color: var(--pending-soft);
    border-color: #edd8e8;
    color: var(--pending);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--pending) 50%),
        linear-gradient(135deg, var(--pending) 50%, transparent 50%);
}


.inline-edit-cell.is-saving .inline-edit-input,
.inline-edit-cell.is-saving .inline-edit-select {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.inline-edit-cell.is-saved .inline-edit-input,
.inline-edit-cell.is-saved .inline-edit-select {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.18);
}

.inline-edit-cell.is-error .inline-edit-input,
.inline-edit-cell.is-error .inline-edit-select {
    border-color: #ef4444;
    background: #fff7f7;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.inline-edit-error-message {
    display: none;
    width: 100%;
    max-width: 220px;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    background: #fff1f2;
    color: #b42318;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 8px 18px -16px rgba(190, 24, 93, 0.45);
}

.inline-edit-cell.is-error .inline-edit-error-message:not(:empty) {
    display: block;
}

.metric-value-small {
    font-size: 1rem;
    line-height: 1.45;
}

.montage-detail-form,
.montage-filter-form,
.montage-status-create-form {
    align-items: start;
    column-gap: 16px;
    row-gap: 16px;
}

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

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

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

.montage-filter-form > .btn-row,
.montage-comment-form > .btn-row {
    grid-column: 1 / -1;
}

.montage-filter-form > .montage-month-nav {
    grid-column: 1 / -1;
}

.montage-form-section-label {
    grid-column: 1 / -1;
    padding-top: 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.montage-detail-actions {
    grid-column: 1 / -1;
    justify-content: space-between;
}

.montage-segments-field {
    min-width: 0;
}

.montage-segments-editor {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-soft);
}

.montage-segments-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.montage-segments-head label {
    margin-bottom: 6px;
}

.montage-segments-head .muted {
    margin: 0;
}

.montage-segments-list {
    display: grid;
    gap: 10px;
}

.montage-segment-row {
    display: grid;
    grid-template-columns: minmax(145px, 0.8fr) minmax(145px, 0.8fr) minmax(220px, 1.4fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
}

.montage-segment-row .form-field {
    min-width: 0;
}

.montage-segment-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.montage-segments-empty {
    padding: 16px;
    border-radius: 18px;
}

.montage-comment-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.montage-comment-card {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
}

.montage-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.montage-comment-body {
    margin-bottom: 10px;
    color: var(--text);
    line-height: 1.55;
}

.montage-inline-select {
    min-width: 148px;
    font-weight: 600;
}

.montage-inline-date {
    min-width: 140px;
}

.montage-timeline-card {
    overflow: hidden;
}

.schedule-page .page-stack > *,
.schedule-page .grid-two,
.schedule-page .stats-grid,
.schedule-page .table-card,
.schedule-page .card {
    min-width: 0;
}

.schedule-page .grid-two,
.schedule-page .admin-grid {
    align-items: start;
}

.schedule-page .admin-grid > .card {
    height: auto;
}

.montage-switch-card {
    position: relative;
    display: grid;
    align-items: center;
    justify-items: center;
    min-height: 108px;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.montage-switch-actions {
    position: absolute;
    top: 16px;
    right: 24px;
    justify-content: flex-end;
}

.montage-switch-grid {
    width: min(760px, 100%);
    max-width: 760px;
    margin: 0 auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.montage-switch-card .quick-switch-tab {
    overflow: hidden;
    text-overflow: ellipsis;
}

.montage-switch-card .quick-switch-tab.is-active {
    min-width: 0;
}

.montage-dashboard-timeline-card .montage-timeline-shell {
    --montage-timeline-label-width: 220px;
}

.montage-dashboard-filter-card {
    width: 100%;
}

.montage-dashboard-filter-form .montage-dashboard-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
}

.montage-overview-table {
    min-width: 2380px;
    table-layout: fixed;
}

.montage-overview-table th:nth-child(1),
.montage-overview-table td:nth-child(1) {
    width: 260px;
}

.montage-overview-table th:nth-child(2),
.montage-overview-table td:nth-child(2) {
    width: 440px;
}

.montage-overview-table th:nth-child(3),
.montage-overview-table td:nth-child(3) {
    width: 160px;
}

.montage-overview-table th:nth-child(4),
.montage-overview-table td:nth-child(4),
.montage-overview-table th:nth-child(5),
.montage-overview-table td:nth-child(5) {
    width: 190px;
}

.montage-overview-table th:nth-child(6),
.montage-overview-table td:nth-child(6),
.montage-overview-table th:nth-child(8),
.montage-overview-table td:nth-child(8) {
    width: 170px;
}

.montage-overview-table th:nth-child(7),
.montage-overview-table td:nth-child(7) {
    width: 150px;
}

.montage-overview-table th:nth-child(9),
.montage-overview-table td:nth-child(9),
.montage-overview-table th:nth-child(10),
.montage-overview-table td:nth-child(10),
.montage-overview-table th:nth-child(11),
.montage-overview-table td:nth-child(11),
.montage-overview-table th:nth-child(12),
.montage-overview-table td:nth-child(12) {
    width: 170px;
}

.montage-overview-table th:nth-child(13),
.montage-overview-table td:nth-child(13) {
    width: 180px;
}

.montage-overview-table th:nth-child(14),
.montage-overview-table td:nth-child(14) {
    width: 170px;
}

.montage-overview-table th:nth-child(15),
.montage-overview-table td:nth-child(15) {
    width: 170px;
}

.montage-overview-identity-cell {
    vertical-align: middle;
}

.montage-overview-link {
    display: grid;
    min-width: 0;
    gap: 4px;
    color: var(--text);
    text-decoration: none;
}

.montage-overview-link:hover .montage-overview-title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.montage-overview-title {
    display: block;
    overflow: visible;
    overflow-wrap: normal;
    word-break: normal;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.012em;
    white-space: normal;
}

.montage-overview-meta {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.montage-month-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
}

.montage-month-switch strong {
    min-width: 64px;
    text-align: center;
    font-size: 0.95rem;
}

.montage-timeline-shell {
    --timeline-day-width: 40px;
    --montage-timeline-label-width: 260px;
    --montage-timeline-tray-padding: var(--switch-tray-padding);
    --montage-timeline-tray-radius: var(--switch-tray-radius);
    --montage-timeline-pill-gap: 4px;
    --montage-timeline-column-gap: 0px;
    --montage-timeline-track-padding: 0px;
    --montage-timeline-track-height: 64px;
    --montage-timeline-row-height: calc(var(--montage-timeline-track-height) + (var(--montage-timeline-tray-padding) * 2));
    --montage-timeline-bar-height: 44px;
    --montage-timeline-row-gap: 12px;
    display: grid;
    gap: var(--montage-timeline-row-gap);
    overflow-x: auto;
    padding-bottom: 6px;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable both-edges;
}

.montage-timeline-header,
.montage-timeline-row {
    display: grid;
    grid-template-columns: var(--montage-timeline-label-width) max-content;
    gap: 14px;
    align-items: stretch;
    width: max-content;
    min-width: 100%;
}

.montage-timeline-body {
    display: grid;
    gap: 0;
    width: max-content;
    min-width: 100%;
}

.montage-timeline-label-col {
    min-width: 0;
    min-height: var(--montage-timeline-row-height);
    position: sticky;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.montage-timeline-label-col-head {
    z-index: 5;
    display: flex;
    align-items: center;
    min-height: var(--montage-timeline-row-height);
    padding: 0 18px 0 0;
    border: 0;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: transparent;
    box-shadow: none;
}

.montage-timeline-label-pill {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    min-height: var(--montage-timeline-bar-height);
    height: var(--montage-timeline-bar-height);
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 0 18px;
    border: 1px solid var(--montage-timeline-border, rgba(148, 163, 184, 0.18));
    border-radius: calc(var(--montage-timeline-tray-radius) - 6px);
    background: linear-gradient(180deg, var(--montage-timeline-gradient-start, #94a3b8) 0%, var(--montage-timeline-gradient-end, #64748b) 100%);
    color: var(--montage-timeline-text, #fff);
    text-decoration: none;
    overflow: hidden;
    box-shadow: none;
    transition: filter 0.15s ease, border-color 0.15s ease;
}

.montage-timeline-label-pill:hover {
    filter: brightness(0.98);
}

.montage-timeline-label-primary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.montage-timeline-label-secondary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 600;
    color: var(--montage-timeline-subtext, rgba(255, 255, 255, 0.84));
}

.montage-timeline-header-grid {
    display: grid;
    gap: 0;
    width: max-content;
}

.montage-timeline-grid {
    display: grid;
    grid-template-columns: repeat(var(--timeline-days), var(--timeline-day-width));
    column-gap: var(--montage-timeline-column-gap);
    width: max-content;
}

.montage-timeline-month-segment {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-top: 1px solid #dde4ef;
    border-bottom: 1px solid #dde4ef;
    border-right: 1px solid #dde4ef;
    border-radius: 0;
    background: #fff;
    color: #596579;
    font-size: 13px;
    font-weight: 700;
    box-sizing: border-box;
    justify-content: center;
}

.montage-timeline-month-segment.is-anchor-month {
    background: #f7faff;
    color: #1f2430;
}

.montage-timeline-months-grid {
    overflow: hidden;
    border-left: 1px solid #dde4ef;
    border-radius: 0;
    background: #fff;
}

.montage-timeline-day {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0;
    border-top: 1px solid #dde4ef;
    border-bottom: 1px solid #dde4ef;
    border-right: 1px solid #dde4ef;
    border-radius: 0;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #2b303b;
    background: #fff;
    box-sizing: border-box;
}

.montage-timeline-day.is-anchor-month {
    background: #fff;
}

.montage-timeline-days-grid {
    overflow: hidden;
    border-left: 1px solid #dde4ef;
    border-radius: 0;
    background: #fff;
    margin-top: -1px;
}

.montage-timeline-track {
    position: relative;
    min-height: var(--montage-timeline-row-height);
    width: max-content;
    padding: var(--montage-timeline-track-padding);
    border-radius: 0;
    background: #fff;
    border: 1px solid #dde4ef;
    box-shadow: none;
    overflow: hidden;
}

.montage-timeline-track > .montage-timeline-grid {
    min-height: var(--montage-timeline-row-height);
    height: var(--montage-timeline-row-height);
    align-items: stretch;
}

.montage-timeline-body .montage-timeline-row + .montage-timeline-row .montage-timeline-track,
.montage-timeline-body .montage-timeline-row + .montage-timeline-row .montage-timeline-label-col {
    border-top: 0;
}

.montage-timeline-cell {
    min-height: var(--montage-timeline-row-height);
    height: 100%;
    align-self: stretch;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    background: #fff;
    box-sizing: border-box;
}

.montage-timeline-cell.is-anchor-month {
    background: #fff;
}

.montage-timeline-cell.is-weekend,
.montage-timeline-day.is-weekend {
    background: #f7f9fd;
    color: #445062;
}

.montage-timeline-cell.is-anchor-month.is-weekend {
    background: #f7f9fd;
}

.montage-timeline-day.is-anchor-month.is-weekend {
    background: #f7f9fd;
}

.montage-timeline-day.is-today {
    background: #fcfbff;
    color: #7c2392;
    box-shadow: inset 0 3px 0 rgba(124, 35, 146, 0.32);
}

.montage-timeline-day.is-today::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 7px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 999px;
    background: rgba(124, 35, 146, 0.75);
}

.montage-timeline-bar {
    position: absolute;
    top: calc((var(--montage-timeline-row-height) - var(--montage-timeline-bar-height)) / 2);
    left: calc(var(--montage-timeline-track-padding) + (var(--timeline-start-offset, 0) * var(--timeline-day-width)) + (var(--timeline-start-offset, 0) * var(--montage-timeline-column-gap)) + var(--montage-timeline-pill-gap));
    width: max(calc((var(--timeline-span, 1) * var(--timeline-day-width)) + (var(--timeline-gap-span, 0) * var(--montage-timeline-column-gap)) - (var(--montage-timeline-pill-gap) * 2)), var(--montage-timeline-min-bar-width, 52px));
    min-height: var(--montage-timeline-bar-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--montage-timeline-border, rgba(148, 163, 184, 0.18));
    border-radius: 999px;
    background: linear-gradient(180deg, var(--montage-timeline-gradient-start, #94a3b8) 0%, var(--montage-timeline-gradient-end, #64748b) 100%);
    font-size: 13px;
    font-weight: 700;
    color: var(--montage-timeline-text, #fff);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    z-index: 2;
    box-shadow: none;
    transition: filter 0.15s ease;
}

.montage-timeline-bar:hover {
    filter: brightness(0.98);
}

.montage-timeline-bar.is-segment {
    --montage-timeline-min-bar-width: 36px;
}

.montage-timeline-bar span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

@media (max-width: 1180px) {
    .montage-timeline-shell {
        --timeline-day-width: 34px;
    }

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

    .montage-dashboard-timeline-card .table-toolbar-frame {
        grid-template-columns: minmax(0, 1fr);
    }

    .montage-dashboard-timeline-card .table-toolbar-center,
    .montage-dashboard-timeline-card .table-toolbar-actions {
        justify-self: start;
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .montage-switch-card {
        padding-left: 0;
        padding-right: 0;
        min-height: 0;
        align-items: stretch;
        justify-items: stretch;
    }

    .montage-switch-actions {
        position: static;
        justify-content: flex-start;
    }

    .montage-switch-grid {
        width: 100%;
        max-width: none;
    }

    .montage-detail-form,
    .montage-filter-form,
    .montage-status-create-form {
        grid-template-columns: 1fr;
    }

    .montage-segments-head,
    .montage-segment-row {
        grid-template-columns: 1fr;
    }

    .montage-segments-head {
        display: grid;
    }

    .montage-segment-actions {
        justify-content: flex-start;
    }

    .montage-timeline-shell {
        --timeline-day-width: 30px;
        --montage-timeline-label-width: 190px;
    }

    .montage-timeline-label-col {
        padding: 10px;
    }
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.guest-board-shell {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.guest-freeze-pane {
    --guest-frozen-name-width: 250px;
    --guest-frozen-company-width: 200px;
    overflow: auto;
    max-height: clamp(380px, 74vh, 860px);
    max-width: 100%;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
}

.guest-board {
    width: max-content;
    min-width: 2200px;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}

.guest-board th,
.guest-board td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    background: var(--surface);
}

.guest-board thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    background: var(--surface-muted);
    box-shadow: inset 0 -1px 0 var(--line);
}

.guest-freeze-pane .guest-board thead th:first-child,
.guest-freeze-pane .guest-board tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    overflow: hidden;
    background-clip: padding-box;
}

.guest-freeze-pane .guest-board thead th:first-child {
    z-index: 14;
    background: var(--surface-muted);
}

.guest-freeze-pane .guest-board tbody td:nth-child(2) {
    position: static;
    left: auto;
    z-index: auto;
    overflow: visible;
    background: var(--surface);
    background-clip: border-box;
}

.guest-freeze-pane .guest-board thead th:nth-child(2) {
    background: var(--surface-muted);
}

.guest-freeze-pane .guest-board thead th:first-child::before,
.guest-freeze-pane .guest-board tbody td:first-child::before,
.guest-freeze-pane .guest-board thead th:nth-child(2)::before,
.guest-freeze-pane .guest-board tbody td:nth-child(2)::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--line);
    pointer-events: none;
    z-index: 3;
}

.guest-freeze-pane .guest-board thead th:first-child::after,
.guest-freeze-pane .guest-board tbody td:first-child::after,
.guest-freeze-pane .guest-board thead th:nth-child(2)::after,
.guest-freeze-pane .guest-board tbody td:nth-child(2)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: var(--line);
    pointer-events: none;
    z-index: 3;
}

.guest-freeze-pane .guest-board tbody td:nth-child(2)::before,
.guest-freeze-pane .guest-board tbody td:nth-child(2)::after {
    display: none;
}

.guest-board tr:last-child td {
    border-bottom: 0;
}

.guest-board tr td:last-child,
.guest-board tr th:last-child {
    border-right: 0;
}

.guests-table {
    table-layout: fixed;
}

.guests-col-name {
    min-width: var(--guest-frozen-name-width);
    width: var(--guest-frozen-name-width);
}

.guests-col-company {
    min-width: var(--guest-frozen-company-width);
    width: var(--guest-frozen-company-width);
}

.guests-col-status {
    width: 150px;
}

.guests-col-compact {
    width: 122px;
}

.guests-col-note {
    width: 240px;
}

.guests-col-contact {
    width: 128px;
}

.guests-col-actions {
    width: 128px;
}

.guest-board td {
    overflow: hidden;
}

.guest-board td input,
.guest-board td textarea,
.guest-board td select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.guest-status-stack,
.guest-toggle-stack,
.guest-contact-stack {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.guest-status-stack {
    justify-items: center;
    text-align: center;
    white-space: nowrap;
    align-content: start;
}

.guest-toggle-stack {
    justify-items: center;
    text-align: center;
    align-content: start;
}

.guest-contact-stack {
    align-content: start;
    gap: 12px;
}

.guest-contact-field {
    display: grid;
    gap: 8px;
}

.guest-contact-field > span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.guest-status-select {
    min-width: 88px;
    max-width: 92px;
    min-height: 34px;
    padding: 6px 30px 6px 10px;
    text-align-last: center;
    background-position:
        calc(100% - 15px) calc(50% - 3px),
        calc(100% - 9px) calc(50% - 3px);
}

.guest-status-select.guest-status-select-yes {
    background-color: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--completed) 50%),
        linear-gradient(135deg, var(--completed) 50%, transparent 50%);
}

.guest-status-select.guest-status-select-no {
    background-color: var(--danger-soft);
    border-color: #f7d4d1;
    color: var(--danger);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--danger) 50%),
        linear-gradient(135deg, var(--danger) 50%, transparent 50%);
}

.guest-status-select.guest-status-select-empty {
    background-color: #f3f4f6;
    border-color: #d7dce5;
    color: var(--text-muted);
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
}

.guest-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

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

.guest-toggle-compact {
    justify-content: center;
    min-height: 24px;
}

.guest-toggle-stack-compact {
    gap: 4px;
}

.guest-status-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
}

.guest-status-row-toggle {
    gap: 12px;
}

.guest-inline-textarea {
    resize: vertical;
    min-height: 34px;
    height: 34px;
    line-height: 1.2;
    padding-top: 7px;
    padding-bottom: 7px;
}

.guest-badge {
    justify-self: center;
    min-width: 54px;
}

.guest-badge-yes {
    background: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
}

.guest-badge-no {
    background: var(--danger-soft);
    border-color: #f7d4d1;
    color: var(--danger);
}

.guest-meta {
    font-size: 10px;
    line-height: 1.2;
    min-height: 1.2em;
}

.guest-contact-link {
    width: 100%;
    white-space: nowrap;
    justify-content: center;
}

.guest-action-column {
    min-width: 0;
}

.guest-action-column {
    display: table-cell;
}

.guest-table-open-btn {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px;
    justify-content: center;
}

.guest-board tbody td:nth-child(10),
.guest-board tbody td:nth-child(11) {
    vertical-align: top;
}

.guest-modal-panel {
    max-width: 560px;
}

.guest-detail-modal-panel {
    max-width: 860px;
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.guest-modal-form,
.guest-modal-stack {
    display: grid;
    gap: 14px;
}

.guest-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.guest-modal-stack .btn {
    width: 100%;
    justify-content: center;
}

.guest-modal-note {
    font-size: 13px;
    line-height: 1.5;
}

.guest-modal-note-success {
    color: var(--completed);
    font-weight: 600;
}

.guest-detail-row td {
    background: #fafbfe;
    padding-top: 0 !important;
    position: static !important;
    left: auto !important;
}

.guest-detail-row td::before,
.guest-detail-row td::after {
    display: none !important;
}

.guest-detail-panel {
    display: grid;
    gap: 16px;
    padding: 18px 0 4px;
}

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

.guest-detail-field {
    display: grid;
    gap: 8px;
}

.guest-detail-field > span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.guest-detail-field-full {
    grid-column: 1 / -1;
}

.guest-detail-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 13px;
}

.guest-action-column .btn {
    justify-content: center;
    width: 100%;
}

.guest-table-card .table-toolbar-frame {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px 20px;
    margin-bottom: 26px;
}

.guest-table-card .table-toolbar-center {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
    align-self: center;
    justify-self: center;
    min-width: 0;
    pointer-events: none;
    z-index: 1;
}

.guest-table-card .table-toolbar-actions {
    grid-column: 3;
    grid-row: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    align-self: center;
    gap: 12px;
    flex-wrap: nowrap;
    min-width: 0;
    position: relative;
    z-index: 2;
}

.guest-table-card .table-toolbar-actions > * {
    flex: 0 0 auto;
}

.guest-table-card .section-heading {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    align-self: center;
    position: relative;
    z-index: 2;
}

.guest-table-card .section-heading h2 {
    margin: 0;
}

.guest-table-card .guest-board-shell {
    margin-bottom: 10px;
}

.guest-table-card .table-toolbar-actions .btn {
    min-width: 0;
    padding: 13px var(--control-padding-x);
    font-size: var(--font-ui);
    font-family: inherit;
    font-weight: 600;
    line-height: 1.2;
}

.guest-toolbar-inline-form {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
}

.guest-import-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.admin-edit-table-shell {
    overflow: auto;
    resize: horizontal;
    max-width: 100%;
}

.admin-edit-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.admin-edit-table th,
.admin-edit-table td {
    vertical-align: top !important;
}

.admin-edit-table tr {
    vertical-align: top;
}

.admin-edit-table td {
    padding-top: 18px;
    padding-bottom: 18px;
}

.admin-edit-table td > form[id]:first-child,
.admin-edit-table td > input,
.admin-edit-table td > textarea,
.admin-edit-table td > select,
.admin-edit-table td > .muted,
.admin-edit-table td > .table-actions,
.admin-edit-table td > .pill,
.admin-edit-table td > .status-badge {
    margin-top: 0;
}

.admin-edit-table td > form[id]:first-child {
    display: none;
}

.admin-edit-table td input,
.admin-edit-table td textarea,
.admin-edit-table td select {
    min-width: 150px;
}

.admin-edit-table .table-actions {
    align-items: stretch;
    flex-direction: column;
    flex-wrap: nowrap;
}

.admin-edit-table .table-actions .btn,
.admin-edit-table .table-actions .inline-form {
    width: 100%;
}

.roles-table td:nth-child(1) input {
    min-width: 170px;
}

.roles-table td select {
    min-width: 170px;
}

.roles-table td:nth-last-child(2) {
    min-width: 96px;
    white-space: nowrap;
}

.roles-table th:last-child,
.roles-table td:last-child {
    min-width: 118px;
}

.users-table-shell {
    overflow: auto;
    resize: horizontal;
    max-width: 100%;
}

.users-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.users-company-filter {
    display: grid;
    gap: 8px;
    min-width: 240px;
}

.users-company-filter label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.users-company-filter select {
    min-width: 240px;
}

.users-table td:nth-child(1),
.users-table td:nth-child(2) {
    min-width: 170px;
    white-space: nowrap;
}

.users-table td:nth-child(3) input {
    min-width: 220px;
}

.users-table td:nth-child(4) select,
.users-table td:nth-child(5) select,
.users-table td:nth-child(6) select,
.users-table td:nth-child(7) select {
    min-width: 200px;
}

.users-table .account-company-cell select.is-missing-company {
    border-color: #f2c27b;
    background: #fff9ef;
    color: #8a5a12;
    font-weight: 600;
}

.users-table td:nth-child(9) select {
    min-width: 190px;
}

.users-table td:nth-child(11) input {
    min-width: 220px;
}

.users-table th:nth-child(12),
.users-table td:nth-child(12) {
    min-width: 150px;
    white-space: nowrap;
}

.users-table td:nth-child(10) {
    min-width: 118px;
}

.users-table td:nth-child(8) {
    min-width: 120px;
    text-align: center;
}

.users-table td:nth-child(8) .table-checkbox-center {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 56px;
}

.users-table td:nth-child(8) .table-checkbox-center input {
    width: 22px;
    height: 22px;
    margin: 0;
}

.users-table .table-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.users-table .table-actions .btn,
.users-table .table-actions .inline-form {
    width: auto;
}

.material-project-panel .table-shell {
    overflow: auto;
}

.material-project-panel table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.material-project-panel td:nth-child(1) input {
    min-width: 180px;
}

.material-project-panel td:nth-child(2) input {
    min-width: 420px;
}

.material-project-panel td:nth-child(3) input {
    min-width: 130px;
}

.material-project-panel td:nth-child(4) input {
    min-width: 120px;
}

.material-project-panel th:nth-child(5),
.material-project-panel td:nth-child(5) {
    min-width: 180px;
    white-space: nowrap;
}

.material-project-count {
    color: var(--text-muted);
}

.account-activity-table td:nth-child(1) {
    min-width: 170px;
    white-space: nowrap;
}

.account-activity-table td:nth-child(3),
.account-activity-table td:nth-child(5) {
    min-width: 180px;
}

.account-activity-table td:nth-child(4) {
    min-width: 320px;
}

.account-activity-table td:nth-child(6) {
    min-width: 280px;
}

.activity-log-cell {
    white-space: normal;
}

.activity-log-meta {
    margin-top: 6px;
    overflow-wrap: anywhere;
}

.projects-table th,
.projects-table td {
    vertical-align: middle !important;
}

.projects-table tr {
    vertical-align: middle;
}

.projects-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.projects-table td:nth-child(1) input,
.projects-table td:nth-child(2) input {
    min-width: 220px;
}

.projects-table td:nth-child(3) {
    min-width: 96px;
    white-space: nowrap;
}

.projects-table td:nth-child(4),
.projects-table td:nth-child(5) {
    min-width: 64px;
    white-space: nowrap;
}

.projects-table td:nth-child(6) select {
    min-width: 180px;
}

.projects-table .table-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.projects-table .table-actions .btn,
.projects-table .table-actions .inline-form {
    width: auto;
}

.sections-table th,
.sections-table td,
.frames-table th,
.frames-table td {
    vertical-align: middle !important;
}

.sections-table tr,
.frames-table tr {
    vertical-align: middle;
}

.sections-table td,
.frames-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.sections-table td:nth-child(1) {
    min-width: 140px;
}

.sections-table td:nth-child(2) input {
    min-width: 220px;
}

.sections-table td:nth-child(3) input {
    min-width: 160px;
}

.sections-table td:nth-child(4) {
    min-width: 520px;
}

.sections-table td:nth-child(5) {
    min-width: 72px;
    white-space: nowrap;
}

.sections-table .table-actions,
.frames-table .table-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.sections-table .table-actions .btn,
.sections-table .table-actions .inline-form,
.frames-table .table-actions .btn,
.frames-table .table-actions .inline-form {
    width: auto;
}

.frames-table td:nth-child(2),
.frames-table td:nth-child(3),
.frames-table td:nth-child(6) {
    white-space: nowrap;
}

.frames-table td:nth-child(4) input {
    min-width: 220px;
}

.frames-table td:nth-child(5) {
    min-width: 320px;
}

.employees-table-shell {
    overflow: auto;
    resize: horizontal;
    max-width: 100%;
}

.employees-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
}

.employees-table td input,
.employees-table td select {
    min-width: 132px;
}

.employees-table td:nth-child(3) select {
    min-width: 170px;
}

.employees-table td:nth-child(4) input,
.employees-table td:nth-child(5) input {
    min-width: 160px;
}

.employees-table td:nth-child(6) select {
    min-width: 130px;
}

.employees-table td:nth-child(7),
.employees-table td:nth-child(8) {
    min-width: 120px;
    vertical-align: middle;
    white-space: nowrap;
}

.employees-table td:nth-child(9) {
    min-width: 118px;
}

.table-toolbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.table-toolbar-frame {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.table-toolbar-frame .section-heading {
    margin-bottom: 0;
}

.table-toolbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    padding-top: 2px;
}

.table-toolbar-frame .table-toolbar-actions {
    justify-content: flex-end;
    align-self: start;
}

.table-context-pill {
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    padding: 12px 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(124, 35, 146, 0.18);
    color: #fff;
}

.table-filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
    gap: 18px 12px;
    align-items: end;
    margin-bottom: 16px;
}

.table-filter-form label {
    display: grid;
    gap: 10px;
}

.assembly-filter-form {
    grid-template-columns:
        minmax(160px, 1.2fr)
        minmax(160px, 1fr)
        minmax(180px, 1fr)
        minmax(170px, 1fr)
        minmax(170px, 1fr)
        auto;
}

.table-filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.bulk-actions-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.bulk-actions-select {
    min-width: 240px;
}

.price-lists-page .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.price-lists-page .metric-card-link {
    position: relative;
    min-height: 118px;
    border-color: var(--line);
    outline: 0;
}

.price-lists-page .metric-card-link.is-active {
    border-color: var(--line);
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.price-lists-page .metric-card-completed.metric-card-link.is-active {
    border-color: #cdeed7;
}

.price-lists-page .metric-card-pending.metric-card-link.is-active {
    border-color: #edd8e8;
}

.price-lists-page .metric-card-danger.metric-card-link.is-active {
    border-color: #f3ceca;
}

.price-lists-page .price-list-results-card {
    padding: 28px;
}

.price-lists-page .price-list-results-toolbar {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.price-lists-page .price-list-results-toolbar .section-heading {
    margin-bottom: 0;
}

.price-lists-page .price-list-results-toolbar .table-toolbar-actions {
    align-items: center;
    gap: 10px;
    padding-top: 2px;
}

.price-lists-page .price-list-results-toolbar .inline-form {
    display: inline-flex;
    margin: 0;
}

.price-lists-page .price-list-filter-form {
    grid-template-columns:
        minmax(170px, 0.95fr)
        minmax(180px, 1fr)
        minmax(260px, 1.55fr)
        minmax(170px, 0.95fr)
        minmax(150px, 0.8fr)
        auto;
    gap: 14px;
    align-items: end;
    margin: 0 0 18px;
}

.price-lists-page .price-list-filter-form .form-field {
    gap: 8px;
}

.price-lists-page .price-list-filter-form label {
    display: block;
    color: var(--text);
}

.price-lists-page .price-list-filter-form input,
.price-lists-page .price-list-filter-form select {
    width: 100%;
    min-width: 0;
}

.price-lists-page .price-list-filter-form .table-filter-actions {
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: nowrap;
}

.price-lists-page .price-list-bulk-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
}

.price-lists-page .price-list-bulk-form .bulk-actions-select {
    flex: 1 1 260px;
    min-width: 220px;
}

.price-lists-page .price-list-items-shell {
    resize: none;
}

.price-lists-page .price-list-items-table {
    width: max-content;
    min-width: 2320px;
    table-layout: fixed;
}

.price-lists-page .price-list-items-table th,
.price-lists-page .price-list-items-table td {
    vertical-align: top;
}

.price-lists-page .price-list-col-check {
    width: 54px;
}

.price-lists-page .price-list-col-code {
    width: 140px;
}

.price-lists-page .price-list-col-name {
    width: 540px;
    min-width: 540px;
}

.price-lists-page .price-list-col-name span {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.35;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-lists-page .price-list-col-short {
    width: 140px;
}

.price-lists-page .price-list-col-number {
    width: 138px;
    min-width: 138px;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.price-lists-page th.price-list-col-number {
    text-align: right;
}

.price-lists-page td.price-list-col-number strong {
    white-space: nowrap;
}

.price-lists-page .price-list-col-reason {
    width: 360px;
    line-height: 1.35;
}

.price-lists-page .price-list-col-status {
    width: 230px;
}

.price-lists-page .price-list-col-status .status-badge {
    display: inline-flex;
    margin: 0 6px 6px 0;
    white-space: nowrap;
}

.price-lists-page .price-list-items-table td:not(.price-list-col-name):not(.price-list-col-reason) {
    word-break: normal;
}

.price-lists-page .price-list-table-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
}

.price-lists-page .price-list-module-stage {
    gap: 26px;
}

.price-lists-page .price-list-module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.price-lists-page .price-list-module-card {
    min-height: 260px;
}

.price-lists-page .price-compare-card {
    display: grid;
    gap: 18px;
    padding: 28px;
}

.price-lists-page .price-compare-upload-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.price-lists-page .price-compare-upload-form input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.price-lists-page .price-compare-form {
    display: grid;
    gap: 18px;
}

.price-lists-page .price-compare-primary-switch {
    display: grid;
    gap: 10px;
    width: min(100%, 560px);
    max-width: 560px;
    margin: 0 auto;
}

.price-lists-page .price-compare-primary-switch-head label {
    display: block;
    color: var(--text);
    font-weight: 700;
    text-align: center;
}

.price-lists-page .price-compare-primary-switch-control {
    width: 100%;
}

.price-lists-page .price-compare-primary-switch .price-compare-switch {
    width: 100%;
}

.price-lists-page .price-compare-primary-switch .quick-switch-tab {
    min-height: 58px;
    font-size: 16px;
}

.price-lists-page .price-compare-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 900px);
    gap: 14px;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.price-lists-page .price-compare-form-grid .form-field {
    display: grid;
    gap: 8px;
}

.price-lists-page .price-compare-switch {
    display: flex;
    gap: var(--switch-tray-gap);
    padding: var(--switch-tray-padding);
    border-radius: var(--switch-tray-radius);
    background: var(--switch-tray-bg);
}

.price-lists-page .price-compare-switch .quick-switch-tab {
    flex: 1 1 0;
    min-height: var(--switch-tab-min-height);
    border: 0;
    border-radius: 999px;
    background: transparent;
    cursor: pointer;
}

.price-lists-page .price-compare-switch .quick-switch-tab:hover {
    background: rgba(255, 255, 255, 0.62);
}

.price-lists-page .price-compare-switch .quick-switch-tab.is-active,
.price-lists-page .price-compare-switch .quick-switch-tab:has(input:checked) {
    background: linear-gradient(180deg, #9f2aa0 0%, #7c2392 100%);
    color: #fff;
}

.price-lists-page .price-compare-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.price-lists-page .price-compare-input-field textarea {
    width: 100%;
    min-height: 132px;
    resize: vertical;
}

.price-lists-page .price-compare-input-field {
    width: 100%;
}

.price-lists-page .price-compare-input-field label {
    text-align: center;
}

.price-lists-page .price-compare-submit-field {
    display: grid;
    justify-items: center;
}

.price-lists-page .price-compare-submit-field .btn {
    min-height: 48px;
    min-width: 220px;
}

.price-lists-page .price-compare-summary {
    margin-top: 2px;
}

.price-lists-page .price-compare-table {
    min-width: 1320px;
    table-layout: fixed;
}

.price-lists-page .price-compare-table th,
.price-lists-page .price-compare-table td {
    vertical-align: top;
}

.price-lists-page .price-compare-table th:nth-child(1),
.price-lists-page .price-compare-table td:nth-child(1) {
    width: 140px;
}

.price-lists-page .price-compare-table th:nth-child(2),
.price-lists-page .price-compare-table td:nth-child(2) {
    width: 360px;
}

.price-lists-page .price-compare-table th:nth-child(4),
.price-lists-page .price-compare-table td:nth-child(4) {
    width: 240px;
}

@media (max-width: 1180px) {
    .price-lists-page .price-list-filter-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .price-lists-page .price-list-filter-form .table-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .price-lists-page .price-compare-form-grid,
    .price-lists-page .price-list-module-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .price-lists-page .price-list-results-card {
        padding: 20px;
    }

    .price-lists-page .price-list-filter-form {
        grid-template-columns: 1fr;
    }

    .price-lists-page .price-list-filter-form .table-filter-actions,
    .price-lists-page .price-list-bulk-form,
    .price-lists-page .price-list-results-toolbar .table-toolbar-actions {
        align-items: stretch;
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .price-lists-page .price-list-filter-form .table-filter-actions .btn,
    .price-lists-page .price-list-bulk-form .btn,
    .price-lists-page .price-list-results-toolbar .table-toolbar-actions .btn,
    .price-lists-page .price-list-results-toolbar .inline-form {
        width: 100%;
    }

    .price-lists-page .price-compare-card {
        padding: 20px;
    }

    .price-lists-page .price-compare-switch {
        min-width: 0;
    }
}

.project-row.dragging {
    opacity: 0.5;
}

.project-order-cell {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.drag-handle {
    width: auto;
    min-width: 40px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px dashed #c7cfdb;
    background: var(--surface-muted);
    color: var(--text-muted);
    cursor: grab;
    font-size: 16px;
    line-height: 1;
}

.drag-handle:active {
    cursor: grabbing;
}

.upload-field {
    display: grid;
    gap: 8px;
    min-width: 220px;
}

.upload-pair {
    display: grid;
    gap: 6px;
}

.attendance-time-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr));
    gap: 8px;
}

.weld-code {
    display: inline-flex;
    min-width: 48px;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: var(--surface-muted);
    border: 1px solid var(--line);
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
}

.status-completed {
    background: var(--completed-soft);
    border-color: #cdeed7;
    color: var(--completed);
}

.status-pending {
    background: var(--pending-soft);
    border-color: #edd8e8;
    color: var(--pending);
}

.status-total {
    background: var(--surface);
    color: var(--text-muted);
    border: 1px solid var(--line);
}

.note-text {
    color: var(--text-muted);
}

.history-change-list {
    display: grid;
    gap: 6px;
}

.history-change-item {
    color: var(--text);
    line-height: 1.45;
}

.history-meta {
    color: var(--text-muted);
    white-space: nowrap;
}

.attendance-toolbar-form {
    display: grid;
    grid-template-columns: minmax(420px, auto) minmax(240px, 1fr) minmax(180px, 220px) minmax(180px, 220px) auto;
    gap: 12px;
    align-items: end;
}

.attendance-month-nav,
.attendance-toolbar-actions,
.attendance-legend,
.attendance-summary-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.attendance-month-nav {
    display: grid;
    grid-template-columns: auto minmax(180px, 220px) auto;
    align-items: end;
}

.attendance-month-input-wrap,
.attendance-search-wrap,
.attendance-filter-wrap {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.attendance-field-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.attendance-search-wrap input,
.attendance-month-input-wrap input,
.attendance-filter-wrap select {
    min-width: 0;
}

.attendance-stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.attendance-inline-notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #ead8e8;
    border-radius: 14px;
    background: var(--pending-soft);
    color: var(--text);
}

.attendance-table-toolbar {
    align-items: flex-start;
    margin-bottom: 10px;
}

.attendance-table-heading {
    margin-bottom: 0;
}

.attendance-table-toolbar-meta {
    align-items: flex-start;
    padding-top: 2px;
}

.attendance-board-shell {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}

.attendance-freeze-pane {
    --attendance-frozen-person-width: 180px;
    --attendance-frozen-summary-width: 150px;
    overflow: auto;
    max-height: clamp(420px, 72vh, 860px);
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
}

.attendance-board {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
}

.attendance-board th,
.attendance-board td {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.attendance-freeze-pane .attendance-board thead th {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--surface-muted);
    box-shadow: inset 0 -1px 0 var(--line);
}

.attendance-freeze-pane .attendance-board thead th:first-child,
.attendance-freeze-pane .attendance-board tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 7;
    background: var(--surface);
    overflow: hidden;
    background-clip: padding-box;
}

.attendance-freeze-pane .attendance-board thead th:first-child {
    z-index: 12;
    background: var(--surface-muted);
}

.attendance-freeze-pane .attendance-board thead th:nth-child(2),
.attendance-freeze-pane .attendance-board tbody td:nth-child(2) {
    position: sticky;
    left: var(--attendance-frozen-person-width);
    z-index: 6;
    background: var(--surface);
    overflow: hidden;
    background-clip: padding-box;
}

.attendance-freeze-pane .attendance-board thead th:nth-child(2) {
    z-index: 11;
    background: var(--surface-muted);
}

.attendance-freeze-pane .attendance-board thead th:first-child::before,
.attendance-freeze-pane .attendance-board tbody td:first-child::before,
.attendance-freeze-pane .attendance-board thead th:nth-child(2)::before,
.attendance-freeze-pane .attendance-board tbody td:nth-child(2)::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--line);
    pointer-events: none;
    z-index: 3;
}

.attendance-freeze-pane .attendance-board thead th:first-child::after,
.attendance-freeze-pane .attendance-board tbody td:first-child::after,
.attendance-freeze-pane .attendance-board thead th:nth-child(2)::after,
.attendance-freeze-pane .attendance-board tbody td:nth-child(2)::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: var(--line);
    pointer-events: none;
    z-index: 3;
}

.attendance-board tr:last-child td {
    border-bottom: 0;
}

.attendance-board tr td:last-child,
.attendance-board tr th:last-child {
    border-right: 0;
}

.attendance-col-person {
    min-width: var(--attendance-frozen-person-width);
    width: var(--attendance-frozen-person-width);
}

.attendance-col-summary {
    min-width: var(--attendance-frozen-summary-width);
    width: var(--attendance-frozen-summary-width);
}

.attendance-day-head,
.attendance-day-cell {
    width: 84px;
    min-width: 84px;
    padding: 10px 8px;
    text-align: center;
}

.attendance-day-head {
    position: relative;
    font-size: 12px;
    color: var(--text-muted);
}

.attendance-day-head span,
.attendance-day-head strong {
    display: block;
}

.attendance-day-head strong {
    margin-top: 4px;
    font-size: 16px;
    line-height: 1;
    color: var(--text);
}

.attendance-day-head.is-weekend {
    background: #f6f8fc;
    color: #5d687b;
    box-shadow: inset 0 -1px 0 #dde4ef;
}

.attendance-day-head.is-weekend strong {
    color: #465062;
}

.attendance-day-head.is-today {
    background: #fcfbff;
    color: #7c2392;
    box-shadow: inset 0 3px 0 rgba(124, 35, 146, 0.32);
    width: 104px;
    min-width: 104px;
}

.attendance-day-head.is-today strong {
    color: #7c2392;
}

.attendance-day-head.is-today::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 8px;
    width: 6px;
    height: 6px;
    margin-left: -3px;
    border-radius: 999px;
    background: rgba(124, 35, 146, 0.75);
}

.attendance-summary-pills {
    gap: 8px;
}

.attendance-summary-pills .status-badge {
    padding: 5px 9px;
    font-size: 12px;
}

.attendance-summary-pills .attendance-overtime-badge {
    border-color: #d7dce6;
    background: #f8fafc;
    color: #1f2430;
}

.attendance-person-cell,
.attendance-summary-cell {
    padding: 12px 14px;
    vertical-align: middle;
}

.attendance-person-name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.15;
    margin-bottom: 6px;
}

.attendance-person-cell .muted,
.attendance-summary-cell .muted {
    display: block;
    font-size: 13px;
    margin-top: 0;
    line-height: 1.15;
}

.attendance-day-cell {
    position: relative;
    background: #fff;
    vertical-align: middle;
    padding: 0;
}

.attendance-day-cell.is-empty {
    background: #fff;
}

.attendance-day-cell.is-weekend,
.attendance-day-cell.is-empty.is-weekend {
    background: #f7f9fd;
}

.attendance-day-cell.is-weekend::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(105, 118, 143, 0.04);
    pointer-events: none;
}

.attendance-day-cell > * {
    position: relative;
    z-index: 1;
}

.attendance-day-label,
.attendance-day-sub-label {
    display: block;
}

.attendance-day-button {
    display: block;
    width: 100%;
    min-height: 72px;
    padding: 10px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    margin: 0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    text-align: inherit;
    font-size: 12px;
    line-height: 1.15;
}

.attendance-day-static {
    display: block;
    width: 100%;
    min-height: 72px;
    padding: 10px 8px;
    box-sizing: border-box;
    font-size: 12px;
    line-height: 1.15;
}

.attendance-day-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-day-sub-label {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.2;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-day-button-empty,
.attendance-day-static-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0;
}

.attendance-day-cell-split {
    position: relative;
    padding: 0;
    background: #fff;
    overflow: hidden;
}

.attendance-day-button-split,
.attendance-day-static-split {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: 100%;
    min-height: 100%;
    padding: 0;
    gap: 0;
    border: 0;
}

.attendance-day-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 6px 8px;
    margin: 0;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0;
    overflow: hidden;
}

.attendance-day-segment:last-child {
    border-bottom: 0;
}

.attendance-day-segment-label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-day-segment-sub-label {
    display: block;
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.1;
    color: var(--attendance-color-subtext, var(--text-muted));
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attendance-day-button {
    transition: background-color 0.14s ease, box-shadow 0.14s ease;
}

.attendance-day-button:hover {
    background: rgba(31, 36, 48, 0.035);
    box-shadow: inset 0 0 0 1px rgba(31, 36, 48, 0.08);
}

.attendance-day-button.is-range-preview {
    background: rgba(124, 35, 146, 0.08);
    box-shadow: inset 0 0 0 2px rgba(124, 35, 146, 0.2);
}

.attendance-day-button.is-range-anchor,
.attendance-day-button.is-range-edge-start,
.attendance-day-button.is-range-edge-end {
    background: rgba(124, 35, 146, 0.12);
    box-shadow: inset 0 0 0 2px rgba(124, 35, 146, 0.34);
}

.attendance-empty-marker {
    color: #c1c7d0;
    font-size: 18px;
    line-height: 1;
}

.attendance-empty-marker-readonly {
    font-size: 16px;
}

.status-badge.attendance-color-inline,
.attendance-day-cell.attendance-color-inline,
.attendance-day-segment.attendance-color-inline {
    background: var(--attendance-color-bg, #f1f5f9);
    color: var(--attendance-color-text, #475569);
    border-color: var(--attendance-color-border, #d5dee8);
}

.attendance-day-cell.attendance-color-inline .attendance-day-sub-label {
    color: var(--attendance-color-subtext, var(--text-muted));
}

.attendance-day-segment.attendance-color-inline {
    border-color: var(--attendance-color-border, rgba(213, 222, 232, 0.85));
}

.status-badge.attendance-status-present,
.attendance-day-cell.attendance-status-present,
.status-badge.attendance-assignment-color-default,
.attendance-day-cell.attendance-assignment-color-default {
    background: #edf9f0;
    color: #167a39;
    border-color: #cdeed7;
}

.status-badge.attendance-assignment-color-emerald,
.attendance-day-cell.attendance-assignment-color-emerald {
    background: #edf9f0;
    color: #167a39;
    border-color: #cdeed7;
}

.status-badge.attendance-assignment-color-blue,
.attendance-day-cell.attendance-assignment-color-blue {
    background: #edf5ff;
    color: #235da1;
    border-color: #cfe0fb;
}

.status-badge.attendance-assignment-color-violet,
.attendance-day-cell.attendance-assignment-color-violet {
    background: #f5eefb;
    color: #7c2392;
    border-color: #ead8f4;
}

.status-badge.attendance-assignment-color-amber,
.attendance-day-cell.attendance-assignment-color-amber {
    background: #fff8e8;
    color: #9b6a11;
    border-color: #f4e3b7;
}

.status-badge.attendance-assignment-color-rose,
.attendance-day-cell.attendance-assignment-color-rose {
    background: #fff1f5;
    color: #be185d;
    border-color: #f7c8d7;
}

.status-badge.attendance-assignment-color-teal,
.attendance-day-cell.attendance-assignment-color-teal {
    background: #edfdf9;
    color: #0f766e;
    border-color: #bdece3;
}

.status-badge.attendance-assignment-color-indigo,
.attendance-day-cell.attendance-assignment-color-indigo {
    background: #eef2ff;
    color: #4338ca;
    border-color: #cfd5ff;
}

.status-badge.attendance-assignment-color-orange,
.attendance-day-cell.attendance-assignment-color-orange {
    background: #fff3e8;
    color: #c2410c;
    border-color: #f6d3ba;
}

.status-badge.attendance-assignment-color-lime,
.attendance-day-cell.attendance-assignment-color-lime {
    background: #f7fee7;
    color: #4d7c0f;
    border-color: #dbf0b7;
}

.status-badge.attendance-assignment-color-slate,
.attendance-day-cell.attendance-assignment-color-slate {
    background: #f1f5f9;
    color: #475569;
    border-color: #d5dee8;
}

.status-badge.attendance-status-remote,
.attendance-day-cell.attendance-status-remote {
    background: #edf5ff;
    color: #235da1;
    border-color: #cfe0fb;
}

.status-badge.attendance-status-vacation,
.attendance-day-cell.attendance-status-vacation {
    background: #fff3eb;
    color: #b45418;
    border-color: #f4d1b7;
}

.status-badge.attendance-status-sick,
.attendance-day-cell.attendance-status-sick {
    background: #fef3f2;
    color: #b42318;
    border-color: #f3c6c1;
}

.status-badge.attendance-status-absent,
.attendance-day-cell.attendance-status-absent {
    background: #f5f6f8;
    color: #434b57;
    border-color: #d7dce5;
}

.status-badge.attendance-status-unknown,
.attendance-day-cell.attendance-status-unknown {
    background: #f8f9fc;
    color: var(--text-muted);
    border-color: var(--line);
}

.attendance-empty-state {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 28px 20px 8px;
}

.attendance-empty-state h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.2;
    color: var(--text);
}

.attendance-empty-state p {
    max-width: 640px;
    margin: 0;
}

.attendance-assignment-note {
    font-size: 12px;
    color: var(--text-muted);
}

.attendance-segment-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid #e3e8f2;
    border-radius: 18px;
    background: #f8fafc;
}

.attendance-segment-card-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
}

.attendance-split-toggle {
    margin-top: 2px;
    margin-bottom: -2px;
}

.attendance-admin-record-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

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

.attendance-range-hint {
    margin-top: 0;
    line-height: 1.45;
}

.attendance-time-field {
    display: grid;
    gap: 6px;
}

.attendance-assignment-color-input {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.attendance-assignment-color-input input[type="color"] {
    width: 52px;
    height: 46px;
    min-height: 46px;
    padding: 4px;
    border-radius: 14px;
    cursor: pointer;
}

.attendance-assignment-color-label {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border: 1px solid #e3e8f2;
    border-radius: 14px;
    background: #fff;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.attendance-modal-divider {
    height: 1px;
    margin: -2px 0 0;
    background: #e8edf5;
}

.attendance-modal-info {
    padding: 12px 14px;
    border: 1px solid #e3e8f2;
    border-radius: 16px;
    background: #f8fafc;
    line-height: 1.45;
}

.attendance-modal-notes {
    display: grid;
    gap: 4px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
}

.checkbox-cell {
    width: 44px;
    text-align: center;
}

.checkbox-cell input {
    margin: 0 auto;
}

.test-box,
.admin-list-item {
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 16px;
}

.quick-login,
.admin-list {
    display: grid;
    gap: 10px;
}

.quick-login-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
}

.admin-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.attendance-color-picker-field {
    width: 100%;
}

.attendance-color-picker-trigger.btn.btn-secondary {
    width: 100%;
    min-height: 52px;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
}

.attendance-color-picker-trigger.btn.btn-secondary:hover {
    background: #fff;
}

.attendance-color-picker-swatch {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: #dbe3ef;
}

.attendance-color-picker-swatch.is-empty {
    background: linear-gradient(135deg, #eef2f7 0%, #e3e9f2 100%);
    border-color: #d4dce8;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32);
}

.attendance-color-picker-text {
    min-width: 0;
    font-weight: 600;
    text-align: left;
}

.csv-columns {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px dashed #c8d1df;
    background: #fbfcfe;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    color: var(--text-muted);
    word-break: break-word;
}

.import-hint {
    margin: 0;
}

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

.logout-form {
    margin: 0;
}

.hidden {
    display: none !important;
}

.is-visually-hidden {
    display: none !important;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.24);
}

.modal.hidden {
    display: none;
}

.material-cart-link {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.modal-panel {
    width: 100%;
    max-width: 620px;
    padding: 24px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    position: relative;
}

.attendance-modal {
    padding: 28px 18px;
    align-items: flex-start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(6px);
}

.attendance-modal-panel {
    width: min(690px, 100%);
    max-height: calc(100dvh - 56px);
    margin: auto;
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-radius: 24px;
    border-color: rgba(215, 222, 234, 0.95);
    box-shadow: 0 26px 80px -36px rgba(15, 23, 42, 0.42);
}

.attendance-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-right: 64px;
    min-height: 42px;
}

.attendance-modal-heading {
    min-width: 0;
}

.attendance-modal-panel h2 {
    margin: 0;
    padding-right: 0;
    font-size: 22px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #1f2430;
}

.attendance-modal-panel form {
    gap: 16px;
}

.attendance-modal-panel label {
    margin-bottom: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
}

.attendance-modal-close {
    top: 22px;
    right: 22px;
}

.attendance-date-grid {
    margin-top: -2px;
}

.attendance-modal-actions {
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 6px;
}

.attendance-modal-actions-primary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.attendance-modal-actions .btn {
    min-height: 44px;
    padding-inline: 18px;
}

.attendance-modal-actions .btn.btn-secondary {
    min-width: 96px;
}

.material-cart-modal-panel {
    max-width: 920px;
}

.attendance-color-modal-panel {
    max-width: 980px;
}

.attendance-color-modal-heading {
    padding-right: 48px;
}

.attendance-color-modal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.attendance-color-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.attendance-color-choice:hover {
    border-color: #c7d0dd;
    transform: translateY(-1px);
}

.attendance-color-choice.is-active {
    border-color: #c7a8df;
    box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.12);
}

.attendance-color-choice-swatch {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.attendance-color-choice-label {
    min-width: 0;
    font-weight: 600;
}

.attendance-color-choice-code {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.attendance-color-modal-custom {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.attendance-color-modal-code-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 12px;
    align-items: center;
}

.attendance-color-modal-code-row input[type="text"] {
    text-transform: uppercase;
}

.attendance-color-modal-code-row input[type="color"] {
    width: 58px;
    min-width: 58px;
    height: 52px;
    padding: 6px;
    border-radius: 14px;
    cursor: pointer;
}

.attendance-color-modal-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-muted);
}

.attendance-color-modal-preview-copy {
    display: grid;
    gap: 4px;
}

.attendance-color-modal-preview-copy strong {
    line-height: 1.1;
}

.attendance-color-modal-preview-copy span {
    color: var(--text-muted);
    font-size: 13px;
}

.attendance-color-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

@media (max-width: 860px) {
    .attendance-color-modal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .attendance-color-modal-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

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

.material-cart-modal-panel .section-heading {
    padding-right: 52px;
}

.material-cart-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.material-cart-summary .muted {
    line-height: 1.45;
}

.material-cart-table-shell {
    width: 100%;
    max-height: 360px;
    overflow: auto;
}

.material-cart-table {
    width: 100%;
    table-layout: fixed;
}

.material-cart-col-code {
    width: 18%;
}

.material-cart-col-name {
    width: 42%;
}

.material-cart-col-quantity {
    width: 20%;
}

.material-cart-col-unit {
    width: 8%;
}

.material-cart-col-action {
    width: 12%;
}

.material-cart-table th,
.material-cart-table td {
    vertical-align: middle;
}

.material-cart-table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

.material-cart-table td:nth-child(1),
.material-cart-table td:nth-child(2) {
    word-break: break-word;
}

.material-cart-mobile-label {
    display: none;
}

.material-cart-table td input[type="number"] {
    width: 100%;
    min-width: 0;
}

.material-cart-table .table-actions {
    justify-content: flex-end;
}

.material-cart-item-code strong,
.material-cart-item-name span:last-child,
.material-cart-item-unit span:last-child {
    display: block;
}

.material-cart-empty-state {
    padding: 10px 0 4px;
}

.material-cart-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.material-cart-field {
    display: grid;
    gap: 10px;
}

.material-cart-field-full {
    grid-column: 1 / -1;
}

.material-cart-field textarea {
    width: 100%;
    min-height: 116px;
    resize: vertical;
}

.material-order-button.is-selected {
    background: #fff;
    color: var(--text);
}

.material-order-button.is-selected:hover {
    transform: none;
}

.material-cart-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.material-cart-actions-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.material-cart-clear {
    flex-shrink: 0;
}

.material-cart-actions .btn {
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    appearance: none;
    -webkit-appearance: none;
    background: #1f2430;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    box-sizing: border-box;
    box-shadow: none;
    cursor: pointer;
}

.modal-close:hover {
    background: #111827;
}

.modal-close:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.45);
    outline-offset: 2px;
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        position: static;
    }

    .grid-two,
    .stats-grid,
    .dashboard-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .attendance-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .attendance-toolbar-form {
        grid-template-columns: 1fr;
    }

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

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

    .assembly-item {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "title"
            "meta"
            "action";
    }

    .assembly-meta {
        flex-wrap: wrap;
    }

    .assembly-link.btn.btn-back.btn-back-compact {
        justify-self: start;
    }

    .drawing-gallery.is-dual {
        grid-template-columns: 1fr;
    }

    .portal-stage {
    padding: 32px 24px 64px 24px;
}

    .portal-stage-head {
        flex-direction: column;
        align-items: stretch;
    }

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

    .material-cart-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .material-cart-meta-grid {
        grid-template-columns: 1fr;
    }

    .material-cart-table {
        table-layout: auto;
    }

    .material-cart-actions,
    .material-cart-actions-right {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 800px) {
    html,
    body {
        overflow-x: hidden;
    }

    .app-shell {
        padding: 0 16px 16px;
    }

    .login-wrap {
        padding: 16px;
    }

    .login-card,
    .card,
    .modal-panel {
        padding: 20px;
    }

    .portal-shell {
        padding-top: 0;
    }

    .portal-stage {
        padding: 24px 18px;
        gap: 22px;
        border-radius: 24px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .portal-card {
        min-height: 280px;
        border-radius: 24px;
    }

    .portal-card-media {
        min-height: 150px;
        padding-top: 22px;
    }

    .portal-card-title-row h2 {
        font-size: 1.45rem;
    }

    .page-sticky-shell {
        gap: 0;
    }

    .topbar {
        min-height: 0;
        align-items: center;
        gap: 12px;
        padding: 12px 0 10px;
    }

    .topbar-right,
    .section-panel-summary,
    .section-panel-title-row,
    .section-panel-stats,
    .table-toolbar,
    .table-toolbar-actions,
    .bulk-actions-bar,
    .bulk-actions-form,
    .detail-row,
    .quick-login-item,
    .btn-row,
    .title-row {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-brand,
    .topbar-brand-inline {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        gap: 4px;
    }

    .topbar-brand .page-title,
    .topbar-brand-inline .page-title {
        font-size: clamp(1.9rem, 7vw, 2.35rem);
    }

    .topbar-brand > .muted,
    .topbar-brand > .page-subtitle-inline,
    .topbar-brand-inline .page-subtitle-inline {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.95rem;
    }

    .topbar-right {
        flex: 0 0 auto;
        flex-direction: row;
        justify-content: flex-end;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        width: auto;
    }

    .topbar-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .topbar-menu-panel {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: var(--topbar-menu-panel-gap);
        padding: var(--topbar-menu-panel-padding);
        background: rgba(255, 255, 255, 0.98);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
        opacity: 0;
        pointer-events: none;
        overflow-y: auto;
        transform: translateY(-16px);
        transition: opacity 0.22s ease, transform 0.22s ease;
        z-index: 80;
    }

    .topbar-menu-panel-head {
        position: sticky;
        top: 0;
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
        padding-bottom: 4px;
        background: transparent;
    }

    .topbar-menu-panel-label {
        display: block;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .topbar.is-menu-open {
        z-index: 81;
    }

    .topbar.is-menu-open .topbar-menu-panel {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .topbar-menu-panel .btn,
    .topbar-menu-panel .pill {
        width: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        justify-content: flex-start;
        font-size: var(--topbar-menu-panel-item-size);
        line-height: 1.08;
        color: var(--text);
    }

    .topbar-menu-panel .pill {
        margin-top: 12px;
        font-size: var(--topbar-menu-panel-pill-size);
        line-height: 1.4;
        color: var(--text-muted);
    }

    .topbar-menu-panel .topbar-inline-icon {
        display: none;
    }

    .topbar-menu-panel .topbar-user-pill {
        margin-top: 10px;
        white-space: normal;
    }

    .topbar-menu-panel .topbar-user-pill-label {
        max-width: none;
        white-space: normal;
    }

    .topbar-search {
        gap: 0;
        background: transparent;
        border: 0;
        padding: 0;
    }

    .topbar-right > .topbar-search .topbar-search-toggle {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border: 1px solid rgba(148, 163, 184, 0.22);
        border-radius: 14px;
        background: #ffffff;
        box-shadow: 0 10px 20px -18px rgba(15, 23, 42, 0.35);
        color: var(--text-muted);
    }

    .topbar-search.is-open .topbar-search-toggle,
    .topbar-search.is-active .topbar-search-toggle,
    .topbar-search-toggle:hover {
        background: #f8fafc;
    }

    .material-cart-modal-panel {
        max-width: 100%;
        padding: 18px;
        border-radius: 18px;
    }

    .material-cart-form {
        gap: 16px;
    }

    .material-cart-modal-panel .section-heading {
        padding-right: 44px;
        margin-bottom: 0;
    }

    .material-cart-modal-panel .section-heading h2 {
        font-size: 1.45rem;
    }

    .material-cart-summary {
        gap: 8px;
    }

    .material-cart-table-shell {
        max-height: none;
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .material-cart-table,
    .material-cart-table thead,
    .material-cart-table tbody,
    .material-cart-table tr,
    .material-cart-table th,
    .material-cart-table td {
        display: block;
        width: 100%;
    }

    .material-cart-table colgroup,
    .material-cart-table thead {
        display: none;
    }

    .material-cart-table tbody {
        display: grid;
        gap: 12px;
    }

    .material-cart-item-row {
        display: grid;
        gap: 10px;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--surface-muted);
        box-shadow: 0 10px 24px -22px rgba(15, 23, 42, 0.35);
    }

    .material-cart-table td {
        padding: 0;
        border: 0;
        word-break: break-word;
    }

    .material-cart-mobile-label {
        display: block;
        margin-bottom: 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .material-cart-item-code strong,
    .material-cart-item-name span:last-child {
        font-size: 1rem;
        line-height: 1.35;
    }

    .material-cart-item-quantity {
        display: grid;
        gap: 6px;
    }

    .material-cart-item-quantity input[type="number"] {
        min-height: 46px;
        padding: 10px 14px;
        border-radius: 14px;
        background: #fff;
    }

    .material-cart-item-unit span:last-child {
        font-weight: 600;
    }

    .material-cart-item-action {
        justify-content: stretch;
    }

    .material-cart-item-action .btn {
        width: 100%;
    }

    .material-cart-meta-grid {
        gap: 14px;
    }

    .material-cart-field {
        gap: 8px;
    }

    .material-cart-field input,
    .material-cart-field textarea {
        min-height: 48px;
        border-radius: 14px;
    }

    .material-cart-field textarea {
        min-height: 116px;
    }

    .material-cart-actions {
        gap: 10px;
    }

    .material-cart-actions .btn {
        width: 100%;
    }

    .project-list {
        gap: 16px;
    }

    .project-card {
        gap: 4px;
    }

    .frame-summary-card {
        display: none;
    }

    .project-card-header {
        align-items: flex-start;
        gap: 12px;
    }

    .project-card-link {
        font-size: 0.92rem;
    }

    .metric-card,
    .mini-card {
        padding: 14px;
        border-radius: 16px;
    }

    .metric-label,
    .stat-label {
        font-size: 12px;
    }

    .metric-value,
    .mini-card strong {
        margin-top: 6px;
        font-size: clamp(1.3rem, 6vw, 1.58rem);
    }

    .metric-progress {
        margin-top: 10px;
    }

    .metric-progress-meta {
        margin-top: 6px;
        gap: 8px;
        font-size: 12px;
    }

    .project-card .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .project-card .stats-grid > .metric-card:not(.metric-card-progress) {
        display: none;
    }

    .project-card .metric-card-progress {
        grid-column: auto;
    }

    #weld-table > .table-filter-form {
        display: none;
    }

    .section-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section-item {
        display: grid;
        gap: 10px;
    }

    .project-card > .section-list {
        margin-top: 16px;
    }

    .section-card {
        border-radius: var(--section-card-radius);
    }

    .section-panel-summary {
        min-height: 0;
        padding: 14px;
        gap: 10px;
    }

    .section-panel-summary-with-costs {
        min-height: 0;
    }

    .section-panel-title-row {
        gap: 10px;
    }

    .section-panel-title-row h2 {
        font-size: 1.15rem;
    }

    .section-panel-complete-icon {
        width: 30px;
        height: 30px;
    }

    .section-panel-deadline {
        min-height: 0;
        font-size: 12px;
    }

    .section-panel-progress-track {
        height: 8px;
    }

    .section-panel-progress-meta {
        font-size: 11px;
    }

    .section-panel-stats {
        gap: 8px;
    }

    .section-panel-stats .status-badge {
        min-height: 30px;
        padding: 0 10px;
        font-size: 11px;
    }

    .section-panel-cost span {
        font-size: 11px;
    }

    .section-panel-cost strong {
        font-size: 1.15rem;
    }

    .section-panel-cost .muted {
        font-size: 11px;
    }

    .section-detail-panel {
        order: initial;
        grid-column: auto;
        border-radius: 16px;
    }

    .section-panel-body {
        padding: 14px;
    }

    .dashboard-section-switch-grid,
    .assembly-switch-grid {
        gap: 10px;
    }

    .dashboard-scroll-indicator {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 0 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .dashboard-scroll-cue {
        position: absolute;
        top: 50%;
        z-index: 2;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        color: #2b303b;
        box-shadow: 0 8px 18px -16px rgba(15, 23, 42, 0.45);
        opacity: 0;
        transform: translateY(-50%);
        transition: opacity 0.18s ease;
        pointer-events: none;
    }

    .dashboard-scroll-cue-left {
        left: 6px;
    }

    .dashboard-scroll-cue-right {
        right: 6px;
    }

    .dashboard-scroll-shell.is-scrollable .dashboard-scroll-cue,
    .assembly-scroll-shell.is-scrollable .dashboard-scroll-cue {
        opacity: 0.92;
    }

    .dashboard-scroll-shell.is-at-start .dashboard-scroll-cue-left,
    .dashboard-scroll-shell.is-at-end .dashboard-scroll-cue-right,
    .assembly-scroll-shell.is-at-start .dashboard-scroll-cue-left,
    .assembly-scroll-shell.is-at-end .dashboard-scroll-cue-right {
        opacity: 0.2;
    }

    .dashboard-section-switch-grid .quick-switch-row,
    .assembly-switch-grid .quick-switch-row {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
        padding: 6px 34px;
        border-radius: 22px;
        scroll-snap-type: x proximity;
    }

    .dashboard-assembly-tab,
    .assembly-switch-tab {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        max-width: min(200px, 62vw);
        min-height: var(--switch-tab-mobile-min-height);
        padding: 8px var(--switch-tab-mobile-padding-x);
        justify-content: flex-start;
        font-size: 13px;
        text-align: left;
        scroll-snap-align: start;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dashboard-section-switch-grid .quick-switch-row,
    .assembly-switch-grid .quick-switch-row {
        align-items: stretch;
        padding: 0 34px;
        border-radius: 0;
        background: transparent;
    }

    .dashboard-assembly-card {
        width: min(220px, 72vw);
        max-width: min(220px, 72vw);
        min-height: 58px;
        padding: 10px;
    }

    .dashboard-assembly-card-title {
        font-size: 12px;
    }

    .dashboard-assembly-card-subtitle {
        font-size: 11px;
    }

    .dashboard-assembly-card-percent {
        font-size: 10px;
    }

    .table-filter-form {
        grid-template-columns: 1fr;
    }

    .dashboard-search-form {
        grid-template-columns: 1fr;
    }

    .topbar-search-form {
        grid-template-columns: 1fr;
    }

    .attendance-month-nav,
    .attendance-toolbar-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .attendance-time-grid {
        grid-template-columns: 1fr;
    }

    .attendance-modal {
        padding: 16px 12px;
    }

    .attendance-modal-panel {
        width: 100%;
        max-height: calc(100dvh - 24px);
        padding: 18px;
        border-radius: 22px;
    }

    .attendance-modal-header {
        margin-bottom: 12px;
        padding-right: 56px;
        min-height: 36px;
    }

    .attendance-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .attendance-modal-actions-primary {
        width: 100%;
        flex-direction: column;
    }

    .attendance-modal-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .attendance-month-nav {
        grid-template-columns: 1fr;
    }

    .btn {
        width: 100%;
    }

    .admin-actions-wrap {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-switch-row {
        grid-template-columns: 1fr;
    }

    .assembly-link {
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .modal {
        padding: 12px;
        align-items: flex-start;
    }

    .topbar {
        gap: 10px;
        --topbar-menu-toggle-size: 42px;
        --topbar-menu-toggle-radius: 13px;
        --topbar-menu-panel-padding: 20px 22px 32px;
        --topbar-menu-panel-item-size: 1.5rem;
        --topbar-menu-panel-pill-size: 0.92rem;
    }

    .topbar-brand .page-title,
    .topbar-brand-inline .page-title {
        font-size: clamp(1.7rem, 8vw, 2rem);
    }

    .topbar-brand > .muted,
    .topbar-brand > .page-subtitle-inline,
    .topbar-brand-inline .page-subtitle-inline {
        font-size: 0.88rem;
    }

    .topbar-menu-toggle,
    .topbar-right > .topbar-search .topbar-search-toggle {
        width: var(--topbar-menu-toggle-size);
        height: var(--topbar-menu-toggle-size);
        border-radius: var(--topbar-menu-toggle-radius);
    }

    .material-cart-modal-panel {
        margin-top: 8px;
        padding: 16px;
        border-radius: 16px;
    }

    .material-cart-modal-panel .section-heading h2 {
        font-size: 1.3rem;
    }

    .material-cart-item-row {
        padding: 12px;
        border-radius: 16px;
    }

    .modal-close {
        top: 10px;
        right: 10px;
    }
}
/* === SF-like tuning for Inter === */

/* Main titles */
.login-card h1,
.portal-card-title-row h2,
.attendance-empty-state h3 {
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.028em;
}

.page-title {
    font-weight: 650;
    line-height: 1.14;
    letter-spacing: -0.028em;
}

/* Secondary titles */
.section-title,
.card h2,
.modal-panel h2,
.admin-page .admin-card-toggle-title,
.admin-console-page .admin-card-toggle-title,
.drawing-panel-summary,
.section-panel-title-row h2 {
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.018em;
}

@media (max-width: 1180px) {
    .guest-app-shell .context-bar {
        grid-template-columns: minmax(0, 1fr);
    }

    .guest-app-shell .guest-context-bar {
        grid-template-areas: none;
        gap: 16px;
    }

    .guest-app-shell .context-trail,
    .guest-app-shell .guest-context-pill-row,
    .guest-app-shell .portal-intro-actions,
    .guest-app-shell .guest-context-actions {
        justify-self: start;
    }

    .guest-app-shell .portal-intro-actions,
    .guest-app-shell .guest-context-actions {
        flex-wrap: wrap;
    }

    .guest-app-shell .guest-context-pill-row .table-context-pill {
        pointer-events: auto;
    }

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

    .guest-table-card .table-toolbar-frame {
        grid-template-columns: minmax(0, 1fr);
    }

    .guest-table-card .section-heading,
    .guest-table-card .table-toolbar-center,
    .guest-table-card .table-toolbar-actions {
        grid-column: auto;
        grid-row: auto;
    }

    .guest-table-card .table-toolbar-center {
        position: static;
        justify-content: flex-start;
        justify-self: start;
        pointer-events: auto;
    }

    .guest-table-card .table-toolbar-actions {
        justify-self: start;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .guest-filter-form,
    .guest-create-form,
    .guest-settings-form,
    .guest-settings-template-panel,
    .guest-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guest-filter-form .guest-filter-search {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .guest-stats-grid,
    .guest-filter-form,
    .guest-create-form,
    .guest-settings-form,
    .guest-settings-template-panel,
    .guest-detail-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .guest-detail-field-full,
    .guest-settings-form textarea,
    .guest-settings-form .form-submit,
    .guest-create-form .form-submit {
        grid-column: auto;
    }

    .guest-filter-form .guest-filter-search {
        grid-column: auto;
    }

    .guest-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Big numeric values / KPI */
.metric-value,
.mini-card strong {
    font-weight: 600;
    line-height: 0.98;
    letter-spacing: -0.025em;
}

/* Subtitles and helper text */
.muted,
.page-subtitle-inline,
.admin-page .admin-card-toggle-subtitle,
.admin-console-page .admin-card-toggle-subtitle,
.form-help-text,
.note-text,
.history-meta,
.metric-label,
.stat-label {
    letter-spacing: -0.006em;
}

/* General content text */
p,
li,
.status-badge,
.dashboard-assembly-tab,
.context-trail,
.assembly-title,
.attendance-person-name,
.attendance-day-label,
.attendance-day-sub-label,
.table-card td,
.detail-row,
.inline-edit-hint,
.admin-inline-note {
    letter-spacing: -0.01em;
}

.dashboard-assembly-card,
.dashboard-assembly-card * {
    letter-spacing: 0;
}

/* Tables */
.table-card th,
.attendance-day-head,
.attendance-field-label,
.admin-sidebar-eyebrow,
.attendance-scope-label {
    letter-spacing: 0.035em;
}

.table-card th {
    font-weight: 650;
}

.table-card td,
.attendance-board td,
.attendance-board th {
    line-height: 1.35;
}

/* Small UI text */
.inline-edit-input,
.inline-edit-select,
.status-badge,
.inline-edit-hint,
.admin-inline-note,
.attendance-summary-pills .status-badge {
    letter-spacing: -0.006em;
}

/* Slightly calmer bolds */
strong,
b {
    font-weight: 600;
}

.weld-protocols-page .stats-grid {
    margin-bottom: 24px;
}

.weld-protocol-filter-card,
.weld-protocol-detail-card,
.weld-protocol-source-card,
.weld-protocol-edit-section {
    border: 1px solid rgba(148, 163, 184, 0.22);
}

.weld-protocol-detail-card.is-nok {
    border-color: rgba(190, 24, 93, 0.34);
    background: linear-gradient(180deg, rgba(255, 244, 247, 0.92), #ffffff 240px);
}

.weld-protocol-inline-note {
    margin-top: -4px;
    color: var(--muted, #64748b);
    font-size: 0.92rem;
    line-height: 1.45;
}

.weld-protocol-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.weld-protocol-summary-card {
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.9);
}

.weld-protocol-summary-card strong,
.weld-protocol-summary-card .status-badge {
    display: inline-flex;
    margin-top: 6px;
}

.weld-protocol-summary-label {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.weld-protocol-form {
    margin-top: 22px;
}

.weld-protocol-batch-card {
    margin-top: 22px;
}

.weld-protocol-batch-summary {
    margin-bottom: 16px;
}

.weld-protocol-batch-form {
    display: grid;
    gap: 16px;
}

.weld-protocol-batch-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.weld-protocol-batch-toggle {
    margin: 0;
}

.weld-protocol-batch-selected {
    color: #475569;
    font-size: 0.92rem;
    font-weight: 600;
}

.weld-protocol-batch-check-col {
    width: 88px;
}

.weld-protocol-batch-check-col .checkbox-row {
    justify-content: center;
    margin: 0;
}

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

.weld-protocol-edit-section .form-grid {
    align-items: start;
}

.weld-protocol-detail-actions {
    margin-top: 18px;
}

.form-error {
    margin-top: -10px;
    margin-bottom: 10px;
    color: #b42318;
    font-size: 0.88rem;
    font-weight: 600;
}

.protocol-status-draft {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(239, 246, 255, 0.92);
    color: #1d4ed8;
}

.protocol-status-ok {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(236, 253, 245, 0.95);
    color: #047857;
}

.protocol-status-nok {
    border-color: rgba(244, 63, 94, 0.18);
    background: rgba(255, 241, 242, 0.96);
    color: #be123c;
}

.protocol-status-missing {
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.96);
    color: #475569;
}

.protocol-row-nok {
    background: rgba(255, 245, 247, 0.78);
}

@media (max-width: 1100px) {
    .weld-protocol-summary-grid,
    .weld-protocol-edit-grid {
        grid-template-columns: 1fr;
    }

    .weld-protocol-batch-actions {
        align-items: stretch;
    }

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

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

    .machine-detail-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .machine-module-stats-grid,
    .machine-detail-grid,
    .machine-loan-grid,
    .machine-return-grid,
    .machine-detail-profile-grid,
    .weld-machine-form-grid,
    .weld-loan-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .machine-custom-field-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .machine-tile-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .machine-loan-summary,
    .machine-active-loan-head,
    .machine-document-item,
    .machine-recent-attachment,
    .machine-history-item,
    .machine-overview-hero-head,
    .machine-detail-hero,
    .machine-tile-head,
    .machine-tile-topline,
    .machine-tile-meta-row,
    .machine-status-line,
    .machine-custom-field-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .machine-loan-summary-meta,
    .machine-detail-toolbar-actions,
    .machine-document-actions,
    .machine-recent-attachment-actions,
    .machine-history-meta,
    .machine-tile-actions {
        justify-content: flex-start;
    }

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

    .machine-detail-hero-actions {
        justify-items: start;
    }

    .machine-history-stamp {
        white-space: normal;
    }
}

.project-card-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.weld-overview-page {
    background: #f4f5f7;
}

.weld-overview-shell {
    max-width: 1760px;
}

.weld-overview-nav {
    min-height: 64px;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto minmax(300px, 1fr);
    align-items: center;
    gap: 18px;
    padding: 12px 18px;
    border-radius: 18px;
}

.project-pill {
    justify-self: center;
    min-width: 168px;
    padding: 10px 26px;
    border-radius: 999px;
    background: var(--pending);
    color: #ffffff;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 10px 24px rgba(139, 44, 125, 0.2);
}

.weld-overview-nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    min-width: 0;
}

.weld-overview-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 16px;
    align-items: stretch;
}

.weld-overview-activity-card,
.weld-timeline-card,
.weld-filter-card,
.weld-overview-table-card {
    border-radius: 18px;
}

.weld-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.weld-card-heading h1 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.weld-card-heading p {
    margin: 6px 0 0;
    color: var(--text-muted);
}

.weld-heading-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f1f3f7;
    color: var(--text);
    font-size: 0.9rem;
}

.weld-today-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding-top: 18px;
}

.weld-metric-tile,
.weld-kpi-tile {
    min-height: 132px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.weld-metric-tile span,
.weld-kpi-tile span {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.weld-metric-tile strong,
.weld-kpi-tile strong {
    color: var(--text);
    font-size: clamp(1.25rem, 1.8rem, 2.2rem);
    line-height: 1;
    letter-spacing: 0;
}

.weld-metric-tile small,
.weld-kpi-tile small {
    color: var(--text-muted);
    font-weight: 700;
}

.weld-metric-tile.is-completed,
.weld-kpi-tile.is-completed {
    border-color: rgba(22, 163, 74, 0.22);
    background: #fbfffc;
}

.weld-metric-tile.is-completed strong,
.weld-kpi-tile.is-completed strong,
.text-success {
    color: var(--completed);
}

.weld-metric-tile.is-changed,
.weld-metric-tile.is-pending,
.weld-kpi-tile.is-pending {
    border-color: rgba(139, 44, 125, 0.2);
    background: #fffbff;
}

.weld-metric-tile.is-changed strong,
.weld-metric-tile.is-pending strong,
.weld-kpi-tile.is-pending strong,
.text-pending {
    color: var(--pending);
}

.weld-timeline-card {
    display: grid;
    gap: 14px;
}

.weld-timeline-list {
    display: grid;
    gap: 12px;
}

.weld-timeline-item {
    display: grid;
    grid-template-columns: 12px 48px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    font-size: 0.92rem;
}

.weld-timeline-dot {
    width: 8px;
    height: 8px;
    margin-top: 7px;
    border-radius: 999px;
    background: var(--completed);
}

.weld-timeline-item:nth-child(even) .weld-timeline-dot {
    background: var(--pending);
}

.weld-timeline-item time {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.weld-timeline-item strong {
    margin-right: 4px;
}

.weld-timeline-item small {
    display: block;
    color: var(--text-muted);
    line-height: 1.3;
}

.weld-overview-filter-form {
    display: grid;
    grid-template-columns: repeat(8, minmax(130px, 1fr));
    gap: 16px;
    align-items: end;
}

.weld-overview-filter-form label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 800;
}

.weld-filter-actions {
    grid-column: span 3;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.weld-overview-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.weld-overview-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

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

.weld-kpi-tile {
    min-height: 108px;
    padding: 16px;
}

.weld-kpi-tile strong {
    font-size: 1.7rem;
}

.weld-kpi-tile:last-child strong {
    font-size: 1.05rem;
    line-height: 1.2;
}

.weld-view-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: #f0f1f6;
}

.weld-view-tabs a {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 14px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: center;
}

.weld-view-tabs a.is-active {
    background: var(--pending);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(139, 44, 125, 0.2);
}

.weld-overview-table-shell {
    max-height: 640px;
    overflow: auto;
}

.weld-overview-table {
    min-width: 920px;
}

.weld-overview-detail-table {
    min-width: 1560px;
}

.weld-overview-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fbfcfe;
}

.pagination {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 16px;
}

.pagination-link {
    min-width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
}

.pagination-link.is-active {
    background: var(--pending);
    color: #ffffff;
    border-color: var(--pending);
}

@media (max-width: 1320px) {
    .weld-overview-top-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 980px) {
    .weld-overview-nav {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .project-pill {
        justify-self: stretch;
    }

    .weld-overview-nav-right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .weld-today-metrics,
    .weld-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .weld-filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .weld-view-tabs {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .project-card-actions,
    .weld-overview-nav-right {
        flex-direction: column;
        align-items: stretch;
    }

    .weld-today-metrics,
    .weld-kpi-grid,
    .weld-overview-filter-form {
        grid-template-columns: 1fr;
    }

    .weld-view-tabs {
        grid-template-columns: 1fr;
    }
}
