/* CSS Variables / Design Tokens */
:root {
    --doc-section-spacing: 2rem;
    --doc-header-spacing: 1.2rem;
    --doc-text-spacing: 1rem;
}

/* Small Button Styling */
.small-button {
    padding: 4px 8px;
    font-size: 0.8rem;
    height: 26px;
    width: max-content;
    border: 1px solid var(--color-foreground-darker);
    background: var(--color-background);
    color: var(--color-foreground);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    border-radius: 2px;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.small-button:hover {
    background: var(--color-background-darker);
    border-color: var(--color-foreground);
}

.small-button.success {
    background: var(--color-accent-01-darker);
    border-color: var(--color-accent-01);
    color: var(--color-accent-01-brighter);
}

/* Remove extra spacing after small buttons in paragraphs */
p:has(.small-button) {
    margin-bottom: 0;
}


/* Default Table Styles */
.table-title {
    display: block;
    margin: 42px 0px 30px 0px;
    font-size: 1rem;
    letter-spacing: 0.03rem;
    border-top: 1px solid rgba(var(--color-foreground-rgb), 0.8);
    padding-top: 15px;
    color: rgba(var(--color-foreground-rgb), 0.93);
    text-transform: uppercase;
    font-weight: 100;
}

.table-description {
    margin: 0px 0px var(--space-9) 0px;
    color: rgba(var(--color-foreground-rgb), 0.8);
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.3rem;
    letter-spacing: 0.5px;
}



/* Account Dashboard Radio Button Styling */
#account-dashboard-content .radio-label {
    font-size: 0.8rem;
}

.template-materials-display {
    margin: 21px 0px;
    min-height: 100px;
    overflow: visible;
}

.template-materials-table {
    width: 100%;
    border-collapse: collapse;
    margin: 21px 0px;
}

.template-materials-table th,
.template-materials-table td {
    height: 30px;
    padding: 0px 12px;
    border: 1px solid var(--color-background-brighter);
    text-align: left;
    vertical-align: middle;
}

.template-materials-table th {
    background-color: var(--color-background);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--color-foreground-brighter);
    opacity: 0.9;
    padding: 12px;
    text-wrap: nowrap;
}

.template-materials-table td {
    font-size: 0.75rem;
}

.template-materials-table tr:hover {
    background-color: var(--color-background-darker);
}

.material-id-cell {
    font-weight: 600;
    color: var(--color-accent-01);
    min-width: 80px;
}

.material-preset-cell {
    color: var(--color-foreground);
    font-family: var(--font-family-01);
}

.material-preset-cell.default-preset {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

.preset-name-input.default-preset {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
}

/* Default roll presets table action columns */
#default-roll-presets-table td:nth-child(4),
#default-roll-presets-table td:nth-child(5) {
    width: 5%;
    text-align: center;
}

/* Custom roll presets table action columns */
#custom-roll-presets-table td:nth-child(4),
#custom-roll-presets-table td:nth-child(5) {
    width: 5%;
    text-align: center;
}

/* Custom sheet presets table action columns */
#custom-sheet-presets-table td:nth-child(5),
#custom-sheet-presets-table td:nth-child(6) {
    width: 5%;
    text-align: center;
}

button.button-delete {
    max-width: 60px;
    justify-content: center;
}


/* Custom roll presets table */
button.button-delete.delete-custom-preset {
    justify-content: center;
}

/* Preset button container */
.preset-button-container {
    display: flex;
    gap: 21px;
    padding: 21px 0px;
    align-items: center;
}

/* Add panel button styling - subtle link-like appearance */
.add-panel-btn {
    display: block;
    margin-top: 6px;
    padding: 2px 0 21px 0;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: none;
    background: none;
    color: var(--color-foreground);
    border: 0;
    border-radius: 0;
    cursor: pointer;
    width: auto;
    text-align: left;
    opacity: 0.7;
    transition: all 0.2s ease;
    font-style: italic;
}

.add-panel-btn:hover {
    opacity: 1;
    color: var(--color-foreground);
    text-decoration: underline;
}

/* Save preset button styling - using job-card button styling */
.save-roll-preset-btn,
.save-sheet-preset-btn,
.save-panel-group-preset-btn {
    width: auto;
    color: var(--color-accent-01-brighter);
    background-color: var(--color-accent-01-darker);
    border-color: var(--color-accent-01);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    text-wrap: nowrap;
    opacity: 0.8;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid;
    transition: all 0.2s ease;
}

.save-roll-preset-btn:hover,
.save-sheet-preset-btn:hover,
.save-panel-group-preset-btn:hover {
    opacity: 1;
}

/* Template Materials Table Column Widths - Match custom presets table structure */
.template-materials-table th:nth-child(1),
.template-materials-table td:nth-child(1) {
    width: 10%;
    /* Material ID column */
}

.template-materials-table th:nth-child(2),
.template-materials-table td:nth-child(2) {
    width: 35%;
    /* Preset Type column */
}

.template-materials-table th:nth-child(3),
.template-materials-table td:nth-child(3) {
    width: 15%;
    /* Width column */
    text-align: center;
}

.template-materials-table th:nth-child(4),
.template-materials-table td:nth-child(4) {
    width: 20%;
    /* Length column */
    text-align: center;
}

.template-materials-table th:nth-child(5),
.template-materials-table td:nth-child(5) {
    width: 20%;
    /* Grain Direction column */
}

/* Template Materials Table Cell Styling */
.material-width-cell,
.material-length-cell {
    color: var(--color-foreground);
    font-family: var(--font-family-02);
    font-size: 0.75rem;
    text-align: center;
}


.template-materials-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--color-foreground-darker);
    font-style: italic;
}

.restore-status {
    margin-top: 10px;
    display: none;
}

.restore-status.show {
    display: block;
}

/* Account Dashboard Layout Fixes - Use specific selectors instead of !important */
.account-dashboard-page .section-main-page .documentation#account-dashboard-content {
    overflow-x: hidden;
    overflow-y: visible;
    /* Override documentation.css overflow-x: scroll with higher specificity */
}

