/* ===== Base Reset ===== */
html, body {
    font-family: 'Manrope', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: 100vh;
}

h1:focus { outline: none; }

/* ===== Design Tokens ===== */
:root {
    --primary: #137fec;
    --primary-hover: #0b6dd4;
    --primary-light: rgba(19, 127, 236, 0.1);
    --primary-border: rgba(19, 127, 236, 0.2);
    --bg-light: #f6f7f8;
    --bg-white: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-xs: #cbd5e1;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
}

/* ===== Blazor infrastructure ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.loading-progress {
    position: absolute; display: block; width: 8rem; height: 8rem;
    inset: 20vh 0 auto 0; margin: 0 auto;
}
.loading-progress circle { fill: none; stroke: #e0e0e0; stroke-width: 0.6rem; transform-origin: 50% 50%; transform: rotate(-90deg); }
.loading-progress circle:last-child { stroke: #137fec; stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%; transition: stroke-dasharray 0.05s ease-in-out; }
.loading-progress-text { position: absolute; text-align: center; font-weight: bold; inset: calc(20vh + 3.25rem) 0 auto 0.2rem; }
.loading-progress-text:after { content: var(--blazor-load-percentage-text, "Loading"); }

/* ===== Header ===== */
.planner-header {
    background: var(--bg-white) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-primary) !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 0 20px !important;
    box-shadow: none !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-brand {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 8px;
}

.header-project-label {
    font-size: 13px;
    color: var(--text-muted);
}

.header-project-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.15s;
}
.header-project-name:hover { color: var(--primary); }

.header-edit-icon {
    font-size: 14px !important;
    color: var(--text-muted);
    cursor: pointer;
}

.header-project-input {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-light);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    padding: 2px 8px;
    outline: none;
    font-family: inherit;
    width: 180px;
    box-shadow: 0 0 0 2px rgba(19, 127, 236, 0.15);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 30px;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.header-lang-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.header-help-btn {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
    font-family: inherit;
}
.header-help-btn:hover { color: var(--primary); }

.header-save-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: none;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
    font-family: inherit;
}
.header-save-btn:hover { background: #e2e8f0; color: var(--text-primary); }

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary-border);
}

/* ===== Header Navigation ===== */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
    height: 32px;
    overflow-x: auto;
    scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
    display: none;
}

.header-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.header-nav-item .material-icons-round {
    font-size: 17px;
}

.header-nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.header-nav-item.active {
    color: var(--primary);
    background: var(--primary-light);
    font-weight: 600;
}

/* ===== Content Area ===== */
.planner-content {
    padding: 0 !important;
    padding-top: 56px !important;
    margin: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
    background: var(--bg-light) !important;
    box-sizing: border-box !important;
}

/* ===== Three-Column Layout ===== */
.planner-layout {
    display: flex;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* ===== Left Panel: Library ===== */
.library-panel {
    width: 280px;
    min-width: 280px;
    flex: 0 0 280px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    min-height: 0;
    overflow: hidden;
}

.library-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.library-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.library-search {
    position: relative;
}

.library-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px !important;
    color: var(--text-muted);
    pointer-events: none;
}

.library-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    font-size: 13px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: box-shadow 0.15s;
}
.library-search input::placeholder { color: var(--text-muted); }
.library-search input:focus { box-shadow: 0 0 0 2px var(--primary); }

.library-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.library-content::-webkit-scrollbar { display: none; }
.library-content { -ms-overflow-style: none; scrollbar-width: none; }

/* Category */
.lib-category { margin-bottom: 20px; }

.lib-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}
.lib-category-header:hover .lib-category-title { color: var(--primary); }

.lib-category-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    transition: color 0.15s;
}

.lib-category-toggle {
    font-size: 16px !important;
    color: var(--text-muted);
    transition: transform 0.2s;
}
.lib-category-toggle.collapsed { transform: rotate(180deg); }

.lib-category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.lib-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 6px;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.lib-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.lib-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-border);
}

.lib-item .lib-item-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lib-item .lib-item-icon svg { width: 100%; height: 100%; }
.lib-item .lib-item-icon .material-symbols-outlined,
.lib-item .lib-item-icon .material-icons-round {
    font-size: 28px;
    color: var(--text-muted);
    transition: color 0.15s;
}
.lib-item:hover .lib-item-icon .material-symbols-outlined,
.lib-item:hover .lib-item-icon .material-icons-round,
.lib-item.selected .lib-item-icon .material-symbols-outlined,
.lib-item.selected .lib-item-icon .material-icons-round {
    color: var(--primary);
}

.lib-item-name {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.3;
    word-break: keep-all;
}
.lib-item.selected .lib-item-name {
    color: var(--primary);
    font-weight: 600;
}

.lib-item-full { grid-column: span 2; }

.library-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.library-add-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.lib-custom-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.lib-custom-form input[type="file"],
.lib-custom-editor input[type="file"] {
    width: 100%;
    font-size: 12px;
    color: var(--text-secondary);
}

.lib-image-preview {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    padding: 6px;
}

.lib-custom-editor {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
}

.lib-custom-editor-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lib-custom-editor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.lib-custom-editor-label {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.planner-toast {
    position: fixed;
    right: 18px;
    top: 18px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    animation: fadeIn 0.2s ease;
}

.planner-toast-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.planner-toast-success {
    background: #ecfdf5;
    border: 1px solid #86efac;
    color: #166534;
}

.planner-toast .material-icons-round {
    font-size: 18px;
}

.planner-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.planner-modal {
    width: min(520px, 100%);
    max-height: calc(100vh - 40px);
    box-shadow: var(--shadow-lg);
    overflow: auto;
}

.planner-save-name-modal {
    border: 1px solid var(--border);
}

.planner-save-name-modal-header {
    margin: 0;
    padding: 14px 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
    border-bottom: 1px solid var(--border-light);
}

.planner-save-name-modal-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 18px;
}

.planner-save-name-modal-description {
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.planner-modal-body {
    padding: 16px;
}

.planner-name-input {
    margin-top: 0;
}

.planner-save-name-modal-hint {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.planner-name-input-error {
    margin-top: 8px;
    font-size: 12px;
    color: #b91c1c;
}

.planner-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 16px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-light);
}

