/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #111;
    background-color: #f3f4f6;
}

.container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #111 0%, #111 60%, #c8102e 60%, #c8102e 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    width: 84px;
    flex: 0 0 auto;
}

.rcw-logo {
    width: 100%;
    height: auto;
    display: block;
}

.rcw-logo .logo-leaf {
    fill: #c8102e;
    stroke: #fff;
    stroke-width: 2;
}

.rcw-logo .logo-spool {
    fill: #fff;
}

.rcw-logo .logo-wire {
    stroke: #111;
}

.brand-text h1 {
    letter-spacing: 0.5px;
}

.brand-text p {
    margin: 0;
}

/* Action buttons section */
.actions-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 2rem;
}

.btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.75rem 1rem;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    font-family: inherit;
}

.btn-action:hover {
    border-color: #c8102e;
    box-shadow: 0 4px 16px rgba(200,16,46,0.15);
    transform: translateY(-2px);
}

.btn-action i {
    font-size: 2rem;
    color: #c8102e;
}

.btn-action-cut i {
    color: #111;
}

.btn-action-cut:hover {
    border-color: #111;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.btn-action-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
}

.btn-action-sub {
    font-size: 0.82rem;
    color: #777;
}

@media (max-width: 480px) {
    .actions-section {
        grid-template-columns: 1fr;
    }
}

/* Sections */
section:not(.actions-section) {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

input[readonly] {
    background: #f3f4f6;
    color: #666;
    cursor: default;
}

section h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #c8102e;
    padding-bottom: 0.5rem;
}

/* Form styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #555;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #c8102e;
    box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.form-hint {
    font-size: 0.8rem;
    color: #888;
    font-weight: 400;
}

.cut-entry-summary {
    background: #f8f9fb;
    border: 1px solid #e1e5ea;
    border-left: 4px solid #c8102e;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
}

.cut-entry-summary-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.35rem;
}

.cut-entry-summary p {
    margin: 0;
    color: #555;
}

.cut-entry-summary p + p {
    margin-top: 0.25rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-danger, .btn-edit {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #c8102e;
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 16, 46, 0.35);
}

.btn-secondary {
    background: #111;
    color: #fff;
}

.btn-secondary:hover {
    background: #2b2b2b;
    transform: translateY(-2px);
}

.btn-danger {
    background: #8a0b1f;
    color: #fff;
}

.btn-danger:hover {
    background: #6f0818;
    transform: translateY(-2px);
}

.btn-edit {
    background: #fff;
    color: #111;
    border: 2px solid #111;
}

.btn-edit:hover {
    background: #f3f4f6;
    transform: translateY(-2px);
}

/* Section header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-count {
    display: inline-block;
    background: #c8102e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 12px;
    padding: 0.1rem 0.55rem;
    vertical-align: middle;
    margin-left: 0.4rem;
    line-height: 1.6;
}

.section-subheader {
    font-size: 0.85rem;
    color: #777;
    margin: 0.1rem 0 0;
    font-weight: 400;
}

.cutoff-heading {
    display: flex;
    flex-direction: column;
}

.cutoff-heading h2 {
    margin-bottom: 0;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    margin-bottom: 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9ecef;
    transition: border-color 0.2s ease;
}

.collapsible-header:hover {
    border-color: #c8102e;
}

.collapsible-header h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.btn-collapse {
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.btn-collapse:hover {
    background: #f3f4f6;
    color: #c8102e;
}

.btn-collapse i {
    transition: transform 0.3s ease;
}

.btn-collapse.collapsed i {
    transform: rotate(-180deg);
}

#inventoryContent,
#cutoffContent {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
    max-height: 4000px;
    opacity: 1;
    margin-top: 1.5rem;
}

#inventoryContent.collapsed,
#cutoffContent.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
}

.search-filter {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-filter input {
    padding: 0.5rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* Clickable rope type cell */
.rope-type-link {
    cursor: pointer;
    color: #c8102e;
    font-weight: 600;
    text-decoration: underline dotted;
    transition: color 0.2s ease;
}

