/* BuildCo Brand CSS - Aligned with Official Brand Guide */

/* Typography - Montserrat carries every branded surface; JetBrains Mono for references */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* Build.Co brand tokens - Brand Guide v2.1 / 2026 */
:root {
    /* Primary Colors */
    --primary-color: #FF6B00;       /* Build Orange - primary */
    --primary-hover: #FF8C40;       /* Ember - hover & active states */
    --dark-bg: #121212;             /* Carbon - surface 800 */

    /* Secondary Colors */
    --card-bg: #1E1E1E;             /* Slate - surface 700 */
    --footer-bg: #0A0A0A;           /* Ink - surface 900 */

    /* Text Colors */
    --text-white: #FFFFFF;          /* White for main headings */
    --text-muted: #BFBFBF;          /* Steel - secondary text on dark */

    /* Accent Colors */
    --gradient-orange: linear-gradient(90deg, #FF6B00, #FFB700); /* For special headings */

    /* Additional UI colors */
    --success-color: #0f9d58;       /* Green - functional status */
    --warning-color: #FFB700;       /* Amber - data & flags only */
    --error-color: #d93025;         /* Red - functional status */
    --border-color: #2A2A2A;        /* Line - hairline dividers on dark */
    --row-line: #2A2A2A;            /* table row rules */
    --field-border: #3A3A3A;        /* form fields and ghost buttons */
    --field-bg: #0A0A0A;            /* Ink - fields sit inset on dark */
    --th-bg: #0A0A0A;               /* Ink - table header */
    --zebra: rgba(255, 255, 255, 0.025);
    --link-color: #FF6B00;          /* orange reads on dark */
    --link-hover: #FF8C40;
    --accent-text: #FF6B00;         /* orange text: Build Orange on dark */

    /* Shadows and Effects */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.5);

    /* Borders - corner radius 10px for UI */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 10px;

    /* Spacing - 4px base scale */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Typography */
    --font-heading: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-alt: 'Montserrat', sans-serif;
}

/* Light Mode Variables - the white working face (paper system) */
.light-theme {
    --dark-bg: #F6F6F6;             /* Paper-alt */
    --card-bg: #FFFFFF;             /* Paper */
    --footer-bg: #ECECEC;
    --text-white: #161616;          /* Paper-ink */
    --text-muted: #6B6B6B;          /* Grey Text - secondary on white */
    --border-color: #BFBFBF;        /* Steel - divider grey: cards, panels, rules */
    --row-line: #E2E2E2;            /* Paper-line - table row rules */
    --field-border: #8C8C8C;        /* fields need 3:1 against white */
    --field-bg: #FFFFFF;
    --th-bg: #161616;               /* Paper-ink - table header */
    --zebra: #F6F6F6;               /* Paper-alt - alternate rows */
    --link-color: #161616;          /* orange text fails on white: links are ink */
    --link-hover: #B24A00;
    --accent-text: #B24A00;         /* deep orange that passes on white */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Light mode: no gradient or orange text on white */
.light-theme h1 {
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-white);
}
.light-theme h3 { color: var(--text-white); }
.light-theme a { text-decoration-color: rgba(22, 22, 22, 0.35); }

/* Global styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg);
    color: var(--text-white);
    font-family: var(--font-body);
    line-height: 1.8;
    font-weight: 400;
    font-size: 1.1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--dark-bg);
    padding: var(--spacing-lg);
}

/* Skip links for accessibility */
.skip-link {
    position: absolute;
    top: -200px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-white);
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* Typography - following brand guide specs */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-white);
}

h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-lg);
    background: var(--gradient-orange);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

h2 {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: var(--spacing-sm);
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
}

h3 {
    font-size: 1.75rem;
    color: var(--accent-text);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--link-hover);
}

/* Focus - 2px Build Orange ring (Brand Guide 07) */
a:focus-visible, button:focus-visible, .btn:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Modern header */
header {
    background-color: var(--dark-bg);
    color: var(--text-white);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-white);
}