/* ===== Center: Canvas Area ===== */
.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #f1f5f9;
    min-width: 0;
    min-height: 0;
}

.planner-name-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.96);
    border-bottom: 1px solid var(--border);
}

.planner-name-bar-copy {
    min-width: 0;
}

.planner-name-bar-label {
    margin-bottom: 4px;
}

.planner-name-bar-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.planner-name-bar-input-wrap {
    flex: 1 1 320px;
    min-width: 240px;
    max-width: 100%;
}

.planner-name-bar-input {
    width: 100%;
}

.planner-name-bar-caption {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Toolbar */
.canvas-toolbar {
    height: auto;
    min-height: 48px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 8px 16px;
    z-index: 10;
    box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

/* View tab */
.view-tab {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 3px;
    gap: 2px;
}

.view-tab-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
}
.view-tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.view-tab-btn:not(.active):hover { color: var(--text-primary); }

/* Shape buttons */
.shape-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-right: 4px;
}

.shape-btn {
    padding: 5px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.shape-btn:hover { color: var(--primary); background: var(--bg-light); }
.shape-btn.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: var(--primary-border);
}
.shape-btn .material-symbols-outlined { font-size: 18px; }

/* Toolbar action buttons */
.toolbar-action {
    padding: 5px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.toolbar-action:hover { color: var(--primary); background: var(--bg-light); }
.toolbar-action:disabled { color: var(--text-xs); cursor: not-allowed; }
.toolbar-action .material-icons-round { font-size: 18px; }

/* Mode indicator */
.mode-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.mode-indicator.wall-mode { background: #fef3c7; color: #92400e; }
.mode-indicator.select-mode { background: #dbeafe; color: #1e40af; }
.mode-indicator.create-mode { background: #d1fae5; color: #065f46; }

/* Canvas */
.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.canvas-wrapper canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
}

/* Zoom controls */
.zoom-controls {
    position: absolute;
    bottom: 16px;
    left: 16px;
    display: flex;
    flex-direction: column;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    z-index: 20;
}

.zoom-btn {
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.zoom-btn:hover { background: var(--bg-light); }
.zoom-btn:first-child { border-bottom: 1px solid var(--border-light); }
.zoom-btn .material-icons-round { font-size: 20px; }

/* ===== Bottom Summary Bar ===== */
.summary-bar {
    height: auto;
    min-height: 72px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 12px 24px;
    z-index: 20;
}

.summary-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.summary-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 2px;
}

.summary-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 320px;
    flex-wrap: wrap;
    gap: 24px;
    margin-left: auto;
    min-width: 0;
}

.summary-total-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.summary-total-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.summary-cta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(19, 127, 236, 0.3);
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.summary-cta:hover {
    background: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(19, 127, 236, 0.35);
    transform: translateY(-1px);
}
.summary-cta:active { transform: scale(0.97); }
.summary-cta .material-icons-round { font-size: 18px; }

.summary-cta.summary-cta-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 1px solid var(--border);
    box-shadow: none;
}

.summary-cta.summary-cta-secondary:hover {
    background: var(--bg-light);
    border-color: var(--primary-border);
    box-shadow: none;
}

/* ===== Right Panel: Properties ===== */
.properties-panel {
    width: 300px;
    min-width: 300px;
    flex: 0 0 300px;
    background: var(--bg-white);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    z-index: 10;
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 1360px) {
    .library-panel {
        width: 248px;
        min-width: 248px;
        flex-basis: 248px;
    }

    .properties-panel {
        width: 272px;
        min-width: 272px;
        flex-basis: 272px;
    }

    .summary-right {
        gap: 16px;
    }
}
.properties-panel::-webkit-scrollbar { width: 4px; }
.properties-panel::-webkit-scrollbar-track { background: transparent; }
.properties-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.props-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
}

.props-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

.props-delete-btn {
    padding: 6px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.props-delete-btn:hover { color: #ef4444; background: #fef2f2; }
.props-delete-btn .material-icons-round { font-size: 20px; }

/* Preview */
.props-preview {
    margin: 0 20px 16px;
    aspect-ratio: 16/9;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.props-preview .preview-icon {
    font-size: 48px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.props-preview .preview-icon svg { width: 64px; height: 64px; }
.props-preview .preview-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.props-item-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    padding: 0 20px;
}

.props-item-desc {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 20px 0;
    line-height: 1.5;
}

/* Property sections */
.props-section {
    padding: 16px 20px;
}

.props-section-divider {
    height: 1px;
    background: var(--border-light);
    margin: 0 20px;
}

.props-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.props-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.props-shape-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.props-shape-btn {
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 10px;
    transition: all 0.15s;
}

.props-shape-btn:hover {
    color: var(--text-primary);
    background: #e2e8f0;
}

.props-shape-btn.active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.props-field label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.props-field input,
.props-field .mud-input-control {
    width: 100%;
    padding: 7px 10px;
    font-size: 13px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-primary);
    font-family: 'Manrope', monospace;
    outline: none;
    box-sizing: border-box;
    transition: box-shadow 0.15s;
}
.props-field input:focus { box-shadow: 0 0 0 2px var(--primary); }

.props-field .input-with-unit {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding-right: 8px;
    transition: box-shadow 0.15s;
}
.props-field .input-with-unit:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.props-field .input-with-unit input {
    flex: 1;
    min-width: 0;
    background: transparent;
}
.props-field .input-with-unit input:focus { box-shadow: none; }
.props-field .input-with-unit .unit {
    font-size: 11px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Rotation slider */
.props-rotation {
    padding: 0 20px 16px;
}

.props-rotation label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.props-rotation-value {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    float: right;
}

/* Empty state */
.props-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
}
.props-empty .material-icons-round {
    font-size: 48px;
    color: var(--text-xs);
    margin-bottom: 12px;
}
.props-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.props-empty-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Properties footer */
.props-footer {
    margin-top: auto;
    padding: 12px 20px;
    background: var(--bg-light);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}
.props-footer-label { color: var(--text-secondary); }
.props-footer-value { font-weight: 700; color: var(--text-primary); }

/* Wall controls in properties */
.wall-controls {
    padding: 16px 20px;
}

.wall-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* ===== Share buttons ===== */
.share-section {
    padding: 12px 20px 16px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-bottom: 6px;
}
.share-btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}
.share-btn-primary:hover { background: var(--primary-hover); }
.share-btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.share-btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.share-btn .material-icons-round { font-size: 16px; }

/* ===== MudBlazor Overrides ===== */
.mud-appbar { box-shadow: none !important; }

/* MudSlider in properties */
.props-section .mud-slider { margin: 0; }

/* Chips */
.modern-chip {
    border-radius: var(--radius-sm) !important;
    background: var(--bg-light) !important;
    border: 1px solid var(--border) !important;
    font-size: 11px !important;
    font-family: 'Manrope', sans-serif !important;
}

.modern-chip-selected {
    border-radius: var(--radius-sm) !important;
    background: var(--primary-light) !important;
    border: 2px solid var(--primary) !important;
    font-size: 11px !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
    font-family: 'Manrope', sans-serif !important;
}

/* Numeric field overrides */
.props-field .mud-input-outlined-border {
    border: none !important;
    background: var(--bg-light) !important;
    border-radius: var(--radius-sm) !important;
}

/* Switch override */
.wall-switch .mud-switch-track { border-radius: 12px !important; }

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.2s ease; }

