/* --- CSS Variables (Consolidated) --- */
:root {
    /* Core Theme (Dark - Frame/Production) */
    --primary-color: #f5f5f5;
    --background-color: #1a1a1a;
    --secondary-bg: #252525;
    --tertiary-bg: #303030;
    --border-color: #3a3a3c; /* Slightly adjusted from dashboard */
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --accent-color: #f2fb86; /* Yellow from Frame/Prod */
    --accent-secondary: #b0be56;
    --highlight-color: rgba(242, 251, 134, 0.15);
    --highlight-border: #f2fb86;
    --header-height: 60px;

    /* Grid (from Frame-gen) */
    --grid-major: #2a2a2a;
    --grid-minor: #232323;

    /* Production Accents */
    --blue-accent: #86a8fb;
    --green-accent: #86fb9a;
    --red-accent: #fb8686;
    --orange-accent: #fbc086;
    --purple-accent: #c086fb;
    --plate-outline-color: #f2fb86; /* Accent Yellow */
    --stud-outline-color: #86a8fb; /* Accent Blue */

    /* Dashboard Theme (Modern Dark) - Some overrides or additions */
    --dash-bg-color: #0f0f0f;
    --dash-card-bg-color: #1c1c1e;
    --dash-header-bg-color: #000000;
    --dash-text-color: #f5f5f7;
    --dash-text-color-secondary: #86868b;
    --dash-accent-color: #007aff; /* Apple Blue */
    --dash-accent-color-hover: #1a8cff;
    --dash-success-color: #30d158;
    --dash-highlight-bg: #2c2c2e;
    --dash-font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

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

html {
    font-size: 16px; /* Base font size */
}

body {
    /* Default to Frame/Production style, Dashboard overrides where needed */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    background-color: var(--background-color);
    overflow: hidden; /* Default */
    line-height: 1.6; /* From dashboard, good default */
}

/* Dashboard specific body overrides */
body.dashboard-body {
    background-color: var(--dash-bg-color);
    color: var(--dash-text-color);
    font-family: var(--dash-font-family);
    height: auto; /* Dashboard scrolls */
    overflow: auto; /* Dashboard scrolls */
}


a { /* From Dashboard */
    color: var(--dash-accent-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover { /* From Dashboard */
    color: var(--dash-accent-color-hover);
}

h1, h2, h3, h4, h5, h6 { /* From Dashboard */
    margin-bottom: 0.5em;
    font-weight: 600;
}

/* --- Header Styles (Combined & Scoped) --- */
header {
    height: var(--header-height);
    background-color: rgba(30, 30, 30, 0.8); /* Default */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px; /* Default */
    position: sticky; /* Frame-gen specific? */
    top: 0; /* Frame-gen specific? */
    z-index: 100;
    flex-shrink: 0; /* From Production */
}

/* Production Header Adjustments */
header.production-header {
    background-color: rgba(30, 30, 30, 0.9);
    padding: 0 25px;
    position: static; /* Override sticky */
}

/* Dashboard Header Adjustments */
header.dashboard-header {
    background-color: var(--dash-header-bg-color);
    padding: 1rem 2rem;
    position: static; /* Override sticky */
    backdrop-filter: none; /* Remove blur */
    -webkit-backdrop-filter: none;
}

/* Logo Styles */
.logo { /* Common class */
    font-weight: 600;
    letter-spacing: 0.5px;
}
header .logo { /* Frame-gen */
    font-size: 1.2rem;
    color: var(--accent-color);
}
header.production-header .logo { /* Production */
    font-size: 1.4rem;
    color: var(--accent-color);
}
header.production-header .logo i { /* Production */
    margin-right: 10px;
}
header.dashboard-header .logo { /* Dashboard */
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--dash-text-color); /* Different color */
}

/* Navigation Styles */
nav ul { /* Frame-gen */
    display: flex;
    list-style: none;
}
nav li { /* Frame-gen */
    margin-left: 24px;
}
nav a { /* Frame-gen */
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}
nav a:hover { /* Frame-gen */
    color: var(--accent-color);
}

.menu-toggle { /* Frame-gen mobile */
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Dashboard Navigation */
.nav-links { /* Dashboard */
    display: flex;
    gap: 2rem;
}
.nav-links a { /* Dashboard */
    color: var(--dash-text-color-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}
.nav-links a:hover { /* Dashboard */
   color: var(--dash-text-color); /* Brighter on hover */
}

.profile { /* Dashboard */
    width: 36px;
    height: 36px;
    background-color: var(--dash-accent-color);
    color: var(--dash-bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Frame Generator Specific Styles --- */
.main-content { /* Frame-gen */
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

#floorplan-container { /* Frame-gen */
    flex: 1;
    position: relative; /* Needed for absolute positioning of controls */
    border-right: 1px solid var(--border-color);
    overflow: hidden;
    background-color: var(--background-color);
    display: flex;
    flex-direction: column;
}
#floorplan-container > div:first-of-type { /* Section title spacing */
    flex-shrink: 0;
}

#floorplan-canvas { /* Frame-gen */
    flex-grow: 1;
    display: block;
    background-color: var(--background-color); /* Explicitly set */
    cursor: pointer;
}

/* --- Wall List (Right Panel) --- */
#wall-list-container { /* Frame-gen */
    flex-basis: 350px;
    flex-shrink: 0;
    overflow-y: auto;
    background-color: var(--secondary-bg);
    display: flex;
    flex-direction: column;
}

.section-title { /* Frame-gen & Wall List */
    padding: 16px 20px; /* Restored padding */
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    background-color: rgba(35, 35, 35, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;
    /* Removed flex properties - button is no longer inside */
}

#wall-list { /* Frame-gen */
    flex-grow: 1;
    overflow-y: auto;
}

.category-header { /* Frame-gen */
    cursor: pointer;
    user-select: none;
}

.category-title { /* Frame-gen */
    padding: 16px 20px;
    display: flex;
    align-items: center;
    font-weight: 500;
    background-color: var(--secondary-bg);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}
.category-title:hover { /* Frame-gen */
    background-color: var(--tertiary-bg);
}
.category-title.highlighted { /* Frame-gen */
    background-color: var(--highlight-color);
    font-weight: 600;
}
.category-title.highlighted i { /* Frame-gen */
    color: var(--highlight-border) !important;
}
.category-title span { /* Frame-gen */
    flex: 1;
}

.expand-icon { /* Frame-gen */
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}
.expand-icon.up { /* Frame-gen */
    transform: rotate(180deg);
}

.category-content { /* Frame-gen */
    background-color: var(--tertiary-bg);
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    max-height: 0;
    padding: 0;
    border-bottom: 1px solid var(--border-color);
}
.category-content.expanded { /* Frame-gen */
    max-height: 1000px; /* Adjust if needed */
    padding: 0;
    border-bottom: none;
}

.wall-item { /* Frame-gen */
    padding: 12px 20px 12px 40px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wall-item:last-child { /* Frame-gen */
    border-bottom: none;
}
.wall-item:hover { /* Frame-gen */
    background-color: rgba(60, 60, 60, 0.5);
    color: var(--text-color);
}
.wall-item.highlighted { /* Frame-gen */
    background-color: var(--highlight-color);
    border-left: 3px solid var(--highlight-border);
    color: var(--text-color);
    font-weight: 500;
    padding-left: 37px;
}

.installation-order-badge { /* Frame-gen */
    background-color: var(--accent-secondary);
    color: var(--background-color);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}

.wall-details { /* Frame-gen */
    padding: 0px 20px 0px 40px;
    background-color: rgba(60, 60, 60, 0.3);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    border-bottom: 1px solid var(--border-color);
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out, padding-bottom 0.35s ease-out, opacity 0.2s ease-in;
}
.wall-details.expanded { /* Frame-gen */
    max-height: 500px;
    padding-top: 16px;
    padding-bottom: 16px;
    opacity: 1;
    transition: max-height 0.35s ease-out, padding-top 0.35s ease-out, padding-bottom 0.35s ease-out, opacity 0.25s 0.1s ease-out;
}

.wall-details table { /* Frame-gen */
    width: 100%;
    border-collapse: collapse;
}
.wall-details td { /* Frame-gen */
    padding: 8px 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}
.wall-details tr:last-child td { /* Frame-gen */
    border-bottom: none;
}
.wall-details td:first-child { /* Frame-gen */
    font-weight: 500;
    width: 40%;
    color: var(--text-secondary);
}

/* --- Floor Plan Canvas Controls --- */

/* Base style for control buttons */
.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(40, 40, 40, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    font-size: 1rem; /* Icon size */
}
.control-btn:hover {
    background-color: var(--accent-color);
    color: var(--background-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(242, 251, 134, 0.3);
}
/* Ensure anchor tags styled as buttons look right */
a.control-btn {
    text-decoration: none;
}
a.control-btn:hover {
     /* Ensure hover color is applied */
    color: var(--background-color);
}

/* Container for Bottom-Left controls */
#controls {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* NEW Container for Top-Right controls */
#top-right-controls {
    position: absolute;
    top: 15px; /* Adjust vertical position from top edge of container */
    right: 15px; /* Adjust horizontal position from right edge of container */
    z-index: 10; /* Same level as other controls */
    display: flex;
    gap: 8px;
}


/* --- Production Screen Specific Styles --- */
#production-screen { /* Production */
    display: flex;
    flex: 1;
    overflow: hidden;
}

#current-panel-view { /* Production */
    flex: 3;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
}

.panel-header { /* Production */
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--tertiary-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.panel-header h2 { /* Production */
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0; /* Override base heading margin */
}
.panel-header h2 span { /* Production */
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-left: 10px;
}
.panel-header .panel-id { /* Production */
    font-size: 0.8rem;
    font-family: monospace;
    color: var(--text-secondary);
    background-color: var(--background-color);
    padding: 3px 6px;
    border-radius: 4px;
    margin-top: 4px; /* Add some space */
}

#panel-timer { /* Production */
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(242, 251, 134, 0.5);
}
#panel-timer.alert { /* Production */
    color: var(--red-accent);
    text-shadow: 0 0 8px rgba(251, 134, 134, 0.6);
}

#panel-visualization { /* Production */
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background-color: var(--background-color);
    overflow: hidden;
    position: relative;
}
#panel-canvas { /* Production */
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.panel-controls { /* Production */
    padding: 15px 25px;
    border-top: 1px solid var(--border-color);
    background-color: var(--tertiary-bg);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}
