/* ==========================================================================
   PRICE LIST MAKER - PRODUCTION CLEAN DOCUMENT STYLESHEET
   ========================================================================== */

@import url('fonts.css');

:root {
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --primary-light: #f1f5f9;
  --primary-border: #cbd5e1;
  --primary-text: #ffffff;
  
  --company-title-color: #0f172a;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  
  --bg-app: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-surface-secondary: #f8fafc;
  --bg-hover: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-radius: 6px;
  --border-radius-sm: 4px;
  --border-radius-lg: 10px;
  
  --font-family: 'Montserrat', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  --font-scale: 13.5px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  --header-bg: #0f172a;
  --header-text: #ffffff;
  --table-stripe-bg: #f8fafc;
  --table-border-color: #94a3b8;
}

/* Color Picker Inputs */
.color-picker-input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 26px;
  height: 24px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  padding: 1px;
  vertical-align: middle;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}

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

html, body {
  overflow-x: hidden;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-scale);
  color: var(--text-main);
  background-color: var(--bg-app);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Unified Floating Sticky Top Navigation Capsule */
.top-nav-sticky-wrapper {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  padding: 10px 18px 2px 18px;
  display: flex;
  justify-content: center;
  pointer-events: none;
  box-sizing: border-box;
}

/* Top App Header Capsule (Rectangle with half-circle rounded ends) */
.app-header {
  pointer-events: auto;
  width: 100%;
  max-width: 1220px;
  min-height: 48px;
  height: 48px;
  background: rgba(15, 23, 42, 0.88);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94) 0%, rgba(15, 23, 42, 0.88) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  color: #ffffff;
  padding: 0 14px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 100px;
  gap: 1rem;
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.28), 0 4px 12px -2px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  box-sizing: border-box;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-title {
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffffff;
}

.brand-badge {
  font-size: 0.62rem;
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.35);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-block;
  min-width: 84px;
  text-align: center;
}

.save-status {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.save-status.saved { color: #4ade80; }
.save-status.saving { color: #facc15; }

.save-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.app-header .btn {
  border-radius: 50px;
  padding: 5px 12px;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.app-header .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
}

.app-header .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: translateY(-1px);
}

.app-header .btn-accent {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.app-header .btn-accent:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
}

.app-header .btn-dark {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.app-header .btn-dark:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}

.app-header .btn-google-signin {
  border-radius: 50px;
  padding: 5px 12px;
}

/* Secondary Control Toolbar */
.control-toolbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 0.45rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.toolbar-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-secondary:hover { background-color: var(--bg-surface-secondary); }

.btn-accent {
  background-color: #0284c7;
  color: #ffffff;
}

.btn-accent:hover { background-color: #0369a1; }

.btn-dark {
  background: #334155;
  color: #ffffff;
}

.btn-dark:hover { background: #1e293b; }

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

.btn-primary:hover { background-color: #1d4ed8; }

.form-control, .form-select {
  padding: 0.32rem 0.55rem;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--border-radius-sm);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Workspace Canvas */
.app-container {
  flex: 1;
  overflow: auto;
  padding: 1.5rem 1rem 3rem 1rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
}

.workspace-canvas {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
}

/* Sheet & Right Action Dock Layout */
.sheet-and-sidebar-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  position: relative;
  margin: 0 auto;
}

/* A4 Document Sheet (Narrow 6mm Margins) */
.price-sheet-container {
  flex: 0 1 960px;
  max-width: 960px;
  width: 100%;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  padding: 22px 26px;
  margin: 0 auto 3rem auto;
  position: relative;
  min-height: 1050px;
  border: 1px solid var(--border-strong);
  transform-origin: top center;
  transition: max-width 0.25s ease, min-height 0.25s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* A4 Landscape Page Mode (297mm x 210mm) */
body.orientation-landscape .workspace-canvas {
  max-width: 1400px;
}

body.orientation-landscape .price-sheet-container {
  flex: 0 1 1220px;
  max-width: 1220px;
  width: 100%;
  min-height: 820px;
  padding: 22px 30px;
  margin: 0 auto 3rem auto;
}

body.orientation-landscape .company-name {
  font-size: 1.55rem;
}

/* Floating Liquid Glass Quick Actions Toolbox */
.floating-toolbox {
  position: fixed;
  right: 28px;
  top: 75px;
  width: 198px;
  z-index: 1000;
  box-sizing: border-box;
  user-select: none;
}

.sidebar-dock-card {
  background: rgba(255, 255, 255, 0.72);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.58) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-top: 1.5px solid rgba(255, 255, 255, 1);
  border-radius: 16px;
  padding: 8px 10px 12px 10px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(0, 0, 0, 0.05), inset 0 1px 2px rgba(255, 255, 255, 0.95), inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-sizing: border-box;
  width: 100%;
}

/* Static Liquid Glass Header */
.dock-main-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  margin-bottom: 2px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 1px 3px rgba(0, 0, 0, 0.03);
}

.dock-drag-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.78rem;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.dock-content-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  box-sizing: border-box;
}

.dock-card-header {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 1px 2px;
}

.dock-action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.04), inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.dock-action-btn:hover {
  background: rgba(239, 246, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.45);
  color: #1d4ed8;
  transform: translateY(-1px) translateX(1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.95);
}

.dock-icon {
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dock-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

.dock-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.2) 0%, rgba(226, 232, 240, 0.8) 50%, rgba(226, 232, 240, 0.2) 100%);
  margin: 3px 0;
}