/* Keyboard shortcut hint */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
}

/* Alert override */
.mud-alert { animation: fadeIn 0.3s ease; border-radius: var(--radius-md) !important; }

/* ====================================================================
   QUOTE & RECEIPT PAGES
   ==================================================================== */

/* ===== Page Container ===== */
.page-container {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 40px 64px;
    background: var(--bg-light);
}
.page-container::-webkit-scrollbar { width: 6px; }
.page-container::-webkit-scrollbar-track { background: transparent; }
.page-container::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ===== Breadcrumbs ===== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}
.breadcrumb-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}
.breadcrumb-link:hover { color: var(--primary); }
.breadcrumb-sep {
    font-size: 16px !important;
    color: var(--text-muted);
}
.breadcrumb-current {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 24px;
}
.page-header-compact {
    margin-bottom: 20px;
}
.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.page-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
}
.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ===== Page Grid ===== */
.page-grid {
    display: grid;
    gap: 24px;
}
.page-grid-3-1 {
    grid-template-columns: 3fr 1fr;
}
.page-grid-8-4 {
    grid-template-columns: 2fr 1fr;
}
.page-col-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}
.page-col-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.sticky-top {
    position: sticky;
    top: 0;
    align-self: flex-start;
}

/* ===== Card ===== */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
}
.card-flush {
    padding: 0;
}
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
}
.card-header-bar-compact {
    margin-bottom: 12px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.card-title-sm {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}
.card-title-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-title-icon .material-icons-round {
    font-size: 20px;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
    text-decoration: none;
    border: none;
    line-height: 1.4;
}
.btn .material-icons-round,
.btn .material-symbols-outlined {
    font-size: 16px;
}
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(19, 127, 236, 0.25);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(19, 127, 236, 0.3);
}
.btn-outline {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.btn-outline-sm {
    background: var(--bg-white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.btn-outline-sm:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}
.btn-block {
    width: 100%;
}
.btn-text-primary {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.btn-text-primary:hover {
    background: var(--primary-light);
}
.btn-text-primary .material-icons-round {
    font-size: 16px;
}
.btn-add-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    transition: all 0.15s;
}
.btn-add-row:hover { background: var(--primary-light); }
.btn-add-row .material-icons-round { font-size: 18px; }

.btn-icon-delete {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-icon-delete:hover { color: #ef4444; background: #fef2f2; }
.btn-icon-delete .material-icons-round { font-size: 18px; }

.btn-icon-delete-hover {
    background: none;
    border: none;
    color: transparent;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.table-row-group:hover .btn-icon-delete-hover { color: var(--text-muted); }
.btn-icon-delete-hover:hover { color: #ef4444 !important; background: #fef2f2; }
.btn-icon-delete-hover .material-icons-round { font-size: 18px; }

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}
.btn-back:hover { color: var(--primary); }
.btn-back .material-icons-round { font-size: 18px; }

.btn-icon-sm {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.btn-icon-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon-sm .material-icons-round { font-size: 16px; }

/* ===== Status Badges ===== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
.status-draft {
    background: #f1f5f9;
    color: var(--text-secondary);
}
.status-draft .status-dot { background: var(--text-muted); }
.status-pending {
    background: #fef3c7;
    color: #92400e;
}
.status-pending .status-dot { background: #f59e0b; }
.status-approved {
    background: #d1fae5;
    color: #065f46;
}
.status-approved .status-dot { background: #10b981; }

/* ===== Form Elements ===== */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
}
.form-group-full {
    grid-column: span 2;
}
.field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.field-label-sm {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 3px;
}
.field-label-upper {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(19, 127, 236, 0.1);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input-disabled {
    background: var(--bg-light);
    color: var(--text-secondary);
    cursor: not-allowed;
}
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(19, 127, 236, 0.1);
}
.form-textarea::placeholder { color: var(--text-muted); }

.select-inline {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    cursor: pointer;
    margin-left: 6px;
}
.select-inline-sm {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

/* Quote number block */
.quote-number-block {
    text-align: right;
}
.quote-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Manrope', monospace;
}

/* ===== Data Table ===== */
.table-container {
    overflow-x: auto;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead {
    background: var(--bg-light);
}
.data-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}
.data-table-view td {
    padding: 12px 16px;
}
.table-row-hover:hover {
    background: #f8fafc;
}
.table-row-group:hover {
    background: #f8fafc;
}

/* Table column widths */
.th-desc { min-width: 240px; }
.th-qty, .th-qty-c { width: 70px; text-align: center; }
.th-qty-r { width: 90px; text-align: right; }
.th-price, .th-price-r { width: 110px; text-align: right; }
.th-total, .th-total-r { width: 110px; text-align: right; }
.th-action { width: 44px; }
.th-action-sm { width: 36px; }

.td-desc { min-width: 240px; }
.td-desc-view {
    display: flex;
    align-items: center;
    gap: 12px;
}
.td-qty { text-align: center; }
.td-qty-c { text-align: center; }
.td-price-r { text-align: right; }
.td-mono-r {
    text-align: right;
    font-family: 'Manrope', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}
.td-bold-r {
    text-align: right;
    font-weight: 700;
    font-family: 'Manrope', monospace;
}
.td-total {
    text-align: right;
    font-weight: 700;
    font-family: 'Manrope', monospace;
}
.td-action, .td-action-sm {
    text-align: center;
}

/* Inline inputs in table */
.input-inline {
    width: 100%;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}
.input-inline-detail {
    width: 100%;
    padding: 2px 0;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    outline: none;
    font-family: inherit;
}
.input-inline-detail::placeholder { color: var(--text-xs); }

.input-transparent {
    width: 100%;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}
.input-transparent-detail {
    width: 100%;
    padding: 2px 0;
    font-size: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    outline: none;
    font-family: inherit;
}
.input-transparent-detail::placeholder { color: var(--text-xs); }

.input-number {
    width: 60px;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    text-align: center;
}
.input-number:focus { border-color: var(--primary); }

.input-number-sm {
    width: 50px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    text-align: center;
}
.input-number-sm:focus { border-color: var(--primary); }

.input-currency-wrap {
    display: flex;
    align-items: center;
    gap: 2px;
}
.currency-symbol {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
}
.input-currency {
    width: 80px;
    padding: 5px 8px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    text-align: right;
}
.input-currency:focus { border-color: var(--primary); }
.input-currency-sm {
    width: 70px;
    padding: 4px 6px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
    text-align: right;
}
.input-currency-sm:focus { border-color: var(--primary); }

/* Item details in view tables */
.item-thumb {
    width: 36px;
    height: 36px;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.item-sku {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Table footer for adding */
.table-footer-add {
    padding: 8px 16px;
    border-top: 1px solid var(--border-light);
}

/* Table foot totals */
.table-foot-totals td {
    padding: 8px 16px;
    font-size: 13px;
}
.tfoot-label {
    text-align: right;
    color: var(--text-secondary);
    font-weight: 500;
}
.tfoot-value {
    text-align: right;
    font-weight: 600;
    font-family: 'Manrope', monospace;
    color: var(--text-primary);
}
.tfoot-total-row {
    background: var(--bg-light);
}
.tfoot-total-label {
    text-align: right;
    font-weight: 700;
    color: var(--text-primary);
}
.tfoot-total-value {
    text-align: right;
    font-weight: 800;
    font-size: 15px;
    color: var(--primary);
    font-family: 'Manrope', monospace;
}

/* ===== Totals Section ===== */
.totals-section {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}
.totals-row-flex {
    display: flex;
    gap: 40px;
}
.totals-notes {
    flex: 1;
}
.totals-summary {
    width: 320px;
    flex-shrink: 0;
}
.totals-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.totals-line-border {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    margin-top: 4px;
}
.totals-value {
    font-weight: 600;
    font-family: 'Manrope', monospace;
    color: var(--text-primary);
}
.totals-label-with-badge {
    display: flex;
    align-items: center;
    gap: 6px;
}
.totals-tax-select {
    display: flex;
    align-items: center;
    gap: 4px;
}
.totals-grand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 0;
    margin-top: 8px;
    border-top: 2px solid var(--text-primary);
    font-weight: 800;
    font-size: 15px;
    color: var(--text-primary);
}
.totals-grand-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Manrope', monospace;
}

/* Green badge/text */
.badge-green {
    display: inline-flex;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-full);
}
.text-green { color: #10b981 !important; }
.text-primary { color: var(--primary) !important; }

/* ===== Section Headers (QuoteView) ===== */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--border-light);
}
.section-header-blue { background: rgba(19, 127, 236, 0.04); }
.section-header-purple { background: rgba(139, 92, 246, 0.04); }
.section-header-orange { background: rgba(249, 115, 22, 0.04); }

.section-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.section-icon-wrap .material-icons-round { font-size: 18px; color: white; }
.bg-blue { background: var(--primary); }
.bg-purple { background: #8b5cf6; }
.bg-orange { background: #f97316; }

.section-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

/* ===== Meta Row (QuoteView) ===== */
.meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.meta-col {
    padding: 0;
}
.meta-col-border {
    padding-left: 24px;
    border-left: 1px solid var(--border);
}
.meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 10px;
}
.meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.meta-item-label {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 3px;
}
.meta-item-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Client info in meta */
.client-info-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--primary-border);
}
.client-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.client-detail {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 0;
    display: flex;
    align-items: center;
    gap: 3px;
}
.icon-inline {
    font-size: 14px !important;
    color: var(--text-muted);
}

/* Mono helper */
.mono {
    font-family: 'Manrope', monospace;
}

/* ===== Summary Card (QuoteView right column) ===== */
.summary-card {
    border: 1px solid var(--primary-border);
    overflow: hidden;
}
.summary-body {
    padding: 20px 24px;
}
.summary-card-title {
    margin-bottom: 16px;
}
.summary-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.summary-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.summary-line-value {
    font-weight: 600;
    font-family: 'Manrope', monospace;
    color: var(--text-primary);
}
.summary-divider {
    height: 1px;
    background: var(--border-light);
    margin: 6px 0;
}
.summary-grand-section {
    background: var(--bg-light);
    padding: 16px 24px 20px;
    border-top: 1px solid var(--border);
}
.summary-grand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.summary-grand-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.summary-grand-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Manrope', monospace;
}
.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.summary-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
    line-height: 1.5;
}

