/* ========================================
   WARDROBE DESIGNER PRO - COMPLETE STYLES
   With Collapsible Panels & Quick Toolbar
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0f1c;
    color: #e2e8f0;
    line-height: 1.6;
}

.container {
    max-width: 100vw;
    margin: 0 auto;
    padding: 0;
}

/* Header */
header {
    background: linear-gradient(180deg, #1e293b 0%, #172032 100%);
    padding: 0 1.5rem;
    height: 52px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.brand-logo {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 0.3rem 0.45rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
    line-height: 1;
}

.brand-text {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}

header h1 {
    color: #f1f5f9;
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.2px;
    white-space: nowrap;
}

.brand-pro {
    color: #60a5fa;
    font-weight: 700;
}

.brand-version {
    font-size: 0.55rem;
    color: #475569;
    font-weight: 500;
    background: #0f172a;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.header-project {
    flex: 1;
    display: flex;
    justify-content: center;
}

.project-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    border-radius: 999px;
    background: #0f172a;
    border: 1px solid #334155;
    font-size: 0.8rem;
    color: #e2e8f0;
    font-weight: 500;
    max-width: 260px;
    transition: border-color 0.2s;
}

.project-chip:hover {
    border-color: #475569;
}

.project-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-status {
    color: #22c55e;
    font-size: 0.5rem;
    line-height: 1;
}

.header-controls {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-shrink: 0;
}

.btn-divider {
    width: 1px;
    height: 24px;
    background: #334155;
    margin: 0 0.2rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-icon {
    font-size: 0.85rem;
}

.btn-redraw {
    background: #3b82f6;
    color: white;
    border-color: #2563eb;
}

.btn-redraw:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-save {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

.btn-save:hover {
    background: #334155;
    border-color: #475569;
}

.btn-load {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #334155;
}

.btn-load:hover {
    background: #334155;
    border-color: #475569;
}

/* ========== QUICK TOOLBAR ========== */
.quick-toolbar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.35rem 1rem;
    background: #0f172a;
    border-bottom: 1px solid #1e293b;
    overflow-x: auto;
    flex-wrap: nowrap;
}

.toolbar-section {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.5rem;
}

.toolbar-section-label {
    font-size: 0.5rem;
    color: #475569;
    letter-spacing: 1.2px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    line-height: 1;
}

.toolbar-buttons {
    display: flex;
    gap: 0.2rem;
}

.toolbar-divider {
    width: 1px;
    height: 36px;
    background: #1e293b;
    margin: 0 0.25rem;
    flex-shrink: 0;
}

.quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.55rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    min-width: 50px;
    color: #94a3b8;
}

.quick-btn:hover {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

.quick-btn:active {
    background: #334155;
}

.quick-icon {
    font-size: 0.95rem;
    line-height: 1.2;
}

.quick-label {
    font-size: 0.58rem;
    white-space: nowrap;
    font-weight: 500;
}

/* Buttons */
button, .btn-primary, .btn-secondary, .btn-small {
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #475569;
    color: white;
}

.btn-secondary:hover {
    background: #64748b;
}

.btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    background: #334155;
    color: #e2e8f0;
}

.btn-small:hover {
    background: #475569;
}

.btn-success {
    background: #22c55e;
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

button:active {
    transform: translateY(1px);
}

/* Layout */
.main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    height: calc(100vh - 95px);
}

/* Panels */
.controls-panel {
    background: #1e293b;
    padding: 0.5rem;
    overflow-y: auto;
    border-right: 1px solid #334155;
}

.visualization-area {
    padding: 1rem;
    overflow-y: auto;
    background: #0f172a;
}

.panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.panel h3 {
    color: #f8fafc;
    font-size: 0.9rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: -0.1px;
}

/* ========== COLLAPSIBLE PANELS ========== */
.panel.collapsible .panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    background: linear-gradient(180deg, #1e293b 0%, #1a2435 100%);
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.panel.collapsible .panel-header:hover {
    background: #253449;
    border-left-color: #3b82f6;
}

.panel.collapsible .panel-header h3 {
    flex: 1;
}

.panel-badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.55rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: #e0f2fe;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.panel-badge.off {
    background: #374151;
    color: #6b7280;
}

.panel-badge.on {
    background: linear-gradient(135deg, #15803d, #22c55e);
    color: #f0fdf4;
}

.collapse-icon {
    font-size: 0.7rem;
    color: #64748b;
    transition: transform 0.2s;
}

.panel-body {
    padding: 0.75rem;
    border-top: 1px solid #334155;
}

.panel-body.hidden {
    display: none;
}

/* ========== MINI COLLAPSIBLE ========== */
.mini-collapse {
    margin-top: 0.75rem;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
}

.mini-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.6rem;
    background: #0f172a;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: left;
}

.mini-header:hover {
    background: #1e293b;
}

.mini-chevron {
    font-size: 0.6rem;
    color: #64748b;
}

.mini-body {
    padding: 0.6rem;
    background: #111827;
    border-top: 1px solid #334155;
}

.mini-body.hidden {
    display: none;
}

/* ========== TOGGLE SWITCH ========== */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle-switch.small {
    width: 34px;
    height: 18px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #334155;
    transition: 0.2s;
    border-radius: 22px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
}

.toggle-switch.small .slider:before {
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
}

.toggle-switch input:checked + .slider {
    background: #3b82f6;
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(18px);
}

.toggle-switch.small input:checked + .slider:before {
    transform: translateX(16px);
}

/* Feature toggle row */
.feature-toggle-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0;
    flex-wrap: wrap;
}

