/* ============================================================================
   Rizzy Doors Quote System - Main Styles
   ============================================================================ */

/* ============================================================================
   FONTS & CUSTOM PROPERTIES
   ============================================================================ */

/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Mokoto Font */
@font-face {
    font-family: 'Mokoto';
    src: url('../fonts/mokoto.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* CSS Custom Properties */
:root {
    --primary-color: #00204b;
    --secondary-color: #2D3748;
    --accent-color: #334d6f;
    --background-color: #F7FAFC;
    --text-color: #1A202C;
    --spacing-unit: 1rem;

    /* Additional semantic colors */
    --success-color: #28a745;
    --warning-color: #fd7e14;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;

    /* Border and shadow */
    --border-color: #dee2e6;
    --border-radius: 6px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --box-shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow-y: scroll;
}

/* Typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Mokoto font application */
header h1,
.login-form h2 {
    font-family: 'Mokoto', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: normal;
    letter-spacing: 0.3px;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* ============================================================================
   HEADER & NAVIGATION
   ============================================================================ */

.header {
    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--box-shadow);
    position: relative;
    z-index: 1001;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-unit);
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Logo - Left */
.logo {
    position: absolute;
    left: var(--spacing-unit);
}

.logo img {
    height: 40px;
    width: auto;
    display: block;
}

.logo a {
    display: block;
    transition: opacity 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.logo a:hover {
    opacity: 0.8;
    cursor: pointer;
}

/* Navigation - Center */
.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: center;
    min-width: 600px;
}

.nav-links li {
    margin-right: 2rem;
}

.nav-links li:last-child {
    margin-right: 0;
}

.nav-link {
    text-decoration: none;
    color: white;
    font-weight: 500;
    font-family: 'Mokoto', sans-serif;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: pointer;
    pointer-events: auto;
}

.nav-link:hover {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

.nav-link.active {
    border-bottom-color: rgba(255, 255, 255, 0.9);
}


.nav-link:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Add extra space after dashboard link */
.nav-link[href*="takeoffs"] {
    margin-left: 4rem; /* 2rem + 2rem extra for separation from dashboard */
}

/* User Actions Navigation - Right */
.nav-links-right {
    position: absolute;
    right: var(--spacing-unit);
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

/* Title - Right */
.header-title {
    position: absolute;
    right: var(--spacing-unit);
}

.header-title h1 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: normal;
    letter-spacing: 0.5px;
    color: white;
}

/* ============================================================================
   MAIN CONTENT AREAS
   ============================================================================ */

main {
    padding: 2rem 0;
}

.page-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 2rem;
}

.actions {
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem; /* 8px gap between buttons */
}

.actions > * {
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    text-align: center;
    line-height: 1;
}

.btn:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button variants */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 32, 75, 0.2);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 32, 75, 0.3);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
}

.btn-success:hover {
    background: #218838;
    border-color: #218838;
    color: white;
}

.btn-info {
    background: var(--info-color);
    color: white;
    border: 1px solid var(--info-color);
}

.btn-info:hover {
    background: #138496;
    border-color: #138496;
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
    border: 1px solid var(--warning-color);
}

.btn-warning:hover {
    background: #e8660c;
    border-color: #e8660c;
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
}

/* Confirm price button */
.btn-confirm-price {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
    font-weight: 900;
    width: 27px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-confirm-price:hover {
    background: #218838;
    border-color: #218838;
    color: white;
}

/* Button sizes */
.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}



.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Button variants */
.btn-outline {
    background: transparent;
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Semantic button classes */
.btn-edit {
    background: var(--info-color);
    color: white;
    border: 1px solid var(--info-color);
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-edit:hover {
    background: #138496;
    border-color: #138496;
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
    font-weight: bold;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    width: 27px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-delete:hover {
    background: #c82333;
    border-color: #c82333;
    color: white;
}

.btn-deactivate {
    background: var(--warning-color);
    color: white;
    border: 1px solid var(--warning-color);
}
.btn-deactivate:hover {
    background: #e8660c;
    border-color: #e8660c;
    color: white;
}

.btn-activate {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
}
.btn-activate:hover {
    background: #218838;
    border-color: #218838;
    color: white;
}

.btn-view {
    background: #6f42c1;
    color: white;
    border: 1px solid #6f42c1;
}
.btn-view:hover {
    background: #5a32a3;
    border-color: #5a32a3;
    color: white;
}

.btn-quote {
    background: var(--success-color);
    color: white;
    border: 1px solid var(--success-color);
}
.btn-quote:hover {
    background: #218838;
    border-color: #218838;
    color: white;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(51, 77, 111, 0.1);
}

.form-group textarea {
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-group.full-width {
    flex: 1 1 100%;
}

/* Date fields container */
.date-fields {
    display: flex;
    gap: 1rem;
}

.date-field {
    flex: 1;
}

.date-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin-bottom: 0.375rem;
}

.date-field input[type="date"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.date-field input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 32, 75, 0.1);
}

.date-field select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    background-color: white;
}

.date-field select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 32, 75, 0.1);
}

/* Checkbox styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    transform: scale(1.2);
}

.checkbox-group .help-text {
    color: #666;
    font-size: 0.875rem;
    font-style: italic;
    margin-left: 1.5rem;
}

/* ============================================================================
   FILTERS & SEARCH
   ============================================================================ */

.filters-row {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 2rem;
    position: relative;
    padding-right: 300px; /* Reserve space for filter buttons on the right */
}