/* Info card (QuoteView) */
.info-card {
    background: rgba(19, 127, 236, 0.04);
    border-color: var(--primary-border);
}
.info-card-inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.info-card-icon {
    font-size: 20px !important;
    color: var(--primary);
    flex-shrink: 0;
}
.info-card-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.info-card-text {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Info row (side panels) */
.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
}
.info-label { color: var(--text-secondary); }
.info-value { font-weight: 600; color: var(--text-primary); }

/* ===== Empty State ===== */
.empty-state-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 24px;
    text-align: center;
}
.empty-state-page .empty-icon {
    font-size: 64px !important;
    color: var(--text-xs);
    margin-bottom: 16px;
}
.empty-state-page h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 0 0 8px;
}
.empty-state-page p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

/* ===== Tab Toggle (ReceiptCreate) ===== */
.tab-toggle {
    display: flex;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: 3px;
    gap: 2px;
}
.tab-btn {
    flex: 1;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    text-align: center;
}
.tab-btn-active {
    background: var(--bg-white);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}
.tab-btn:not(.tab-btn-active):hover {
    color: var(--text-primary);
}

/* ===== Payment Method Grid (ReceiptCreate) ===== */
.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.payment-method-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.payment-method-option:hover {
    border-color: var(--primary-border);
}
.payment-method-option.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}
.payment-icon {
    font-size: 24px !important;
    color: var(--text-muted);
}
.payment-method-option.selected .payment-icon {
    color: var(--primary);
}
.payment-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}
.payment-method-option.selected .payment-label {
    color: var(--primary);
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ===== Receipt Create Layout ===== */
.receipt-create-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    align-items: start;
}
.receipt-form-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.receipt-preview-col {
    position: sticky;
    top: 0;
    align-self: flex-start;
}