/* Dock Settings Controls */
.dock-field-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.dock-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
}

.dock-select {
  width: 100% !important;
  font-size: 0.78rem !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(203, 213, 225, 0.8) !important;
  background: rgba(255, 255, 255, 0.75) !important;
  color: #1e293b !important;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dock-colors-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.dock-color-item {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 7px;
  padding: 3px 6px;
  flex: 1;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.dock-color-picker {
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  border: none !important;
  cursor: pointer;
  background: transparent !important;
}

.dock-color-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
}

.dock-search-input {
  width: 100% !important;
  font-size: 0.75rem !important;
  padding: 5px 8px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(203, 213, 225, 0.8) !important;
  background: rgba(255, 255, 255, 0.75) !important;
  box-sizing: border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

.dock-subgroup {
  display: flex;
  gap: 4px;
}

.dock-mini-btn {
  flex: 1;
  padding: 5px 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 7px;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.12s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.dock-mini-btn:hover {
  background: rgba(239, 246, 255, 0.9);
  border-color: rgba(59, 130, 246, 0.45);
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* Sheet Header Box */
.sheet-header-box {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
  margin-bottom: 1rem;
}

.company-identity {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  flex: 1;
}

/* Logo Upload & Preview */
.company-logo-wrapper {
  position: relative;
  width: 80px;
  height: 80px;
  border: 1.5px dashed #94a3b8;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f8fafc;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.company-logo-wrapper:hover {
  border-color: var(--accent);
  background: #f1f5f9;
}

.company-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-overlay-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  border: none;
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 0.65rem;
  cursor: pointer;
  display: none;
}

.company-logo-wrapper:hover .logo-overlay-btn { display: block; }

.logo-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ef4444;
  color: #fff;
  border: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.company-logo-wrapper:hover .logo-remove-btn { display: flex; }

/* Company Info Box (Exact 2px gap) */
.company-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.company-name {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--company-title-color);
  letter-spacing: -0.02em;
  padding: 2px 4px;
  border: 1px solid transparent;
  line-height: 1.15;
  margin: 0;
  box-sizing: border-box;
}

.company-name:empty,
.company-name.is-empty {
  min-width: 240px;
  min-height: 28px;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
}

.company-name:empty::before,
.company-name.is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-weight: 700;
  font-size: 1.25rem;
  pointer-events: none;
  display: block;
}

.company-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  padding: 2px 4px;
  border: 1px solid transparent;
  line-height: 1.15;
  margin: 0;
  box-sizing: border-box;
}

.company-tagline:empty,
.company-tagline.is-empty {
  min-width: 240px;
  min-height: 22px;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
}

.company-tagline:empty::before,
.company-tagline.is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-weight: 500;
  font-size: 0.8rem;
  pointer-events: none;
  display: block;
}

/* Document Meta (Right-Aligned) */
.document-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 4px;
  min-width: 200px;
}

.document-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--company-title-color);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: right;
  padding: 4px 8px;
  border: 1.5px solid transparent;
  min-height: 36px;
  box-sizing: border-box;
}

.document-title:empty,
.document-title.is-empty {
  min-width: 180px;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
}

.document-title:empty::before,
.document-title.is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-weight: 800;
  pointer-events: none;
  display: block;
}

.doc-meta-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  font-size: 0.85rem;
  line-height: 1.2;
  margin-top: 2px;
}

.doc-meta-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  line-height: 1.2;
}

.doc-meta-value {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
  display: inline-block;
  padding: 3px 6px;
  border: 1px solid transparent;
  min-height: 24px;
  min-width: 90px;
  text-align: left;
  box-sizing: border-box;
  border-radius: 3px;
}