/* Specific container adjustment for send revisions button */
#upcoming-panels-view .panel-controls {
    justify-content: center; /* Center the send revisions button */
}

.control-button { /* Production (Complete/Next Button & Send Revisions) */
    background-color: var(--green-accent); /* Default green */
    color: var(--background-color);
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex; /* Ensure icon and text align */
    align-items: center;
    gap: 8px;
}
.control-button:hover:not(:disabled) { /* Generic hover for non-disabled buttons */
    transform: translateY(-1px);
    filter: brightness(1.1); /* Add slight brightness increase */
}
.control-button:disabled { /* Generic disabled style */
    background-color: var(--border-color) !important; /* Use !important to override specific colors */
    color: var(--text-secondary) !important;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
}

/* Specific hover for Complete/Next */
.control-button:not(.revise):not(:disabled):hover {
     background-color: #a3fbb3; /* Lighter green */
}

/* Style for the revision button */
.control-button.revise {
    background-color: var(--orange-accent); /* Use orange for revise */
    color: var(--background-color);
}
.control-button.revise:hover:not(:disabled) {
     background-color: #ffc98f; /* Lighter orange on hover */
}


#upcoming-panels-view { /* Production */
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-bg);
    overflow: hidden;
}

.queue-header { /* Production */
    padding: 15px 25px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--tertiary-bg);
    flex-shrink: 0;
}
.queue-header h3 { /* Production */
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 0; /* Override base */
    display: flex; /* Align icon */
    align-items: center;
    gap: 10px;
}