/* Preview header */
.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.preview-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.preview-actions {
    display: flex;
    gap: 6px;
}

/* ===== Receipt Paper (live preview) ===== */
.receipt-paper {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.receipt-paper-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 24px 16px;
}
.receipt-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.receipt-brand-icon {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}
.receipt-brand-icon .material-icons-round { font-size: 20px; color: white; }
.receipt-brand-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.receipt-brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}
.receipt-title-block {
    text-align: right;
}
.receipt-doc-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
    letter-spacing: 0.1em;
}
.receipt-doc-number {
    font-size: 12px;
    color: var(--text-muted);
    margin: 2px 0 0;
    font-family: 'Manrope', monospace;
}

/* Receipt meta */
.receipt-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}
.receipt-meta-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 4px;
}
.receipt-meta-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.receipt-meta-addr {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 0;
}
.receipt-meta-right {
    text-align: right;
}
.receipt-meta-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}
.receipt-status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-full);
}

/* Receipt preview items */
.receipt-items {
    padding: 0 24px;
}
.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.receipt-table th {
    padding: 8px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.receipt-table td {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 12px;
}
.receipt-item-detail {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* Receipt totals in preview */
.receipt-totals {
    padding: 12px 24px;
    margin: 0;
}
.receipt-totals-line {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
    color: var(--text-secondary);
}
.receipt-totals-grand {
    display: flex;
    justify-content: space-between;
    padding: 8px 0 0;
    margin-top: 6px;
    border-top: 2px solid var(--text-primary);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

/* Receipt footer */
.receipt-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}
.receipt-footer-quote {
    font-size: 11px;
    font-style: italic;
    color: var(--text-muted);
    margin: 0 0 8px;
}
.receipt-footer-contacts {
    display: flex;
    justify-content: center;
    gap: 16px;
    font-size: 11px;
    color: var(--text-secondary);
}
.receipt-footer-contacts span {
    display: flex;
    align-items: center;
    gap: 3px;
}
.receipt-footer-icon {
    font-size: 14px !important;
    color: var(--text-muted);
}

/* ===== Receipt View ===== */
.receipt-view-container {
    background: var(--bg-light);
}
.receipt-view-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 24px;
    align-items: start;
}

/* Receipt Document */
.receipt-document {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.receipt-doc-stripe {
    height: 4px;
    background: linear-gradient(90deg, var(--primary), #3b82f6, #6366f1);
}
.receipt-doc-body {
    padding: 40px 48px;
}

/* Receipt doc header */
.receipt-doc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}
.receipt-doc-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.receipt-doc-icon {
    font-size: 28px !important;
    color: var(--primary);
}
.receipt-doc-h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}
.receipt-doc-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 4px 0 0;
}
.receipt-success-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #d1fae5;
    color: #065f46;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
}
.receipt-success-badge .material-icons-round { font-size: 18px; }

/* Payment status badge variants */
.receipt-status-paid { background: #d1fae5; color: #065f46; }
.receipt-status-pending { background: #fef3c7; color: #92400e; }
.receipt-status-partial { background: #dbeafe; color: #1e40af; }
.receipt-status-overdue { background: #fee2e2; color: #991b1b; }
.receipt-status-refunded { background: #e5e7eb; color: #374151; }

.receipt-doc-hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 20px 0;
}

/* Receipt metadata grid */
.receipt-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}
.receipt-meta-grid-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0 0 4px;
}
.receipt-meta-grid-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}
.receipt-meta-grid-email {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 2px 0 0;
}
.receipt-meta-payment {
    display: flex;
    align-items: center;
    gap: 6px;
}
.icon-sm {
    font-size: 16px !important;
    color: var(--text-secondary);
}

/* Receipt doc table */
.receipt-doc-table-wrap {
    margin-bottom: 24px;
}
.receipt-doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.receipt-doc-table thead {
    background: var(--bg-light);
}
.receipt-doc-table th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.receipt-doc-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}
.receipt-doc-item-name {
    font-weight: 600;
}
.receipt-doc-item-detail {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Receipt doc totals */
.receipt-doc-totals {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    margin-bottom: 32px;
}
.receipt-doc-totals-line {
    display: flex;
    justify-content: space-between;
    width: 280px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
}
.receipt-doc-totals-hr {
    border: none;
    height: 1px;
    background: var(--border);
    width: 280px;
    margin: 6px 0;
}
.receipt-doc-totals-grand {
    display: flex;
    justify-content: space-between;
    width: 280px;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
}
.receipt-doc-grand-amount {
    color: var(--primary);
    font-family: 'Manrope', monospace;
    font-size: 20px;
}

/* Receipt doc footer */
.receipt-doc-footer {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}
.receipt-doc-footer-company {
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
}
.receipt-doc-footer p {
    margin: 0;
}
.receipt-doc-footer a {
    text-decoration: none;
}

/* Receipt actions sidebar */
.receipt-actions-sidebar .card {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.receipt-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 20px;
}
.receipt-help-section {
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}
.receipt-help-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
}
.receipt-help-card {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    align-items: flex-start;
}
.receipt-help-icon-wrap {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.receipt-help-icon-wrap .material-icons-round {
    font-size: 16px;
    color: var(--primary);
}
.receipt-help-card-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px;
}
.receipt-help-card-text {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
}

/* ===== Utility Classes ===== */
.text-right { text-align: right; }
.text-center { text-align: center; }
.fw-medium { font-weight: 500; }
.fw-bold { font-weight: 700; }
.tabular { font-family: 'Manrope', monospace; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   RESPONSIVE: Panel Overlay, Toggle Buttons & Utility Classes
   ========================================================================== */

/* --- Panel Overlay Backdrop --- */
.panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 90;
}