.rope-type-link:hover {
    color: #8a0b1f;
    text-decoration: underline solid;
}

/* Bay location badge */
.bay-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a56db;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    border: 1px solid #c3d3f7;
    white-space: nowrap;
}

/* Sortable column */
.sortable-col {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-col:hover {
    background: #e9ecef;
    color: #c8102e;
}

.sortable-col.sort-active {
    color: #c8102e;
}

.sort-icon {
    font-size: 0.75rem;
    margin-left: 4px;
    opacity: 0.5;
}

.sortable-col.sort-active .sort-icon {
    opacity: 1;
}

/* Show More button */
.show-more-container {
    text-align: center;
    padding: 1rem 0 0.25rem;
}

.btn-show-more {
    background: none;
    border: 2px solid #c8102e;
    color: #c8102e;
    padding: 0.5rem 2rem;
    border-radius: 5px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-show-more:hover {
    background: #c8102e;
    color: #fff;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    position: sticky;
    top: 0;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* Stock level row highlighting */
.row-low-stock {
    background-color: #fff3cd;
}

.row-low-stock:hover {
    background-color: #ffe8a1;
}

.row-cutoff {
    background-color: #f8d7da;
}

.row-cutoff:hover {
    background-color: #f1b0b7;
}

/* Action buttons in tables */
.table-actions {
    display: flex;
    gap: 0.5rem;
}

.table-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 2% auto;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideIn 0.3s ease;
    max-height: 95vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close:hover {
    color: #333;
}

/* Cuts history modal */
.modal-content-wide {
    max-width: 700px;
}

.cuts-history-header {
    margin-bottom: 1.25rem;
}

.cuts-history-header h2 {
    margin-bottom: 0.25rem;
}

.cuts-history-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.cuts-history-lot {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
}

.cuts-history-type {
    font-size: 0.9rem;
    color: #666;
    background: #f3f4f6;
    border-radius: 4px;
    padding: 0.1rem 0.5rem;
}

.cuts-history-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-label {
    font-size: 0.75rem;
    color: #777;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111;
}

.lot-link {
    cursor: pointer;
    color: #111;
    text-decoration: underline dotted #aaa;
    transition: color 0.2s;
}

.lot-link:hover {
    color: #c8102e;
    text-decoration: underline solid #c8102e;
}

@media (max-width: 600px) {
    .cuts-history-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* -------------------------------------------------------
   Site Navigation
------------------------------------------------------- */
.site-nav {
    display: flex;
    gap: 0.5rem;
    background: #1a1a1a;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: #ccc;
    text-decoration: none;
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
    background: #333;
    color: #fff;
}

.site-nav a.active {
    background: #c8102e;
    color: #fff;
}

/* -------------------------------------------------------
   Status badges
------------------------------------------------------- */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-pending   { background: #fff3cd; color: #856404; }
.status-received  { background: #d1e7dd; color: #0f5132; }
.status-shipped   { background: #cfe2ff; color: #084298; }
.status-delivered { background: #d1e7dd; color: #0f5132; }

/* -------------------------------------------------------
   Shipment document list
------------------------------------------------------- */
.doc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.doc-list li {
    background: #f3f4f6;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    color: #444;
}

/* -------------------------------------------------------
   Shipment page section header extras
------------------------------------------------------- */
.shipment-stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.shipment-stat {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    text-align: center;
    min-width: 110px;
}

.shipment-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #c8102e;
    line-height: 1;
}

.shipment-stat-label {
    font-size: 0.78rem;
    color: #666;
    margin-top: 0.2rem;
}

/* -------------------------------------------------------
   File upload zones
------------------------------------------------------- */
.upload-zone {
    border: 2px dashed #d0d5dd;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    min-height: 70px;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: #c8102e;
    background: #fff5f6;
}

.upload-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 1rem;
    color: #888;
    text-align: center;
    pointer-events: none;
}

.upload-prompt i {
    font-size: 1.6rem;
    color: #c8102e;
    margin-bottom: 0.15rem;
}

.upload-prompt span {
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
}

.upload-prompt small {
    font-size: 0.75rem;
    color: #aaa;
}

.upload-preview {
    padding: 0.5rem 0.75rem;
}

.upload-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.88rem;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.upload-file-item:last-child {
    border-bottom: none;
}

.upload-file-item i {
    color: #c8102e;
    flex-shrink: 0;
}

.upload-file-item a {
    color: #c8102e;
    text-decoration: none;
}

.upload-file-item a:hover {
    text-decoration: underline;
}

.upload-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.2rem;
    flex-shrink: 0;
}

.upload-remove:hover {
    color: #c8102e;
}

.doc-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f3f4f6;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.2rem 0.55rem;
    font-size: 0.8rem;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
}

.doc-link:hover {
    background: #fff0f2;
    border-color: #c8102e;
    color: #c8102e;
}

.doc-link i {
    font-size: 0.85rem;
}

/* -------------------------------------------------------
   Notification toast
------------------------------------------------------- */
.notification {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.85rem 1.4rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    z-index: 9999;
    animation: slideIn 0.25s ease;
    width: max-content;
    max-width: 360px;
}

.notification-success {
    background: #d1e7dd;
    color: #0f5132;
    border-left: 4px solid #0f5132;
}

.notification-error {
    background: #f8d7da;
    color: #842029;
    border-left: 4px solid #842029;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: #666;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (min-width: 769px) and (max-width: 1100px) {
    .container {
        max-width: 98%;
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    section {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .search-filter input {
        width: 100%;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
    
    .table-actions {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 1rem;
        width: 95%;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    section h2 {
        font-size: 1.2rem;
    }
    
    .btn-primary, .btn-secondary, .btn-danger, .btn-edit {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .table-container {
        font-size: 0.7rem;
    }
    
    th, td {
        padding: 0.3rem;
    }
}

/* Utility classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-success {
    color: #28a745;
    font-weight: 600;
}

.text-warning {
    color: #ffc107;
    font-weight: 600;
}

.text-danger {
    color: #dc3545;
    font-weight: 600;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #ddd;
}

/* ── Cut Worksheet ─────────────────────────────────────────── */
.worksheet-modal-content {
    max-width: 780px;
}

.worksheet-actions-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    justify-content: flex-end;
}

.worksheet-header {
    border-bottom: 2px solid #111;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.worksheet-company {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.4rem;
    text-align: center;
}

.worksheet-wire-name {
    font-size: 2.2rem;
    font-weight: 900;
    color: #111;
    text-align: center;
    letter-spacing: 0.02em;
    line-height: 1.15;
    margin-bottom: 0.6rem;
}

.worksheet-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: baseline;
}

.worksheet-field-group {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

.worksheet-label {
    font-size: 0.82rem;
    color: #666;
    white-space: nowrap;
}

.worksheet-value {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    border-bottom: 1px solid #888;
    min-width: 120px;
}

.worksheet-section-heading {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin: 0.75rem 0 0.4rem;
    font-weight: 600;
}

.worksheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.worksheet-table th,
.worksheet-table td {
    border: 2px solid #333;
    padding: 0.45rem 0.65rem;
    text-align: center;
}

.worksheet-table tbody td:nth-child(2) {
    text-align: left;
}

.worksheet-table th {
    background: #e8e8e8;
    font-weight: 700;
    color: #222;
    font-size: 0.82rem;
    border-bottom: 3px solid #111;
    text-align: center;
}

.worksheet-blank-table td {
    height: 2.4rem;
}

.ws-trim-notice {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin: 0.2rem 0 0.3rem;
    padding: 0;
    /* Only visible during print */
    display: none;
}

.ws-print-hidden {
    /* Visible on screen, hidden during print */
    opacity: 1;
}

.worksheet-footer {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    border-top: 2px solid #111;
    padding-top: 0.75rem;
    margin-top: 1.25rem;
}

/* ── Label Generator ───────────────────────────────────────── */
.label-modal-content {
    max-width: 980px;
}

.label-form {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fafafa;
}

.label-form h3 {
    margin: 0 0 0.85rem;
    font-size: 1.1rem;
    color: #1f2937;
}

.label-form .form-group label {
    font-size: 0.96rem;
    font-weight: 700;
    color: #1f2937;
}

.label-form input,
.label-form select {
    font-size: 1.02rem;
    padding: 0.62rem 0.72rem;
}

.label-form .form-hint {
    font-size: 0.86rem;
}

.label-print-area {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    background: #fff;
}

.label-sheet-header {
    text-align: center;
    margin-bottom: 0.85rem;
}

.label-sheet-meta {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
}

.label-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.label-card {
    border: 2px solid #222;
    border-radius: 6px;
    padding: 0.7rem 0.8rem;
    break-inside: avoid;
}

.label-card-title {
    font-size: 1.2rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid #666;
    padding-bottom: 0.3rem;
}

.label-card-row {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 0.35rem;
    align-items: baseline;
    font-size: 0.95rem;
    margin: 0.12rem 0;
}

.label-card-label {
    color: #444;
    font-weight: 600;
}

.label-card-value {
    color: #111;
    font-weight: 700;
}

.label-card-row-cable {
    border: 2px solid #111;
    border-radius: 4px;
    background: #f3f4f6;
    padding: 0.22rem 0.35rem;
    margin: 0.22rem 0;
}

.label-card-row-cable .label-card-label,
.label-card-row-cable .label-card-value {
    font-size: 1.05rem;
    font-weight: 900;
    color: #000;
}

/* ── Print styles ──────────────────────────────────────────── */
@page {
    margin: 1cm;
    size: letter portrait;
}

@media print {
    body > * {
        display: none !important;
    }

    body.print-worksheet #worksheetModal,
    body.print-labels #labelModal {
        display: block !important;
        position: static !important;
        background: none !important;
    }

    body.print-worksheet .worksheet-modal-content,
    body.print-labels .label-modal-content {
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: 100% !important;
        border-radius: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .no-print {
        display: none !important;
    }

    body.print-worksheet .worksheet-wire-name {
        font-size: 2.2rem;
    }

    body.print-worksheet .worksheet-header {
        page-break-after: avoid;
    }

    body.print-worksheet .worksheet-table {
        page-break-inside: avoid;
    }

    body.print-worksheet #wsCurrentCutsSection {
        page-break-inside: avoid;
    }

    body.print-worksheet .worksheet-blank-table td {
        height: 2.6rem;
    }

    body.print-worksheet .worksheet-table th,
    body.print-worksheet .worksheet-table td {
        border: 2px solid #111 !important;
        text-align: center !important;
    }

    body.print-worksheet .worksheet-table tbody td:nth-child(2) {
        text-align: left !important;
    }

    body.print-worksheet .worksheet-table th {
        border-bottom: 3px solid #000 !important;
        background: #ddd !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    body.print-worksheet .worksheet-footer {
        page-break-inside: avoid;
    }

    /* Hide overflow rows on print; they are visible on screen */
    body.print-worksheet .ws-print-hidden {
        display: none !important;
    }

    /* Show the trim notice only when printing */
    body.print-worksheet .ws-trim-notice {
        display: block !important;
        color: #555 !important;
        font-size: 0.7rem;
        font-style: italic;
        margin-bottom: 0.3rem;
    }

    body.print-labels .label-form {
        display: none !important;
    }

    body.print-labels .label-print-area {
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
    }

    body.print-labels .label-grid {
        gap: 0.35rem;
    }

    body.print-labels .label-card {
        border: 2px solid #111 !important;
        border-radius: 0 !important;
        page-break-inside: avoid;
    }

    body.print-labels .label-card-title {
        font-size: 1.05rem;
    }

    body.print-labels .label-card-row {
        font-size: 0.88rem;
    }

    body.print-labels .label-card-row-cable {
        border: 2px solid #000 !important;
        background: #e5e7eb !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