.doc-meta-value:empty,
.doc-meta-value.is-empty {
  min-width: 90px;
  min-height: 24px;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
  vertical-align: middle;
}

.doc-meta-value:empty::before,
.doc-meta-value.is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.8rem;
  pointer-events: none;
  display: block;
}

/* Global ContentEditable Box Model (Zero-Shift) */
[contenteditable="true"] {
  outline: none;
  background: transparent;
  min-width: 20px;
  border-radius: 4px;
  box-sizing: border-box;
  border: 1px solid transparent;
  padding: 3px 6px;
  line-height: 1.35;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

[contenteditable="true"]:hover {
  background-color: rgba(59, 130, 246, 0.05);
}

[contenteditable="true"]:focus {
  background-color: #ffffff;
  border-color: #3b82f6 !important;
  border-style: solid !important;
  box-shadow: 0 0 0 1.5px rgba(59, 130, 246, 0.25);
}

/* Closed rectangle dashed line placeholders when empty */
.company-info [contenteditable="true"]:empty,
.company-info [contenteditable="true"].is-empty,
.document-meta [contenteditable="true"]:empty,
.document-meta [contenteditable="true"].is-empty,
.footer-notes [contenteditable="true"]:empty,
.footer-notes [contenteditable="true"].is-empty,
.signature-block [contenteditable="true"]:empty,
.signature-block [contenteditable="true"].is-empty {
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
  border-radius: 4px;
  display: block;
}

.footer-notes [contenteditable="true"]:empty::before,
.footer-notes [contenteditable="true"].is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-size: 0.78rem;
  pointer-events: none;
  display: block;
}

.signature-block [contenteditable="true"]:empty::before,
.signature-block [contenteditable="true"].is-empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  font-size: 0.8rem;
  pointer-events: none;
  display: block;
}

/* ==========================================================================
   DOCUMENT PRODUCT TABLE (NO MANDATORY COLUMNS, CLEAN ROWS)
   ========================================================================== */

.price-table-wrapper {
  width: 100%;
  overflow: visible;
  margin-bottom: 1.25rem;
  position: relative;
  padding: 1px;
}

.price-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.85rem;
  border: 1.5px solid var(--table-border-color);
}

.price-table thead th {
  background-color: var(--header-bg);
  color: var(--header-text);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 8px 10px;
  border: 1px solid var(--table-border-color);
  position: relative;
  user-select: none;
}

.price-table thead th:last-child,
.price-table tbody td:last-child {
  border-right: 1.5px solid var(--table-border-color);
}

/* Column Width Resizer Handle */
.col-resizer {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 50;
  touch-action: none;
}

.col-resizer::after {
  content: '';
  position: absolute;
  top: 3px;
  bottom: 3px;
  right: 3px;
  width: 2px;
  background: transparent;
  transition: background 0.15s ease;
  border-radius: 1px;
}

.col-resizer:hover::after,
.col-resizer.is-resizing::after {
  background: #3b82f6;
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.6);
}

.th-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}

.th-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0.3;
  transition: opacity 0.15s;
  margin-bottom: 2px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  align-self: center;
}

.price-table thead th:hover .th-actions {
  opacity: 1;
}

.th-title {
  width: 100%;
  text-align: inherit;
  outline: none;
  border-radius: 2px;
  padding: 1px 2px;
  display: block;
  white-space: normal;
  word-break: break-word;
}

.col-btn {
  background: transparent;
  border: none;
  color: inherit;
  padding: 1px 4px;
  cursor: pointer;
  border-radius: 2px;
  font-size: 11px;
}

.col-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.col-btn.delete-col:hover {
  background: #ef4444;
  color: #fff;
}

.price-table tbody tr {
  border-bottom: 1px solid var(--table-border-color);
  position: relative;
}

.price-table tbody tr:hover {
  background-color: rgba(59, 130, 246, 0.03);
}

.price-table.table-striped tbody tr:nth-child(even) {
  background-color: var(--table-stripe-bg);
}

/* Row Height Resizer Handle */
.row-resizer-handle {
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 8px;
  cursor: row-resize;
  user-select: none;
  z-index: 35;
  touch-action: none;
}

.row-resizer-handle::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.15s ease;
}

.price-table tbody tr:hover .row-resizer-handle::after {
  background: rgba(59, 130, 246, 0.35);
}

.row-resizer-handle:hover::after,
.row-resizer-handle.is-resizing::after {
  background: #3b82f6 !important;
  box-shadow: 0 0 4px rgba(59, 130, 246, 0.6);
}