.feature-toggle-row span {
    font-size: 0.85rem;
    color: #cbd5e1;
}

.inline-input {
    width: 80px;
    padding: 0.3rem 0.4rem;
    font-size: 0.8rem;
}

.inline-input.small {
    width: 60px;
}

.unit-label {
    font-size: 0.75rem;
    color: #64748b;
}

/* Unit buttons row */
.unit-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.panel.soft-panel {
    background: #0f172a;
    border-color: #1e293b;
    border-left: 3px solid #3b82f6;
}

.panel.soft-panel h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 0.5rem 0;
    padding: 0.45rem 0.6rem;
    background: linear-gradient(135deg, #1e293b, #253449);
    border-radius: 4px;
    border-left: 3px solid #f59e0b;
    letter-spacing: -0.1px;
}

.panel-header-simple {
    font-weight: 600;
    color: #f8fafc;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #334155;
    font-size: 0.9rem;
}

/* Grid helpers */
.grid1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.grid3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Form elements */
label {
    display: block;
    font-size: 0.8rem;
    color: #cbd5e1;
}

input, select {
    width: 100%;
    padding: 0.4rem 0.5rem;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 4px;
    color: #f8fafc;
    font-size: 0.8rem;
}

input:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #334155;
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s;
}

.chip:hover {
    background: #475569;
}

.chip input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Sub-options and separators */
.sub-options {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #0f172a;
    border-radius: 4px;
    border: 1px dashed #334155;
}

.sub-separator {
    border: none;
    border-top: 1px solid #253449;
    margin: 0.75rem 0;
}

.sub-label {
    font-size: 0.75rem;
    color: #60a5fa;
    margin: 0.5rem 0 0.25rem 0;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.sub-label strong {
    color: #93c5fd;
}

/* Loft column config panels */
.loft-col-panel {
    background: #1e293b;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 6px;
    border: 1px solid #334155;
}

.loft-col-panel:hover {
    border-color: #475569;
}

.loft-col-panel .grid2 {
    margin-bottom: 0;
}

.loft-col-panel label {
    font-size: 11px;
}

.loft-col-panel input {
    font-size: 11px;
    padding: 0.3rem 0.4rem;
}

#loftColConfig {
    max-height: 300px;
    overflow-y: auto;
}