#upcoming-panels-list { /* Production - Right column list area */
    flex-grow: 1;
    overflow-y: auto;
    padding-top: 10px;
    padding-bottom: 10px;
}
#no-more-panels { /* Production - Message holder inside upcoming list */
    text-align: center;
    padding: 40px 20px; /* Adjust padding */
    color: var(--text-secondary); /* Default color */
    font-size: 1.1rem; /* Adjust size */
}

/* Style for the final completion message */
.production-complete-message {
    text-align: center;
    padding: 50px 20px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--green-accent); /* Use green accent */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.production-complete-message i {
    font-size: 2.5rem;
}


.panel-item { /* Production - Used in right column lists */
    padding: 12px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}
.panel-item:last-child { /* Production */
    border-bottom: none;
}
.panel-item:hover { /* Production */
    background-color: var(--tertiary-bg);
}
.panel-item .item-info span { /* Production */
    display: block;
}
.panel-item .item-info .item-order { /* Production */
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
}
.panel-item .item-info .item-id { /* Production */
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 2px;
}
.panel-item .item-dims { /* Production */
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}
.panel-item .item-type { /* Production */
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 10px;
    background-color: var(--blue-accent);
    color: var(--background-color);
    opacity: 0.7;
}
.panel-item .item-type.exterior { /* Production */
    background-color: var(--accent-secondary);
}

