/* ===== TRIAL BANNER ===== */
.trial-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 20px;
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: #fff;
    font-size: 0.85rem;
}

.trial-banner-text { font-size: 0.85rem; }

.trial-banner-btn {
    padding: 4px 16px;
    background: #fff;
    color: #F57C00;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.2s;
}

.trial-banner-btn:hover { opacity: 0.9; }

/* ===== COMPACT TOPBAR ===== */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 900;
}

body.dark-mode .topbar {
    background: #1e1e1e;
    border-bottom-color: #333;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-logo img {
    height: 38px;
    width: auto;
    display: block;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Tenant name label */
.topbar-tenant {
    font-size: 0.78rem;
    color: #999;
    margin-right: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Icon buttons (theme, etc.) */
.topbar-icon-btn {
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.15s;
    padding: 0;
    color: #555;
}

.topbar-icon-btn:hover {
    background: #f0f0f0;
}

body.dark-mode .topbar-icon-btn { color: #999; }
body.dark-mode .topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* Theme Toggle Wrap */
.theme-toggle-wrap {
    position: relative;
}

/* User dropdown trigger */
.topbar-user-wrap {
    position: relative;
}

.topbar-user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 12px 6px 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: #333;
    transition: background 0.15s, border-color 0.15s;
    height: 38px;
    min-height: auto;
}

.topbar-user-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

body.dark-mode .topbar-user-btn { color: #ddd; border-color: #444; }
body.dark-mode .topbar-user-btn:hover { background: rgba(255, 255, 255, 0.06); border-color: #666; }

.topbar-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--brand-primary, #4CAF50);
    color: #fff;
}

.topbar-user-name {
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-chevron {
    color: #999;
    flex-shrink: 0;
}

/* Page title in topbar */
.topbar-page-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Date */
.topbar-date {
    font-size: 0.8rem;
    color: #999;
    white-space: nowrap;
}

/* Vertical divider */
.topbar-divider {
    width: 1px;
    height: 24px;
    background: #e0e0e0;
    flex-shrink: 0;
}

body.dark-mode .topbar-date { color: #888; }
body.dark-mode .topbar-divider { background: #444; }

/* Notification dot (for future use) */
.topbar-notif-btn {
    position: relative;
}

/* User dropdown menu */
.topbar-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 4px;
    z-index: 2000;
    min-width: 200px;
    white-space: nowrap;
}

.topbar-user-menu.open {
    display: block;
    animation: themeMenuIn 0.15s ease-out;
}

.topbar-user-menu-header {
    padding: 10px 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topbar-user-menu-header strong {
    font-size: 0.88rem;
    color: #333;
}

.topbar-user-menu-header span {
    font-size: 0.75rem;
    color: #999;
}

.topbar-user-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
    min-height: auto;
    font-family: inherit;
    white-space: nowrap;
}

.topbar-user-menu-item:hover {
    background: #f0f0f0;
}

.topbar-user-menu-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 8px;
}

.topbar-user-menu-logout {
    color: #dc3545;
}

.topbar-user-menu-logout:hover {
    background: #fef2f2;
}

/* Hide old header img rule, use topbar-logo instead */
header img { max-width: 300px; }

@media (max-width: 768px) {
    .topbar-user-name { display: none; }
    .topbar-user-btn { padding: 4px 6px; }
    .topbar-date { display: none; }
    .topbar-page-title { display: none; }
}

@media (max-width: 480px) {
    .topbar { padding: 0 10px; }
}

/* Dark mode topbar */
body.dark-mode .topbar {
    background: #1e1e1e;
    border-bottom-color: #333;
}

body.dark-mode .topbar-page-title { color: #e0e0e0; }
body.dark-mode .topbar-date { color: #777; }
body.dark-mode .topbar-divider { background: #444; }

body.dark-mode .topbar-icon-btn {
    color: #ccc;
}

body.dark-mode .topbar-icon-btn:hover {
    background: #333;
}

body.dark-mode .topbar-user-menu-header strong { color: #e0e0e0; }
body.dark-mode .topbar-user-menu-header span { color: #777; }

body.dark-mode .topbar-user-btn {
    color: #e0e0e0;
    border-color: #444;
}

body.dark-mode .topbar-user-btn:hover {
    background: #2a2a2a;
    border-color: #555;
}

body.dark-mode .topbar-avatar {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 20%, #1e1e1e);
}

body.dark-mode .topbar-chevron {
    color: #777;
}

body.dark-mode .topbar-user-menu {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

body.dark-mode .topbar-user-menu-item {
    color: #e0e0e0;
}

body.dark-mode .topbar-user-menu-item:hover {
    background: #383838;
}

body.dark-mode .topbar-user-menu-divider {
    background: #404040;
}

body.dark-mode .topbar-user-menu-logout:hover {
    background: #3a2020;
}

/* Color theme topbar overrides */
body.theme-forest .topbar { background: #1a2318; border-bottom-color: #3d5235; }
body.theme-forest .topbar-icon-btn { color: #8cb07a; }
body.theme-forest .topbar-icon-btn:hover { background: #2a3825; }
body.theme-forest .topbar-tenant { color: #6a8a5a; }
body.theme-forest .topbar-user-btn { color: #b8d4a8; border-color: #3d5235; }
body.theme-forest .topbar-user-btn:hover { background: #243020; }
body.theme-forest .topbar-avatar { background: rgba(90, 158, 75, 0.15); }
body.theme-forest .topbar-chevron { color: #6a8a5a; }
body.theme-forest .topbar-user-menu { background: #1a2318; border-color: #3d5235; }
body.theme-forest .topbar-user-menu-item { color: #b8d4a8; }
body.theme-forest .topbar-user-menu-item:hover { background: #243020; }
body.theme-forest .topbar-user-menu-divider { background: #3d5235; }

body.theme-ocean .topbar { background: #151c27; border-bottom-color: #2e4460; }
body.theme-ocean .topbar-icon-btn { color: #6a9cc8; }
body.theme-ocean .topbar-icon-btn:hover { background: #1f2d40; }
body.theme-ocean .topbar-tenant { color: #5078a0; }
body.theme-ocean .topbar-user-btn { color: #a0c4e8; border-color: #2e4460; }
body.theme-ocean .topbar-user-btn:hover { background: #1c2636; }
body.theme-ocean .topbar-avatar { background: rgba(59, 130, 196, 0.15); }
body.theme-ocean .topbar-chevron { color: #5078a0; }
body.theme-ocean .topbar-user-menu { background: #151c27; border-color: #2e4460; }
body.theme-ocean .topbar-user-menu-item { color: #a0c4e8; }
body.theme-ocean .topbar-user-menu-item:hover { background: #1c2636; }
body.theme-ocean .topbar-user-menu-divider { background: #2e4460; }

body.theme-slate .topbar { background: #e8e2d8; border-bottom-color: #c8bfb0; }
body.theme-slate .topbar-icon-btn { color: #8b7d6b; }
body.theme-slate .topbar-icon-btn:hover { background: #ddd6ca; }
body.theme-slate .topbar-tenant { color: #8b7d6b; }
body.theme-slate .topbar-user-btn { color: #504840; border-color: #c8bfb0; }
body.theme-slate .topbar-user-btn:hover { background: #ddd6ca; }
body.theme-slate .topbar-user-menu { background: #f0ece4; border-color: #c8bfb0; }
body.theme-slate .topbar-user-menu-item { color: #504840; }
body.theme-slate .topbar-user-menu-item:hover { background: #e8e2d8; }
body.theme-slate .topbar-user-menu-divider { background: #c8bfb0; }

body.theme-sunset .topbar { background: #f8ebe4; border-bottom-color: #e0bfb0; }
body.theme-sunset .topbar-icon-btn { color: #b87060; }
body.theme-sunset .topbar-icon-btn:hover { background: #f0ddd4; }
body.theme-sunset .topbar-tenant { color: #b87060; }
body.theme-sunset .topbar-user-btn { color: #6b3f35; border-color: #e0bfb0; }
body.theme-sunset .topbar-user-btn:hover { background: #f0ddd4; }
body.theme-sunset .topbar-user-menu { background: #fdf5f0; border-color: #e0bfb0; }
body.theme-sunset .topbar-user-menu-item { color: #6b3f35; }
body.theme-sunset .topbar-user-menu-item:hover { background: #f8ebe4; }
body.theme-sunset .topbar-user-menu-divider { background: #e0bfb0; }

/* Theme Dropdown Menu */
.theme-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
    z-index: 2000;
    min-width: 180px;
}

.theme-menu.open {
    display: block;
    animation: themeMenuIn 0.15s ease-out;
}

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

.theme-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    transition: background 0.15s;
    min-height: auto;
}

.theme-menu-item:hover {
    background: #f0f0f0;
}

.theme-menu-item.active {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 12%, white);
    color: var(--brand-primary, #4CAF50);
    font-weight: 600;
}

.theme-menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.theme-menu-label {
    flex: 1;
    text-align: left;
}

body.dark-mode .theme-menu {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

body.dark-mode .theme-menu-item {
    color: #e0e0e0;
}

body.dark-mode .theme-menu-item:hover {
    background: #383838;
}

body.dark-mode .theme-menu-item.active {
    background: color-mix(in srgb, var(--brand-primary, #4CAF50) 20%, #2d2d2d);
    color: var(--brand-primary, #4CAF50);
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .dark-mode-icon::before {
    content: '☀️';
}

body.dark-mode .dark-mode-icon {
    display: none;
}

body.dark-mode .dark-mode-toggle::after {
    content: '☀️';
    font-size: 24px;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3 {
    color: #f0f0f0;
}

body.dark-mode .unit-toggle-container,
body.dark-mode .templates-section,
body.dark-mode .deck-areas-section {
    background: #2d2d2d;
    border-color: #404040;
}

body.dark-mode .unit-toggle-btn,
body.dark-mode .template-btn,
body.dark-mode .deck-area-card {
    background: #383838;
    border-color: #505050;
    color: #e0e0e0;
}

body.dark-mode .unit-toggle-btn:hover,
body.dark-mode .template-btn:hover {
    background: #404040;
}

body.dark-mode .unit-toggle-btn.active,
body.dark-mode .template-btn.active {
    background: var(--brand-primary, #4CAF50);
    color: white;
}

body.dark-mode input,
body.dark-mode select {
    background: #383838;
    border: 1px solid #505050;
    color: #e0e0e0;
}

body.dark-mode input:focus,
body.dark-mode select:focus {
    outline: 2px solid var(--brand-primary, #4CAF50);
    background: #404040;
}

body.dark-mode .results {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode #visual {
    background: #2d2d2d;
    border-color: #505050;
}

body.dark-mode button {
    background-color: var(--brand-primary, #4CAF50);
}

body.dark-mode button:hover {
    background-color: #45a049;
}

body.dark-mode .dark-mode-toggle {
    background: #383838;
    border-color: #505050;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #404040;
}

body.dark-mode fieldset {
    border-color: #505050;
}

body.dark-mode label {
    color: #e0e0e0;
}

body.dark-mode .fascia-button {
    background-color: #383838;
    border-color: #505050;
    color: #e0e0e0;
}

body.dark-mode .fascia-button.selected {
    background-color: var(--brand-primary, #4CAF50);
    color: white;
}

body.dark-mode .waste-badge.excellent {
    background-color: #1e5631;
    color: #b8e6c5;
}

body.dark-mode .waste-badge.good {
    background-color: #5c4a1a;
    color: #ffe9b3;
}

body.dark-mode .waste-badge.moderate {
    background-color: #5c3317;
    color: #ffd4b3;
}

body.dark-mode .waste-badge.high {
    background-color: #5c1f1f;
    color: #ffb3b3;
}

body.dark-mode #wasteSummary {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    border-color: #505050;
}

/* Tooltip Styles */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    font-size: 12px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.tooltip:hover .tooltip-icon {
    background: var(--brand-primary, #4CAF50);
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    font-size: 13px;
    font-weight: normal;
    line-height: 1.4;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

body.dark-mode .tooltip .tooltiptext {
    background-color: #f8f9fa;
    color: #212529;
}

body.dark-mode .tooltip .tooltiptext::after {
    border-color: #f8f9fa transparent transparent transparent;
}

body { font-family: Arial, sans-serif; padding: 0; margin: 0; transition: background-color 0.3s ease, color 0.3s ease; }

/* Footer */
.app-footer {
    margin-top: 60px;
    padding: 30px 20px;
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}
.app-footer p:first-child { color: #333; }
body.dark-mode .app-footer { background: #222; border-top-color: #404040; color: #888; }
body.dark-mode .app-footer p:first-child { color: #ccc; }
body.theme-forest .app-footer { background: #162014; border-top-color: #3d5235; color: #6a8a5a; }
body.theme-forest .app-footer p:first-child { color: #8cb07a; }
body.theme-ocean .app-footer { background: #111820; border-top-color: #2e4460; color: #5078a0; }
body.theme-ocean .app-footer p:first-child { color: #6a9cc8; }
body.theme-slate .app-footer { background: #ddd6ca; border-top-color: #c8bfb0; color: #8b7d6b; }
body.theme-slate .app-footer p:first-child { color: #504840; }
body.theme-sunset .app-footer { background: #f0ddd4; border-top-color: #e0bfb0; color: #a06858; }
body.theme-sunset .app-footer p:first-child { color: #6b3f35; }
h1 { text-align: center; color: #333; font-family: var(--brand-font-heading, system-ui, sans-serif); }
h2 { color: #333; margin-top: 30px; font-family: var(--brand-font-heading, system-ui, sans-serif); }
body.dark-mode h1, body.dark-mode h2 { color: #eee; }

/* Unit Toggle Styles */
.unit-toggle-container {
    text-align: center;
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.unit-toggle-container label {
    font-weight: bold;
    margin-right: 15px;
    color: #333;
}

.unit-toggle-buttons {
    display: inline-flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.unit-toggle-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #666;
}

.unit-toggle-btn:hover {
    background: #e8f5e9;
    border-color: var(--brand-primary, #4CAF50);
}

.unit-toggle-btn.active {
    background: var(--brand-primary, #4CAF50);
    border-color: #45a049;
    color: white;
    font-weight: bold;
}

.unit-label {
    color: var(--brand-primary, #4CAF50);
    font-weight: 600;
    font-size: 0.9em;
}

/* Template Section Styles */
.templates-section {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
}

.templates-section h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c5f2d;
    font-size: 1.5rem;
}

.templates-description {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 15px;
}

.template-btn {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.template-btn:hover {
    background: #f0f7f0;
    border-color: var(--brand-primary, #4CAF50);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.template-btn.active {
    background: var(--brand-primary, #4CAF50);
    border-color: #45a049;
    color: white;
}

.template-btn.active .template-size {
    color: #e8f5e9;
}

.template-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.template-name {
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
}

.template-btn.active .template-name {
    color: white;
}

.template-size {
    font-size: 0.85rem;
    color: #666;
}
form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
label, fieldset { font-weight: bold; display: flex; flex-direction: column; }
input, select { padding: 8px; font-size: 1rem; }
fieldset { grid-column: span 2; }
.checkbox-group { display: flex; gap: 10px; }
.results { background: #f4f4f4; padding: 15px; border-radius: 5px; margin-bottom: 20px; }
.results p { margin: 8px 0; }
#visual {
    background: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    min-height: 500px;
}

/* Canvas Container with Pan/Zoom */
.canvas-container {
    position: relative;
    overflow: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    margin: 20px 0;
    max-height: 80vh;
    cursor: grab;
}

.canvas-container:active {
    cursor: grabbing;
}

.canvas-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 10000;
    background: #fff;
}

#visual canvas {
    background: #ffffff;
    display: block;
    margin: auto;
    transition: transform 0.2s ease;
}

/* Canvas Controls */
.canvas-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
    flex-wrap: wrap;
    position: relative;
    z-index: 10001;
}

.canvas-control-btn {
    padding: 10px 16px;
    font-size: 1.1rem;
    background-color: #2196F3;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: bold;
    min-width: 50px;
    position: relative;
    z-index: 10002;
}

.canvas-control-btn:hover {
    background-color: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.canvas-control-btn:active {
    transform: translateY(0);
}
.legend { margin-top: 10px; font-size: 14px; text-align: center; }
button { padding: 10px; font-size: 1rem; background-color: var(--brand-primary, #4CAF50); color: white; border: none; cursor: pointer; margin-top: 10px; border-radius: 4px; transition: background-color 0.3s ease; }
button:hover { background-color: var(--brand-primary-dark, #388E3C); }
#printButton { background-color: var(--brand-primary, #4CAF50); }
#printButton:hover { background-color: var(--brand-primary-dark, #388E3C); }

/* Error handling styles */
.error-message {
    display: none;
    color: #d32f2f;
    font-size: 0.875rem;
    font-weight: normal;
    margin-top: 4px;
    margin-bottom: 0;
}

.input-error {
    border: 2px solid #d32f2f !important;
    background-color: #ffebee;
}

input.input-error:focus, select.input-error:focus {
    outline: none;
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

/* Helper text styles */
.helper-text {
    display: block;
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 4px;
    margin-bottom: 0;
    line-height: 1.4;
}

body.dark-mode .helper-text {
    color: #999;
}

/* Button group for Calculate and Clear */
.button-group {
    display: flex;
    gap: 10px;
    grid-column: span 2;
}

.button-group button {
    flex: 1;
    margin-top: 0;
}

.clear-btn {
    background-color: #757575;
}

.clear-btn:hover {
    background-color: #616161;
}

/* Project Management Section */
.project-management {
    background: black;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.project-name-group,
.project-selector-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.project-name-group label,
.project-selector-group label {
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.project-name-input,
.project-select {
    padding: 8px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.project-name-input:focus,
.project-select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.project-notes-group {
    margin-bottom: 15px;
}

.project-notes-group label {
    display: block;
    margin-bottom: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.project-notes-input {
    width: 98%;
    padding: 10px 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 50px;
    transition: all 0.3s ease;
}

.project-notes-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.8);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.project-notes-input::placeholder {
    color: #999;
    font-style: italic;
}

.project-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: white;
    font-size: 14px;
}

/* Cloud Sync Section */

.cloud-sync-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: white;
}

.cloud-icon {
    font-size: 20px;
}

.cloud-sync-title {
    font-weight: 600;
    font-size: 14px;
}

.cloud-sync-status {
    margin-left: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.cloud-sync-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.cloud-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.cloud-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cloud-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cloud-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.cloud-btn .btn-icon {
    font-size: 16px;
}

.config-btn:hover:not(:disabled) {
    background: rgb(103 172 91 / 47%);
}

.save-cloud-btn:hover:not(:disabled) {
    background: rgba(33, 150, 243, 0.3);
}

.load-cloud-btn:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.3);
}

.manage-projects-btn:hover:not(:disabled) {
    background: rgb(103 172 91 / 47%);
}

.view-history-btn:hover:not(:disabled) {
    background: rgba(96, 125, 139, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cloud-sync-actions {
        grid-template-columns: 1fr;
    }

    .cloud-btn {
        width: 100%;
    }
}

.label-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.label-with-icon svg {
    width: 20px;
    height: 20px;
    fill: #555;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    margin: 10px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.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-color: #ccc;
    transition: 0.4s;
    border-radius: 28px;
}

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

.toggle-switch input:checked + .slider {
    background-color: var(--brand-primary, #4CAF50);
}

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

.toggle-group {
    display: flex;
    gap: 10px; /* adjust spacing as needed */
    flex-wrap: wrap; /* if you want them to wrap on small screens */
    align-items: center;
    margin: 10px 0;
}

.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.fascia-grid {
    display: grid;
    grid-template-areas:
        ". top ."
        "left center right"
        ". bottom .";
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
}

.fascia-button {
    padding: 6px 12px;
    border: 2px solid #aaa;
    border-radius: 5px;
    background-color: #eee;
    cursor: pointer;
    font-weight: bold;
    user-select: none;
    text-align: center;
}

.fascia-button.selected {
    background-color: var(--brand-primary, #4CAF50);
    color: white;
    border-color: var(--brand-primary, #4CAF50);
}

.fascia-top { grid-area: top; }
.fascia-bottom { grid-area: bottom; }
.fascia-left { grid-area: left; }
.fascia-right { grid-area: right; }
.fascia-center {
    grid-area: center;
    font-size: 14px;
    font-weight: bold;
    color: #3b3b3b;
    margin-left: 17px;
}

.fascia-section {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.fascia-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#calculateBtn.full-width {
    grid-column: span 2;
    width: 100%;
}

.results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: space-between;
}

.results-grid > div {
    flex: 1 1 48%;
    min-width: 280px;
}

.results ul {
    padding-left: 20px;
    margin-top: 5px;
}

.results li {
    margin-bottom: 5px;
}

/* ===== MOBILE IMPROVEMENTS ===== */
@media (max-width: 600px) {
    form {
        grid-template-columns: 1fr !important;
    }

    .fascia-section {
        flex-direction: column;
        gap: 20px;
    }

    .fascia-inputs {
        width: 100%;
    }

    .fascia-grid {
        justify-content: center;
    }

    /* Larger touch targets for mobile */
    button {
        min-height: 48px;
        font-size: 16px;
        padding: 14px 20px;
    }

    .button-group {
        grid-column: span 1;
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
        min-height: 50px;
    }

    .unit-toggle-btn {
        min-height: 48px;
        padding: 12px 18px;
        font-size: 15px;
    }

    .template-btn {
        min-height: 100px;
        padding: 18px 14px;
    }

    .fascia-button {
        min-height: 48px;
        min-width: 48px;
        padding: 12px 16px;
        font-size: 16px;
    }

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

    .toggle-switch .slider:before {
        height: 26px;
        width: 26px;
    }

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

    /* Larger input fields */
    input,
    select {
        min-height: 44px;
        font-size: 16px;
        padding: 10px;
    }

    /* Larger dark mode toggle */
    .dark-mode-toggle {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    /* Deck area cards */
    .deck-area-card {
        min-height: 80px;
        padding: 18px;
    }

    .deck-area-remove {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .add-deck-btn,
    .combined-totals-btn {
        min-height: 50px;
        font-size: 16px;
    }

    #deckForm > div.fascia-section > fieldset {
        margin: 0 auto;
    }

    .templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .template-icon {
        font-size: 2rem;
    }

    .template-name {
        font-size: 0.85rem;
    }

    .template-size {
        font-size: 0.75rem;
    }

    /* Larger tooltip for mobile */
    .tooltip .tooltip-icon {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

/* Waste Indicator Badges */
.waste-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95em;
    margin: 5px 0;
    border: 2px solid;
}

.waste-badge.excellent {
    background-color: #d4edda;
    color: #155724;
    border-color: #28a745;
}

.waste-badge.good {
    background-color: #fff3cd;
    color: #856404;
    border-color: #ffc107;
}

.waste-badge.moderate {
    background-color: #ffe5d0;
    color: #8b4513;
    border-color: #fd7e14;
}

.waste-badge.high {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
}

.waste-percentage {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 0.85em;
    margin-left: 8px;
}

.waste-percentage.low {
    background-color: #d4edda;
    color: #155724;
}

.waste-percentage.medium {
    background-color: #fff3cd;
    color: #856404;
}

.waste-percentage.high {
    background-color: #ffe5d0;
    color: #8b4513;
}

.waste-percentage.very-high {
    background-color: #f8d7da;
    color: #721c24;
}

#wasteSummary {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 10px;
    margin-top: 10px;
    border: 2px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Deck Areas Section */
.deck-areas-section {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.deck-areas-description {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.deck-areas-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.deck-area-card {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: move;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.deck-area-card.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.deck-area-card.drag-over {
    border-color: #2196F3;
    border-style: dashed;
    background: #e3f2fd;
}

.deck-area-card:hover {
    border-color: var(--brand-primary, #4CAF50);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.deck-area-card.active {
    border-color: var(--brand-primary, #4CAF50);
    background: #e8f5e9;
}

.deck-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.deck-area-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #333;
}

.deck-area-status {
    background: var(--brand-primary, #4CAF50);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
}

.deck-area-preview {
    width: 100%;
    height: 120px;
    background: #f5f5f5;
    border-radius: 6px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
}

.deck-area-preview canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.deck-area-preview-placeholder {
    color: #999;
    font-size: 0.85em;
    text-align: center;
}

.deck-area-info {
    font-size: 0.9em;
    color: #666;
    margin: 5px 0 0 0;
}

.deck-area-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.deck-area-action-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 0.85em;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-area-action-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.deck-area-action-btn.clone-btn {
    color: #2196F3;
}

.deck-area-action-btn.clone-btn:hover {
    background: #e3f2fd;
    border-color: #2196F3;
}

.deck-area-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.deck-area-card:hover .deck-area-remove {
    display: flex;
}

.deck-area-remove:hover {
    background: #c82333;
}

.combined-totals-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-combined-btn, .print-combined-btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-combined-btn {
    background: #2196F3;
    color: white;
}

.export-combined-btn:hover {
    background: #0b7dda;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.3);
}

.print-combined-btn {
    background: #9C27B0;
    color: white;
}

.print-combined-btn:hover {
    background: #7B1FA2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(156, 39, 176, 0.3);
}

.add-deck-btn, .combined-totals-btn {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
}

.add-deck-btn {
    background: var(--brand-primary, #4CAF50);
    color: white;
}

.add-deck-btn:hover {
    background: #45a049;
}

.combined-totals-btn {
    background: #2196F3;
    color: white;
}

.combined-totals-btn:hover {
    background: #0b7dda;
}

/* Combined Totals Section */
.combined-totals {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
}

.combined-totals h2 {
    color: white;
    margin-top: 0;
}

.combined-totals h3, .combined-totals h4 {
    color: #f0f0f0;
}

.combined-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.combined-areas-summary {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.combined-areas-summary p {
    margin: 5px 0;
    font-size: 0.95em;
}

#combinedCostBreakdown {
    list-style: none;
    padding: 0;
}

#combinedCostBreakdown li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== PRINT STYLESHEET ===== */
@media print {
    /* Hide interactive elements */
    .unit-toggle-container,
    .templates-section,
    .deck-areas-section,
    #addDeckAreaBtn,
    #showCombinedTotalsBtn,
    .button-group,
    #printButton,
    .dark-mode-toggle,
    .project-management,
    button,
    .toggle-group,
    .toggle-wrapper,
    .fascia-grid {
        display: none !important;
    }

    /* Hide form inputs */
    form {
        display: none !important;
    }

    /* Clean page breaks */
    body {
        background: white !important;
        color: black !important;
        padding: 0;
        margin: 0;
        max-width: 100%;
    }

    header {
        text-align: center;
        border-bottom: 2px solid #333;
        padding-bottom: 10px;
        margin-bottom: 20px;
        page-break-after: avoid;
    }

    h1, h2, h3 {
        color: #000 !important;
        page-break-after: avoid;
    }

    /* Results section */
    .results {
        background: white !important;
        border: 1px solid #000;
        padding: 15px;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .results p {
        margin: 8px 0;
        font-size: 12pt;
    }

    .results-grid {
        display: block !important;
    }

    .results-grid > div {
        page-break-inside: avoid;
        margin-bottom: 15px;
    }

    /* Canvas/Visual */
    #visual {
        background: white !important;
        border: 1px solid #000;
        page-break-inside: avoid;
        page-break-before: always;
    }

    #deckCanvas {
        max-width: 100%;
        height: auto;
    }

    /* Waste badges */
    .waste-badge {
        border: 1px solid #000 !important;
        background: white !important;
        color: #000 !important;
    }

    #wasteSummary {
        background: white !important;
        border: 2px solid #000;
        color: #000 !important;
        page-break-inside: avoid;
    }

    /* Combined totals */
    .combined-totals {
        background: white !important;
        border: 2px solid #000;
        color: #000 !important;
        page-break-before: always;
    }

    .combined-totals h2,
    .combined-totals h3,
    .combined-totals h4 {
        color: #000 !important;
    }

    .combined-areas-summary {
        background: #f0f0f0 !important;
        border: 1px solid #000;
    }

    /* Lists */
    ul {
        page-break-inside: avoid;
    }

    /* Add header/footer */
    @page {
        margin: 2cm;

        @top-center {
            content: "EstiFlow - Deck Estimate";
        }

        @bottom-right {
            content: "Page " counter(page) " of " counter(pages);
        }
    }

    /* Print company info on first page */
    header::after {
        content: "EstiFlow | Professional Deck Installation";
        display: block;
        font-size: 10pt;
        color: #666;
        margin-top: 10px;
    }
}

/* ===== NOTIFICATION SYSTEM ===== */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #28a745;
}

.notification.success {
    border-left-color: #28a745;
}

.notification.error {
    border-left-color: #dc3545;
}

.notification.warning {
    border-left-color: #ffc107;
}

.notification.info {
    border-left-color: #17a2b8;
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.notification.success .notification-icon::before {
    content: '✓';
    color: #28a745;
}

.notification.error .notification-icon::before {
    content: '✕';
    color: #dc3545;
}

.notification.warning .notification-icon::before {
    content: '⚠';
    color: #ffc107;
}

.notification.info .notification-icon::before {
    content: 'ℹ';
    color: #17a2b8;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: #333;
}

.notification-message {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.notification-close:hover {
    background: #f0f0f0;
    color: #333;
}

.notification.hiding {
    animation: slideOut 0.3s ease-out forwards;
}

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

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Dark mode support for notifications */
body.dark-mode .notification {
    background: #2d2d2d;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .notification-title {
    color: #e0e0e0;
}

body.dark-mode .notification-message {
    color: #b0b0b0;
}

body.dark-mode .notification-close {
    color: #999;
}

body.dark-mode .notification-close:hover {
    background: #3d3d3d;
    color: #e0e0e0;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .notification-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .notification {
        min-width: auto;
        max-width: none;
    }
}

/* ===== LOADING INDICATOR ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.loading-spinner {
    background: white;
    padding: 30px 40px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: scaleIn 0.3s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-primary, #4CAF50);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

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

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

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Dark mode support for loading indicator */
body.dark-mode .loading-overlay {
    background: rgba(0, 0, 0, 0.7);
}

body.dark-mode .loading-spinner {
    background: #2d2d2d;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

body.dark-mode .loading-text {
    color: #e0e0e0;
}

body.dark-mode .spinner {
    border-color: #444;
    border-top-color: var(--brand-primary, #4CAF50);
}

/* Cabinet Calculator Styles */
.cabinet-cut-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cabinet-cut-list thead {
    background: var(--brand-primary, #4CAF50);
    color: white;
}

.cabinet-cut-list th,
.cabinet-cut-list td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

.cabinet-cut-list tbody tr:nth-child(even) {
    background: #f9f9f9;
}

.cabinet-cut-list tbody tr:hover {
    background: #f0f0f0;
}

body.dark-mode .cabinet-cut-list th,
body.dark-mode .cabinet-cut-list td {
    border-color: #505050;
}

body.dark-mode .cabinet-cut-list tbody tr:nth-child(even) {
    background: #383838;
}

body.dark-mode .cabinet-cut-list tbody tr:hover {
    background: #404040;
}

.editable-dimension {
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.editable-dimension:hover {
    border-color: var(--brand-primary, #4CAF50);
    background: #f0f8ff;
}

.editable-dimension:focus {
    outline: none;
    border-color: var(--brand-primary, #4CAF50);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

body.dark-mode .editable-dimension {
    background: #2d2d2d;
    border-color: #505050;
    color: #e0e0e0;
}

body.dark-mode .editable-dimension:hover {
    border-color: var(--brand-primary, #4CAF50);
    background: #383838;
}

body.dark-mode .editable-dimension:focus {
    background: #404040;
    border-color: var(--brand-primary, #4CAF50);
}

#cutListSummary {
    color: #333;
}

body.dark-mode #cutListSummary {
    color: #e0e0e0;
}

/* Cabinet Calculator Print Styles */
@media print {
    /* Hide form, buttons, and editable table */
    #cabinetForm,
    #printResultsBtn,
    #copyCsvBtn,
    #downloadCsvBtn,
    #copySummaryBtn,
    .no-print,
    nav,
    header button,
    .dark-mode-toggle {
        display: none !important;
    }

    /* Hide editable aspects - show as plain text */
    .editable-dimension {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
    }

    /* Clean page layout */
    body {
        background: white !important;
        color: black !important;
    }

    main {
        max-width: 100% !important;
        padding: 0 !important;
    }

    #resultsContainer {
        display: block !important;
    }

    h1, h2 {
        color: black !important;
        page-break-after: avoid;
    }

    /* Table styling for print */
    .cabinet-cut-list {
        page-break-inside: avoid;
        border: 2px solid #000 !important;
    }

    .cabinet-cut-list th {
        background: #ddd !important;
        color: #000 !important;
        border: 1px solid #000 !important;
    }

    .cabinet-cut-list td {
        border: 1px solid #000 !important;
        color: #000 !important;
    }

    /* Cut list summary */
    #cutListSummary {
        background: #f5f5f5 !important;
        border: 2px solid #000 !important;
        padding: 15px !important;
        page-break-inside: avoid;
        color: #000 !important;
    }

    /* Diagrams */
    #frontSvg, #sideSvg {
        page-break-inside: avoid;
        border: 1px solid #000 !important;
    }

    /* Ensure diagrams print on same page if possible */
    .diagrams-container {
        page-break-inside: avoid;
    }
}

/* ===== COLOR THEMES ===== */

/* Forest Green — deep green dark theme */
body.theme-forest {
    background-color: #1a2318;
    color: #d4e4cf;
}

body.theme-forest h1,
body.theme-forest h2,
body.theme-forest h3 {
    color: #b8d4a8;
}

body.theme-forest .results {
    background: #243020;
    color: #d4e4cf;
}

body.theme-forest input,
body.theme-forest select {
    background: #2a3825;
    border-color: #3d5235;
    color: #d4e4cf;
}

body.theme-forest input:focus,
body.theme-forest select:focus {
    outline: 2px solid #5a9e4b;
    background: #2f4029;
}

body.theme-forest .unit-toggle-container,
body.theme-forest .templates-section,
body.theme-forest .deck-areas-section {
    background: #243020;
    border-color: #3d5235;
}

body.theme-forest .unit-toggle-btn,
body.theme-forest .template-btn,
body.theme-forest .deck-area-card {
    background: #2a3825;
    border-color: #3d5235;
    color: #d4e4cf;
}

body.theme-forest .dark-mode-toggle {
    background: #2a3825;
    border-color: #3d5235;
}

body.theme-forest fieldset { border-color: #3d5235; }
body.theme-forest label { color: #d4e4cf; }

body.theme-forest #visual {
    background: #243020;
    border-color: #3d5235;
}

/* Ocean Blue — blue-tinted dark theme */
body.theme-ocean {
    background-color: #151c27;
    color: #c8d8e8;
}

body.theme-ocean h1,
body.theme-ocean h2,
body.theme-ocean h3 {
    color: #a0c4e8;
}

body.theme-ocean .results {
    background: #1c2636;
    color: #c8d8e8;
}

body.theme-ocean input,
body.theme-ocean select {
    background: #1f2d40;
    border-color: #2e4460;
    color: #c8d8e8;
}

body.theme-ocean input:focus,
body.theme-ocean select:focus {
    outline: 2px solid #3b82c4;
    background: #243450;
}

body.theme-ocean .unit-toggle-container,
body.theme-ocean .templates-section,
body.theme-ocean .deck-areas-section {
    background: #1c2636;
    border-color: #2e4460;
}

body.theme-ocean .unit-toggle-btn,
body.theme-ocean .template-btn,
body.theme-ocean .deck-area-card {
    background: #1f2d40;
    border-color: #2e4460;
    color: #c8d8e8;
}

body.theme-ocean .dark-mode-toggle {
    background: #1f2d40;
    border-color: #2e4460;
}

body.theme-ocean fieldset { border-color: #2e4460; }
body.theme-ocean label { color: #c8d8e8; }

body.theme-ocean #visual {
    background: #1c2636;
    border-color: #2e4460;
}

/* Warm Slate — muted warm light theme */
body.theme-slate {
    background-color: #f0ece4;
    color: #3d3832;
}

body.theme-slate h1,
body.theme-slate h2,
body.theme-slate h3 {
    color: #504840;
}

body.theme-slate .results {
    background: #e8e2d8;
    color: #3d3832;
}

body.theme-slate input,
body.theme-slate select {
    background: #faf7f2;
    border-color: #c8bfb0;
    color: #3d3832;
}

body.theme-slate input:focus,
body.theme-slate select:focus {
    outline: 2px solid #8b7d6b;
    background: #fff;
}

body.theme-slate .unit-toggle-container,
body.theme-slate .templates-section,
body.theme-slate .deck-areas-section {
    background: #e8e2d8;
    border-color: #c8bfb0;
}

body.theme-slate .unit-toggle-btn,
body.theme-slate .template-btn,
body.theme-slate .deck-area-card {
    background: #faf7f2;
    border-color: #c8bfb0;
    color: #3d3832;
}

body.theme-slate .dark-mode-toggle {
    background: #e8e2d8;
    border-color: #c8bfb0;
}

body.theme-slate fieldset { border-color: #c8bfb0; }

body.theme-slate #visual {
    background: #faf7f2;
    border-color: #c8bfb0;
}

/* Sunset — warm peach/coral light theme */
body.theme-sunset {
    background-color: #fdf5f0;
    color: #4a3530;
}

body.theme-sunset h1,
body.theme-sunset h2,
body.theme-sunset h3 {
    color: #6b3f35;
}

body.theme-sunset .results {
    background: #f8ebe4;
    color: #4a3530;
}

body.theme-sunset input,
body.theme-sunset select {
    background: #fff8f5;
    border-color: #e0bfb0;
    color: #4a3530;
}

body.theme-sunset input:focus,
body.theme-sunset select:focus {
    outline: 2px solid #d4826a;
    background: #fff;
}

body.theme-sunset .unit-toggle-container,
body.theme-sunset .templates-section,
body.theme-sunset .deck-areas-section {
    background: #f8ebe4;
    border-color: #e0bfb0;
}

body.theme-sunset .unit-toggle-btn,
body.theme-sunset .template-btn,
body.theme-sunset .deck-area-card {
    background: #fff8f5;
    border-color: #e0bfb0;
    color: #4a3530;
}

body.theme-sunset .dark-mode-toggle {
    background: #f8ebe4;
    border-color: #e0bfb0;
}

body.theme-sunset fieldset { border-color: #e0bfb0; }

body.theme-sunset #visual {
    background: #fff8f5;
    border-color: #e0bfb0;
}