/* --- Panel Toggle Buttons (hidden on desktop by default) --- */
.panel-toggle-btn {
    display: none !important;
}

/* --- Responsive Utility Classes (hidden by default, activated by media queries) --- */

/* ==========================================================================
   TABLET BREAKPOINT: 768px – 1024px
   Library panel becomes an overlay drawer; Properties panel stays visible.
   ========================================================================== */
@media (max-width: 1024px) {

    /* Show overlay when a panel is toggled open */
    .panel-overlay {
        display: block;
    }

    /* --- Library Panel: off-screen drawer --- */
    .library-panel {
        position: fixed;
        top: 56px;                  /* below header */
        left: 0;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,0.12);
    }
    .library-panel.panel-open {
        transform: translateX(0);
    }

    /* Show the Library toggle button */
    .library-toggle-btn {
        display: flex !important;
    }

    /* Properties panel stays inline but narrows slightly */
    .properties-panel {
        width: 260px;
        min-width: 260px;
    }

    /* Hide elements tagged .hide-tablet */
    .hide-tablet {
        display: none !important;
    }

    /* Header: slightly tighter */
    .planner-header {
        padding: 0 12px !important;
    }
    .header-left {
        gap: 6px;
    }

    /* Header nav: compact on tablet */
    .header-nav {
        margin-left: 8px;
        padding-left: 8px;
    }
    .header-nav-item .nav-label {
        display: none;
    }
}

/* ==========================================================================
   MOBILE BREAKPOINT: < 768px
   Both Library AND Properties panels become overlay drawers.
   Canvas takes full width. Header and toolbar are compacted.
   ========================================================================== */
@media (max-width: 768px) {

    /* Show overlay when a panel is toggled open */
    .panel-overlay {
        display: block;
    }

    .planner-modal-backdrop {
        padding: 14px;
    }

    .planner-save-name-modal {
        width: 100%;
    }

    .planner-modal-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .planner-modal-actions .btn {
        width: 100%;
    }

    /* --- Library Panel (already off-screen from tablet rule) --- */
    .library-panel {
        top: 48px;
        width: 260px;
        min-width: 260px;
    }

    /* --- Properties Panel: off-screen drawer from right --- */
    .properties-panel {
        position: fixed;
        top: 48px;                  /* below header */
        right: 0;
        bottom: 0;
        width: 280px;
        min-width: 280px;
        z-index: 100;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    }
    .properties-panel.panel-open {
        transform: translateX(0);
    }

    /* Show both toggle buttons */
    .library-toggle-btn,
    .properties-toggle-btn {
        display: flex !important;
    }

    /* Hide elements tagged .hide-mobile */
    .hide-mobile {
        display: none !important;
    }

    /* --- Header: compact --- */
    .planner-header {
        padding: 0 10px !important;
        height: 48px !important;
        min-height: 48px !important;
    }
    .header-left {
        gap: 4px;
    }
    .header-logo {
        width: 28px;
        height: 28px;
    }
    .header-logo .material-icons-round {
        font-size: 16px !important;
    }
    .header-brand {
        font-size: 14px;
    }
    .header-right {
        gap: 8px;
    }
    .header-save-btn {
        padding: 5px 10px;
        font-size: 12px;
    }
    .header-avatar {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    /* --- Content area: adjust for shorter header --- */
    .planner-content {
        height: 100vh !important;
        padding-top: 48px !important;
    }

    /* --- Header nav: icons only on mobile --- */
    .header-nav {
        margin-left: 8px;
        padding-left: 8px;
        gap: 0;
    }
    .header-nav-item {
        padding: 6px 8px;
    }
    .header-nav-item .nav-label {
        display: none;
    }

    /* --- Canvas Toolbar: compact --- */
    .planner-name-bar {
        padding: 12px 8px;
        gap: 12px;
    }
    .planner-name-bar-input-wrap {
        min-width: 180px;
    }
    .canvas-toolbar {
        height: auto;
        min-height: 42px;
        padding: 8px;
    }
    .toolbar-left, .toolbar-right {
        gap: 4px;
    }

    /* Slightly smaller view tabs */
    .view-tab-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    /* Shape buttons: slightly smaller */
    .shape-btn {
        padding: 4px;
    }

    /* Mode indicator: smaller */
    .mode-indicator {
        padding: 3px 8px;
        font-size: 9px;
    }

    /* --- Summary Bar: compact --- */
    .summary-bar {
        height: auto;
        min-height: 48px;
        padding: 8px 12px;
    }
    .summary-stat-value {
        font-size: 15px;
    }
    .summary-total-value {
        font-size: 18px;
    }
    .summary-cta {
        padding: 8px 14px;
        font-size: 12px;
    }
}

/* ==========================================================================
   SMALL MOBILE BREAKPOINT: < 480px
   Extra fine-tuning for very small screens.
   ========================================================================== */
@media (max-width: 480px) {

    /* Narrower overlay panels */
    .library-panel {
        width: 240px;
        min-width: 240px;
    }
    .properties-panel {
        width: 260px;
        min-width: 260px;
    }

    /* Even more compact header */
    .planner-header {
        padding: 0 8px !important;
    }
    .header-brand {
        font-size: 13px;
    }
    .header-save-btn {
        padding: 4px 8px;
        font-size: 11px;
        gap: 4px;
    }

    /* Toolbar: tighter */
    .planner-name-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 8px;
        gap: 8px;
    }
    .planner-name-bar-input-wrap {
        min-width: 0;
        max-width: none;
    }
    .canvas-toolbar {
        padding: 6px;
    }
    .view-tab-btn {
        padding: 3px 6px;
        font-size: 9px;
    }

    /* Summary bar: stack if cost UI is visible */
    .summary-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 10px;
    }
    .summary-right {
        gap: 12px;
        flex-wrap: wrap;
    }
    .summary-cta {
        padding: 8px 12px;
        font-size: 11px;
    }
}

/* ==========================================================================
   DASHBOARD LAYOUT
   ========================================================================== */

/* --- Root layout: sidebar + main --- */
.dashboard-root {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-light);
}