.account-dashboard-page .section-main-page .documentation#account-dashboard-content section {
    overflow-x: hidden;
    /* Prevent horizontal scroll on sections */
}

.account-dashboard-page .section-main-page {
    overflow-x: hidden;
    /* Ensure parent container doesn't show scroll bars */
}

/* Contact Forms Styling */
form#support-form,
form#feedback-form {
    background-color: var(--color-background-darker);
    padding: 24px;
    border: 1px solid var(--color-foreground-darker);
}

/* Form Header */
.form-header {
    padding: 0 0 42px 0;
}

/* Form Title and Description */
.form-title {
    margin: 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-foreground);
}

.form-description {
    margin: 0 0 0 0;
    font-size: 0.9rem;
    color: var(--color-foreground);
    opacity: 0.8;
    line-height: 1.4;
}

/* Color Picker Styling */
.color-picker-section {
    background-color: var(--color-background-darker);
    padding: 42px 24px 30px 24px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
    margin-top: 42px;
}

.color-picker-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.color-picker-group label {
    min-width: 120px;
    font-size: 0.9rem;
    color: var(--color-foreground);
    font-weight: 500;
}

.color-picker-group input[type="color"] {
    width: 50px;
    height: 32px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
    cursor: pointer;
    background: none;
}

.color-picker-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-group input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Range slider styling */
.color-picker-group input[type="range"] {
    flex: 1;
    height: 6px;
    background: var(--color-background-brighter);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.color-picker-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-foreground);
    border-radius: 50%;
    cursor: pointer;
}

.color-picker-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--color-foreground);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.color-picker-group label span {
    font-weight: 600;
    color: var(--color-foreground-brighter);
}

/* Two-column, two-row grid layout */
.color-controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 21px 42px;
    margin-bottom: 20px;
}

.color-control-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.color-label {
    font-size: 0.9rem;
    line-height: 1.5rem;
    color: var(--color-foreground);
    font-weight: 600;
    text-align: left;
    text-transform: uppercase;
}

.color-label-subheading {
    font-size: 0.72rem;
    color: var(--color-foreground);
    opacity: 0.8;
    font-weight: 400;
    text-align: left;
    line-height: 1.2rem;
}

/* Color swatches */
.color-swatches {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
    margin: 21px 0px;
}

.swatch-container {
    display: flex;
    width: 30%;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.color-swatch {
    width: 100%;
    height: 32px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 32px;
    cursor: pointer;
}

.clickable-swatch {
    border: 2px solid var(--color-foreground);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.clickable-swatch:hover {
    transform: scale(1.1);
    border-color: var(--color-foreground-brighter);
}

.swatch-label {
    font-size: 0.7rem;
    color: var(--color-foreground-darker);
    text-align: center;
    font-weight: 500;
}


/* Color swatch pickers - styled to look like original swatches */
.color-swatch-picker {
    width: 100%;
    height: 32px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 32px;
    cursor: pointer;
    background: none;
    padding: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.color-swatch-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-swatch-picker::-webkit-color-swatch {
    border: none;
    border-radius: 32px;
}

.color-swatch-picker::-moz-color-swatch {
    border: none;
    border-radius: 32px;
}

.color-swatch-picker:hover {
    transform: scale(1.02);
    border-color: var(--color-foreground);
    transition: transform 0.1s ease;
}

/* Opacity swatch wrapper for low-opacity colors */
.opacity-swatch-wrapper {
    position: relative;
    width: 100%;
    height: 32px;
    border-radius: 32px;
    background: var(--color-base-material-01);
    background-image: repeating-linear-gradient(-45deg,
            var(--color-base-material-01) 0px,
            var(--color-base-material-01) 30px,
            var(--color-base-material-02) 30px,
            var(--color-base-material-02) 51px,
            var(--color-base-material-01) 51px,
            var(--color-base-material-01) 90px);
    overflow: hidden;
}

.opacity-swatch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 32px;
}

/* Specific opacity for different swatch types */
#base-material-02-picker.opacity-swatch::-webkit-color-swatch {
    opacity: 0.15;
}

#base-material-02-picker.opacity-swatch::-moz-color-swatch {
    opacity: 0.15;
}

#panel-background-picker.opacity-swatch::-webkit-color-swatch {
    opacity: 0.06;
}

#panel-background-picker.opacity-swatch::-moz-color-swatch {
    opacity: 0.06;
}

/* Hidden color inputs */
input[type="color"][id$="-color-picker"] {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    visibility: hidden;
    width: 0;
    height: 0;
    border: none;
    padding: 0;
    margin: 0;
}

/* Base Material Preview */
.base-material-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 21px;
    width: 100%;
    justify-self: center;
    align-self: start;
}

.base-material-preview .base-material {
    width: 100%;
    height: 330px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
    background-color: var(--color-base-material-01);
    background-image: repeating-linear-gradient(-45deg,
            var(--color-base-material-01) 0px,
            var(--color-base-material-01) 30px,
            var(--color-base-material-02) 30px,
            var(--color-base-material-02) 51px,
            var(--color-base-material-01) 51px,
            var(--color-base-material-01) 90px);
    background-position: 0 0;
    background-repeat: repeat;
    outline: 1px solid rgba(var(--color-foreground-rgb), 0.3);
    position: relative;
}

.base-material-preview .base-material::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.2;
}

/* Panel Preview now uses exact same classes as real implementation:
   - .base-material (instead of .base-material-stripe)
   - .panel (instead of .preview-panel)
   All styling inherited from layout.css */

/* Panel State Color Display */
.panel-states-display {
    margin-top: 15px;
}

.panel-state-swatches {
    display: flex;
    gap: 8px;
    justify-content: space-evenly;
    flex-wrap: wrap;
    margin: 21px 0px;
}