/* Density Settings */
.price-table.density-compact tbody td {
  padding: 3px 6px;
}

.price-table.density-normal tbody td {
  padding: 6px 8px;
}

.price-table.density-spacious tbody td {
  padding: 12px 10px;
}

.price-table tbody td {
  padding: 6px 8px;
  border: 1px solid var(--table-border-color);
  vertical-align: middle;
  position: relative;
}

.price-table tbody tr:not(.category-row) td:last-child {
  padding-right: 8px;
}

/* Isolated Cell Editor Container */
.cell-editor {
  min-height: 20px;
  width: 100%;
  outline: none;
  border: none !important;
  background: transparent !important;
  box-sizing: border-box;
}

.cell-editor:focus {
  background-color: #ffffff;
  box-shadow: 0 0 0 1.5px #3b82f6;
  border-radius: 2px;
}

/* Floating Row Actions (Positioned vertically outside the table to the right) */
.row-floating-actions {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 3px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16), 0 2px 4px rgba(0, 0, 0, 0.06);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  user-select: none;
}

/* Invisible hover bridge to ensure seamless mouse transition to buttons */
.row-floating-actions::before {
  content: '';
  position: absolute;
  left: -20px;
  top: -10px;
  right: -10px;
  bottom: -10px;
  z-index: -1;
}

.price-table tbody tr:hover .row-floating-actions,
.row-floating-actions:hover {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.row-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  transition: all 0.12s ease;
  padding: 0;
  pointer-events: auto !important;
  position: relative;
  z-index: 85;
}

.row-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: scale(1.1);
}

.row-btn.del-row-btn:hover {
  background: #fee2e2;
  border-color: #ef4444;
  color: #b91c1c;
  transform: scale(1.1);
}

.row-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

/* Category Row (50% Table Color with White Text) */
.category-row {
  background-color: var(--category-bg, #0f172a) !important;
  color: #ffffff !important;
  font-family: var(--font-heading);
}

.category-row td {
  background-color: var(--category-bg, #0f172a) !important;
  color: #ffffff !important;
  padding: 6px 10px !important;
  border: 1.5px solid var(--table-border-color) !important;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-cell-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 8px;
}

.category-title-text {
  padding: 2px 6px;
  border-radius: 3px;
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 95px);
  display: inline-block;
  color: #ffffff !important;
  font-weight: 800;
  word-break: break-word;
  box-sizing: border-box;
}

.category-title-text:empty,
.category-title-text.is-empty {
  border: 1px dashed rgba(255, 255, 255, 0.7) !important;
  background-color: rgba(255, 255, 255, 0.15);
  min-width: 140px;
  max-width: 100%;
  min-height: 22px;
}

/* Product Thumbnail Box (38px) */
th.photo-header-cell {
  padding: 6px 2px !important;
}

.product-photo-cell {
  text-align: center;
  vertical-align: middle;
  padding: 2px 1px !important;
}

.photos-gallery-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-wrap: nowrap;
  max-width: 100%;
  padding: 0 !important;
  margin: 0 auto;
}

.product-img-box {
  width: 48px;
  height: 48px;
  border: 1.2px dashed #94a3b8;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.add-more-photo-btn {
  width: 24px;
  height: 24px;
  border: 1px dashed #94a3b8;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.add-more-photo-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

.product-img-box:hover {
  border-color: var(--accent);
  background: #f1f5f9;
}

.product-img-box:has(img) {
  border: none;
  background: transparent;
}

.product-img-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  border: none;
}

