/* ===== WhoSitsWhere Brand Palette ===== */
:root {
  --cream:       #fdf8f3;
  --champagne:   #f5e6cf;
  --gold:        #d4a24e;
  --gold-light:  #e8c97a;
  --gold-dark:   #b8872e;
  --terracotta:  #c06a45;
  --terracotta-deep: #944e2f;
  --blush:       #f2d1c4;
  --blush-deep:  #e4a690;
  --sage:        #a7be95;
  --sage-light:  #d0dfc6;
  --ink:         #2d2219;
  --ink-soft:    #5a4a3a;
  --warm-gray:   #9a8b7a;
  --rose:        #d4847a;
  --ivory:       #fffdf8;
  --parchment:   #f8f0e3;
  --deep:        #3a2a1e;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-heading: 'Cormorant Garamond', Garamond, serif;
  --font-body:    'Libre Franklin', 'Gill Sans', sans-serif;

  /* Semantic — keep for validation/status */
  --success: #16a34a;
  --danger:  #dc2626;
  --warning: #d97706;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); line-height: 1.6; color: var(--ink-soft); background: var(--cream); }
a { color: var(--terracotta); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--blush); color: var(--ink); }

/* ===== Layout ===== */
.app-layout { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { background: var(--deep); color: #fff; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 56px; flex-shrink: 0; }
.app-header h1 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.app-header h1 a { color: #fff; text-decoration: none; }
.app-header .nav-user { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.app-header .nav-user span { opacity: 0.85; }
.app-content { flex: 1; padding: 1.5rem; max-width: 1100px; width: 100%; margin: 0 auto; }

/* ===== Buttons ===== */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.5rem 1rem; border: none; border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: background 0.15s; }
.btn-primary { background: var(--terracotta); color: #fff; }
.btn-primary:hover { background: var(--terracotta-deep); }
.btn-secondary { background: var(--warm-gray); color: #fff; }
.btn-secondary:hover { background: var(--ink-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-link { background: none; color: var(--terracotta); padding: 0; border: none; cursor: pointer; font-size: 0.9rem; }
.btn-link:hover { text-decoration: underline; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-weight: 500; font-size: 0.9rem; color: var(--ink-soft); }
.form-input { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--blush-deep); border-radius: 6px; font-size: 0.9rem; transition: border-color 0.15s; }
.form-input:focus { outline: none; border-color: var(--terracotta); box-shadow: 0 0 0 3px rgba(192,106,69,0.1); }
.form-input-error { border-color: var(--danger); }
.form-input-error:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 15%, 45%, 75% { transform: translateX(-4px); } 30%, 60%, 90% { transform: translateX(4px); } }
.shake { animation: shake 0.4s ease-in-out; }
.form-required { color: var(--danger); margin-left: 0.15em; }
select.form-input { appearance: auto; }

/* ===== Cards ===== */
.card { background: var(--ivory); border-radius: 8px; border: 1px solid var(--champagne); padding: 1.25rem; margin-bottom: 1rem; transition: box-shadow 0.15s; }
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.card-clickable { cursor: pointer; }
.card h3 { font-family: var(--font-heading); font-size: 1.1rem; margin-bottom: 0.4rem; }
.card .card-meta { font-size: 0.85rem; color: var(--warm-gray); display: flex; gap: 1rem; flex-wrap: wrap; }
.card .card-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }

/* ===== Event List ===== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h2 { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 600; }
.event-grid { display: grid; gap: 1rem; }
.new-event-form { background: var(--ivory); border: 2px dashed var(--blush-deep); border-radius: 8px; padding: 1.25rem; margin-bottom: 1.5rem; }
.new-event-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.new-event-form .form-row .form-group { flex: 1; min-width: 180px; }

/* ===== Tables ===== */
table.data-table { width: 100%; border-collapse: collapse; background: var(--ivory); border-radius: 8px; overflow: hidden; border: 1px solid var(--champagne); }
table.data-table th, table.data-table td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid var(--champagne); }
table.data-table th { background: var(--parchment); font-weight: 600; font-size: 0.85rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
table.data-table tr:nth-child(even) td { background: var(--parchment); }
table.data-table tr:hover td { background: var(--champagne); }

/* ===== Workflow Stepper ===== */
.workflow-stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-bottom: 1.5rem; position: relative; }
.wf-step { text-align: center; padding: 0.75rem 0.5rem; cursor: pointer; position: relative; transition: transform 0.15s; }
.wf-step:hover { transform: translateY(-2px); }

/* Connecting line between steps */
.wf-step:not(:last-child)::after { content: ''; position: absolute; top: 1.5rem; left: calc(50% + 1.5rem); width: calc(100% - 3rem); height: 2px; background: var(--champagne); z-index: 0; }
.wf-step-completed:not(:last-child)::after { background: var(--sage); }

/* Step icon circle */
.wf-step-icon { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--blush) 0%, var(--champagne) 100%); display: flex; align-items: center; justify-content: center; margin: 0 auto 0.4rem; font-size: 1.2rem; position: relative; z-index: 1; transition: background 0.2s, box-shadow 0.2s; }
.wf-step-active .wf-step-icon { background: linear-gradient(135deg, var(--terracotta) 0%, var(--blush-deep) 100%); box-shadow: 0 2px 8px rgba(192, 106, 69, 0.3); }
.wf-step-completed .wf-step-icon { background: linear-gradient(135deg, var(--sage) 0%, var(--sage-light) 100%); }
.wf-step-completed.wf-step-active .wf-step-icon { background: linear-gradient(135deg, var(--terracotta) 0%, var(--blush-deep) 100%); }
.wf-step-check { color: white; font-weight: 700; font-size: 1.1rem; }

/* Step number */
.wf-step-number { font-family: var(--font-display); font-size: 1.8rem; font-weight: 300; color: var(--blush-deep); line-height: 1; margin-bottom: 0.2rem; opacity: 0.4; }
.wf-step-active .wf-step-number { color: var(--terracotta); opacity: 1; }

/* Step title */
.wf-step-title { font-family: var(--font-heading); font-size: 0.95rem; font-weight: 500; color: var(--warm-gray); }
.wf-step-active .wf-step-title { color: var(--ink); }

/* ===== Sub-Tab Bar ===== */
.sub-tab-bar { display: flex; gap: 0; border-bottom: 2px solid var(--champagne); margin-bottom: 1.5rem; }
.sub-tab-item { padding: 0.5rem 1rem; cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--warm-gray); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; background: none; border-top: none; border-left: none; border-right: none; }
.sub-tab-item:hover { color: var(--ink); }
.sub-tab-item.active { color: var(--terracotta); border-bottom-color: var(--terracotta); }