.panel-state-swatch {
    display: flex;
    width: 28%;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.panel-state-color {
    width: 100%;
    height: 32px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 32px;
    cursor: pointer;
}

.panel-state-label {
    font-size: 0.7rem;
    color: var(--color-foreground);
    opacity: 0.8;
    text-transform: lowercase;
}

/* Panel state color definitions */
#panel-normal-color {
    background-color: rgba(var(--color-panel-border-rgb), 1);
}

#panel-hover-color {
    background-color: var(--color-panel-border-hover);
}

#panel-selected-color {
    background-color: var(--color-panel-border-selected);
}

#panel-dragging-color {
    background-color: var(--color-panel-border-dragging);
}

#panel-snapping-color {
    background-color: var(--color-panel-border-snapping);
}

/* Snap Line Styles (identical to real implementation) */
.base-material-preview .snap-line {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--color-accent-04);
    opacity: 0;
    z-index: 1001;
    will-change: opacity;
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.base-material-preview .snap-line.vertical {
    width: 1px;
    height: 100%;
    top: 0;
}

.base-material-preview .snap-line.horizontal {
    height: 1px;
    width: 100%;
    left: 0;
}

.base-material-preview .snap-line.visible {
    opacity: 0.3;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .color-controls-grid {
        grid-template-columns: 1fr;
        gap: 15px 30px;
    }
}

.color-picker-actions {
    display: flex;
    gap: 18px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-foreground-darker);
}

/* Base Styles & Typography */
html {
    /* Dynamic scroll padding based on actual header state */
    scroll-padding-top: calc(var(--secondary-header-height) + var(--gap));
    scroll-behavior: smooth;
}

/* Prevent header bounce on documentation page */
.account-dashboard-page .secondary-header {
    /* Ensure smooth transitions */
    transition: top 0.2s ease-in-out, transform 0.2s ease-in-out;
    /* Prevent flicker */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.job_id-selected {
    display: none;
}

.unit-options {
    display: none;
}

/* Stabilize gap fillers on documentation page */
.account-dashboard-page .gap-filler_header-sticky,
.account-dashboard-page .gap-filler_header-not-sticky {
    /* Prevent transition jank */
    transition: none;
    transform: translateZ(0);
}

/* Fix main content area to proper height and scrolling */
.account-dashboard-page .section-container.split_100pcnt {
    position: sticky;
    top: calc(var(--secondary-header-height) + var(--gap) + 6px);
    /* Match sidebar height exactly */
    height: calc(100vh - var(--secondary-header-height) - var(--gap) - 12px);
    max-height: calc(100vh - var(--secondary-header-height) - var(--gap) - 12px);
    overflow: hidden;
    /* Container doesn't scroll, content inside does */
    /* Ensure consistent sizing */
    flex-shrink: 0;
    /* Prevent layout shifts */
    contain: layout style size;
}

/* Adjust height when header menu is visible */
.account-dashboard-page:not(:has(.header-menu.header-hidden)) .section-container.split_100pcnt {
    height: calc(100vh - var(--header-height) - var(--secondary-header-height) - var(--gap) - 12px);
    max-height: calc(100vh - var(--header-height) - var(--secondary-header-height) - var(--gap) - 12px);
}

/* Make the main content area scrollable */
.account-dashboard-page .section-main-page {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    /* Enable smooth scrolling on touch devices */
    -webkit-overflow-scrolling: touch;
    /* Prevent bounce at scroll boundaries - more restrictive */
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
    /* Ensure trackpad scrolling works */
    scroll-behavior: smooth;
    /* Prevent height changes from causing scroll issues */
    position: relative;
}

/* Ensure documentation content takes full height */
.account-dashboard-page .documentation {
    min-height: 100%;
    padding: var(--space-24);
    /* Ensure content can be scrolled */
    display: block;
}

/* Improve touch scrolling responsiveness */
.account-dashboard-page .section-main-page::-webkit-scrollbar {
    width: 8px;
}

.account-dashboard-page .section-main-page::-webkit-scrollbar-track {
    background: var(--color-background-darker);
}

.account-dashboard-page .section-main-page::-webkit-scrollbar-thumb {
    background: var(--color-background-brighter);
    border-radius: 4px;
}

.account-dashboard-page .section-main-page::-webkit-scrollbar-thumb:hover {
    background: var(--color-foreground-darker);
}

/* Hide mobile elements on desktop by default */
.documentation section .mobile-section-header,
.mobile-group-header {
    display: none;
}

/* Ensure mobile-section-content is always visible on desktop, overriding hidden class */
@media screen and (min-width: 900px) {

    .gap-filler_390 {
        width: 360px;
    }

    .documentation section .mobile-section-content.hidden {
        display: block !important;
    }

    .documentation section .mobile-section-content {
        display: block !important;
    }
}

/* Handle dropdown section animations to prevent bounce - only for toggleable content */
.account-dashboard-page .input-container {
    /* Normal display for content by default */
    transition: none;
}

.account-dashboard-page .input-container.hidden {
    /* Use the global hidden class behavior but add scroll position preservation */
    display: none !important;
}

/* Basic overscroll prevention for documentation page */
.account-dashboard-page .section-main-page {
    /* Prevent bounce at scroll boundaries */
    overscroll-behavior-y: contain;
}

/* Make section headers clickable and add hover effects */
.account-dashboard-page .section-header {
    /* Make entire header clickable */
    cursor: pointer;
    /* Add smooth transition for hover effect */
    transition: background-color 0.2s ease;
}

.account-dashboard-page .section-header:hover {
    /* Darker background on hover */
    background-color: var(--color-background-darker);
}

/* Content Container Base Styles */
.content-container {
    font-size: 0.85rem;
    margin: var(--doc-text-spacing) 0;
    padding: var(--space-12);
    background: var(--color-background);
    color: var(--color-foreground);
    font-family: var(--font-family-01);
    line-height: 1.5;
    min-width: 0;
}

/* Section Layout Base Styles */
.section-main-page {
    border-top: 1px solid var(--color-background-brighter);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0 var(--space-18);
}

/* Typography Base Styles */
h1 {
    font-size: 1.6rem;
    font-weight: 600;
    text-align: left;
    margin: 0 0 var(--doc-section-spacing) 0;
    padding-top: var(--doc-header-spacing);
    border-top: 6px solid var(--color-foreground);
    color: var(--color-foreground);
}

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: var(--doc-section-spacing) 0 var(--doc-text-spacing) 0;
    padding-bottom: 0.5rem;
    color: var(--color-foreground);
}