/* Build Orange top rule on every tool page (Brand Guide: orange is the mark, top rule, eyebrow) */
body:has(header)::before {
    content: ''; display: block; height: 4px; background: var(--primary-color);
}

/* Header order on every tool: logo, page title, then theme switch and user bar on the right */
header { gap: 18px; justify-content: flex-start; }
header .header-actions { display: contents; }
header .logo-container { order: -1; height: 40px; }
header .theme-toggle { order: 1; margin-left: auto; }
header:has(.theme-toggle) .bc-userbar { order: 2; margin-left: 0; padding-left: 0; }

.logo-container {
    height: 60px;
    display: flex;
    align-items: center;
}

.logo-container img {
    height: 100%;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Text-based logo styling per brand guide */
.logo-text {
    font-family: var(--font-heading);
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-text-main {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-white);
}

.logo-text-sub {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--accent-text);
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: 1px solid var(--field-border);
    color: var(--text-white);
    font-size: 1.2rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
    margin-left: 15px;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--accent-text);
}

.header-actions {
    display: flex;
    align-items: center;
}

/* Form elements */
.form-section {
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    background-color: var(--card-bg);
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: var(--shadow-md);
}

.form-section h2 {
    margin-top: 0;
    color: var(--text-white);
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
    gap: var(--spacing-md);
}

.form-group {
    flex: 1;
    min-width: 300px;
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 14px;
}

.required-label::after {
    content: "*";
    color: var(--error-color);
    margin-left: 3px;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    font-size: 16px;
    transition: border 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--field-bg);
    color: var(--text-white);
    font-family: var(--font-body);
}

input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 1; }

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 1px;
    border-color: transparent;
    box-shadow: none;
}

input.input-error, select.input-error, textarea.input-error {
    border-color: var(--error-color);
}

.field-error {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 4px;
    min-height: 18px;
}

/* Collapsible sections */
.collapsible {
    background-color: var(--card-bg);
    color: var(--text-white);
    cursor: pointer;
    padding: 16px;
    width: 100%;
    border: none;
    text-align: left;
    outline: none;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-md);
    position: relative;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--border-color);
}

.collapsible:hover {
    background-color: rgba(255, 107, 0, 0.1);
}

.collapsible i {
    color: var(--accent-text);
    transition: transform 0.2s ease;
}

.collapsible[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: var(--card-bg);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 0 18px;
}

.content[aria-hidden="false"] {
    padding: 18px;
    max-height: 1000px;
    border: 1px solid var(--border-color);
    border-top: none;
}

/* Tooltips */
.tooltip-container {
    display: inline-block;
    position: relative;
    margin-left: 5px;
    vertical-align: middle;
}

.tooltip-container i {
    color: var(--accent-text);
    cursor: pointer;
    font-size: 14px;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    width: 200px;
    background-color: var(--card-bg);
    color: var(--text-white);
    text-align: center;
    border-radius: var(--radius-sm);
    padding: 8px;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    pointer-events: none;
    border: 1px solid var(--border-color);
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--card-bg) transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 0.9;
}

/* Form validation */
.validation-summary {
    background-color: rgba(217, 48, 37, 0.2);
    border: 1px solid var(--error-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    margin-bottom: 20px;
    color: var(--error-color);
}

.validation-heading {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
}

.validation-errors-list {
    margin: 0;
    padding-left: 20px;
}

/* Buttons */
.btn {
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    font-family: var(--font-heading);
    text-decoration: none;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
}

.btn:active {
    transform: translateY(1px);
}

/* Primary: Build Orange with ink text, Ember on hover (Brand Guide 07) */
.btn-primary {
    background-color: var(--primary-color);
    color: #0A0A0A;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #0A0A0A;
}

/* Secondary: ghost - hairline border, text in the surface colour, orange on hover */
.btn-secondary {
    background-color: transparent;
    color: var(--text-white);
    border: 1px solid var(--field-border);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--accent-text);
    background-color: transparent;
}