/* --- Sidebar --- */
.dashboard-sidebar {
    width: 256px;
    min-width: 256px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
}

/* Brand */
.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
}
.sidebar-brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}
.sidebar-brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav-item:hover {
    background: var(--bg-light);
    color: var(--text-primary);
    text-decoration: none;
}
.sidebar-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}
.sidebar-nav-item.active .material-icons-round {
    color: var(--primary);
}
.sidebar-nav-item.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}
.sidebar-nav-item .material-icons-round {
    font-size: 20px;
}

/* User section */
.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-user:hover {
    background: var(--bg-light);
}
.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 11px;
    color: var(--text-secondary);
}
.sidebar-user-settings {
    font-size: 18px;
    color: var(--text-muted);
}

/* --- Main content area --- */
.dashboard-main {
    flex: 1;
    margin-left: 256px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
}

/* --- Header --- */
.dashboard-header {
    height: 64px;
    min-height: 64px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}
.dashboard-search {
    position: relative;
    width: 380px;
    max-width: 100%;
}
.dashboard-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-muted);
}
.dashboard-search input {
    width: 100%;
    background: var(--bg-light);
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 16px 9px 40px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: box-shadow 0.15s;
}
.dashboard-search input::placeholder {
    color: var(--text-muted);
}
.dashboard-search input:focus {
    box-shadow: 0 0 0 2px var(--primary-border);
}
.dashboard-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dashboard-notify-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: background 0.15s;
}
.dashboard-notify-btn:hover {
    background: var(--bg-light);
}
.dashboard-notify-btn .material-icons-round {
    font-size: 20px;
    color: var(--text-secondary);
}
.notify-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: var(--radius-full);
    border: 2px solid white;
}
.dashboard-header-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    margin: 0 4px;
}
.dashboard-new-project-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: var(--shadow-sm);
}
.dashboard-new-project-btn:hover {
    background: var(--primary-hover);
}

/* --- Dashboard page content --- */
.dashboard-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}
.dashboard-page {
    padding: 32px;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* --- Welcome row --- */
.dashboard-welcome-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.dashboard-welcome {
    flex: 1;
    min-width: 240px;
}
.dashboard-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}
.dashboard-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}
.dashboard-stats {
    display: flex;
    gap: 16px;
}
.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    min-width: 180px;
    box-shadow: var(--shadow-sm);
}
.stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}
.stat-value-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-top: 4px;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-trend {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 2px;
}
.stat-trend.up {
    color: #10b981;
}
.stat-trend.down {
    color: #ef4444;
}

/* --- Sections --- */
.dashboard-section {
    display: flex;
    flex-direction: column;
}
.section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-icon {
    font-size: 20px;
}
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-header-row .section-title {
    margin-bottom: 0;
}
.section-link {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.section-link:hover {
    text-decoration: underline;
}

/* --- Quick Actions --- */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.quick-action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.quick-action-card:not([disabled]):hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.quick-action-card[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}
.quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}
.quick-action-icon .material-icons-round {
    font-size: 24px;
}
.quick-action-icon.blue {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}
.quick-action-card:not([disabled]):hover .quick-action-icon.blue {
    background: var(--primary);
    color: white;
}
.quick-action-icon.indigo {
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
}
.quick-action-card:not([disabled]):hover .quick-action-icon.indigo {
    background: #6366f1;
    color: white;
}
.quick-action-icon.emerald {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}
.quick-action-card:not([disabled]):hover .quick-action-icon.emerald {
    background: #10b981;
    color: white;
}
.quick-action-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}
.quick-action-desc {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- Bottom grid: projects + documents --- */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

/* --- Projects grid --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.project-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.project-card:hover {
    box-shadow: var(--shadow-md);
}
.project-card-thumb {
    height: 128px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.project-thumb-icon {
    font-size: 56px;
    color: var(--border);
}
.project-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,0.92);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    box-shadow: var(--shadow-sm);
}
.project-card-body {
    padding: 16px;
}
.project-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.project-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

/* Empty state */
.empty-state-card {
    background: var(--bg-white);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    grid-column: 1 / -1;
}
.empty-state-card:hover {
    border-color: var(--primary);
}
.empty-icon {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.empty-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.empty-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 4px 0 0 0;
}

/* --- Documents list --- */
.docs-list {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.docs-empty {
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.doc-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s;
}
.doc-item:last-child {
    border-bottom: none;
}
.doc-item:hover {
    background: var(--bg-light);
}
.doc-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.doc-item-icon .material-icons-round {
    font-size: 20px;
}
.doc-icon-blue {
    background: rgba(59, 130, 246, 0.08);
    color: var(--primary);
}
.doc-icon-green {
    background: rgba(16, 185, 129, 0.08);
    color: #10b981;
}
.doc-icon-gray {
    background: var(--bg-light);
    color: var(--text-muted);
}
.doc-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.doc-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.doc-item-sub {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--text-muted);
}
.doc-item-status {
    text-align: right;
    flex-shrink: 0;
}
.doc-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 700;
}
.badge-blue {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}
.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}
.badge-gray {
    background: var(--bg-light);
    color: var(--text-secondary);
}
.doc-item-time {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   DASHBOARD RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .dashboard-sidebar {
        width: 220px;
        min-width: 220px;
    }
    .dashboard-main {
        margin-left: 220px;
    }
    .dashboard-page {
        padding: 24px;
        gap: 24px;
    }
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-header {
        padding: 0 20px;
    }
    .dashboard-search {
        width: 280px;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        display: none;
    }
    .dashboard-main {
        margin-left: 0;
    }
    .dashboard-page {
        padding: 16px;
        gap: 20px;
    }
    .dashboard-welcome-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .dashboard-stats {
        width: 100%;
    }
    .stat-card {
        flex: 1;
        min-width: 0;
    }
    .quick-actions-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-title {
        font-size: 22px;
    }
    .dashboard-header {
        padding: 0 16px;
    }
    .dashboard-search {
        width: 200px;
    }
    .dashboard-new-project-btn span:not(.material-icons-round) {
        display: none;
    }
}

/* ======================================================
   QUOTE CREATE - Customer Search & Selected Customer Card
   ====================================================== */