.hint-text {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.formula-box {
    background: #0f172a;
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid #3b82f6;
}

/* Hide helper */
.hide {
    display: none !important;
}

.hidden {
    display: none !important;
}

/* Tabs */
.tabs {
    display: flex;
    margin-bottom: 0.75rem;
    background: #1e293b;
    border-radius: 8px;
    padding: 0.25rem;
}

.tab {
    flex: 1;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.tab.active {
    background: #3b82f6;
    color: white;
}

/* Preview toolbar */
.preview-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #1e293b;
    border-radius: 6px;
    align-items: center;
}

.preview-toolbar input[type="range"] {
    width: 80px;
    cursor: pointer;
    accent-color: #3b82f6;
}

#zoomValue {
    font-size: 0.7rem;
    color: #94a3b8;
    min-width: 35px;
}

/* Legend */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #cbd5e1;
}

.legend .sw {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    border: 1px solid #1e293b;
}

.sw.carcass { background: #64748b; }
.sw.laminate { background: #6b7280; }
.sw.glass { background: #3b82f6; }
.sw.partition { background: #f97316; }
.sw.hanging { background: #22c55e; }
.sw.drawer { background: #f87171; }
.sw.shelf-marker { background: #facc15; }

/* SVG host — white background for export */
#svgHost {
    background: #ffffff;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

/* Isometric host — also white */
#isometricHost {
    background: #ffffff;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

#isometricCanvas {
    border-radius: 8px;
}

/* Summary box */
.summary-box {
    background: #0f172a;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Cutlist */
.cutlist-preview {
    max-height: 350px;
    overflow-y: auto;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 4px;
    margin-top: 0.5rem;
}

/* ----- Cutlist alerts (modern) ----- */
.cutlist-alerts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
}
.cutlist-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.35;
    background: linear-gradient(135deg, rgba(30,41,59,0.85), rgba(15,23,42,0.85));
    border: 1px solid rgba(148,163,184,0.18);
    color: #e2e8f0;
    backdrop-filter: blur(6px);
    transform: translateY(-4px);
    opacity: 0;
    animation: cutlistAlertIn 0.22s ease-out forwards;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.cutlist-alert:hover {
    border-color: rgba(148,163,184,0.35);
    transform: translateY(0) scale(1.005);
}
.cutlist-alert.error {
    border-left: 3px solid #ef4444;
    background: linear-gradient(135deg, rgba(127,29,29,0.45), rgba(15,23,42,0.85));
}
.cutlist-alert.warn {
    border-left: 3px solid #f59e0b;
    background: linear-gradient(135deg, rgba(120,53,15,0.4), rgba(15,23,42,0.85));
}
.cutlist-alert.info {
    border-left: 3px solid #3b82f6;
    background: linear-gradient(135deg, rgba(30,58,138,0.35), rgba(15,23,42,0.85));
}
.cutlist-alert-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,0.06);
    color: #f8fafc;
}
.cutlist-alert.error .cutlist-alert-icon { color: #fca5a5; background: rgba(239,68,68,0.15); }
.cutlist-alert.warn  .cutlist-alert-icon { color: #fcd34d; background: rgba(245,158,11,0.15); }
.cutlist-alert.info  .cutlist-alert-icon { color: #93c5fd; background: rgba(59,130,246,0.15); }
.cutlist-alert-msg {
    flex: 1;
    color: #e2e8f0;
}
.cutlist-alert-dismiss {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}
.cutlist-alert-dismiss:hover {
    background: rgba(148,163,184,0.15);
    color: #f8fafc;
}
.cutlist-alert--leaving {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
}
@keyframes cutlistAlertIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ----- Cutlist toolbar (modern) ----- */
.cutlist-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    margin: 8px 0;
    background: linear-gradient(135deg, rgba(30,41,59,0.7), rgba(15,23,42,0.7));
    border: 1px solid rgba(148,163,184,0.18);
    border-radius: 10px;
    backdrop-filter: blur(6px);
}
.btn-reset-cutlist {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(37,99,235,0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn-reset-cutlist:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(37,99,235,0.45);
}
.btn-reset-cutlist:active {
    transform: translateY(0);
    filter: brightness(0.95);
    box-shadow: 0 1px 4px rgba(37,99,235,0.35);
}
.cutlist-edit-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.3;
}
.cutlist-edit-hint::before {
    content: 'i';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(59,130,246,0.18);
    color: #93c5fd;
    font-size: 10px;
    font-weight: 700;
    font-style: italic;
    font-family: Georgia, serif;
}

.cutlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}

.cutlist-table th,
.cutlist-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #334155;
    text-align: left;
}

.cutlist-table th {
    background: #1e293b;
    color: #f8fafc;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.cutlist-table td {
    color: #cbd5e1;
}

.cutlist-table tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

/* Label column - ensure full visibility */
.cutlist-table .label-cell {
    white-space: normal;
    word-break: break-word;
}

.cutlist-table .edit-label {
    min-width: 120px;
    width: auto;
    font-weight: bold;
    font-size: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 3px;
    color: #f97316;
    padding: 2px 4px;
}

/* Cutlist table input fields */
.cutlist-table .edit-dim,
.cutlist-table .edit-qty {
    width: 55px;
    background: transparent;
    border: 1px solid #475569;
    border-radius: 3px;
    color: #e2e8f0;
    padding: 2px 4px;
    font-size: 0.7rem;
}

.cutlist-table .edit-material {
    background: #1e293b;
    border: 1px solid #475569;
    border-radius: 3px;
    color: #e2e8f0;
    font-size: 0.7rem;
    padding: 2px;
}

.category-header td {
    background: #334155 !important;
    font-weight: bold;
    color: #facc15 !important;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.toolbar button {
    font-size: 0.75rem;
    padding: 0.35rem 0.6rem;
}

/* Wardrobe unit cards */
.wardrobe-unit {
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #0f172a;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wardrobe-unit:hover {
    border-color: #475569;
}

.wardrobe-unit.active-unit {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px #22c55e44;
}

.wardrobe-unit .unit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #1e293b;
}

.wardrobe-unit .unit-header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #f8fafc;
}

.wardrobe-unit .active-badge {
    color: #22c55e;
    font-size: 0.7rem;
    font-weight: normal;
    margin-left: 0.5rem;
}

.wardrobe-unit .unit-section {
    margin-bottom: 0.6rem;
    padding: 0.5rem;
    background: #1e293b;
    border-radius: 5px;
    border: 1px solid #253449;
}

.wardrobe-unit .section-title {
    font-size: 0.72rem;
    color: #60a5fa;
    margin-bottom: 0.4rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.wardrobe-unit .unit-summary {
    padding: 0.3rem 0.4rem;
    background: #1e293b;
    border-radius: 4px;
    text-align: center;
}

.wardrobe-unit .unit-summary small {
    color: #64748b;
    font-size: 0.7rem;
}

.wardrobe-unit .custom-widths-row {
    margin-top: 0.3rem;
}

.wardrobe-unit .custom-widths-row.hide {
    display: none;
}

.wardrobe-unit .unit-actions {
    display: flex;
    gap: 0.25rem;
}

.wardrobe-unit .unit-actions button {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
}

/* ========== COLUMN PANEL STYLES ========== */
.col-panel {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    border-left: 3px solid #8b5cf6;
}

.col-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    background: linear-gradient(135deg, #1e293b, #1a2435);
    cursor: pointer;
    border-bottom: 1px solid #334155;
}

.col-panel-header h4 {
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
    letter-spacing: -0.1px;
}

.col-dimensions {
    font-size: 0.7rem;
    color: #64748b;
    background: #0f172a;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.col-panel-body {
    padding: 0.6rem;
    display: none;
}

.col-panel-body.expanded {
    display: block;
}

.col-section {
    margin-bottom: 0.6rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed #1e293b;
}

.col-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.col-section h5 {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.4rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group {
    margin-bottom: 0.4rem;
}

.form-group label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.15rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
    margin: 0;
}

.checkbox-label span {
    font-size: 0.8rem;
    color: #cbd5e1;
}

.hint {
    display: block;
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 0.15rem;
}

/* Hanging options highlight */
.hanging-options {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 4px;
}

.hanging-partition-options {
    margin-top: 0.4rem;
    padding: 0.4rem;
    background: #0f172a;
    border-radius: 4px;
}

/* Type selector pills */
.type-selector {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.type-btn {
    flex: 1;
    padding: 0.4rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 4px;
    color: #94a3b8;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.type-btn:hover {
    background: #253449;
}

.type-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Dimension styles */
.dimension rect {
    fill: #ffffff;   /* white dim box */
    stroke: #d1d5db;
    stroke-width: 0.5;
}

.dimension text {
    fill: #000000;   /* black text */
    font-weight: 500;
}

.dimension line {
    stroke: #374151;
}

/* Make all SVG text black (wardrobe drawing) */
#svgHost svg text {
    fill: #000000;
}

/* Profile light visual — yellow lines */
.profile-light-line {
    stroke: #facc15;
    stroke-width: 3;
    stroke-linecap: round;
}

.profile-light-glow {
    stroke: #fef08a;
    stroke-width: 5;
    stroke-linecap: round;
    opacity: 0.5;
}

/* Shelf / drawer position markers: white circle + black text */
.shelf-marker {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 1;
}

.shelf-marker-text {
    fill: #000000;
    font-size: 8px;
    font-weight: 600;
}

.shelf-marker-line {
    stroke: #facc15;
    stroke-width: 1;
    stroke-dasharray: 3,2;
}

/* Drawer zone */
.drawer-zone {
    fill: rgba(248, 113, 113, 0.18);
    stroke: #f97373;
    stroke-width: 1;
}

/* Partition styles */
.partition-line {
    stroke: #f97316;
    stroke-width: 1.2;
}

/* Groove / Pattam lines — red */
.groove-line,
.pattam-line {
    stroke: #ef4444;
    stroke-width: 2;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* ========== CONSOLIDATED CUTLIST STYLES ========== */
.cutlist-table.consolidated {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.8rem;
}

.cutlist-table.consolidated th {
    background: #1e293b;
    padding: 0.5rem 0.4rem;
    text-align: left;
    font-weight: 500;
    border-bottom: 2px solid #3b82f6;
    white-space: nowrap;
}

.cutlist-table.consolidated td {
    padding: 0.4rem;
    border-bottom: 1px solid #1e293b;
}

.cutlist-table.consolidated tr:hover {
    background: #1e293b;
}

.cutlist-table.consolidated .category-header {
    background: #0f172a;
}

.cutlist-table.consolidated .category-header td {
    padding: 0.6rem;
    border-bottom: 1px solid #334155;
}

.cutlist-table.consolidated .cat-count {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: normal;
    margin-left: 0.5rem;
}

.cutlist-table.consolidated .piece-no {
    font-size: 0.8rem;
    font-weight: 600;
    width: 30px;
    text-align: center;
}

.cutlist-table.consolidated .desc-cell {
    max-width: 150px;
}

.cutlist-table.consolidated .dim-cell {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.75rem;
    color: #e2e8f0;
    text-align: right;
    padding-right: 8px;
    min-width: 55px;
}

.cutlist-table.consolidated .qty-cell {
    text-align: center;
    color: #22c55e;
    font-weight: 600;
}

.cutlist-table.consolidated .labels-cell {
    font-size: 0.75rem;
    color: #f97316;
    font-family: 'Monaco', 'Consolas', monospace;
    white-space: normal;
    word-break: break-word;
    min-width: 100px;
}

/* Vertical pieces (even numbers) - purple */
.cutlist-table.consolidated tr.vertical-piece .piece-no {
    color: #a78bfa;
}

/* Horizontal pieces (odd numbers) - blue */
.cutlist-table.consolidated tr.horizontal-piece .piece-no {
    color: #60a5fa;
}

.consolidation-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    background: #1e293b;
    border-radius: 6px;
    font-size: 0.8rem;
}

.consolidation-summary .saved-info {
    color: #22c55e;
    font-size: 0.75rem;
}

.glass-profile-summary {
    padding: 0.6rem 0.8rem;
    margin-top: 0.5rem;
    background: #1e3a5f;
    border-radius: 6px;
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.glass-profile-summary .total {
    color: #22c55e;
    font-weight: 600;
}

.sheet-info {
    padding: 0.4rem 0.8rem;
    margin-top: 0.5rem;
    background: #1e293b;
    border-radius: 4px;
    color: #94a3b8;
}
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    font-size: 0.8rem;
    line-height: 1.6;
}

.glass-profile-summary strong {
    color: #60a5fa;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .controls-panel {
        height: auto;
        max-height: 50vh;
    }
}

@media (max-width: 640px) {
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .grid2 {
        grid-template-columns: 1fr;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .preview-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .quick-toolbar {
        padding: 0.3rem 0.5rem;
    }

    .quick-btn {
        min-width: 48px;
        padding: 0.25rem 0.4rem;
    }
}
/* ========================================
   MULTI-BORE DRILLING STYLES
   ======================================== */

.multi-bore-disabled {
    padding: 15px;
    text-align: center;
    background: #1e293b;
    border-radius: 6px;
    color: #94a3b8;
}

.multi-bore-summary {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.multi-bore-summary h4 {
    margin-bottom: 12px;
    color: #60a5fa;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.summary-item {
    background: #0f172a;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.summary-item.error {
    background: #450a0a;
    border: 1px solid #dc2626;
}

.summary-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #22c55e;
}

.summary-item.error .summary-value {
    color: #f87171;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
}

.measurement-note {
    background: #422006;
    border-left: 3px solid #f59e0b;
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 0 4px 4px 0;
}

.multi-bore-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.multi-bore-errors {
    background: #450a0a;
    border: 1px solid #dc2626;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
}

.multi-bore-errors h4 {
    color: #f87171;
    margin-bottom: 8px;
}

.multi-bore-errors ul {
    margin-left: 20px;
    font-size: 0.85rem;
}

.multi-bore-batches h4 {
    margin-bottom: 12px;
    color: #a5b4fc;
}

.drill-batch {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
}

.batch-header {
    background: #334155;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-number {
    font-weight: 700;
    color: #60a5fa;
}

.batch-info {
    font-size: 0.85rem;
    color: #94a3b8;
}

.batch-details {
    padding: 12px 15px;
    border-bottom: 1px solid #334155;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    font-size: 0.9rem;
}

.batch-pieces {
    grid-column: 1 / -1;
}

.batch-rows {
    padding: 12px 15px;
}

.drill-row {
    margin-bottom: 12px;
}

.drill-row:last-child {
    margin-bottom: 0;
}

.row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.row-label {
    font-weight: 600;
    color: #22c55e;
}

.back-row .row-label {
    color: #f59e0b;
}

.row-offset {
    font-size: 0.8rem;
    color: #94a3b8;
    background: #0f172a;
    padding: 2px 8px;
    border-radius: 4px;
}

.row-positions {
    background: #0f172a;
    padding: 10px;
    border-radius: 4px;
}

.positions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    max-height: 100px;
    overflow-y: auto;
}

.pos {
    background: #1e3a5f;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
}

.pos-more {
    background: #422006;
    color: #f59e0b;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.positions-summary {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.individual-cards {
    margin-top: 15px;
}

.individual-cards summary {
    cursor: pointer;
    padding: 10px;
    background: #334155;
    border-radius: 6px;
    font-weight: 600;
}

.individual-cards summary:hover {
    background: #475569;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.drill-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    overflow: hidden;
}

.card-header {
    background: #334155;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
}

.card-label {
    font-weight: 700;
    color: #60a5fa;
}

.card-qty {
    color: #94a3b8;
}

.card-body {
    padding: 10px 12px;
    font-size: 0.85rem;
}

.card-row {
    margin-bottom: 4px;
}

.exclusion-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.exclusion-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #334155;
    border-radius: 4px;
    margin-bottom: 4px;
}

.btn-small {
    padding: 4px 10px;
    font-size: 0.8rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background: #2563eb;
}

.grid3 {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

/* Drilling info in cutlist */
.drill-info {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    color: #60a5fa;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: help;
    white-space: nowrap;
}

.drill-info:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e3a5f 100%);
    color: white;
}