h3 {
    font-size: 1.2rem;
    margin: 1.5rem 0 var(--doc-text-spacing) 0;
    font-weight: 600;
    color: var(--color-foreground);
}

h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 var(--doc-text-spacing) 0;
    font-weight: 500;
    color: var(--color-foreground);
}

/* Text Elements Base Styles */
p {
    letter-spacing: 0.01rem;
    margin: var(--doc-text-spacing) 0;
    line-height: 1.6;
    font-size: 0.85rem;
}

strong {
    font-weight: 600;
}

em {
    font-style: italic;
}

/* Links Base Styles */
a {
    color: var(--color-foreground);

    transition: none;
}

a:hover {
    color: var(--color-foreground-brighter);
    border-bottom-color: var(--color-foreground-brighter);
}

/* Lists Base Styles */
.doc-list {
    list-style-type: none;
    padding: 0 var(--space-12);
    font-size: 0.84rem;
    line-height: 1.5rem;
}

.doc-list li {
    margin: 8px 0 0 15px;
    list-style: decimal-leading-zero;
}

.doc-list li a {
    color: var(--color-foreground);
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 2px;
    padding: 2px 4px;
    display: block;
}

.doc-list li a:hover {
    color: var(--color-foreground-brighter);
    background-color: var(--color-background-darker);
}

.doc-list li a:focus {
    outline: 2px solid var(--color-accent-01);
    outline-offset: 1px;
    color: var(--color-foreground-brighter);
    background-color: var(--color-background-darker);
}

/* Active navigation highlighting */
.doc-list li.active a,
.doc-list li a.active {
    color: var(--color-foreground-brighter);
    font-weight: 600;
    opacity: 0.9;
}

.doc-list li.active a:hover,
.doc-list li a.active:hover {
    color: var(--color-foreground-brighter);
    background-color: var(--color-background-darker);
    opacity: 1;
}


/* Code Sections Base Styles */
code {
    font-family: var(--font-family-02);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.85em;
    max-width: fit-content;
    background: var(--color-background-darker);
}

pre {
    background: var(--color-background-darker);
    padding: var(--doc-text-spacing) 0;
    border: 1px solid var(--color-background-brighter);
    border-radius: 4px;
    margin: var(--doc-text-spacing) 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

pre code {
    background: none;
    padding: var(--space-12);
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
    white-space: pre;
    overflow-x: auto;
    width: fit-content;
    min-width: 100%;
    padding-bottom: var(--doc-text-spacing);
}


.section-container {
    overflow: hidden;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* Sticky Container Component */
.section-container--sticky {
    position: static;
    height: auto;
    overflow: visible;
}


h2.overview-title {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 200;
    font-style: italic;
    margin: 0px 0px;
    padding: 0px;
}

p.overview-text {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.5rem;
    letter-spacing: 0.03rem;
    font-style: italic;
    margin: 3px 0px 30px 0px;
}

/* Color Grid Component */
.color-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    margin: var(--space-24) 0;
    min-width: 0;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
    margin-bottom: var(--space-12);
}

.color-block {
    height: var(--space-42);
    width: 100%;
    max-width: 25vw;
    border: 1px solid var(--color-foreground-darker);
    border-radius: var(--space-42);
    margin: 0px auto;
}

/* Table of Contents Component */
.toc-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: var(--space-12);
}

.toc-content::-webkit-scrollbar {
    display: none;
}

/* Documentation Layout */
.documentation {
    width: 100%;
    max-width: 100vw;
    overflow-x: scroll;
    /* Use clip instead of hidden for better containment */
    box-sizing: border-box;
}

/* Color Palette Visualization */
.color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    margin: var(--space-60) 0 var(--space-24) 0;
    min-width: 0;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
    min-width: 0;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: calc(var(--gap) / 2);
    min-width: 0;
    align-items: center;
}

.color-swatch code {
    display: block;
    font-size: 0.66rem;
    background: none;
    padding: 0;
    min-width: 0;
}

.color-swatch p {
    font-size: 0.66rem;
    text-align: center;
    color: var(--color-foreground-darker);
    margin: 0;
}


/* License Specific Classes */
.content-container .definition-item {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.content-container .subclause-item {
    padding-left: 2rem;
    margin: 0.5rem 0;
}

.content-container .subclause-item::before {
    content: "•";
    margin-right: 0.5rem;
    color: var(--color-foreground-darker);
}

/* Ensure all sections maintain containment */
.documentation section {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
    margin-top: var(--space-18);
}

.section-main-page {
    border-top: 1px solid var(--color-background-brighter);
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    /* Use clip instead of hidden for better containment */
    box-sizing: border-box;
}

/* Section Container Overrides */
.section-container {
    overflow: hidden;
    /* Contain all overflow by default */
    min-width: 0;
    /* Prevent flex item overflow */
    width: 100%;
    box-sizing: border-box;
}

.section-container--scrollable {
    overflow: auto;
    /* Allow scrolling when needed */
    height: auto;
}

/* Ensure code blocks can still scroll horizontally within the contained section */
.section-container pre {
    max-width: 100%;
    overflow: hidden;
    /* Hide overflow at pre level */
}

.section-container pre code {
    overflow-x: auto;
    /* Enable horizontal scrolling only for code content */
}

/* Documentation Sections */
.documentation section {
    margin-bottom: 4.2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
    margin-top: var(--space-18);
}

.documentation section:last-child {
    margin-bottom: 0;
}

/* Technical Documentation Container */
#technical-documentation {
    border-top: 1px solid var(--color-foreground);
    margin-top: 3rem;
    padding-top: 2rem;
}