.customer-search-wrap {
    position: relative;
}
.customer-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}
.form-input-search {
    padding-left: 38px;
}
.selected-customer-card {
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px;
    margin-bottom: 16px;
}
.selected-customer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.avatar-primary {
    background: rgba(19, 127, 236, 0.1);
    color: var(--primary);
}
.selected-customer-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.selected-customer-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.selected-customer-detail {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}
.selected-customer-detail .material-icons-round {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 1px;
    flex-shrink: 0;
}

.schedule-month-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-calendar-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.schedule-calendar-settings {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-month-current {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.schedule-week-start-label {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.schedule-week-start-select {
    min-width: 140px;
    max-width: 160px;
    height: 34px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.schedule-month-label {
    min-width: 140px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.schedule-calendar-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-light);
}

.schedule-weekday {
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.schedule-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.schedule-cell {
    min-height: 120px;
    border-right: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: 10px;
    background: var(--bg-white);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.schedule-cell:nth-child(7n) {
    border-right: none;
}

.schedule-cell:hover {
    background: #f8fafc;
}

.schedule-cell.out-month {
    background: #fafafa;
}

.schedule-cell.selected {
    box-shadow: inset 0 0 0 2px var(--primary);
    background: var(--primary-light);
}

.schedule-cell-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.schedule-day-number {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.schedule-count {
    font-size: 11px;
    font-weight: 700;
    border-radius: 9999px;
    padding: 2px 8px;
    color: var(--primary);
    background: rgba(19, 127, 236, 0.12);
}

.schedule-cell-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.schedule-cell-item {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-day-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.schedule-day-item {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 10px;
    background: #fbfdff;
}

.schedule-day-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.schedule-day-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.schedule-day-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}

@media (max-width: 1024px) {
    .schedule-calendar-controls {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .schedule-calendar-settings {
        width: 100%;
        flex-wrap: wrap;
    }

    .schedule-week-start-select {
        min-width: 130px;
    }

    .schedule-cell {
        min-height: 96px;
        padding: 8px;
    }

    .schedule-cell-item {
        font-size: 10px;
    }
}

/* ======================================================
   QUOTE CREATE - Files & Photos
   ====================================================== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}
.file-attachment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: border-color 0.15s;
    cursor: pointer;
}
.file-attachment-item:hover {
    border-color: rgba(19, 127, 236, 0.3);
}
.file-attachment-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.file-attachment-icon {
    font-size: 24px;
    color: var(--text-secondary);
}
.file-attachment-item:hover .file-attachment-icon {
    color: var(--primary);
}
.file-attachment-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}
.file-attachment-meta {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0;
}
.btn-icon-sm-muted {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}
.btn-icon-sm-muted:hover {
    color: var(--text-primary);
}
.btn-icon-sm-muted .material-icons-round {
    font-size: 16px;
}
.file-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
.file-upload-zone:hover {
    background: rgba(19, 127, 236, 0.02);
    border-color: var(--primary);
}
.file-upload-icon {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.file-upload-text {
    font-size: 13px;
    color: var(--text-secondary);
}
.file-upload-link {
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}
.file-upload-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ======================================================
   QUOTE VIEW - Discount Code Input
   ====================================================== */
.discount-code-input {
    margin-top: 8px;
}
.discount-code-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.discount-code-icon {
    position: absolute;
    left: 10px;
    font-size: 16px;
    color: var(--text-secondary);
    pointer-events: none;
}
.discount-code-field {
    width: 100%;
    padding: 8px 60px 8px 34px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-light);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}
.discount-code-field::placeholder {
    color: var(--text-secondary);
}
.discount-code-field:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(19, 127, 236, 0.1);
}
.discount-code-apply {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}
.discount-code-apply:hover {
    color: #0e64bd;
}

/* ===== Planner Pricing ===== */
.planner-pricing-page {
    overflow-y: auto;
    height: calc(100vh - 56px);
}

.planner-pricing-summary-card {
    margin-bottom: 16px;
}

.planner-pricing-autosave-status {
    margin-top: 8px;
    font-size: 12px;
}

.planner-pricing-autosave-saving {
    color: var(--text-secondary);
}

.planner-pricing-autosave-saved {
    color: #047857;
}

.planner-pricing-autosave-error {
    color: #b91c1c;
}

.planner-pricing-autosave-warning {
    color: #b45309;
}

.planner-pricing-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: end;
}

.planner-pricing-summary-note {
    grid-column: 1 / -1;
    font-size: 12px;
    color: var(--text-secondary);
}

.planner-pricing-table th,
.planner-pricing-table td {
    vertical-align: middle;
}

.planner-pricing-input-wrap {
    max-width: 180px;
}

.planner-pricing-input {
    width: 100%;
}

.planner-pricing-bottom-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

@media (max-width: 860px) {
    .planner-pricing-summary-grid {
        grid-template-columns: 1fr;
    }

    .planner-pricing-bottom-actions {
        justify-content: stretch;
    }

    .planner-pricing-bottom-actions .btn {
        flex: 1;
    }
}

/* ===== Auth ===== */
.auth-page-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--bg-light);
}

.auth-panel {
    width: 100%;
    max-width: 460px;
}

.auth-brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.auth-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(19, 127, 236, 0.2);
}

.auth-brand-icon .material-icons-round {
    color: #fff;
    font-size: 21px;
}

.auth-brand-name {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.auth-brand-sub {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
}

.auth-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-subtitle {
    margin-top: 6px;
}

.auth-mode-toggle {
    margin-bottom: 14px;
}

.auth-mode-toggle .tab-btn {
    padding-top: 7px;
    padding-bottom: 7px;
}

.auth-mode-badge {
    margin-top: 2px;
    flex-shrink: 0;
}

.auth-card {
    padding: 22px 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-hint {
    margin: 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.auth-error {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    background: #fef2f2;
    color: #b91c1c;
    font-size: 12px;
    line-height: 1.5;
}

.auth-error .material-icons-round {
    font-size: 16px;
    margin-top: 1px;
}

.auth-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
}

.auth-switch-text {
    font-size: 12px;
    color: var(--text-secondary);
}

.header-user-email {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 768px) {
    .auth-page-shell {
        padding: 14px;
    }

    .auth-card {
        padding: 18px;
    }

    .auth-card-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 14px;
    }

    .auth-switch-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-brand-name {
        font-size: 18px;
    }
}