/* Status filters - positioned to the right */
.status-filter-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.status-filter-section label {
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    white-space: nowrap;
}

/* Column reset section */
.column-reset-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Add button section */
.add-button-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.add-button-section .btn {
    width: 160px;
    white-space: nowrap;
    font-family: 'Mokoto', sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2; /* Better vertical centering */
}

/* Search section - standardized layout */
.search-section {
    flex-shrink: 0;
}

/* Header Menu - 3-dot menu in Actions column header */
.header-menu-wrapper {
    float: right;
    position: relative;
    display: inline-block;
}

.header-menu {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 1rem;
    line-height: 1;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    user-select: none;
}

.header-menu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.header-dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    min-width: 140px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 4px;
    z-index: 1000;
    border: 1px solid #ddd;
    margin-top: 2px;
}

.header-dropdown-content .btn-reset-columns {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    text-align: left;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: #333;
    border-radius: 4px;
    line-height: 1.2;
}

.header-dropdown-content .btn-reset-columns:hover {
    background: #f8f9fa;
}

.header-menu-wrapper.active .header-dropdown-content {
    display: block;
}

/* Category filters - match status filter styling */
.category-filter-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.category-filter-section label {
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
    white-space: nowrap;
}

.status-filter-buttons,
.category-filter-buttons {
    display: flex;
    gap: 0.5rem;
}

.category-filters-row {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 2rem;
}

.status-filter-btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--secondary-color);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--secondary-color);
    background: white;
    transition: all 0.2s ease;
    line-height: 1.2; /* Better vertical centering */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-filter-btn:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
}

.status-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Search */
.search-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-bar input {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--secondary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: white;
    color: var(--secondary-color);
    transition: all 0.2s ease;
    min-width: 455px;
    line-height: 1.2; /* Better vertical centering */
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 32, 75, 0.1);
}

.search-bar input::placeholder {
    color: var(--secondary-color);
    font-weight: 400;
}

.search-bar .btn-secondary {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    line-height: 1.2; /* Better vertical centering */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-container,
.vendors-table-container,
.customers-table-container,
.products-table-container,
.quotes-table-container,
.takeoffs-table-container,
.archived-orders-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    width: 100%;
    /* Hide table until column widths are applied to prevent visual jarring */
    opacity: 0;
    transition: opacity 0.15s ease-in;
}

.table-container.widths-applied,
.vendors-table-container.widths-applied,
.customers-table-container.widths-applied,
.products-table-container.widths-applied,
.quotes-table-container.widths-applied,
.takeoffs-table-container.widths-applied,
.archived-orders-table-container.widths-applied {
    opacity: 1;
}

.table,
.vendors-table,
.customers-table,
.products-table,
.quotes-table,
.takeoffs-table,
.archived-orders-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 1px 0;
    table-layout: fixed;
}

.table th,
.table td,
.vendors-table th,
.vendors-table td,
.customers-table th,
.customers-table td,
.products-table th,
.products-table td,
.quotes-table th,
.quotes-table td,
.takeoffs-table th,
.takeoffs-table td,
.archived-orders-table th,
.archived-orders-table td {
    padding: 0.75rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 0;
    font-size: 0.8rem;
}

.table th,
.vendors-table th,
.customers-table th,
.products-table th,
.quotes-table th,
.takeoffs-table th,
.archived-orders-table th {
    background: var(--primary-color);
    font-family: 'Mokoto', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: white;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.table tbody tr:hover,
.vendors-table tbody tr:hover,
.customers-table tbody tr:hover,
.products-table tbody tr:hover,
.quotes-table tbody tr:hover,
.takeoffs-table tbody tr:hover,
.archived-orders-table tbody tr:hover {
    background: var(--light-color);
}

/* Table content styling */

/* Action columns should be narrower */
.table .actions,
.vendors-table .actions,
.customers-table .actions,
.products-table .actions,
.quotes-table .actions {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    padding: 0.75rem 0.25rem; /* Keep vertical padding same as other cells, reduce horizontal */
}

/* Buttons column for table data cells - avoids flexbox inheritance from global .actions */
.table td.buttons,
.vendors-table td.buttons,
.customers-table td.buttons,
.products-table td.buttons,
.quotes-table td.buttons,
.takeoffs-table td.buttons,
.archived-orders-table td.buttons {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    padding: 0.75rem 0.25rem;
}

/* Status indicators and small content can be narrower */
.table th:first-child,
.table td:first-child {
    width: 30%;
}

/* Cost/price columns can be narrow */
.cost, .sell-price, .quote-count, .last-quote {
    width: 100px;
    white-space: nowrap;
}

/* Currency columns should be right-aligned */
.cost, .sell-price, .quote-total {
    text-align: right;
}

/* ============================================================================
   TABLE COLUMN RESIZING
   ============================================================================ */

/* Resizable table headers */
.resizable {
    position: relative;
}

/* Resize handle styling */
.resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    width: 4px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1000;
    user-select: none;
}

.resize-handle:hover {
    background: rgba(255, 255, 255, 0.3);
    border-right: 2px solid rgba(255, 255, 255, 0.6);
}

.resize-handle:active {
    background: rgba(255, 255, 255, 0.5);
    border-right: 2px solid rgba(255, 255, 255, 0.8);
}

/* Visual feedback during resize */
.resizing {
    background: var(--accent-color);
    transition: none;
}

/* Prevent text selection during resize */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Enhanced cursor feedback */
.resize-handle:hover,
.resizing .resize-handle {
    cursor: col-resize;
}