/* Color Info Styles */
.color-info code {
    display: inline-block;
    text-align: center;
    line-height: 1.2;
}

.color-info code .modifier {
    display: block;
    opacity: 0.8;
    font-size: 0.9em;
    line-height: 1.8rem;
}

/* Table of Contents Styles */
.toc-content {
    max-height: calc(100vh - 200px);
    /* Leave space for header */
    overflow-y: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    padding-right: 20px;
    /* Add some padding to account for hidden scrollbar */
}

.toc-content::-webkit-scrollbar {
    display: none;
}

/* Toggle Functionality */
.toc-content.hidden {
    display: none;
}

.hide-show_arrow.active {
    transform: rotate(180deg);
}

/* Contents Section */
#contents.section {
    padding: 0;
}

#contents .section {
    margin-bottom: var(--gap);
}

#contents .section:last-child {
    margin-bottom: 0;
}

/* Input Container */
.input-container {
    padding: 0 12px 12px 12px;
}

.input-container.hidden {
    display: none;
}

/* Documentation List */
.doc-list {
    margin: 0;
    padding: 0;
}

.doc-list li {
    margin: 8px 0px 0px 15px;
    list-style: decimal-leading-zero;
}

/* Desktop Styles (min-width: 900px) */
@media screen and (min-width: 900px) {

    /* Content Container */
    .content-container {
        font-size: 0.9rem;
        max-width: 800px;
        padding: var(--space-18);
        margin: 2rem 0;
    }


    /* Typography */
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.2rem;
    }

    h4 {
        font-size: 1.11rem;
    }

    p {
        font-size: 0.9rem;
    }

    /* Code Sections */
    pre code {
        font-size: 0.9rem;
    }

    /* Color Grid */
    .color-grid {
        grid-template-columns: repeat(3, 1fr);
        margin: var(--space-60) 0 var(--space-24) 0;
    }

    .color-block {
        width: auto;
        max-width: 300px;
        margin: 0 var(--space-12);
    }

    /* Sticky Container - adjusted for documentation page */
    .account-dashboard-page .section-container--sticky {
        position: sticky;
        top: calc(var(--secondary-header-height) + var(--gap) + 6px);
        /* Fixed height to prevent dynamic sizing issues */
        height: calc(100vh - var(--secondary-header-height) - var(--gap) - 12px);
        max-height: calc(100vh - var(--secondary-header-height) - var(--gap) - 12px);
        min-height: calc(100vh - var(--secondary-header-height) - var(--gap) - 12px);
        overflow-y: auto;
        overflow-x: hidden;
        /* Prevent bounce by using proper overflow */
        overscroll-behavior: contain;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        /* Ensure consistent sizing */
        flex-shrink: 0;
    }

    /* Adjust height when header menu is visible */
    .account-dashboard-page:not(:has(.header-menu.header-hidden)) .section-container--sticky {
        height: calc(100vh - var(--header-height) - var(--secondary-header-height) - var(--gap) - 12px);
        max-height: calc(100vh - var(--header-height) - var(--secondary-header-height) - var(--gap) - 12px);
    }


    /* Layout */
    .split_390-100pcnt {
        flex-direction: row;
        grid-template-columns: 360px 1fr;
    }

}

/* Mobile Documentation Layout - FAQ Style Collapsible Sections */
@media screen and (max-width: 899px) {

    /* Keep secondary header visible on mobile documentation page */
    .account-dashboard-page .secondary-header {
        display: flex !important;
        position: sticky;
        top: 0;
        z-index: var(--z-secondary-header);
    }

    /* Remove sticky behavior and adjust heights for mobile */
    .account-dashboard-page .section-container.split_100pcnt {
        position: static !important;
        height: auto !important;
        max-height: none !important;
        top: auto !important;
    }

    /* Remove scroll padding since no sticky header */
    .account-dashboard-page {
        scroll-padding-top: 0 !important;
    }

    /* Override desktop sticky/height constraints on mobile */
    .account-dashboard-page .section-container.split_100pcnt {
        position: static !important;
        height: auto !important;
        max-height: none !important;
        top: auto !important;
        overflow: visible !important;
        flex-shrink: 1 !important;
        contain: none !important;
    }

    /* Override main layout mobile styles for documentation page */
    .account-dashboard-page .split_390-100pcnt {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .account-dashboard-page .split_100pcnt {
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
    }

    /* Remove scrollable behavior from main content area on mobile */
    .account-dashboard-page .section-main-page {
        height: auto !important;
        overflow: visible !important;
        position: static !important;
        border: none !important;
        padding: 0 !important;
        background-color: var(--color-background-darker);
        -webkit-overflow-scrolling: auto !important;
        overscroll-behavior: auto !important;
        scroll-behavior: auto !important;
    }

    /* Remove height constraints from documentation container */
    .account-dashboard-page .documentation {
        min-height: auto !important;
        height: auto !important;
        padding: var(--space-18) !important;
        border: 1px solid var(--color-background-brighter);
        background-color: var(--color-background);
    }

    /* Hide sidebar completely on mobile */
    .account-dashboard-page .split_390 {
        display: none !important;
    }

    /* Make content area full width and visible */
    .account-dashboard-page .split_100pcnt {
        width: 100% !important;
        display: block !important;
    }



    /* Convert each documentation section to collapsible card */
    .account-dashboard-page .documentation section {
        border: 0px solid var(--color-background-brighter) !important;
        border-radius: 4px !important;
        margin-bottom: var(--gap) !important;
        overflow: hidden !important;
        display: block !important;
    }

    /* Show all documentation sections on mobile */
    .account-dashboard-page .documentation section {
        display: block !important;
    }

    /* Mobile group headers - show on mobile only */
    .mobile-group-header {
        display: block !important;
        border-top: 1px solid var(--color-foreground);
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--color-foreground);
        padding: var(--space-24) 0 var(--space-12) 0;
        margin: 60px 0px 0px 0px;
        background: var(--color-background);
        text-align: left;
    }

    /* First mobile group header has no top margin */
    .mobile-group-header:first-of-type {
        margin-top: 0px;
    }

    /* Show mobile section headers only on mobile - EXACT copy of .section-header */
    .documentation section .mobile-section-header {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        height: fit-content;
        padding: 0px;
        background: var(--color-background);
        border-bottom: 0px solid var(--color-background-brighter);
        cursor: pointer;
        transition: background-color 0.2s ease;
    }

    .documentation section .mobile-section-header:hover {
        background: var(--color-background-darker);
    }

    /* EXACT copy of .control-label */
    .documentation section .mobile-section-header .control-label {
        color: var(--color-foreground);
        font-size: 1rem;
        line-height: 1.5rem;
        font-weight: 200;
        text-transform: capitalize;
        opacity: 1;
    }

    /* EXACT copy of .hide-show_arrow */
    .documentation section .mobile-section-header .hide-show_arrow {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        margin: 0 0 0 18px;
        padding: 0;
        background: transparent;
        border: 0;
        cursor: pointer;
        vertical-align: middle;
        transition: none;
        transform: rotate(180deg);
    }

    .documentation section .mobile-section-header .hide-show_arrow svg {
        width: 21px;
        height: 21px;
        color: var(--color-foreground);
        transition: none;
    }

    .documentation section .mobile-section-header .hide-show_arrow:hover svg {
        color: var(--color-foreground);
    }

    /* Rotate arrow to point up when expanded */
    .documentation section .mobile-section-header .hide-show_arrow.active {
        transform: rotate(0deg);
    }

    /* Content area that gets collapsed */
    .documentation section .mobile-section-content {
        padding: 16px 0px;
        background: var(--color-background);
        transition: none;
        display: block;
    }

    /* Hidden state */
    .documentation section .mobile-section-content.hidden {
        display: none !important;
    }



    /* Hide h1 titles inside mobile sections since title is in header */
    .documentation section .mobile-section-content h1 {
        display: none !important;
    }

    /* Adjust content spacing for mobile cards */
    .documentation section .mobile-section-content h2 {
        margin-top: 60px;
        font-size: 1.5rem;
    }

    .documentation section .mobile-section-content p:first-child {
        margin-top: 0;
    }

    .documentation section .mobile-section-content p:last-child {
        margin-bottom: 0;
    }
}