.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
    min-width: 36px;
    min-height: 36px;
}

.button-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.export-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Table styles */
.table-actions {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: 8px;
}

.table-actions-right {
    display: flex;
    gap: 8px;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 0;
}

/* Tables - ink header, 11px uppercase, alternating rows (Brand Guide 07) */
table th {
    position: sticky;
    top: 0;
    background-color: var(--th-bg);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-align: left;
    padding: 12px 16px;
    font-family: var(--font-heading);
}

table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--row-line);
    vertical-align: middle;
    color: var(--text-white);
}

table tbody tr:nth-child(even) {
    background-color: var(--zebra);
}

table tbody tr:hover {
    background-color: rgba(255, 107, 0, 0.06);
}

table input {
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.05);
    padding: 10px;
}

table input:focus {
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.amount {
    font-weight: 500;
    color: var(--accent-text);
}

/* Footer */
.footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background-color: var(--footer-bg);
    padding: var(--spacing-lg);
}

/* Form progress */
.form-progress {
    background-color: rgba(255, 255, 255, 0.1);
    height: 6px;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease-out;
}

/* Auto-save notification */
.auto-save-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--card-bg);
    border-left: 4px solid var(--success-color);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    font-size: 14px;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 900;
}

.auto-save-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.auto-save-notification i {
    color: var(--success-color);
    margin-right: 8px;
    font-size: 16px;
}

/* Textarea container */
.textarea-container {
    position: relative;
}

.char-counter {
    position: absolute;
    bottom: 8px;
    right: 8px;
    font-size: 12px;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Custom modal styling */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.modal-content {
    background-color: var(--dark-bg);
    margin: 60px auto;
    max-width: 500px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: modalFadeIn 0.3s;
    border: 1px solid var(--border-color);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--error-color);
}

/* Preview modal */
#preview-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
    backdrop-filter: blur(3px);
}

#preview-content {
    background-color: var(--dark-bg);
    margin: 40px auto;
    max-width: 850px;
    padding: 0;
    position: relative;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    border: 1px solid var(--border-color);
}

.preview-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-white);
}

#close-preview {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-preview:hover {
    color: var(--error-color);
}

#document-preview {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    background-color: var(--text-white);
    color: #333;
}

.preview-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Loading indicator */
.loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 18, 18, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 107, 0, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

#loading-message {
    font-size: 16px;
    color: var(--text-white);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: var(--card-bg);
    color: var(--text-white);
    border-left: 4px solid var(--primary-color);
    padding: 16px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    min-width: 280px;
    animation: slideIn 0.3s ease forwards;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast i {
    margin-right: 12px;
    font-size: 20px;
}

.toast.success i {
    color: var(--success-color);
}

.toast.error i {
    color: var(--error-color);
}

.toast-message {
    flex: 1;
}