.img-placeholder {
  font-size: 0.6rem;
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.img-remove-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-size: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.product-img-box:hover .img-remove-badge { display: flex; }

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

.item-rate-cell {
  font-weight: 700;
  color: var(--primary);
  font-feature-settings: "tnum";
}

/* TABLE ROWS: Strictly clean without placeholder boxes */
.price-table [contenteditable="true"],
.price-table .cell-editor,
.price-table td [contenteditable="true"],
.price-table [contenteditable="true"]:empty,
.price-table .cell-editor:empty {
  border: 1px solid transparent !important;
  background: transparent !important;
  min-height: 20px;
  padding: 2px 4px !important;
}

/* Document Footer Section */
.sheet-footer-section {
  margin-top: 1.5rem;
  padding-top: 0.5rem;
  border-top: none;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.footer-notes { flex: 1; }

.footer-notes-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.footer-notes-text {
  padding: 4px 8px;
  border: 1px solid transparent;
  min-height: 48px;
  box-sizing: border-box;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.footer-notes-text:empty,
.footer-notes-text.is-empty {
  min-width: 100%;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
}

.signature-block {
  text-align: right;
  min-width: 170px;
}

.signature-title {
  padding: 4px 8px;
  border: 1px solid transparent;
  min-height: 32px;
  margin-bottom: 2.5rem;
  box-sizing: border-box;
  font-size: 0.78rem;
  font-weight: 700;
}

.signature-title:empty,
.signature-title.is-empty {
  min-width: 160px;
  border: 1px dashed #94a3b8 !important;
  background-color: #f8fafc;
}

.signature-line {
  border-top: 1px solid var(--border-strong);
  padding-top: 0.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-backdrop.active { display: flex; }

.modal-card {
  background: #ffffff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 1.2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 0.8rem 1.2rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  box-shadow: var(--shadow-md);
}

.toast.success { border-left: 4px solid #10b981; }
.toast.info { border-left: 4px solid #3b82f6; }

/* Floating Liquid Glass Guest Notice Capsule */
.guest-banner-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: auto;
  max-width: 92vw;
  background: rgba(255, 255, 255, 0.72);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.88) 0%, rgba(255, 255, 255, 0.6) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-top: 1.5px solid rgba(255, 255, 255, 1);
  border-radius: 100px;
  padding: 6px 8px 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.18), 0 4px 12px -2px rgba(0, 0, 0, 0.06), inset 0 1px 2px rgba(255, 255, 255, 0.95), inset 0 -1px 2px rgba(0, 0, 0, 0.03);
  animation: floatBannerUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guest-banner-notice:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 20px 42px -4px rgba(15, 23, 42, 0.22), 0 6px 16px -2px rgba(0, 0, 0, 0.08), inset 0 1px 2px rgba(255, 255, 255, 0.95);
}

.glass-content-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.glass-icon-orb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35) 0%, rgba(245, 158, 11, 0.15) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.glass-text-group {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #1e293b;
  flex-wrap: wrap;
}

.glass-badge-label {
  font-weight: 800;
  color: #b45309;
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.glass-text-main {
  font-weight: 600;
  color: #334155;
}

.glass-text-sub {
  color: #b45309;
  font-weight: 500;
}

.glass-signin-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.glass-signin-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

@keyframes floatBannerUp {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ==========================================================================
   GOOGLE AUTH & ACCOUNT MANAGEMENT
   ========================================================================== */

.auth-header-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin-left: 6px;
}

/* Authentic Google Sign-in Button */
.btn-google-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}

.btn-google-signin:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.google-icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Logged-In User Profile Badge */
.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 3px 10px 3px 4px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.15s ease;
  user-select: none;
}

.user-profile-badge:hover {
  border-color: #94a3b8;
  background: #f8fafc;
}

.user-avatar-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 250px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  display: none;
  flex-direction: column;
  z-index: 1000;
  overflow: hidden;
}

.user-dropdown-menu.active {
  display: flex;
}

.dropdown-user-header {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.dropdown-user-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: #0f172a;
}

.dropdown-user-email {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 1px;
}

.dropdown-menu-item {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: #334155;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
}

.dropdown-menu-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.dropdown-menu-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}

/* Simulated Google Auth Dialog Account List */
.google-account-choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.google-account-choice-card:hover {
  border-color: #3b82f6;
  background: #eff6ff;
}

/* Project Item in Saved Projects Modal */
.saved-project-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #ffffff;
}

.saved-project-item.active {
  border-color: #3b82f6;
  background: #f0f7ff;
}

/* Firebase Cloud Sync Status Pill (Header) */
.firebase-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.15s ease;
  user-select: none;
}

.firebase-status-pill:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.firebase-status-pill.connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.firebase-status-pill.syncing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}

.firebase-status-pill.error {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Firebase Status Banner (Inside Modal) */
.firebase-status-banner {
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.firebase-status-banner.unconfigured {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
}

.firebase-status-banner.connected {
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.firebase-status-banner.error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Cloud badge in list items */
.cloud-sync-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.cloud-sync-badge.cloud {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.cloud-sync-badge.local {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Responsive side dock for mobile screens */
@media (max-width: 768px) {
  .sheet-and-sidebar-layout {
    flex-direction: column;
    align-items: center;
  }

  .sidebar-action-dock {
    position: static;
    width: 100%;
    max-width: 100%;
    margin-bottom: 12px;
  }

  .sidebar-dock-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .dock-card-header {
    width: 100%;
    margin-bottom: 4px;
  }

  .dock-action-btn {
    flex: 1;
    min-width: 120px;
  }
}