/* Analytics Dashboard Styles */

/* Metrics Grid - Dashboard Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: var(--space-15);
    margin: var(--space-24) 0;
}


.metric-card {
    background: var(--color-background-darker);
    border: 1px solid var(--color-foreground-darker);
    padding: var(--space-18);
    border-radius: 2px;
    position: relative;
}

/* Status indicator circles for job status metrics */
.metric-status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--color-background-brighter);
    margin-right: 8px;
    vertical-align: middle;
}

/* Status-specific colors matching the progress tracker */
.metric-status-indicator.quote-status {
    background: var(--color-accent-03);
}

.metric-status-indicator.production-status {
    background: var(--color-accent-04);
}

.metric-status-indicator.completed-status {
    background: var(--color-accent-02);
}

.metric-label {
    font-size: 0.85em;
    color: var(--color-foreground);
    margin-bottom: var(--space-12);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2rem;
    min-height: 42px;
}

.metric-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--color-foreground);
    margin-bottom: var(--space-21);
}

.metric-trend {
    font-size: 0.8em;
    color: var(--color-foreground-darker);
}

/* Chart Sections */
.chart-section {
    margin: var(--space-24) 0 var(--space-60) 0;
    padding: var(--space-24);
    border: 1px solid var(--color-foreground-darker);
    background: var(--color-background-darker);
}

.chart-section h3 {
    margin-top: var(--space-9);
    margin-bottom: var(--space-21);
    color: var(--color-foreground);
}

.timeline-chart {
    background: var(--color-background-darker);
    border: 1px solid var(--color-foreground-darker);
    padding: var(--space-18);
    border-radius: 2px;
    min-height: 200px;
}

/* Material Bar Charts - Existing Pattern */
.material-chart {
    margin-top: var(--space-24);
    margin-bottom: var(--space-12);
}

.material-bars {
    margin-top: var(--space-12);
}

.material-bar-item {
    margin-bottom: var(--space-12);
}

.material-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: var(--space-6);
    color: var(--color-foreground);
}

.material-bar {
    width: 100%;
    height: 20px;
    background: var(--color-background-darker);
    border: 1px solid var(--color-foreground-darker);
    position: relative;
}

.material-bar-fill {
    height: 100%;
    background: var(--color-accent-01);
    transition: width 0.3s ease;
    min-width: 2px;
}

/* Typography */
h3 {
    margin-top: var(--space-24);
    margin-bottom: var(--space-12);
    color: var(--color-foreground);
}

/* Material Preset Chart Styles */
.preset-chart-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-12);
}

.preset-chart-row {
    display: flex;
    align-items: center;
    gap: var(--space-12);
}

.preset-label {
    width: 180px;
    flex-shrink: 0;
    font-size: 0.8em;
    color: var(--color-foreground);
    opacity: 0.8;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.preset-bar {
    flex: 1;
    height: 8px;
    background: var(--color-background);
    border: 1px solid var(--color-background-brighter);
    border-radius: 4px;
    position: relative;
}

.preset-bar-fill {
    height: 100%;
    background: var(--color-accent-04);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.preset-count {
    min-width: 30px;
    font-size: 0.9em;
    color: var(--color-foreground);
    text-align: right;
}

/* Form Styles - Extending existing input styling */
.form-group {
    margin-bottom: var(--space-18);
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 200;
    letter-spacing: 0.03rem;
    opacity: 0.8;
    font-size: 0.72rem;
    color: var(--color-foreground);
}

.form-group input[type="email"],
.form-group input[type="text"],
.form-group select,
.form-group textarea {
    width: 100%;
    height: 32px;
    padding: 6px 9px;
    border: 1px solid var(--color-background-brighter);
    font-size: 0.72rem;
    color: var(--color-foreground);
    font-weight: 200;
    font-family: var(--font-family-01);
    letter-spacing: 0.06rem;
    background: var(--color-background-darker);
    box-sizing: border-box;
}

.form-group input[type="email"]:hover,
.form-group input[type="text"]:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--color-foreground);
}