/* Resume notification */
.resume-notification {
    background-color: rgba(255, 107, 0, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.notification-content {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-content i {
    color: var(--accent-text);
    font-size: 20px;
}

.notification-content p {
    margin: 0 0 8px 0;
    color: var(--text-white);
}

.notification-actions {
    display: flex;
    gap: 10px;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin-left: auto;
}

/* File input styling */
.file-input-container {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.file-input-container input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.file-input-container label {
    margin-bottom: 0;
    margin-right: 10px;
    cursor: pointer;
}

#file-name {
    margin-left: 10px;
    color: var(--text-muted);
    font-size: 14px;
}

.import-options {
    margin-top: 20px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.checkbox-container label {
    margin-bottom: 0;
    font-weight: normal;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive styles */
@media (max-width: 768px) {
    body {
        padding: 0;
        font-size: 1rem;
    }
    
    .container {
        padding: 15px;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        margin-bottom: 20px;
        text-align: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .export-options {
        flex-direction: column;
        width: 100%;
    }
    
    .export-options button {
        width: 100%;
    }
    
    #preview-content {
        margin: 10px;
        max-width: calc(100% - 20px);
        height: calc(100% - 20px);
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-actions-right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Print styles */
@media print {
    .no-print, 
    .collapsible,
    .button-container,
    header button,
    #close-preview,
    .form-section button,
    .tooltip-container {
        display: none !important;
    }
    
    body, .container {
        margin: 0;
        padding: 0;
        width: 100%;
        font-size: 12pt;
        line-height: 1.4;
        box-shadow: none;
        background-color: white !important;
        color: black !important;
    }
    
    header {
        padding: 15px 0;
        margin: 0 0 15px 0;
        background-color: white !important;
        color: #000 !important;
        border-bottom: 2pt solid #000;
    }
    
    .content {
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
    }
    
    table {
        page-break-inside: auto;
        border-collapse: collapse;
    }
    
    tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    th, td {
        border: 1pt solid #000 !important;
    }
    
    .page-break-before {
        page-break-before: always;
    }
    
    .page-break-after {
        page-break-after: always;
    }
    
    .footer {
        position: fixed;
        bottom: 0;
        width: 100%;
        font-size: 9pt;
        text-align: center;
        border-top: 1pt solid #000;
        padding-top: 10px;
        background-color: white !important;
    }
    
    @page {
        margin: 2cm;
    }
}

/* Tool catalog and dashboard specific styles */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.tool-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-card-img {
    height: 160px;
    background-color: rgba(255, 107, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-card-img i {
    font-size: 48px;
    color: var(--accent-text);
}

.tool-card-content {
    padding: 20px;
}

.tool-card-title {
    color: var(--text-white);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    font-family: var(--font-heading);
}

.tool-card-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 15px;
}

.tool-card-link {
    display: inline-block;
    color: var(--accent-text);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tool-card-link:hover {
    color: var(--primary-hover);
}

/* Login page styles */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 200px;
    height: auto;
}

.login-heading {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-white);
}

.login-form {
    margin-bottom: 20px;
}

.login-input {
    margin-bottom: 20px;
}

.login-input label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 14px;
}

.login-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-radius: var(--radius-sm);
}

.login-button {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.login-button:hover {
    background-color: var(--primary-hover);
}

.login-error {
    color: var(--error-color);
    text-align: center;
    margin-bottom: 15px;
}

/* Site Conditions and Trade Scope table styles */
.site-condition-table, 
.trade-scope-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

.site-condition-table th,
.trade-scope-table th {
    background-color: rgba(255, 107, 0, 0.2);
    color: var(--text-white);
    text-align: left;
    padding: 12px;
    border-bottom: 2px solid var(--primary-color);
    font-weight: 600;
}

.site-condition-table td,
.trade-scope-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.site-condition-table input, 
.site-condition-table textarea,
.trade-scope-table input,
.trade-scope-table textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    border-radius: var(--radius-sm);
}

.site-condition-table input:focus,
.site-condition-table textarea:focus,
.trade-scope-table input:focus,
.trade-scope-table textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.1);
}

.site-condition-actions,
.trade-scope-actions {
    display: flex;
    gap: 5px;
}

.site-condition-actions button,
.trade-scope-actions button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s ease;
}

.site-condition-actions button:hover,
.trade-scope-actions button:hover {
    color: var(--accent-text);
}

.site-condition-actions button.btn-delete:hover,
.trade-scope-actions button.btn-delete-item:hover {
    color: var(--error-color);
}

.site-condition-header,
.trade-scope-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.site-condition-title,
.trade-scope-title {
    flex: 1;
}

.site-condition-title input,
.trade-scope-title input {
    font-weight: 600;
    font-size: 16px;
    color: var(--accent-text);
    padding: 6px 10px;
}

.table-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

/* Custom trade save button */
#save-custom-trade-btn {
    margin-top: 10px;
    margin-left: 0;
}