/* Name styling */
.vendor-name,
.customer-name,
.product-name,
.quote-name {
    font-weight: normal;
    color: var(--primary-color);
    min-width: 200px;
}

.name-with-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quote-name-link,
.product-description-link,
.customer-name-link,
.vendor-name-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.quote-name-link:hover,
.product-description-link:hover,
.customer-name-link:hover,
.vendor-name-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.status-indicator {
    width: 5px;
    height: 1.2em;
    border-radius: 2px;
    flex-shrink: 0;
    margin-right: 0;
}

.status-indicator.status-active {
    background-color: var(--success-color);
}

.status-indicator.status-inactive {
    background-color: var(--danger-color);
}

/* Takeoff status indicators */
.status-indicator.status-draft {
    background-color: var(--danger-color); /* Red */
}

.status-indicator.status-quoted {
    background-color: #22c55e; /* Bright green - more contrast with blue */
}

.status-indicator.status-sent {
    background-color: #22c55e; /* Bright green - matches quoted */
}

.status-indicator.status-archived {
    background-color: #3b82f6; /* Bright blue - more contrast with green */
}

/* Stale pricing warning icon (products table) */
.stale-pricing-warning {
    color: #ff8c00; /* Orange - matches quote items warning color */
    font-size: 0.875rem;
    font-weight: bold;
    margin-right: 0;
    flex-shrink: 0;
    cursor: help;
    line-height: 1;
    vertical-align: middle;
}

/* Table utility classes */
.text-center { text-align: center; }
.text-muted { color: #6c757d; }
.text-nowrap { white-space: nowrap; }

.no-data {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.no-data a {
    color: var(--accent-color);
    text-decoration: none;
}

.no-data a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* ============================================================================
   MODALS - LARGE VIEW/EDIT SYSTEM
   ============================================================================ */

/* Modal overlay */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

/* Modal content - dynamic height based on content */
.modal-content {
    background-color: white;
    position: fixed;
    top: 80px; /* Start underneath nav header - fixed */

    /* Dynamic height - fit content but don't exceed bottom constraint */
    max-height: calc(100vh - 130px); /* Maximum: 50px from bottom */
    min-height: 200px; /* Minimum height for usability */
    height: auto; /* Let content determine height */

    /* Horizontal positioning: 25px margins on each side of 1200px main table */
    left: 50%;
    transform: translateX(-50%);
    width: 1150px; /* 1200px table - 50px total margins */
    max-width: calc(100vw - 50px); /* Never exceed viewport with margins */
    min-width: 600px; /* Increased minimum to prevent header text collision */

    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--box-shadow-lg);
    display: flex;
    flex-direction: column;
}

/* Modal header - three-column layout for centered print button */
.modal-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* Title | Print Button | Close */
    align-items: center;
    padding: 0.75rem 1.5rem; /* Reduced height to match table headers */
    border-bottom: 1px solid var(--border-color);
    background: var(--primary-color);
    border-radius: 8px 8px 0 0;
}

/* Modal header titles with Mokoto font */
.modal-header h3 {
    font-family: 'Mokoto', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    color: white;
}

/* Header actions container - right-aligned */
.modal-header .header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Print button in modal headers - centered */
.modal-header .btn-print {
    background: var(--accent-color);
    border: 1px solid white;
    color: white;
    padding: 0.5rem 1rem; /* Increased padding for better proportion */
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.2; /* Reduced line-height for better vertical centering */
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    grid-column: 2; /* Place in center column */
}

.modal-header .btn-print:hover {
    background: white;
    color: var(--secondary-color);
    border-color: white;
}

/* Close button - positioned in right column */
.modal-header .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: white;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    grid-column: 3; /* Place in right column */
    justify-self: end; /* Align to right within the column */
}

.modal-header .close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal body - flex layout for scrolling */
.modal-body,
.view-modal-body,
.edit-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Modal actions */
.modal-actions,
.view-modal-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* View modal styles */
.view-modal-body {
    padding: 1.5rem;
}

.view-field-group {
    margin-bottom: 1.5rem;
}

.view-field-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.view-field {
    flex: 1;
}

.view-field-label {
    display: block;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.view-field-value {
    font-size: 1rem;
    color: var(--text-color);
    min-height: 1.5rem;
}

.view-field-value.email a,
.view-field-value.phone a {
    color: var(--primary-color);
    text-decoration: none;
}

.view-field-value.email a:hover,
.view-field-value.phone a:hover {
    text-decoration: underline;
}

.view-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--light-color);
}