.form-group input[type="email"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-foreground);
    outline: none;
}

.form-group textarea {
    height: auto;
    min-height: 120px;
    resize: vertical;
    padding: 9px;
}

.form-group select {
    padding: 0 36px 0 9px;
}

.form-group .select-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.form-group .select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    width: 12px;
    height: 12px;
    color: var(--color-foreground);
}

.form-group .select-wrapper:focus-within .select-arrow {
    color: var(--color-foreground-brighter);
}

/* Custom Material Presets Tables */

.custom-presets-table {
    width: 100%;
    border-collapse: collapse;
    margin: 21px 0px 12px 0px;
}

.custom-presets-table th,
.custom-presets-table td {
    height: 30px;
    padding: 0px 12px;
    border: 1px solid var(--color-background-brighter);
    text-align: left;
    vertical-align: middle;
}

.custom-presets-table th {
    background-color: var(--color-background);
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--color-foreground-brighter);
    opacity: 0.9;
    padding: 9px 12px;
    text-wrap: nowrap;
}

/* Custom Material Presets Tables units (cm) */
.table-units {
    font-size: 0.6rem;
    opacity: 0.8;
}

/* Column width control */
.custom-presets-table th:nth-child(1),
.custom-presets-table td:nth-child(1) {
    width: 30%;
    /* Preset Name - widest column */
}

.custom-presets-table th:nth-child(2),
.custom-presets-table td:nth-child(2) {
    width: 15%;
    /* Width column */
}

.custom-presets-table th:nth-child(3),
.custom-presets-table td:nth-child(3) {
    width: 15%;
    /* Length column (fixed table) or Kerf column (variable table) */
}

.custom-presets-table th:nth-child(4),
.custom-presets-table td:nth-child(4) {
    width: 15%;
    /* Kerf column (fixed table) */
}

.custom-presets-table th:nth-child(5),
.custom-presets-table td:nth-child(5) {
    width: 5%;
    /* On/Off column for fixed table */
    text-align: center;
}

/* For variable table (4 columns total), adjust columns */
#variable-presets-table th:nth-child(4),
#variable-presets-table td:nth-child(4) {
    width: 5%;
    /* On/Off column for variable table */
    text-align: center;
}

/* Input styling within tables */
.custom-presets-table input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 0px;
    font-size: 0.75rem;
    color: inherit;
}

.custom-presets-table input:focus {
    outline: 1px solid var(--color-accent-01);
    background-color: var(--color-background);
}

.custom-presets-table input[readonly] {
    cursor: default;
}

/* Add preset button */
.create-preset-btn {
    width: auto;
    color: var(--color-foreground);
    background-color: var(--color-background-darker);
    border-color: var(--color-foreground-darker);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    text-wrap: nowrap;
    opacity: 0.75;
    cursor: pointer;
    padding: 8px 16px;
    border: 1px solid;
    transition: all 0.2s ease;
}


.create-preset-btn:hover {
    opacity: 1;
}

/* Preset visibility toggle styling */
.preset-visibility-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: block;
    margin: 0 auto;
}

.preset-visibility-toggle:hover {
    opacity: 1;
}

.preset-visibility-toggle .eye-icon {
    width: 16px;
    height: 16px;
    color: inherit;
}

/* Open eye state (default) */
.preset-visibility-toggle .eye-outline-top {
    stroke: var(--color-foreground);
    fill: none;
}

.preset-visibility-toggle .eye-outline-bottom {
    stroke: var(--color-foreground);
    fill: none;
    opacity: 0.72;
}

.preset-visibility-toggle .eye-pupil {
    stroke: var(--color-foreground);
    fill: none;
}

/* Closed eye state */
.preset-visibility-toggle.closed .eye-outline-top {
    stroke: var(--color-foreground-darker);
    fill: var(--color-background);
    opacity: 0.5;
    transform: translateY(2px);
}

.preset-visibility-toggle.closed .eye-outline-bottom {
    stroke: var(--color-foreground);
    fill: var(--color-background);
    opacity: 0.5;
    transform: translateY(-2px);
}

.preset-visibility-toggle.closed .eye-pupil {
    display: none;
}

.preset-visibility-toggle.closed {
    color: var(--color-foreground-darker);
    opacity: 1;
}

.preset-visibility-toggle.closed:hover {
    opacity: 1;
}

/* Hidden preset row styling */
.custom-preset-row.preset-hidden {
    pointer-events: none;
}

.custom-preset-row.preset-hidden td:not(:last-child) {
    opacity: 0.42;
}

.custom-preset-row.preset-hidden .preset-visibility-toggle {
    pointer-events: auto;
}

/* Panel Groups Table - Clean implementation */
#panel-groups-table td[rowspan]:first-child {
    vertical-align: top;
}

#panel-groups-table td[rowspan]:last-child {
    vertical-align: middle;
}

#panel-groups-table .preset-name-input,
#panel-groups-table .preset-width-input,
#panel-groups-table .preset-length-input,
#custom-panel-group-presets-table .preset-name-input,
#custom-panel-group-presets-table .preset-width-input,
#custom-panel-group-presets-table .preset-length-input {
    text-align: left;
}

#panel-groups-table .preset-qty-input,
#custom-panel-group-presets-table .preset-qty-input {
    text-align: center;
}

#panel-groups-table .custom-preset-row.preset-hidden td {
    opacity: 0.42;
}

#panel-groups-table .custom-preset-row.preset-hidden .preset-visibility-toggle {
    opacity: 1;
}