/* ===== Auth ===== */
.auth-container { max-width: 400px; margin: 3rem auto; }
.auth-container h2 { font-family: var(--font-display); text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }
.auth-container .auth-toggle { text-align: center; margin-top: 1rem; font-size: 0.9rem; color: var(--warm-gray); }
.debug-badge { text-align: center; background: #fef3c7; color: #92400e; padding: 0.3rem 0.75rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1rem; }

/* ===== Terms of Service Checkbox ===== */
.tos-group { margin-top: 0.5rem; }
.tos-label { display: flex; align-items: flex-start; gap: 0.5rem; cursor: pointer; font-weight: 400; font-size: 0.85rem; color: var(--ink-soft); }
.tos-label input[type="checkbox"] { width: 1rem; height: 1rem; margin-top: 0.15rem; flex-shrink: 0; }
.tos-label a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 2px; }
.tos-label a:hover { color: var(--terracotta-deep); }

/* ===== Social Login ===== */
.social-login-divider { text-align: center; margin: 1.5rem 0; position: relative; }
.social-login-divider::before,
.social-login-divider::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background: var(--blush-deep); }
.social-login-divider::before { left: 0; }
.social-login-divider::after { right: 0; }
.social-login-divider span { background: var(--ivory); padding: 0 0.75rem; font-size: 0.85rem; color: var(--warm-gray); position: relative; }
.social-login-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1rem; border: 1px solid var(--blush-deep); border-radius: 6px; font-size: 0.9rem; cursor: pointer; transition: background 0.15s, border-color 0.15s; background: var(--ivory); color: var(--ink-soft); width: 100%; font-family: var(--font-body); }
.btn-social:hover { background: var(--cream); border-color: var(--terracotta); }
.btn-social:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-social-google { border-color: #4285f4; }
.btn-social-google:hover:not(:disabled) { background: #f0f4ff; }
.btn-social-microsoft { border-color: #00a4ef; }
.btn-social-microsoft:hover:not(:disabled) { background: #f0f9ff; }
.btn-social-facebook { border-color: #1877f2; }
.btn-social-facebook:hover:not(:disabled) { background: #f0f4ff; }
.btn-social-apple { border-color: var(--ink); color: var(--ink); }
.btn-social-apple:hover:not(:disabled) { background: #f5f5f5; }

/* ===== Checklist ===== */
.checklist { list-style: none; }
.checklist li { padding: 0.5rem 0; display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.checklist .check-icon { display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; font-size: 0.85rem; font-weight: 700; flex-shrink: 0; }
.checklist .check-ok { background: #dcfce7; color: var(--success); }
.checklist .check-warn { color: var(--warning); }
.checklist .check-missing { background: #fee2e2; color: var(--danger); }

/* ===== Messages ===== */
.error-message { background: #fef2f2; color: var(--danger); padding: 0.75rem 1rem; border-radius: 6px; border: 1px solid #fecaca; margin-bottom: 1rem; font-size: 0.9rem; }
.spinner { display: flex; align-items: center; justify-content: center; padding: 3rem; color: var(--warm-gray); font-size: 0.95rem; }

/* ===== Utility ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--warm-gray); }
.text-sm { font-size: 0.85rem; }
.hidden { display: none; }

/* ===== Icons ===== */
.icon { width: 1em; height: 1em; vertical-align: -0.125em; }

/* ===== Guest Content Layout ===== */
.guest-content-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.guest-main { flex: 1; min-width: 0; }
.guest-edit-sidebar { width: 380px; flex-shrink: 0; }

/* ===== Guest Toolbar ===== */
.guest-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.guest-search { flex: 1; max-width: 300px; }

/* ===== Guest Table Rows ===== */
table.data-table tr.guest-row { cursor: pointer; }
table.data-table tr.guest-row.selected td { background: var(--blush); border-left: 3px solid var(--terracotta); }
table.data-table th.sortable-header { cursor: pointer; user-select: none; }
table.data-table th.sortable-header:hover { color: var(--ink); }

/* ===== Guest Edit Panel ===== */
.guest-edit-panel { background: var(--ivory); border: 1px solid var(--champagne); border-radius: 8px; padding: 1.25rem; }
.guest-edit-panel .form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.guest-edit-panel .form-row .form-group { flex: 1; min-width: 140px; }

/* ===== Checkbox Label ===== */
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-weight: 400; }
.checkbox-label input[type="checkbox"] { width: 1rem; height: 1rem; }

/* ===== Toggle Switch ===== */
.toggle-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; }
.toggle-switch { width: 2.5rem; height: 1.4rem; border-radius: 0.7rem; background: var(--champagne); position: relative; transition: background 0.2s; cursor: pointer; flex-shrink: 0; }
.toggle-switch.active { background: var(--terracotta); }
.toggle-knob { width: 1rem; height: 1rem; border-radius: 50%; background: white; position: absolute; top: 0.2rem; left: 0.2rem; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.15); }
.toggle-switch.active .toggle-knob { transform: translateX(1.1rem); }

/* ===== Tags / Badges ===== */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 99px; background: var(--champagne); color: var(--ink-soft); font-size: 0.75rem; font-weight: 500; margin-right: 0.25rem; }
.badge-optimal { background: #dcfce7; color: #166534; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.25rem; }

/* ===== Import Wizard ===== */
.import-wizard { margin-bottom: 1.5rem; }
.import-steps { display: flex; gap: 0.5rem; }
.import-step { padding: 0.3rem 0.75rem; border-radius: 99px; font-size: 0.8rem; font-weight: 500; background: var(--champagne); color: var(--warm-gray); }
.import-step.active { background: var(--terracotta); color: #fff; }
.import-mapping-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }

/* Paste divider */
.paste-divider { text-align: center; margin: 1.25rem 0; position: relative; }
.paste-divider::before,
.paste-divider::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background: var(--blush-deep); }
.paste-divider::before { left: 0; }
.paste-divider::after { right: 0; }
.paste-divider span { background: var(--ivory); padding: 0 0.75rem; font-size: 0.85rem; color: var(--warm-gray); position: relative; }

/* Paste textarea */
.paste-textarea { min-height: 120px; resize: vertical; font-family: var(--font-body); font-size: 0.9rem; line-height: 1.5; }

/* ===== Relationships ===== */
.relationship-section { background: var(--ivory); border: 1px solid var(--champagne); border-radius: 8px; padding: 1.25rem; margin-bottom: 1rem; }
.relationship-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.relationship-item { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; background: var(--parchment); border-radius: 6px; font-size: 0.9rem; }
.relationship-item > div { display: flex; flex-direction: column; gap: 0.15rem; }
.relationship-name { font-weight: 500; }
.relationship-form { border-top: 1px solid var(--champagne); padding-top: 0.75rem; }
.relationship-form .form-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.relationship-form .form-row .form-group { flex: 1; min-width: 140px; }

/* ===== Member Checklist ===== */
.member-checklist { max-height: 200px; overflow-y: auto; border: 1px solid var(--champagne); border-radius: 6px; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.15rem; }
.member-checklist .checkbox-label { padding: 0.35rem 0.25rem; border-radius: 4px; }
.member-checklist .checkbox-label:hover { background: var(--parchment); }

/* ===== Dialog / Overlay ===== */
.dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.dialog { background: var(--ivory); border-radius: 8px; padding: 1.5rem; max-width: 400px; width: 90%; box-shadow: 0 4px 24px rgba(0,0,0,0.15); }

/* ===== Guest Footer ===== */
.guest-footer { padding: 0.5rem 0; }

/* ===== Table Layout ===== */
.table-layout-container { display: flex; flex-direction: column; gap: 1rem; }
.table-summary-bar { display: flex; align-items: center; gap: 1rem; padding: 0.5rem 0.75rem; background: var(--parchment); border-radius: 6px; border: 1px solid var(--champagne); }
.summary-warning { color: var(--warning); font-weight: 500; }
.summary-warning-icon { color: var(--warning); font-weight: 500; font-size: 0.85rem; }
.table-toolbar { display: flex; align-items: center; justify-content: flex-start; }
.table-edit-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.table-edit-form .form-row .form-group { flex: 1; min-width: 160px; }
.table-config-row td { vertical-align: middle; }
.table-actions { display: flex; gap: 0.35rem; }
.honor-badge { background: #fef3c7; color: #92400e; }

/* ===== Rule Editor ===== */
.rule-editor-container { display: flex; flex-direction: column; gap: 1rem; }
.rule-section { margin-bottom: 0; }
.culture-preset-select { max-width: 280px; }
.culture-description { margin-top: 0.5rem; font-style: italic; }

/* ===== Weight Sliders ===== */
.weight-sliders { display: flex; flex-direction: column; gap: 0.5rem; }
.weight-slider-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0; }
.weight-label { width: 200px; flex-shrink: 0; font-size: 0.9rem; color: var(--ink-soft); }
.weight-slider-control { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.weight-slider { flex: 1; height: 6px; -webkit-appearance: none; appearance: none; background: var(--champagne); border-radius: 3px; outline: none; }
.weight-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--terracotta); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.weight-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--terracotta); cursor: pointer; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.weight-value { width: 28px; text-align: center; font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.weight-slider-row.weight-disabled .weight-label { color: var(--warm-gray); text-decoration: line-through; }
.weight-slider-row.weight-disabled .weight-slider { opacity: 0.4; }
.weight-slider-row.weight-disabled .weight-slider::-webkit-slider-thumb { background: var(--warm-gray); }
.weight-slider-row.weight-disabled .weight-slider::-moz-range-thumb { background: var(--warm-gray); }
.weight-slider-row.weight-disabled .weight-value { color: var(--warm-gray); }

/* ===== Empty Seat Strategy Slider ===== */
.empty-seat-slider-row { display: flex; align-items: center; gap: 0.75rem; }
.empty-seat-slider-row .weight-label { width: auto; white-space: nowrap; }
.empty-seat-slider { max-width: 140px; }
.empty-seat-slider-row .weight-value { width: auto; min-width: 90px; }

/* ===== Rule Form ===== */
.rule-form { margin-top: 0.75rem; border-top: 1px solid var(--champagne); padding-top: 0.75rem; }
.rule-form .form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.rule-form .form-row .form-group { flex: 1; min-width: 180px; }

/* ===== Arrangement View ===== */
.arrangement-view { display: flex; flex-direction: column; gap: 1rem; }

/* Validation */
.validation-issues { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.validation-issue { padding: 0.4rem 0.75rem; border-radius: 6px; font-size: 0.9rem; }
.validation-blocking { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.validation-warning { background: #fffbeb; color: var(--warning); border: 1px solid #fde68a; }

/* Arrange spinner */
.arrange-spinner { width: 20px; height: 20px; border: 3px solid var(--champagne); border-top-color: var(--terracotta); border-radius: 50%; animation: spin 0.7s linear infinite; }
.arrange-spinner-sm { width: 14px; height: 14px; border: 2px solid var(--champagne); border-top-color: var(--terracotta); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Arrangement progress step list */
.progress-step-list { list-style: none; display: flex; flex-direction: column; gap: 0.35rem; padding: 0; margin: 0; }
.progress-step { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; font-size: 0.9rem; }
.progress-step-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; font-weight: 700; }
.progress-step-done .progress-step-icon { color: var(--success); }
.progress-step-done .progress-step-text { color: var(--ink); }
.progress-step-current .progress-step-text { color: var(--ink); font-weight: 500; }
.progress-step-pending .progress-step-text { color: var(--warm-gray); }
.progress-step-pending .progress-step-icon { visibility: hidden; }

/* Arrangement grid (3 across) */
.arrangement-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* Arrangement card */
.arrangement-card { display: flex; flex-direction: column; gap: 0.75rem; }
.arrangement-card.arrangement-selected { border-color: var(--terracotta); box-shadow: 0 0 0 2px rgba(192,106,69,0.15); }
.arrangement-card-header { display: flex; align-items: center; justify-content: space-between; }
.arrangement-card-header h4 { margin: 0; font-size: 1rem; }
.arrangement-selected-badge { background: var(--blush); color: var(--terracotta-deep); }
.arrangement-score-row { display: flex; align-items: center; justify-content: space-between; }
.arrangement-score { font-size: 1.4rem; font-weight: 700; }
.score-good { color: var(--success); }
.score-fair { color: var(--warning); }
.score-poor { color: var(--danger); }
.arrangement-violations { display: flex; flex-direction: column; gap: 0.3rem; }
.arrangement-violation-row { display: flex; align-items: center; justify-content: space-between; font-size: 0.85rem; }
.violation-count { font-weight: 600; }
.violation-hard { color: var(--danger); }
.violation-soft { color: var(--warning); }
.arrangement-card-actions { display: flex; gap: 0.5rem; }
.arrangement-penalty-details { font-size: 0.8rem; }
.penalty-details-toggle { cursor: pointer; color: var(--warm-gray); }
.penalty-details-toggle:hover { color: var(--ink-soft); }
.penalty-detail-list { margin: 0.25rem 0 0 0; padding-left: 1.2rem; }
.penalty-detail-list li { color: var(--warm-gray); line-height: 1.4; }

/* ===== Arrangement Preview ===== */
.arrangement-preview { margin-top: 1.5rem; padding: 1.25rem; background: var(--ivory); border: 1px solid var(--champagne); border-radius: 8px; }
.arrangement-preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.arrangement-preview-title { font-size: 1rem; font-weight: 600; color: var(--ink-soft); margin: 0; }

/* ===== Arrangement Detail ===== */
.arrangement-detail { display: flex; flex-direction: column; gap: 1rem; }
.arrangement-detail-header { display: flex; align-items: center; gap: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--champagne); }
.arrangement-detail-stats { display: flex; gap: 1.5rem; }
.arrangement-detail-layout { display: flex; gap: 1.5rem; align-items: flex-start; }
.arrangement-tables-area { flex: 1; display: flex; flex-wrap: wrap; gap: 3rem; align-items: flex-start; }
.arrangement-detail-sidebar { width: 280px; flex-shrink: 0; }

/* Table visuals */
.table-visual { border: 2px solid var(--champagne); border-radius: 8px; padding: 1rem; background: var(--ivory); cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.table-visual:hover { border-color: var(--warm-gray); }
.table-visual-selected { border-color: var(--terracotta); box-shadow: 0 0 0 2px rgba(192,106,69,0.15); }
.table-center-label { text-align: center; font-weight: 600; font-size: 0.85rem; color: var(--ink-soft); }

/* Round table */
.table-round { position: relative; border-radius: 50%; }
.round-seats { position: absolute; inset: 0; }
.round-seat-wrapper { position: absolute; transform: translate(-50%, -50%); }

/* Rectangular table */
.table-rect { display: flex; flex-direction: column; gap: 0.25rem; border-radius: 8px; }
.rect-side { display: flex; justify-content: center; gap: 0.25rem; flex-wrap: wrap; }
.rect-middle { display: flex; align-items: center; gap: 0.25rem; }
.rect-left, .rect-right { display: flex; flex-direction: column; gap: 0.25rem; }
.rect-middle .table-center-label { flex: 1; padding: 0.5rem; }

/* One-sided table */
.table-onesided { width: auto; min-width: 200px; border-radius: 8px; border-bottom: 4px solid var(--warm-gray); }
.onesided-seats { display: flex; gap: 0.25rem; justify-content: center; flex-wrap: wrap; }

/* Seat boxes */
.seat-box { width: 56px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--blush-deep); border-radius: 4px; background: var(--parchment); cursor: pointer; transition: background 0.15s, border-color 0.15s; overflow: hidden; }
.seat-box:hover { border-color: var(--terracotta); background: var(--blush); }
.seat-box.seat-selected { border-color: var(--terracotta); background: var(--blush); box-shadow: 0 0 0 2px rgba(192,106,69,0.2); }
.seat-box.seat-empty { background: var(--parchment); border-style: dashed; }
.seat-label { font-size: 0.65rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }

/* Family colors — functional, keep as-is */
.family-color-0 { background: #dbeafe; border-color: #93c5fd; } /* blue */
.family-color-1 { background: #dcfce7; border-color: #86efac; } /* green */
.family-color-2 { background: #ffedd5; border-color: #fdba74; } /* orange */
.family-color-3 { background: #f3e8ff; border-color: #c4b5fd; } /* purple */
.family-color-4 { background: #fee2e2; border-color: #fca5a5; } /* red */
.family-color-5 { background: #ccfbf1; border-color: #5eead4; } /* teal */
.family-color-6 { background: #fce7f3; border-color: #f9a8d4; } /* pink */
.family-color-7 { background: #fef3c7; border-color: #fcd34d; } /* amber */
.family-color-8 { background: #e0e7ff; border-color: #a5b4fc; } /* indigo */
.family-color-9 { background: #ecfccb; border-color: #bef264; } /* lime */

/* Detail info panels */
.detail-info-panel { font-size: 0.9rem; }
.detail-info-table { width: 100%; border-collapse: collapse; }
.detail-info-table td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--parchment); }
.detail-info-table td:first-child { font-weight: 500; color: var(--ink-soft); width: 80px; }
.detail-guest-list { list-style: none; margin-top: 0.25rem; }
.detail-guest-list li { padding: 0.15rem 0; font-size: 0.85rem; }

/* ===== Arrangement Edit Mode ===== */
.arrangement-edit-mode { background: #fefce8; border: 2px solid #fde68a; border-radius: 8px; padding: 1rem; }
.edit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0.75rem; background: var(--ivory); border: 1px solid var(--champagne); border-radius: 6px; }
.edit-toolbar-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.edit-toolbar-status { display: flex; gap: 1rem; align-items: center; }
.edit-status-bar { padding: 0.4rem 0.75rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; font-size: 0.85rem; color: #92400e; display: flex; align-items: center; gap: 0.5rem; }

/* Seat states in edit mode */
.seat-box.seat-swap-first { border-color: #f59e0b; background: #fef3c7; box-shadow: 0 0 0 3px rgba(245,158,11,0.3); animation: pulse-swap 1s ease-in-out infinite; }
@keyframes pulse-swap { 0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.3); } 50% { box-shadow: 0 0 0 5px rgba(245,158,11,0.15); } }
.seat-box.seat-swappable { cursor: crosshair; }
.seat-box.seat-swappable:hover { border-color: #f59e0b; background: #fef9c3; }
.seat-box.seat-locked { border-color: var(--danger); background: #fee2e2; position: relative; }
.seat-box.seat-locked:hover { border-color: var(--danger); background: #fecaca; }

/* Lock button on each seat */
.seat-lock-btn { position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--blush-deep); background: var(--parchment); color: var(--warm-gray); font-size: 0.5rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; z-index: 1; }
.seat-lock-btn:hover { background: var(--champagne); }
.seat-lock-btn.seat-lock-active { background: var(--danger); color: #fff; border-color: var(--danger); }
.seat-lock-btn.seat-lock-active:hover { background: #b91c1c; }

/* Seat box needs relative positioning for lock button */
.arrangement-edit-mode .seat-box { position: relative; }

/* ===== Export Panel ===== */
.export-panel { display: flex; flex-direction: column; gap: 1rem; }
.export-no-arrangement { padding: 2rem; text-align: center; }
.export-arrangement-info { display: flex; align-items: center; gap: 0.75rem; }
.export-section-title { font-size: 1rem; font-weight: 600; color: var(--ink-soft); padding-bottom: 0.25rem; border-bottom: 1px solid var(--champagne); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-top: 0.75rem; }
.export-card { display: flex; flex-direction: column; justify-content: space-between; gap: 0.75rem; padding: 1rem; }
.export-card-body { display: flex; gap: 0.75rem; align-items: flex-start; }
.export-card-icon { flex-shrink: 0; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--blush); border-radius: 8px; font-size: 0.7rem; font-weight: 600; color: var(--terracotta); }
.export-icon-pdf { color: var(--danger) !important; background: #fef2f2 !important; }
.export-icon-csv { color: var(--success) !important; background: #f0fdf4 !important; }
.export-card-info h4 { font-size: 0.95rem; margin-bottom: 0.15rem; }
.export-card .btn { align-self: flex-end; }

/* ===== Floor Plan SVG Classes ===== */
.floor-canvas-bg { fill: var(--cream); }
.floor-grid-line { stroke: var(--champagne); stroke-width: 0.5; }
.floor-table { fill: var(--parchment); stroke: var(--warm-gray); stroke-width: 1.5; }
.floor-table-selected { fill: var(--blush); stroke: var(--terracotta); stroke-width: 2.5; }
.floor-table-honor { fill: #fef3c7; stroke: #d97706; stroke-width: 1.5; }
.floor-table-name { fill: var(--ink); font-size: 14px; font-weight: 600; }
.floor-table-capacity { fill: var(--warm-gray); font-size: 11px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .app-content { padding: 1rem; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .new-event-form .form-row { flex-direction: column; }
    .card .card-meta { flex-direction: column; gap: 0.3rem; }
    .wf-step-icon { width: 36px; height: 36px; font-size: 0.9rem; }
    .wf-step-number { font-size: 1.2rem; }
    .wf-step-title { font-size: 0.8rem; }
    .wf-step:not(:last-child)::after { display: none; }
    .sub-tab-bar { overflow-x: auto; }
    .guest-content-layout { flex-direction: column; }
    .guest-edit-sidebar { width: 100%; }
    .guest-toolbar { flex-direction: column; align-items: stretch; }
    .guest-search { max-width: 100%; }
    .import-mapping-grid { grid-template-columns: 1fr; }
    .relationship-form .form-row { flex-direction: column; }
    .guest-edit-panel .form-row { flex-direction: column; }
    .table-edit-form .form-row { flex-direction: column; }
    .rule-form .form-row { flex-direction: column; }
    .weight-slider-row { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
    .weight-label { width: 100%; }
    .weight-slider-control { width: 100%; }
    .arrangement-grid { grid-template-columns: 1fr; }
    .arrangement-detail-layout { flex-direction: column; }
    .arrangement-detail-sidebar { width: 100%; }
    .arrangement-detail-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .arrangement-detail-stats { flex-wrap: wrap; }
    .export-grid { grid-template-columns: 1fr; }
    .floor-plan-canvas-container { min-height: 300px; }
    .arrangement-list-view { max-width: 100%; }
}

/* ===== Floor Plan Editor ===== */
.floor-plan-editor { }
.floor-plan-toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.floor-plan-snap-label { display: flex; align-items: center; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-soft); cursor: pointer; }
.floor-plan-snap-label input[type="checkbox"] { cursor: pointer; }
.floor-plan-rotate-group { display: inline-flex; align-items: center; gap: 0.3rem; }
.floor-plan-rotation-display { font-size: 0.8rem; color: var(--warm-gray); min-width: 50px; text-align: center; }
.floor-plan-canvas-container { background: var(--ivory); border: 1px solid var(--champagne); border-radius: 8px; overflow: hidden; }
.floor-plan-svg { width: 100%; height: auto; min-height: 500px; display: block; user-select: none; }
/* ===== Arrangement View Toggle ===== */
.arrangement-view-toggle { display: inline-flex; gap: 0.25rem; }

/* ===== Arrangement List View ===== */
.arrangement-list-view { max-width: 500px; display: flex; flex-direction: column; gap: 1rem; }
.list-view-table { background: var(--ivory); border: 1px solid var(--champagne); border-radius: 8px; padding: 0.75rem 1rem; }
.list-view-table-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--champagne); }
.list-view-guest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.15rem; }
.list-view-guest-item { padding: 0.25rem 0.5rem; font-size: 0.9rem; border-radius: 4px; }
.list-view-guest-item:nth-child(even) { background: var(--parchment); }
.list-view-empty-seat { color: var(--warm-gray); font-style: italic; }

/* ===== Language Switcher ===== */
.lang-switcher {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    cursor: pointer;
}
.lang-switcher:focus { outline: none; border-color: var(--terracotta); }

.floor-plan-table { cursor: grab; }
.floor-plan-table.dragging { cursor: grabbing; }

/* Account Settings Page */
.account-container { max-width: 600px; margin: 2rem auto; padding: 0 1rem; }
.account-container h2 { font-family: var(--font-display); margin-bottom: 1.5rem; font-size: 1.5rem; }
.account-section { margin-bottom: 1.5rem; }
.account-section h3 { margin-bottom: 1rem; font-size: 1.1rem; font-weight: 600; }
.danger-zone { border-color: #e53e3e; }
.danger-zone h3 { color: #e53e3e; }
.danger-warning { color: #e53e3e; font-size: 0.9rem; margin-bottom: 1rem; }
.form-hint { color: var(--warm-gray); font-size: 0.85rem; margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.5rem; }
.btn-danger { background: #e53e3e; color: #fff; border: none; padding: 0.5rem 1rem; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-danger:hover { background: #c53030; }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }
.connected-providers-list { list-style: none; padding: 0; }
.connected-providers-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--warm-beige); }
.nav-user-name { color: #fff; text-decoration: none; margin-right: 0.5rem; }
.nav-user-name:hover { text-decoration: underline; }