.view-modal-meta {
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.view-modal-buttons {
    display: flex;
    gap: 0.5rem;
}

/* ============================================================================
   CARDS & DASHBOARD
   ============================================================================ */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.card h3 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.card ul {
    list-style: none;
}

.card ul li {
    margin-bottom: 0.5rem;
}

.card ul li a {
    color: var(--accent-color);
    text-decoration: none;
}

.card ul li a:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

/* Dashboard statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-unit);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-unit);
    background: var(--background-color);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.5px;
}


/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-page {
    background-color: var(--primary-color);
    min-height: 100vh;
    padding-top: 0;
}

.login-page .header {
    position: relative;
    z-index: 1000;
    box-shadow: none;
}

.login-page .nav-container {
    justify-content: space-between;
}

.login-page .logo {
    position: static;
}

.login-page .header-title {
    position: static;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 4rem auto 2rem;
    padding: 0 var(--spacing-unit);
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--box-shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-form h2 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.login-form .btn {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 auto;
}

.development-note {
    margin-top: 1.5rem;
    text-align: center;
}

.development-note p {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin: 0;
}

/* ============================================================================
   MESSAGES & ALERTS
   ============================================================================ */

.error {
    background-color: var(--danger-color);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: center;
}

.success {
    background-color: var(--success-color);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: center;
}

.warning {
    background-color: var(--warning-color);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: center;
}

.info {
    background-color: var(--info-color);
    color: white;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    text-align: center;
}

.field-error {
    color: var(--danger-color);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.similarity-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--border-radius);
    padding: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.85rem;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.similarity-warning .warning-icon {
    display: inline-block;
    margin-right: 0.25rem;
}

.similarity-warning .similar-names {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.similarity-warning .similar-names li {
    margin: 0.25rem 0;
}

.similarity-warning .similarity-acknowledgment {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.similarity-warning .acknowledge-similarity-btn {
    flex-shrink: 0;
}

.similarity-warning .acknowledgment-text {
    font-size: 0.8rem;
    color: #666;
}

/* Ensure the input field maintains its width when warning appears */
.info-value input#name {
    width: 100%;
    box-sizing: border-box;
}

/* Wrapper for name field to handle similarity warning without breaking layout */
.info-value:has(#name) {
    display: block; /* Override flex for name field container only */
}

.info-value:has(#name) input {
    display: block;
    width: 100%;
}

/* Ensure form-group inputs also maintain width */
.form-group input#name,
.form-group input#name:focus {
    width: 100%;
    box-sizing: border-box;
}



/* ============================================================================
   STANDARDIZED DATA VIEW LAYOUT (All Modules - Internal Review Tool)

   This pattern provides a unified modal layout for all modules (quotes, products,
   customers, vendors). It supports two layout approaches:

   1. SECTION-BASED LAYOUT (New Pattern - Recommended):
      - Use .data-view class on modal body
      - Organize content in sections with .section-header
      - Use .info-grid and .info-row for data display
      - Best for comprehensive data review

   2. FIELD-BASED LAYOUT (Legacy Pattern - Still Supported):
      - Use .data-view class on modal body
      - Use .view-field-group, .view-field-row, .view-field pattern
      - Best for simple data display

   Both patterns work within .data-view and provide:
   - Consistent typography and spacing
   - Professional internal tool appearance
   - Proper scrolling for long content
   - Easy transition from view to edit modals
   ============================================================================ */

.data-view, .quote-data-view {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: white;
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Section Layout */
.data-view > div, .quote-data-view > div {
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    background: #fafafa;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.section-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

.item-count {
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Info Grid Layout */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 30px;
    align-items: start;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 300px;
    margin-left: auto;
}

.info-row, .pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e8e8e8;
}

.info-row:last-child, .pricing-row:last-child {
    border-bottom: none;
}

.info-row label, .pricing-row label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
    text-align: left;
}

.info-row span, .pricing-row span {
    color: #333;
    text-align: right;
    word-break: break-word;
}

/* Special Styling */
.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-badge.status-sent {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.status-approved {
    background: #d4edda;
    color: #155724;
}

.amount-highlight {
    font-weight: normal;
    color: var(--primary-color);
    font-size: inherit;
}

.total-amount {
    font-weight: normal;
    color: var(--primary-color);
    font-size: inherit;
}

.total-row {
    border-top: 2px solid var(--primary-color);
    padding-top: 15px;
    margin-top: 10px;
}

.uuid-text {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #666;
}

/* Items Table */
.items-table-container {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.items-data-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
}

.items-data-table thead th {
    background: var(--primary-color);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.items-data-table tbody td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    font-size: 13px;
}

.items-data-table tbody td.item-drag-handle {
    padding: 0;
    vertical-align: middle;
}

.items-data-table tbody td.item-quantity {
    padding: 0;
}

.items-data-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.items-data-table tbody tr:hover {
    background: #e3f2fd;
}

/* Quote Items Table Column Widths */
.items-data-table .drag-handle-column {
    width: 18px;
    text-align: center;
    min-width: 18px;
}

.items-data-table .qty-column {
    width: 40px;
    text-align: center;
    min-width: 40px;
}

.items-data-table .description-column {
    width: auto; /* Takes remaining space */
    min-width: 200px;
}

.items-data-table .cost-column {
    width: 90px;
    text-align: right;
    min-width: 90px;
}

.items-data-table .unit-price-column {
    width: 90px;
    text-align: right;
    min-width: 90px;
}

.items-data-table .amount-column {
    width: 100px;
    text-align: right;
    min-width: 100px;
}

.items-data-table .actions-column {
    width: 30px;
    text-align: center;
    min-width: 30px;
}

.items-data-table tbody td.actions-column {
    padding: 0;
    padding-right: 8px;
}

.items-data-table tbody td.item-actions {
    padding: 10px 10px 10px 0;
    text-align: center;
}

/* Column content alignment */
.items-data-table tbody td:nth-child(1) { /* Qty */
    text-align: center;
}

.items-data-table tbody td:nth-child(2) { /* Description */
    text-align: left;
}

.items-data-table tbody td:nth-child(3) { /* Unit Price */
    text-align: right;
}

.items-data-table tbody td:nth-child(4) { /* Amount */
    text-align: right;
}

.items-data-table tbody td:nth-child(5) { /* Actions */
    text-align: center;
}

/* Item Status Indicators */
.item-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.item-status.current {
    background: #d4edda;
    color: #155724;
}

.item-status.changed {
    background: #fff3cd;
    color: #856404;
}

.item-status.deleted {
    background: #f8d7da;
    color: #721c24;
}

/* Item Details */
.item-description-full {
    font-weight: 500;
    margin-bottom: 4px;
}

.item-snapshot-info {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Modal Integration - Preserve existing modal structure */
#quote-view-modal .modal-header {
    background: var(--primary-color);
    color: white;
    font-family: 'Mokoto', sans-serif;
}

#quote-view-modal .view-modal-actions {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Scrolling for long content */
.data-view, .quote-data-view {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f1f1f1;
}

.data-view::-webkit-scrollbar, .quote-data-view::-webkit-scrollbar {
    width: 8px;
}

.data-view::-webkit-scrollbar-track, .quote-data-view::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.data-view::-webkit-scrollbar-thumb, .quote-data-view::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.data-view::-webkit-scrollbar-thumb:hover, .quote-data-view::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Bridge CSS: Allow existing view-field system to work with new data-view */
.data-view .view-field-group, .data-view .view-field-row, .data-view .view-field {
    margin-bottom: 1.5rem;
}

.data-view .view-field-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.data-view .view-field {
    flex: 1;
}

.data-view .view-field-label {
    display: block;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.data-view .view-field-value {
    font-size: 1rem;
    color: var(--text-color);
    min-height: 1.5rem;
}

/* Preserve modal button styling */
#quote-view-modal .modal-header h3,
#quote-view-modal .modal-header .btn-print,
#quote-view-modal .modal-header .close,
#quote-view-modal .view-modal-actions *,
.modal-actions * {
    font-family: 'Mokoto', sans-serif;
}

/* Print styles */
@media print {
    .header,
    .filters-row,
    .actions,
    .btn {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: none;
        padding: 0;
    }
}

/* ============================================================================
   PLACEHOLDER SECTIONS
   ============================================================================ */

.placeholder-section {
    padding: 2rem;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
    margin: 1rem 0;
}

.placeholder-content {
    max-width: 400px;
    margin: 0 auto;
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.placeholder-content h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.placeholder-content p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.placeholder-note {
    font-style: italic;
    font-size: 0.875rem;
    color: #495057;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Display utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }

/* Flex utilities */
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }

/* Spacing utilities */
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.p-0 { padding: 0; }
.pt-1 { padding-top: 0.25rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pb-3 { padding-bottom: 1rem; }

/* ============================================================================
   SETTINGS PAGE STYLES
   ============================================================================ */

/* Settings Page Enhancements */
html {
    scroll-behavior: smooth;
}

/* Quick Navigation */
.settings-nav {
    background: white;
    border-radius: 8px;
    padding: var(--spacing-unit) 2rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.settings-nav .nav-header h3 {
    margin: 0;
    font-family: 'Mokoto', sans-serif;
    font-weight: 500;
    color: var(--primary-color);
    font-size: 1rem;
    white-space: nowrap;
}

.settings-nav .quick-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    flex: 1;
}

.settings-nav .quick-nav-link {
    padding: 0.4rem 0.75rem;
    background: var(--light-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-nav .quick-nav-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Settings Sections */
.settings-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 3rem;
}

.settings-section:last-of-type {
    margin-bottom: 6rem; /* Extra space for sticky save button */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.section-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-family: 'Mokoto', sans-serif;
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    transition: color 0.2s ease;
}

.section-title-with-button {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.section-description {
    color: var(--secondary-color);
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
}

/* Settings Form */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Inline form groups - label and input side by side */
.inline-form-group {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.inline-form-group label {
    flex: 0 0 200px;
    font-weight: 600;
    margin-bottom: 0;
    padding-top: 0.5rem;
    font-size: 0.8rem;
}

.form-input-container {
    flex: 1;
}

/* Full width form groups - for textarea */
.full-width-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-width-form-group label {
    font-weight: 600;
    margin-bottom: 0;
}

.settings-form .form-group {
    margin-bottom: 0;
}

/* Input with suffix (for percentages) */
.input-with-suffix {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-suffix input {
    padding-right: 3rem;
}

.input-suffix {
    position: absolute;
    right: 12px;
    color: var(--secondary-color);
    font-weight: 500;
    pointer-events: none;
}

/* Margin input specific styling */
.margin-input {
    max-width: 70px !important;
    text-align: right;
    padding-right: 0.5rem !important;
}

.input-with-suffix .margin-input + .input-suffix {
    position: static;
    margin-left: 2px;
    padding-left: 2px;
}

/* Setting input styling */
.setting-input,
.form-group .setting-input {
    width: 100%;
    max-width: 400px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.8rem !important;
    transition: border-color 0.2s ease;
}

/* Exclude checkboxes from width and padding constraints */
.setting-input[type="checkbox"] {
    width: auto;
    max-width: none;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Textarea in inline layout */
.inline-form-group .setting-input[type="textarea"],
.inline-form-group textarea.setting-input {
    max-width: 500px;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 32, 75, 0.1);
}

/* Changed settings indicator */
.setting-input.changed {
    border-color: var(--accent-color);
    background-color: #fff9e6;
}

/* Invalid input indicator */
.setting-input.invalid {
    border-color: var(--danger-color);
    background-color: #ffe6e6;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* Tooltip labels */
.tooltip-label {
    position: relative;
    cursor: help;
}

.tooltip-label:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.tooltip-label:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border: 5px solid transparent;
    border-top-color: #333;
    margin-bottom: -5px;
    z-index: 1000;
}


/* Settings Actions - Floating overlay with proper content alignment */
.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
    position: fixed;
    bottom: calc(2rem + 25px);
    right: calc(50vw - 600px + var(--spacing-unit));
    width: auto;
    z-index: 1000;
}

/* Ensure settings container has relative positioning for absolute child */
.container {
    position: relative;
}

/* Settings actions buttons - match modal button styling with Mokoto font */
.settings-actions * {
    font-family: 'Mokoto', sans-serif;
}

/* Remove min-width to let buttons size naturally */
.settings-actions .btn {
    /* Auto-sizing based on content */
}

.settings-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Tax Rates Styles */
.tax-rates-container {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.tax-rates-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tax-rate-item {
    display: grid;
    grid-template-columns: 1fr auto 200px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    gap: 1rem;
}

.tax-rate-item:last-child {
    border-bottom: none;
}

.tax-rate-item:hover {
    background-color: var(--light-color);
}

.tax-rate-item.inactive {
    opacity: 0.6;
}

.tax-rate-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.tax-rate-name {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    min-width: 150px;
}

.tax-rate-value {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1rem;
    min-width: 60px;
}

.inactive-label {
    background: var(--secondary-color);
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tax-rate-middle {
    display: flex;
    justify-content: center;
    align-items: center;
}

.tax-rate-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    min-height: 32px; /* Ensure consistent height even when delete button is missing */
}

.button-spacer {
    width: 60px; /* Same width as typical Delete button */
    height: 32px; /* Same height as buttons */
}

.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: white;
}

.badge-edit {
    background: var(--secondary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.badge-edit:hover {
    background: #4a5568;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.badge-danger:hover {
    background: #c82333;
}

.badge-success {
    background: #28a745;
    color: white;
}


.tax-rate-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.tax-rate-meta small {
    color: var(--secondary-color);
    font-size: 0.8rem;
}

/* Tax Rate Form */
.tax-rate-form .form-group {
    margin-bottom: 1.5rem;
}

.tax-rate-form .inline-form-group {
    margin-bottom: 1rem;
}

.tax-rate-form .form-input-container .checkbox-label {
    padding-top: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.empty-state p {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Text utilities */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.font-weight-normal { font-weight: normal; }
.font-weight-bold { font-weight: bold; }

/* Color utilities */
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-light { color: var(--light-color); }
.text-dark { color: var(--dark-color); }
.text-muted { color: #6c757d; }

/* Background utilities */
.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-success { background-color: var(--success-color); }
.bg-danger { background-color: var(--danger-color); }
.bg-warning { background-color: var(--warning-color); }
.bg-info { background-color: var(--info-color); }
.bg-light { background-color: var(--light-color); }
.bg-dark { background-color: var(--dark-color); }

/* Border utilities */
.border { border: 1px solid var(--border-color); }
.border-0 { border: 0; }
.rounded { border-radius: var(--border-radius); }
.rounded-0 { border-radius: 0; }

/* Shadow utilities */
.shadow { box-shadow: var(--box-shadow); }
.shadow-lg { box-shadow: var(--box-shadow-lg); }
.shadow-none { box-shadow: none; }

/* ============================================================================
   TABLE SORTING STYLES
   ============================================================================ */

/* Sortable column headers */
.table th.sortable,
.vendors-table th.sortable,
.customers-table th.sortable,
.products-table th.sortable,
.quotes-table th.sortable,
.archived-orders-table th.sortable {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.table th.sortable:hover,
.vendors-table th.sortable:hover,
.customers-table th.sortable:hover,
.products-table th.sortable:hover,
.quotes-table th.sortable:hover,
.archived-orders-table th.sortable:hover {
    background-color: var(--accent-color);
}

/* Inset line sort indicators */
.table th.sortable.sort-asc,
.vendors-table th.sortable.sort-asc,
.customers-table th.sortable.sort-asc,
.products-table th.sortable.sort-asc,
.quotes-table th.sortable.sort-asc,
.archived-orders-table th.sortable.sort-asc {
    background-color: var(--accent-color);
    position: relative;
}

.table th.sortable.sort-asc::before,
.vendors-table th.sortable.sort-asc::before,
.customers-table th.sortable.sort-asc::before,
.products-table th.sortable.sort-asc::before,
.quotes-table th.sortable.sort-asc::before,
.archived-orders-table th.sortable.sort-asc::before {
    content: '';
    position: absolute;
    top: 6px; /* Inset from top edge */
    left: 8px; /* Inset from left edge */
    right: 8px; /* Inset from right edge */
    height: 3px;
    background-color: white;
    border-radius: 1px;
}

.table th.sortable.sort-desc,
.vendors-table th.sortable.sort-desc,
.customers-table th.sortable.sort-desc,
.products-table th.sortable.sort-desc,
.quotes-table th.sortable.sort-desc,
.archived-orders-table th.sortable.sort-desc {
    background-color: var(--accent-color);
    position: relative;
}

.table th.sortable.sort-desc::before,
.vendors-table th.sortable.sort-desc::before,
.customers-table th.sortable.sort-desc::before,
.products-table th.sortable.sort-desc::before,
.quotes-table th.sortable.sort-desc::before,
.archived-orders-table th.sortable.sort-desc::before {
    content: '';
    position: absolute;
    bottom: 6px; /* Inset from bottom edge */
    left: 8px; /* Inset from left edge */
    right: 8px; /* Inset from right edge */
    height: 3px;
    background-color: white;
    border-radius: 1px;
}

/* Ensure sort indicator doesn't break layout */
.table th.sortable,
.vendors-table th.sortable,
.customers-table th.sortable,
.products-table th.sortable,
.quotes-table th.sortable,
.archived-orders-table th.sortable {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Special handling for actions column with menu - no sorting */
.table th.actions,
.vendors-table th.actions,
.customers-table th.actions,
.products-table th.actions,
.quotes-table th.actions,
.archived-orders-table th.actions {
    cursor: default;
}


/* ============================================================================
   PAGINATION STYLES
   ============================================================================ */

.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--secondary-color);
    font-size: 0.85rem;
}

.pagination-info strong {
    color: var(--text-color);
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    align-items: center;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 2.5rem;
    text-align: center;
    white-space: nowrap;
}

.pagination-btn:hover:not([disabled]) {
    background: var(--background-color);
    border-color: var(--accent-color);
}

.pagination-btn:active:not([disabled]) {
    transform: translateY(1px);
}

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn[disabled] {
    background: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-prev,
.pagination-next {
    padding: 0.5rem 1rem;
    font-weight: 600;
}

.pagination-ellipsis {
    padding: 0.5rem 0.25rem;
    color: var(--secondary-color);
    font-weight: 500;
}


/* ============================================================================
   GLOBAL NUMBER INPUT SPINNER REMOVAL
   ============================================================================ */

/* Remove spinner arrows from all number input fields across all modules */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox support for removing number input spinners */
input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================================================
   BACKUP REMINDER NOTIFICATION
   ============================================================================ */

#backup-reminder {
    position: relative;
    background: linear-gradient(135deg, #fff3cd 0%, #ffe8a1 100%);
    border-bottom: 2px solid #ffc107;
    padding: 0.75rem 1.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

#backup-reminder.show {
    display: flex;
}

.backup-reminder-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.backup-reminder-icon {
    font-size: 24px;
    line-height: 1;
}

.backup-reminder-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backup-reminder-title {
    font-weight: 600;
    color: #856404;
    font-size: 14px;
}

.backup-reminder-message {
    font-size: 13px;
    color: #856404;
}

.backup-reminder-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.backup-reminder-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.backup-reminder-btn-primary {
    background: #ffc107;
    color: #000;
}

.backup-reminder-btn-primary:hover {
    background: #e0a800;
}

.backup-reminder-btn-dismiss {
    background: transparent;
    color: #856404;
    text-decoration: underline;
}

.backup-reminder-btn-dismiss:hover {
    color: #533f03;
}

/* Adjust main content to account for notification */
#spa-main-content {
    padding-top: 32px;
    min-height: calc(100vh - 32px - 60px); /* 32px for notification space, 60px for header */
    transition: padding-top 0.2s ease;
}
/* ============================================================================
   TAKEOFFS TABLE - Apply all standard table styles
   ============================================================================ */

/* Apply all quotes-table styles to takeoffs-table */
.takeoffs-table tbody tr {
    cursor: default;
}

.takeoffs-table .actions {
    width: 125px;
    min-width: 125px;
    max-width: 125px;
    white-space: nowrap;
    vertical-align: middle;
    text-align: center;
    padding: 0.75rem 0.25rem;
}

.takeoffs-table th.actions {
    cursor: default;
}

/* Sorting styles for takeoffs table */
.takeoffs-table th.sortable {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.takeoffs-table th.sortable:hover {
    background-color: var(--accent-color);
}

.takeoffs-table th.sortable.sort-asc {
    background-color: var(--accent-color);
    position: relative;
}

.takeoffs-table th.sortable.sort-asc::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: white;
    border-radius: 1px;
}

.takeoffs-table th.sortable.sort-desc {
    background-color: var(--accent-color);
    position: relative;
}

.takeoffs-table th.sortable.sort-desc::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: white;
    border-radius: 1px;
}

/* Takeoff name link styling */
.takeoff-name-link {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.takeoff-name-link:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

/* ==========================================================================
   Orders Module - Kanban Board Styles
   ========================================================================== */

/* Orders module uses standard .container class for 1200px constraint */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
}

.page-header h1 {
    margin: 0;
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.archived-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.archived-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* Orders View Toggle */
.orders-view-toggle {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

/* Kanban Board Layout */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.kanban-column {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    min-height: 500px;
    min-width: 0;
    overflow: hidden;
}

.column-header {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color);
}

.column-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-family: 'Mokoto', sans-serif;
    font-size: 18px;
    font-weight: 500;
}

.column-header .count-badge {
    position: absolute;
    right: 0;
}

.count-badge {
    background: var(--accent-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.column-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Order Card Styles */
.order-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    align-items: stretch;
}

.order-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: var(--accent-color);
}

.order-card.archived {
    opacity: 0.8;
}

/* Drag handle */
.card-drag-handle {
    display: flex;
    align-items: center;
    padding: 0 8px 0 0;
    color: #ccc;
    cursor: grab;
    font-size: 16px;
    letter-spacing: -3px;
    user-select: none;
}

.card-drag-handle:hover {
    color: var(--accent-color);
}

.card-drag-handle:active {
    cursor: grabbing;
}

.card-content {
    flex: 1;
    min-width: 0;
}

/* Sortable drag states */
.order-card.sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0;
}

.order-card.sortable-drag {
    opacity: 0.9;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.order-card.sortable-chosen {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Hardware Group Item Drag Handle */
.hw-drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 12px;
    letter-spacing: -2px;
    user-select: none;
    padding: 0 4px;
}

.hw-drag-handle:hover {
    color: var(--accent-color);
}

.hw-drag-handle:active {
    cursor: grabbing;
}

/* Hardware Group Sortable States */
.compact-product-row.hw-sortable-ghost {
    opacity: 0.4;
    background: #f0f0f0;
}

.compact-product-row.hw-sortable-drag {
    opacity: 0.9;
    background: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #eee;
    min-width: 0;
}

.card-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex: 1;
}

.progress-indicator {
    background: #e9ecef;
    color: var(--primary-color);
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

.card-body {
    margin-bottom: 0;
}

.card-field {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 14px;
}

.card-field label {
    color: #666;
    font-weight: 500;
}

.card-field span {
    color: var(--primary-color);
    font-weight: 600;
}

.card-field span.missing-value {
    color: #999;
    font-style: italic;
    font-weight: 400;
}

.card-field-row span:first-child {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.card-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-top: 4px;
    border-top: 1px solid #eee;
    gap: 12px;
}

.view-quote-link,
.buyout-list-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 13px;
}

.view-quote-link:hover,
.buyout-list-link:hover {
    text-decoration: underline;
}

/* Delete button on order card */
.btn-delete-card {
    background: var(--danger-color);
    color: white;
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: var(--border-radius);
    line-height: 1;
    transition: background 0.2s ease;
}

.btn-delete-card:hover {
    background: #c82333;
}

.view-details-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.view-details-btn:hover {
    background: #e55a00;
}

/* Order Column Modal - appears within Kanban column */
.order-column-modal {
    display: none;
    position: sticky;
    top: 48px; /* Stick to viewport top when scrolling */
    left: 15px; /* Match column padding */
    right: 15px; /* Match column padding */
    z-index: 100;
    height: 0; /* Don't take up vertical space */
    overflow: visible; /* Allow content to be visible */
}

.order-column-modal.active {
    display: block;
}

.order-column-modal-content {
    background: white;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    max-height: calc(100vh - 120px); /* Use viewport height instead of parent height */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.order-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--primary-color);
    border-radius: 6px 6px 0 0;
    flex-shrink: 0;
}

.order-modal-header h4 {
    margin: 0;
    color: white;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.order-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
}

.order-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.order-modal-body {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
}

/* Modal body content - mimics card front */
.order-modal-info {
    margin-bottom: 12px;
}

.order-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
}

.order-modal-row:last-child {
    margin-bottom: 0;
}

.order-modal-row label {
    color: #666;
    font-weight: 500;
}

.order-modal-row span {
    color: var(--primary-color);
    font-weight: 600;
}

.order-modal-customer {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

/* Checklist in modal */
.order-modal-checklist {
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.order-modal-checklist h5 {
    margin: 0 0 10px 0;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    font-weight: 600;
}

.order-modal-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.order-checklist-item {
    display: flex;
    align-items: center;
    font-size: 12px;
}

.order-checklist-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.order-checklist-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.order-checklist-item span {
    color: var(--text-color);
}

.order-checklist-item input[type="checkbox"]:checked + span {
    color: #666;
    text-decoration: line-through;
}

/* Delivery date in modal */
.order-modal-delivery {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.order-modal-delivery label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.order-modal-delivery input[type="date"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* Kanban overlay - disables interaction with cards while modal is open */
.kanban-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    /* Transparent - doesn't block visibility, just interaction */
}

.kanban-overlay.active {
    display: block;
}

/* Keep column with modal interactive */
.kanban-column.has-modal {
    position: relative;
    z-index: 101;
    overflow: visible;
}

/* Archived notice in modal */
.order-archived-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 11px;
    color: #856404;
    margin-top: 12px;
    text-align: center;
}

/* View toggle styling */
.orders-view-toggle {
    margin-bottom: 20px;
}

.orders-view-toggle .status-filter-buttons {
    justify-content: flex-start;
}

/* Archived Section */
.archived-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #ddd;
}

.section-header h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.archived-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Order Detail Modal */
.order-details {
    padding: 20px 0;
}

.order-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
}

.info-row:last-child {
    margin-bottom: 0;
}

.info-row label {
    color: #666;
    font-weight: 500;
}

.info-row span {
    color: var(--primary-color);
    font-weight: 600;
}

/* Delivery Address styling - keep same horizontal layout as other fields */
.info-row-delivery-address span {
    white-space: pre-wrap;
    line-height: 1.5;
}

.quote-link {
    color: var(--accent-color);
    text-decoration: none;
}

.quote-link:hover {
    text-decoration: underline;
}

.delivery-date-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.delivery-date-section label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-weight: 500;
}

#job-number-input {
    width: 80px;
    padding: 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: right;
}

#job-number-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

#delivery-date-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#delivery-date-input:disabled {
    background: #e9ecef;
    cursor: not-allowed;
}

.checklist-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checklist-item {
    padding: 10px 15px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.checklist-item:hover {
    background: #e9ecef;
}

.checklist-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checklist-item input[type="checkbox"]:disabled {
    cursor: not-allowed;
}

.checklist-item span {
    color: var(--primary-color);
    font-weight: 500;
}

.archived-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
    color: #856404;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .kanban-board {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .kanban-board {
        grid-template-columns: 1fr;
    }
    
    .archived-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}