/* Horizontal scroll for tables up to 1020px with hidden scrollbars */
@media (max-width: 1020px) {
    .custom-presets-table-container {
        overflow-x: auto;
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
    }

    .custom-presets-table-container::-webkit-scrollbar {
        display: none;
        /* Chrome/Safari */
    }

    /* Ensure Material Preset Name column is never cropped */
    .custom-presets-table th:first-child,
    .custom-presets-table td:first-child {
        min-width: 180px;
        white-space: nowrap;
    }

    .custom-presets-table th:first-child input,
    .custom-presets-table td:first-child input {
        min-width: 160px;
    }
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .custom-presets-table th:nth-child(1),
    .custom-presets-table td:nth-child(1) {
        width: 35%;
    }

    .preset-actions {
        flex-direction: column;
        gap: 4px;
    }

    .preset-actions .button--small {
        min-width: auto;
        font-size: 0.75rem;
    }
}

/* =================
   STAFF MANAGEMENT
   ================= */

.staff-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-foreground-darker);
}

.staff-section h3 {
    margin-bottom: 1rem;
    color: var(--color-foreground);
}

.staff-section h4 {
    margin: 1.5rem 0 0.8rem 0;
    color: var(--color-foreground);
    font-size: 1rem;
    font-weight: 500;
}

/* Staff Table */
.staff-list-container {
    margin-bottom: 2rem;
}

.table-container {
    overflow-x: auto;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
}

.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: auto;
}

.staff-table th,
.staff-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-foreground-darker);
}

.staff-table th:nth-child(1),
.staff-table td:nth-child(1) {
    max-width: 30ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.staff-table th:nth-child(3),
.staff-table td:nth-child(3) {
    min-width: fit-content;
    max-width: 300px;
}

.staff-table th {
    background: var(--color-backround);
    font-weight: 500;
    color: var(--color-foreground);
}

.staff-table td {
    color: var(--color-foreground);
}

.staff-table tbody tr:last-child td {
    border-bottom: none;
}

.staff-table .staff-placeholder {
    opacity: 0.5;
}

.staff-table .staff-placeholder button {
    cursor: not-allowed;
}

/* Inline Staff Editing */
.staff-row-editing {
    background: var(--color-background-darker);
}

.role-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.staff-row-editing .permission-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 1rem;
    padding: 12px 0px;
   
}

.staff-row-editing .checkbox-label {
    display: flex;
    text-wrap: nowrap;
    font-size: 0.72rem;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.staff-row-editing .checkbox-input {
    margin: 0;
    flex-shrink: 0;
}

/* Read-only permission checkboxes in view mode */
.permission-checkboxes-readonly {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 1rem;
    padding: 12px 0px;
    opacity: 0.8;
}

.permission-checkboxes-readonly .checkbox-label {
    display: flex;
    text-wrap: nowrap;
    font-size: 0.72rem;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    cursor: not-allowed;
}

.permission-checkboxes-readonly .checkbox-input {
    margin: 0;
    flex-shrink: 0;
    cursor: not-allowed;
}

.staff-list-empty td {
    text-align: center;
    color: var(--color-foreground-darker);
    font-style: italic;
    padding: 1.5rem;
}

/* Role Badge */
.role-badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--color-accent-04-darker);
    color: var(--color-accent-04-brighter);
}

/* Staff Actions */
.staff-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: space-evenly;
    padding: 15px 0px;
}

.staff-actions .small-button {
    font-size: 0.75rem;
    padding: 2px 6px;
    width: 60px;
    height: 22px;
}

.staff-status {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 500;
}

.staff-status.active {
    background: var(--color-accent-01-darker);
    color: var(--color-accent-01-brighter);
}

.staff-status.pending {
    background: var(--color-accent-03-darker);
    color: var(--color-accent-03-brighter);
}

.staff-status.disabled {
    background: var(--color-accent-02-darker);
    color: var(--color-accent-02-brighter);
}

/* Invite Form */
.invite-staff-container {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
    background: var(--color-background-darker);
}

.invite-form {
    margin: 12px 0px;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: end;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--color-foreground);
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 2px;
    background: var(--color-background);
    color: var(--color-foreground);
    font-size: 0.85rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-accent-04);
}

.form-group:last-child {
    flex: 0;
}

/* Role Cards */
.role-descriptions {
    margin-bottom: 1rem;
}

.role-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.role-card {
    padding: 1rem;
    border: 1px solid var(--color-foreground-darker);
    border-radius: 4px;
    background: var(--color-background-darker);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.role-card:hover {
    border-color: var(--color-foreground);
}

.role-card.selected {
    border-color: var(--color-accent-01);
    background: var(--color-accent-01-darker);
}

.role-name {
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-foreground);
}

.role-permissions ul {
    margin: 0;
    padding-left: 1.2rem;
    list-style-type: disc;
}

.role-permissions li {
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
    color: var(--color-foreground-darker);
    transition: color 0.2s ease;
}

.role-card.selected .role-permissions li {
    color: var(--color-foreground);
}

/* Permission Checkboxes */
.permission-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.permission-checkboxes .checkbox-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.permission-checkboxes .checkbox-label.disabled .checkbox-input {
    cursor: not-allowed;
}

/* Permissions Summary */
.permissions-summary {
    font-size: 0.75rem;
    color: var(--color-foreground-darker);
    line-height: 1.3;
    display: block;
}

.small-button.secondary {
    background: transparent;
    border-color: var(--color-foreground-darker);
    color: var(--color-foreground-darker);
}

.small-button.secondary:hover {
    background: var(--color-background-darker);
    border-color: var(--color-foreground);
    color: var(--color-foreground);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
    }

    .form-group:last-child {
        flex: 1;
    }

    .role-cards {
        grid-template-columns: 1fr;
    }

    .staff-table {
        font-size: 0.8rem;
    }

    .staff-table th,
    .staff-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 1020px) {
    .table-container {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .table-container::-webkit-scrollbar {
        display: none;
    }

    .staff-table th:first-child,
    .staff-table td:first-child {
        min-width: 120px;
        white-space: nowrap;
    }
}

/* Staff permissions display */
.temp-disabled {
    color: var(--color-foreground);
}