#production-review-list { /* Production - Main review list (left column) */
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0;
    background-color: var(--background-color);
}

.review-item { /* Production */
    background-color: var(--secondary-bg);
    margin: 0 10px 10px 10px;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 5px solid var(--blue-accent); /* Default border */
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}
.review-item.status-Inspected { /* Production */
    border-left-color: var(--purple-accent);
}
.review-item.status-Revising { /* Production */
    border-left-color: var(--orange-accent);
}
.review-item.status-Complete { /* Production - Keep default blue */
     border-left-color: var(--blue-accent);
}


.review-item-info { /* Production */
    flex-basis: 250px;
    flex-grow: 1;
}
.review-item-info .item-order { /* Production */
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}
.review-item-info .item-id { /* Production */
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-top: 3px;
    display: block;
}
.review-item-info .item-type { /* Production */
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 5px;
    background-color: var(--blue-accent);
    color: var(--background-color);
    opacity: 0.8;
}
.review-item-info .item-type.exterior { /* Production */
    background-color: var(--accent-secondary);
}

.review-item-details { /* Production */
    flex-basis: 150px;
    text-align: right;
}
.review-item-details .item-dims { /* Production */
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.review-item-details .item-time { /* Production */
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-top: 5px;
    display: block;
}

.review-item-status { /* Production - Status badge in review item */
    flex-basis: 100px;
    text-align: center;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 0.8rem;
}
.review-item-status.status-Complete { /* Production */
    background-color: var(--blue-accent);
    color: var(--background-color);
}
.review-item-status.status-Inspected { /* Production */
    background-color: var(--purple-accent);
    color: var(--primary-color); /* Adjusted for contrast */
}
.review-item-status.status-Revising { /* Production */
    background-color: var(--orange-accent);
    color: var(--background-color);
}

.review-item-actions { /* Production */
    flex-basis: 220px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.review-button { /* Production - Inspect/Revise buttons in review item */
    background-color: var(--tertiary-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}
.review-button:hover:not(:disabled) { /* Production */
    background-color: var(--border-color);
}
.review-button:disabled { /* Production */
    background-color: #444 !important; /* Override base colors */
    color: #777 !important;
    cursor: not-allowed;
    border-color: #555 !important;
    opacity: 0.7;
}
.review-button.inspect { /* Production */
    border-color: var(--purple-accent);
    color: var(--purple-accent);
}
.review-button.inspect:hover:not(:disabled) { /* Production */
    background-color: rgba(192, 134, 251, 0.2);
}
.review-button.revise { /* Production */
    border-color: var(--orange-accent);
    color: var(--orange-accent);
}
.review-button.revise:hover:not(:disabled) { /* Production */
    background-color: rgba(251, 192, 134, 0.2);
}

/* --- Dashboard Specific Styles --- */
.tabs { /* Dashboard */
    display: flex;
    padding: 0.8rem 2rem;
    gap: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--dash-bg-color); /* Match dashboard bg */
}

.tab { /* Dashboard */
    padding-bottom: 0.8rem;
    cursor: pointer;
    color: var(--dash-text-color-secondary);
    font-weight: 500;
    position: relative;
    transition: color 0.2s ease;
}
.tab::after { /* Dashboard */
    content: '';
    position: absolute;
    bottom: -1px; /* Align with the container border */
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--dash-accent-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}
.tab.active { /* Dashboard */
    color: var(--dash-text-color);
}
.tab.active::after { /* Dashboard */
   transform: scaleX(1);
}
.tab:hover { /* Dashboard */
   color: var(--dash-text-color);
}

main { /* Dashboard - Container for sections */
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Space between sections */
}

.timeline-container { /* Dashboard */
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap; /* Allow wrapping */
}

.timeline { /* Dashboard */
    flex: 3;
    min-width: 300px;
    background-color: var(--dash-card-bg-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.activity { /* Dashboard */
    flex: 1;
    min-width: 250px;
    background-color: var(--dash-card-bg-color);
    border-radius: 12px;
    padding: 1.5rem;
}
.sr-only { /* Accessibility helper */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Timeline Phases */
.phases { /* Dashboard */
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.phase { /* Dashboard */
    text-align: center;
    flex: 1;
}

.phase-box { /* Dashboard */
    background-color: #333;
    color: var(--dash-text-color-secondary);
    border-radius: 8px;
    padding: 0.6rem 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.phase-box.current { /* Dashboard */
    background-color: var(--dash-accent-color);
    color: var(--dash-text-color);
    font-weight: 600;
}

.timeline-line-container { /* Dashboard */
    padding: 2.5rem 0 1.5rem 0;
    position: relative;
}

.timeline-line { /* Dashboard */
    height: 2px;
    background-color: var(--border-color);
    width: 100%;
    position: relative;
}

.timeline-markers { /* Dashboard */
    display: flex;
    justify-content: space-between;
    padding: 0 1%;
    position: absolute;
    width: 98%;
    bottom: -0.75rem;
    left: 1%;
}

.marker { /* Dashboard */
    font-size: 0.8rem;
    color: var(--dash-text-color-secondary);
    position: relative;
    transform: translateX(-50%);
}
.marker::before { /* Dashboard */
    content: '';
    position: absolute;
    top: -1.4rem;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 50%;
    z-index: 1;
}
.marker.current-marker::before { /* Dashboard */
    background-color: var(--dash-accent-color);
    transform: translateX(-50%) scale(1.3);
}
.marker.current-marker { /* Dashboard */
    color: var(--dash-text-color);
    font-weight: 600;
}

.activity-title { /* Dashboard */
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dash-text-color);
    letter-spacing: 0.5px;
}

.activity-item { /* Dashboard */
    margin-bottom: 1.5rem;
    position: relative;
    padding-left: 2rem; /* Space for icon/line */
}
.activity-item::before { /* Dashboard */
    content: '';
    position: absolute;
    left: 0.4rem;
    top: 5px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--border-color);
}
.activity-item:not(:last-child)::after { /* Dashboard */
    content: '';
    position: absolute;
    left: calc(0.4rem + 4px);
    top: 18px;
    bottom: -1.5rem;
    width: 2px;
    background-color: var(--border-color);
    opacity: 0.5;
}
.activity-item h4 { /* Dashboard */
    margin-bottom: 0.3em;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--dash-text-color);
}

.activity-details { /* Dashboard */
    font-size: 0.9rem;
    color: var(--dash-text-color-secondary);
}

.activity-user { /* Dashboard */
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.user-avatar { /* Dashboard */
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--dash-text-color); /* Ensure contrast */
}
/* Example avatar backgrounds */
.rh { background-color: #5856d6; } /* Purple */
.pm { background-color: #ff9500; } /* Orange */

/* Stages Section */
.stages-container { /* Dashboard */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.stage-card { /* Dashboard */
    background-color: var(--dash-card-bg-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}
.stage-card.highlight { /* Dashboard */
    background-color: var(--dash-highlight-bg);
    border: 1px solid var(--dash-accent-color);
}

.stage-header { /* Dashboard */
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.stage-header h3 { /* Dashboard */
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dash-text-color-secondary);
    margin-bottom: 0;
}

.stage-status { /* Dashboard */
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--dash-text-color-secondary);
}
/* Specific status colors */
.stage-status.completed { background-color: rgba(48, 209, 88, 0.2); color: var(--dash-success-color); }
.stage-status.inprogress { background-color: rgba(0, 122, 255, 0.2); color: var(--dash-accent-color); }
.stage-status.upcoming { background-color: rgba(134, 134, 139, 0.2); color: var(--dash-text-color-secondary); }

.stage-content { /* Dashboard */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-circle { /* Dashboard - Placeholder visual */
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--dash-bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto 1.5rem;
    font-weight: 600;
    font-size: 1.2rem;
    border: 4px solid var(--dash-accent-color);
}

.stage-title { /* Dashboard */
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dash-text-color);
    margin-bottom: 0.2rem;
}

.stage-subtitle { /* Dashboard */
    font-size: 0.9rem;
    color: var(--dash-text-color-secondary);
    margin-bottom: 1.5rem;
}

.stage-icon { /* Dashboard */
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem auto 1.5rem;
    color: var(--dash-text-color-secondary);
}
.stage-icon svg { /* Dashboard */
    width: 24px;
    height: 24px;
}
.highlight .stage-icon { /* Dashboard */
    background-color: rgba(0, 122, 255, 0.2);
    color: var(--dash-accent-color);
}

.checklist { /* Dashboard */
    list-style: none;
    width: 100%;
    text-align: left;
    margin-top: auto; /* Push to bottom */
}

.checklist-item { /* Dashboard */
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.check-icon { /* Dashboard */
    color: var(--dash-success-color);
    font-weight: bold;
}

.checklist-text { /* Dashboard */
    flex-grow: 1;
}

.checklist-status { /* Dashboard */
    font-size: 0.8rem;
    color: var(--dash-text-color-secondary);
    margin-left: auto;
}

.checklist-item.completed .checklist-text,
.checklist-item.completed .checklist-status { /* Dashboard */
    color: var(--dash-text-color-secondary);
    text-decoration: line-through;
}
.checklist-item.completed .check-icon { /* Dashboard */
    opacity: 0.7;
}

/* --- General Utilities --- */
.welcome-notification { /* Used in Frame-gen, maybe Production? */
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: rgba(30, 30, 30, 0.85);
    color: #e0e0e0;
    padding: 15px 40px 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #3a3a3a;
    z-index: 1000;
    max-width: 320px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    gap: 12px;
}
.welcome-notification i { /* Info icon */
    font-size: 1.5rem;
    color: #f2fb86; /* Accent yellow */
    flex-shrink: 0;
}
.welcome-notification div div:first-child { /* Title */
    font-weight: 500;
    margin-bottom: 5px;
    color: #f2fb86; /* Accent yellow */
}
.welcome-notification .close-popup {
    position: absolute;
    top: 5px;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 5px;
    transition: color 0.2s ease;
}
.welcome-notification .close-popup:hover {
    color: var(--text-color);
}


/* --- Media Queries (Combined) --- */
@media (max-width: 900px) { /* Production Screen Breakpoint */
    #production-screen {
        flex-direction: column;
    }
    #current-panel-view {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex: 2; /* Adjust flex ratio if needed */
    }
    #upcoming-panels-view {
        flex: 1;
    }
    #panel-timer {
        font-size: 2rem;
    }
    .panel-header h2 {
        font-size: 1.2rem;
    }
    /* Production Review adjustments */
    .review-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .review-item-details,
    .review-item-status,
    .review-item-actions {
        text-align: left;
        flex-basis: auto;
        width: 100%;
        margin-top: 10px;
    }
    .review-item-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) { /* Frame Generator Breakpoint */
    .main-content { /* Frame-gen */
        flex-direction: column;
        height: calc(100vh - var(--header-height));
    }
    #floorplan-container { /* Frame-gen */
        width: 100%;
        height: 50%;
        flex: 1 1 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    #wall-list-container { /* Frame-gen */
        width: 100%;
        height: 50%;
        flex: 1 1 50%;
        flex-basis: auto;
    }
    .welcome-notification { /* General */
        bottom: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }

    /* Frame-gen Mobile Menu */
    .menu-toggle {
        display: block;
    }
    header nav { /* Target specifically frame-gen nav if needed */
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: rgba(30, 30, 30, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transform: translateY(-110%);
        transition: transform 0.3s ease;
        border-bottom: 1px solid var(--border-color);
        z-index: 99;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }
    header nav.active {
        transform: translateY(0);
    }
    header nav ul {
        flex-direction: column;
        padding: 10px 0;
    }
    header nav li {
        margin: 0;
        text-align: center;
    }
    header nav li a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-color);
    }
    header nav li:last-child a {
        border-bottom: none;
    }

    /* Consider adjustments for Dashboard on smaller screens if needed */
    .timeline-container { /* Dashboard */
        flex-direction: column; /* Stack timeline and activity */
    }

    /* Production screen button adjustments on small screens */
     .panel-controls {
        justify-content: center; /* Center buttons on smaller screens */
     }
     .review-button {
        padding: 8px 12px; /* Slightly smaller padding */
        font-size: 0.8rem;
     }
     .control-button { /* Includes production screen buttons */
        padding: 10px 20px;
        font-size: 0.9rem;
     }
     /* Ensure frame-gen controls are still okay */
     #controls .control-btn, #top-right-controls .control-btn {
         width: 36px; /* Slightly smaller on mobile */
         height: 36px;
         font-size: 0.9rem;
         padding: 0; /* Remove padding if using fixed size */
     }
     #controls {
         bottom: 10px;
         left: 10px;
         gap: 6px;
     }
      #top-right-controls {
         top: 10px;
         right: 10px;
         gap: 6px;
     }

}