/* ==========================================================================
   FİYAT TEKLİFİ YÖNETİM MERKEZİ - CSS SİSTEMİ
   Kurumsal Mimarlık & Mühendislik Arayüzü (Yuzel Tasarım Kimliği)
   Birebir Çok Sayfalı A4 Belge Motoru
   ========================================================================== */

:root {
  /* Açık Tema (Varsayılan - Yuzel Tasarım Kurumsal Kimliği) */
  --bg-app: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f8fafc;
  --bg-input: #ffffff;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #f48813;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  --accent-amber: #f48813;
  --accent-amber-glow: rgba(244, 136, 19, 0.15);
  --accent-navy: #212d45;
  --accent-blue: #2563eb;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-whatsapp: #25D366;

  /* Excel / Resmi Belge Renkleri */
  --excel-header-gold: #FFCC66;
  --excel-header-gray: #EAEAEA;
  --excel-border: #808080;
  --excel-light-border: #DCDCDC;
  --excel-text: #1a1a1a;
  --excel-subtext: #444444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  --font-sans: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-display: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono: Arial, 'Helvetica Neue', Helvetica, sans-serif;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card: 0 4px 16px -2px rgba(0, 0, 0, 0.07);
  --shadow-paper: 0 12px 36px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Koyu Tema Değişkenleri */
[data-theme="dark"] {
  --bg-app: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --bg-input: #0f172a;
  --border-subtle: #334155;
  --border-strong: #475569;
  --border-focus: #f48813;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-paper: 0 16px 40px rgba(0, 0, 0, 0.6);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   TOP HEADER
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-left .brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-logo {
  height: 38px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.brand-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text-main);
  display: block;
}
.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  font-weight: 500;
}

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

/* Minimal Theme Switcher (Icon Only) */
.theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s ease;
}
.theme-btn:hover {
  border-color: var(--accent-amber);
  transform: scale(1.05);
}
[data-theme="light"] .theme-icon-light { display: none; }
[data-theme="light"] .theme-icon-dark { display: inline-block; }
[data-theme="dark"] .theme-icon-light { display: inline-block; }
[data-theme="dark"] .theme-icon-dark { display: none; }

/* Mobile Tab Switcher */
.mobile-tab-switch {
  display: none;
  background: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 4px;
}
.mobile-tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.mobile-tab-btn.active {
  background: var(--bg-surface);
  color: var(--accent-amber);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   BUTTONS & INPUTS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent-amber);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(244, 136, 19, 0.25);
}
.btn-primary:hover {
  background: #e0790d;
}
.btn-secondary {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-secondary:hover {
  border-color: var(--border-strong);
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}
.btn-outline {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-subtle);
}
.btn-outline:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.btn-success {
  background: #10b981;
  color: #ffffff;
}
.btn-success:hover {
  background: #059669;
}
.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
}
.btn-whatsapp:hover {
  background: #1eb957;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-xs {
  padding: 4px 9px;
  font-size: 11px;
}
.link-action-btn {
  background: transparent;
  border: none;
  color: var(--accent-amber);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-action-btn:hover {
  text-decoration: underline;
}

/* ==========================================================================
   WORKSPACE GRID (TWO COLUMNS - NO HORIZONTAL SCROLL)
   ========================================================================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 500px 1fr;
  flex: 1;
  min-height: calc(100vh - 63px);
  width: 100%;
  overflow-x: hidden;
}

/* LEFT CONTROLS PANEL */
.control-panel {
  background: var(--bg-app);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 20px 130px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 63px);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.panel-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 100%;
  overflow: visible;
  position: relative;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.card-head.space-between {
  justify-content: space-between;
}
.card-head .head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head .head-actions-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-amber);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-head h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.panel-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
}

/* ==========================================================================
   1. PROFİL SEÇİCİ
   ========================================================================== */
.profile-toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
.profile-opt {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.profile-opt:hover {
  border-color: var(--border-strong);
}
.profile-opt.active {
  border-color: var(--accent-amber);
  background: var(--bg-surface);
  box-shadow: 0 4px 12px var(--accent-amber-glow);
}
.prof-icon {
  font-size: 20px;
  line-height: 1;
  margin-top: 2px;
}
.prof-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}
.prof-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}
.prof-tel {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-amber);
  margin-top: 4px;
  font-weight: 600;
}
.prof-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-amber);
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.18s ease;
  pointer-events: none;
}
.profile-opt.active .prof-check {
  opacity: 1;
  transform: scale(1);
}

/* ==========================================================================
   FORM ELEMANLARI
   ========================================================================== */
.form-group {
  margin-bottom: 12px;
  width: 100%;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
textarea,
select,
.form-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.18s ease;
}
input:focus, textarea:focus, select:focus, .form-input:focus {
  border-color: var(--border-focus);
}

/* Client Input & Quick Dropdown */
.client-input-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  width: 100%;
}
.client-input-wrapper input {
  flex: 1;
}

/* Generic Dropdown System */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
}
.dropdown-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
}
.dropdown-toggle-btn:hover {
  border-color: var(--accent-amber);
}

/* Kalem Fiyatlarını Gizleme / Gösterme Göz Butonu (Paket Fiyat Modu) */
.btn-price-eye {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.btn-price-eye:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.btn-price-eye.active {
  background: rgba(245, 158, 11, 0.16);
  border-color: var(--accent-amber, #f59e0b);
  color: var(--accent-amber, #f59e0b);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.22);
}
.btn-price-eye svg {
  display: block;
}
.btn-price-eye svg.hidden {
  display: none !important;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 200px;
  max-width: 320px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  padding: 4px;
}
.dropdown-menu-right {
  left: auto !important;
  right: 0 !important;
}
#clientDropdownMenu {
  right: 0 !important;
  left: auto !important;
  min-width: 220px;
  max-width: min(340px, calc(100vw - 32px));
}
.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dropdown-item:hover {
  background: var(--bg-surface-elevated);
  color: var(--accent-amber);
}
.dropdown-item .item-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 4px 0;
}

/* ==========================================================================
   KALEMLER LİSTESİ (ITEMS EDITOR - NO HORIZONTAL SCROLL)
   ========================================================================== */
.items-editor-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 14px;
  width: 100%;
}
.item-editor-row {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: border-color 0.18s ease;
  width: 100%;
}
.item-editor-row:hover {
  border-color: var(--border-strong);
}
.item-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
/* Number input spinner gizleme */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

.item-name-input {
  flex: 1 1 auto !important;
  min-width: 180px !important;
  font-weight: 600;
}
.item-price-input {
  flex: 0 0 115px !important;
  width: 115px !important;
  min-width: 115px !important;
  max-width: 115px !important;
  font-family: var(--font-mono);
  font-weight: 700;
  text-align: right;
}
.item-del-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.item-del-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
}
.item-row-note-toggle {
  margin-top: 6px;
}
.note-toggle-btn {
  background: transparent;
  border: none;
  color: var(--accent-amber);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.note-toggle-btn:hover {
  text-decoration: underline;
}
.item-desc-wrapper {
  margin-top: 8px;
}
.item-desc-input {
  width: 100%;
  font-size: 12px;
  resize: vertical;
}

/* Kalem Listesi Alt Ekleme Butonları */
.items-editor-bottom-bar {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 12px;
}

/* Canlı Toplam Şeridi */
.live-total-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--accent-amber);
  border-radius: var(--radius-md);
  gap: 10px;
  width: 100%;
}
.total-label-box {
  display: flex;
  flex-direction: column;
}
.ribbon-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-main);
}
.ribbon-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 2px;
}
.total-amount-display {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-amber);
  white-space: nowrap;
}

/* ==========================================================================
   4. HAZIR NOT ŞABLONLARI LİSTESİ & ÖZET
   ========================================================================== */
.notes-active-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.note-summary-chip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border-left: 3px solid var(--accent-amber);
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-main);
}
.note-summary-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-md);
}

.notes-selector-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.note-select-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all 0.18s ease;
  width: 100%;
}
.note-select-card.active {
  border-color: var(--accent-amber);
  background: var(--bg-surface);
}
.note-checkbox {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent-amber);
  flex-shrink: 0;
}
.note-text-edit {
  flex: 1;
  font-size: 12px;
  color: var(--text-main);
  outline: none;
  min-width: 0;
  line-height: 1.4;
}
.note-text-edit:focus {
  background: var(--bg-surface-elevated);
  border-radius: 4px;
}
.note-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  flex-shrink: 0;
}
.note-del-btn:hover {
  color: var(--accent-red);
}

/* ==========================================================================
   5. TEKLİF EKLERİ & GÖRSELLER PANELİ
   ========================================================================== */
.attachment-count-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-amber);
}
.attachment-controls-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.attachment-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  background: var(--bg-surface-elevated);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.attachment-upload-zone:hover {
  border-color: var(--accent-amber);
  background: var(--accent-amber-glow);
}
.attachment-upload-zone svg {
  color: var(--accent-amber);
  flex-shrink: 0;
}
.upload-zone-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}
.upload-zone-text strong {
  font-size: 12px;
  color: var(--text-main);
}
.upload-zone-text span {
  font-size: 10.5px;
  color: var(--text-muted);
}
.attachment-thumbnails-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.attachment-thumb-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.attachment-thumb-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.attachment-preview-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.attachment-caption-input {
  flex: 1;
  font-size: 11.5px;
  padding: 6px 8px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--text-main);
}
.attachment-caption-input:focus {
  outline: none;
  border-color: var(--accent-amber);
}
.attachment-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px dashed var(--border-subtle);
}
.att-tool-buttons {
  display: flex;
  gap: 4px;
  align-items: center;
}
.btn-att-tool {
  padding: 3px 7px;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.btn-att-tool:hover {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.att-savings-badge {
  font-size: 9.5px;
  font-family: var(--font-mono);
  color: #10b981;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Canlı Objektif Sıkıştırma Rapor Kutusu */
.attachment-compression-summary {
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--accent-amber);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  margin-bottom: 6px;
  gap: 8px;
}
.compress-stats-info {
  display: flex;
  flex-direction: column;
}
.compress-stats-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-amber);
}
.compress-stats-detail {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 1px;
}
.compress-stats-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.compress-chip {
  font-size: 11px;
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
}
.compress-chip-arrow {
  font-size: 11px;
  color: var(--text-muted);
}
.compress-chip.highlight {
  border-color: #10b981;
  color: #10b981;
}
.compress-chip.badge-chip {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
  font-weight: 700;
}

/* Toplu Kalem Modalı Stilleri */
.bulk-section-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.bulk-preset-checklist {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
}
.bulk-preset-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 4px 6px;
  border-radius: 4px;
}
.bulk-preset-item:hover {
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   ALT SABİT AKSİYON ÇUBUĞU (BOTTOM ACTION BAR)
   ========================================================================== */
.bottom-action-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 500px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  z-index: 40;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.btn-action {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

/* ==========================================================================
   SAĞ ALAN: BİREBİR A4 KAĞIT MOTORU & ÇOK SAYFALI ÖNİZLEME
   ========================================================================== */
.preview-stage {
  background: #cbd5e1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 63px);
  overflow: hidden;
  position: relative;
}
[data-theme="dark"] .preview-stage {
  background: #1e293b;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 20;
}
.stage-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stage-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.page-count-badge {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.stage-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
#zoomPercentDisplay {
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  min-width: 42px;
  text-align: center;
}

/* Paper Viewport & Multi-Page Wrapper */
.paper-viewport {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding: 30px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
}
.a4-pages-wrapper {
  display: flex;
  flex-direction: column;
  gap: 30px;
  transform-origin: top center;
  transition: transform 0.15s ease;
}

/* Birebir Standart A4 Kağıt (210mm x 297mm) */
.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  height: 297mm;
  background: #ffffff;
  color: var(--excel-text);
  padding: 14mm 16mm 12mm 16mm;
  box-shadow: var(--shadow-paper);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

/* A4 Sheet Header */
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.header-company-col {
  display: flex;
  gap: 14px;
  max-width: 62%;
}
.sheet-logo-box {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sheet-logo-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.sheet-company-meta {
  display: flex;
  flex-direction: column;
}
.sheet-company-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #111827;
  line-height: 1.2;
}
.sheet-person-name {
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2px;
}
.sheet-person-title {
  font-size: 11px;
  color: #4b5563;
  font-weight: 500;
}
.sheet-address-line {
  font-size: 9.5px;
  color: #4b5563;
  margin-top: 4px;
  line-height: 1.35;
}
.sheet-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  color: #1f2937;
  margin-top: 3px;
  font-family: var(--font-mono);
}

/* A4 Sheet Client Box (Sağ Taraf) */
.header-client-col {
  border: 1.5px solid #000000;
  border-radius: 4px;
  min-width: 200px;
  max-width: 230px;
  text-align: center;
  background: #ffffff;
  overflow: hidden;
}
.client-badge-header {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #000000;
  padding: 3px 0;
  background: #fafafa;
}
.client-name-display {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
  color: #000000;
  border-bottom: 1px solid #e5e7eb;
}
.sheet-doc-meta-table {
  padding: 4px 8px;
  font-size: 9.5px;
}
.doc-meta-row {
  display: flex;
  justify-content: space-between;
  line-height: 1.4;
}
.doc-meta-lbl {
  color: #6b7280;
  font-weight: 500;
}
.doc-meta-val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: #111827;
}

/* İletişim Turuncu Vektör İkonları */
.sheet-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f48813;
  margin-right: 4px;
  vertical-align: middle;
}
.sheet-icon-wrap svg {
  stroke: #f48813;
}

/* Bütünleşik Oval Çerçeveli Tablo */
.sheet-unified-table {
  border: 1.5px solid #000000;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
  margin-bottom: 4px;
  background: #ffffff;
}
.excel-header-bar-unified {
  display: flex;
  background-color: var(--excel-header-gold);
  border-bottom: 1.5px solid #000000;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  color: #000000;
}
.bar-col-left { flex: 1; }
.bar-col-right { width: 120px; text-align: right; }

/* Tablo Satırları */
.sheet-table-body {
  background: #ffffff;
}
.sheet-table-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--excel-light-border);
  padding: 3.5px 10px;
  font-size: 10px;
}
.sheet-table-row:last-child {
  border-bottom: none;
}
.sheet-row-left {
  flex: 1;
  padding-right: 12px;
}
.sheet-item-title {
  font-weight: 700;
  color: #000000;
}
.sheet-item-desc {
  font-size: 8.5px;
  color: #555555;
  margin-top: 1px;
  line-height: 1.25;
}
.sheet-item-price {
  width: 120px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  color: #000000;
}
.sheet-item-price.empty-price {
  font-style: italic;
  font-size: 9px;
  color: #666666;
  font-weight: 500;
}

/* Oval Çerçeveli Sağ Toplam Tutar Kutusu (Sol Boş Kutu Yok) */
.sheet-total-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin-top: 4px;
}
.sheet-total-right-box {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #000000;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}
.sheet-total-label {
  padding: 4px 12px;
  background: var(--excel-header-gold);
  border-right: 1.5px solid #000000;
  font-size: 10px;
  font-weight: 800;
  color: #000000;
}
.sheet-total-val {
  padding: 4px 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  color: #000000;
  text-align: right;
  min-width: 100px;
}
.sheet-words-row {
  margin-top: 3px;
  font-size: 9px;
  font-style: italic;
  color: #333333;
  width: 100%;
  text-align: left;
}
.words-lbl { font-weight: 700; }

/* Genel Şartlar Bölümü */
.sheet-notes-section {
  border: 1px solid #999999;
  border-radius: 3px;
  padding: 6px 8px;
  margin-top: 6px;
  background: #fafafa;
}
.sheet-notes-title {
  font-size: 9px;
  font-weight: 800;
  margin-bottom: 3px;
}
.sheet-notes-list {
  padding-left: 14px;
  font-size: 8px;
  line-height: 1.35;
  color: #333333;
}

/* İMZA VE KAŞE BLOKLARI */
/* 1. Sayfa Kompakt Paraf / Onay Bloğu */
.sheet-paraf-section {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 6px;
  border-top: 1px dashed #cccccc;
}
.paraf-box {
  width: 48%;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #999999;
  padding-bottom: 4px;
}
.paraf-lbl { font-weight: 700; color: #444444; }
.paraf-line { color: #888888; font-style: italic; }

/* 2. Sayfa (veya Tek Sayfa) Tam İmza / Kaşe Blokları */
.sheet-signatures-section {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  gap: 12px;
}
.sig-block {
  flex: 1;
  border: 1px solid #999999;
  border-radius: 4px;
  padding: 6px 8px;
  text-align: center;
  background: #ffffff;
}
.sig-role {
  font-size: 9px;
  font-weight: 700;
  color: #666666;
  border-bottom: 1px solid #eeeeee;
  padding-bottom: 2px;
  margin-bottom: 3px;
}
.sig-name {
  font-size: 10.5px;
  font-weight: 800;
  color: #000000;
}
.sig-person {
  font-size: 9px;
  color: #444444;
}
.sig-line {
  margin-top: 18px;
  border-top: 1px dashed #999999;
  padding-top: 3px;
  font-size: 8.5px;
  color: #666666;
}

/* Sheet Footer */
.sheet-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  color: #777777;
  border-top: 1px solid #e5e7eb;
  padding-top: 6px;
  margin-top: auto;
}

/* ==========================================================================
   A4 TEKLİF EKLERİ VE PROJE GÖRSELLERİ SAYFALARI
   ========================================================================== */
.sheet-attach-table {
  border: none;
  border-radius: 0;
  overflow: visible;
  margin-top: 4px;
  margin-bottom: 4px;
  background: transparent;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.sheet-attach-bar {
  background-color: var(--excel-header-gold);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 800;
  padding: 4px 10px;
  color: #000000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.sheet-attach-body {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 720px;
  padding: 0;
  margin: 0;
  background: transparent;
}
.sheet-attachment-card {
  position: absolute;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  user-select: none;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  cursor: move;
}
.sheet-attachment-card.transform-active {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 8px 24px rgba(0,0,0,0.14);
  z-index: 50 !important;
}
.sheet-attachment-card.is-moving {
  cursor: grabbing !important;
  box-shadow: 0 0 0 2px #3b82f6, 0 12px 32px rgba(59, 130, 246, 0.25) !important;
  opacity: 0.95;
}
.sheet-attachment-card:hover {
  border-color: #94a3b8;
}
.sheet-attach-img-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 4px;
  overflow: hidden;
  position: relative;
  cursor: grab;
  user-select: none;
}
.sheet-attach-img-box.is-dragging {
  cursor: grabbing !important;
}

/* Görsel Sahnesi: Resim ve doğrudan köşelerindeki 4 tutamacı bir arada tutar */
.sheet-attach-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  transform-origin: center center;
  transition: transform 0.05s ease-out;
  user-select: none;
}
.sheet-attach-stage .sheet-attach-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.sheet-attach-caption {
  background: #f1f5f9;
  border-top: 1px solid #e2e8f0;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  z-index: 10;
  cursor: grab;
}
.sheet-attach-caption:active {
  cursor: grabbing;
}
.sheet-attachment-page .sheet-signatures-section {
  margin-top: auto;
  margin-bottom: 2px;
}
.sheet-attachment-page .sheet-footer {
  margin-top: 2px;
  padding-top: 4px;
}

/* Floating Photoshop Transform Overlay Controls */
.transform-overlay-controls {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.sheet-attachment-card:hover .transform-overlay-controls,
.sheet-attachment-card.transform-active .transform-overlay-controls {
  display: flex;
}
.btn-tr-tool {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2.5px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-tr-tool:hover {
  background: #f59e0b;
  color: #000000;
}
.btn-tr-tool.page-btn {
  background: #f59e0b;
  color: #000000;
  font-weight: 800;
}
.btn-tr-tool.page-btn:hover {
  background: #d97706;
  color: #ffffff;
}
.card-page-select {
  background: rgba(15, 23, 42, 0.9);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 4px;
  cursor: pointer;
  outline: none;
}
.card-page-select option {
  background: #1e293b;
  color: #ffffff;
}

/* AutoCAD Viewport Pencere 4 Köşe Boyutlandırma Tutamaçları */
.card-corner-resize {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  z-index: 32;
  opacity: 0;
  transition: opacity 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.sheet-attachment-card:hover .card-corner-resize,
.sheet-attachment-card.transform-active .card-corner-resize {
  opacity: 1;
}
.card-corner-resize.corner-tl { top: -6px; left: -6px; cursor: nwse-resize; }
.card-corner-resize.corner-tr { top: -6px; right: -6px; cursor: nesw-resize; }
.card-corner-resize.corner-bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.card-corner-resize.corner-br { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* İç Görsel Düzenleme Modu (Çift Tık) */
.sheet-attachment-card.editing-inner-image {
  box-shadow: 0 0 0 2px #f59e0b, 0 8px 24px rgba(245, 158, 11, 0.25) !important;
}
.inner-edit-badge {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.9);
  color: #f59e0b;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  z-index: 35;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  display: none;
}
.sheet-attachment-card.editing-inner-image .inner-edit-badge {
  display: block;
}

/* Corner & Edge Handles (Doğrudan görselin tam 4 köşesine bağlı) */
.sheet-attach-img-wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  max-height: 100%;
}
.sheet-attach-img-wrap .sheet-attach-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}
.sheet-attach-img-wrap .tr-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #ffffff;
  border: 2px solid #3b82f6;
  border-radius: 2px;
  z-index: 25;
  display: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}
.sheet-attachment-card.editing-inner-image .sheet-attach-img-wrap .tr-handle {
  display: block;
}
.sheet-attach-img-wrap .tr-handle.tr-tl { top: -5px; left: -5px; cursor: nwse-resize; }
.sheet-attach-img-wrap .tr-handle.tr-tr { top: -5px; right: -5px; cursor: nesw-resize; }
.sheet-attach-img-wrap .tr-handle.tr-br { bottom: -5px; right: -5px; cursor: nwse-resize; }
.sheet-attach-img-wrap .tr-handle.tr-bl { bottom: -5px; left: -5px; cursor: nesw-resize; }

/* AutoCAD & Photoshop Smart Guides (Akıllı Hizalama Kılavuz Çizgileri) */
.smart-guide-line {
  position: absolute;
  pointer-events: none;
  z-index: 99;
  display: none;
}
.smart-guide-line.v-line {
  top: 0;
  bottom: 0;
  width: 1.5px;
  background: #ef4444;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
}
.smart-guide-line.h-line {
  left: 0;
  right: 0;
  height: 1.5px;
  background: #ef4444;
  box-shadow: 0 0 5px rgba(239, 68, 68, 0.8);
}

/* Toolbar Snap & Grid Butonları */
.stage-tool-toggle {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}
.stage-tool-toggle:hover {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-strong);
}
.stage-tool-toggle.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}
.grid-size-box {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.grid-pixel-input {
  width: 38px;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
  outline: none;
  font-family: var(--font-mono);
  -moz-appearance: textfield;
}
.grid-pixel-input::-webkit-outer-spin-button,
.grid-pixel-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.grid-pixel-unit {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.stage-tool-divider {
  width: 1px;
  height: 18px;
  background: var(--border-subtle);
  margin: 0 4px;
}

/* AutoCAD Izgara (Grid) Görünümü (Yazdırmada Asla Görünmez) */
.sheet-attach-body.show-grid {
  background-image: 
    linear-gradient(to right, rgba(59, 130, 246, 0.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(59, 130, 246, 0.14) 1px, transparent 1px) !important;
  background-size: var(--grid-size, 30px) var(--grid-size, 30px) !important;
}

/* Snap Guide Lines (Magnetic Alignment) */
.snap-guide-line {
  position: absolute;
  pointer-events: none;
  z-index: 28;
  display: none;
}
.snap-guide-line.v-center {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  border-left: 1.5px dashed #ef4444;
}
.snap-guide-line.h-center {
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  border-top: 1.5px dashed #ef4444;
}
.snap-guide-line.active {
  display: block !important;
}

/* ==========================================================================
   MODALLAR
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease-out;
}
.modal-card.modal-lg {
  max-width: 680px;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-head h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}
.modal-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}
.modal-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.modal-tab-btn {
  padding: 10px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.modal-tab-btn.active {
  border-color: var(--accent-amber);
  background: var(--bg-surface);
  color: var(--accent-amber);
}

/* Logo Slider Box */
.logo-scale-box {
  background: var(--bg-surface-elevated);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
.scale-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.scale-val-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--accent-amber);
  font-size: 12px;
}
.scale-slider-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}
.scale-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: var(--accent-amber);
}

/* Extra Dynamic Fields inside Modal */
.extra-fields-section {
  margin-top: 16px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}
.extra-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.extra-field-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.extra-field-row input {
  font-size: 12px;
}

/* Preset Templates Management Modal Table */
.preset-manage-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preset-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}
.preset-manage-row input {
  padding: 6px 8px;
  font-size: 12px;
}

/* Client Management Modal List */
.clients-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
}
.client-manage-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
}

/* History Modal */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.history-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.hist-client { font-weight: 700; font-size: 13px; display: block; }
.hist-meta { font-size: 11px; color: var(--text-muted); }
.hist-total { font-family: var(--font-mono); font-weight: 800; color: var(--accent-amber); font-size: 14px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-size: 13px;
  font-weight: 600;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  animation: toastIn 0.2s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (LAPTOP & MOBİL)
   ========================================================================== */
@media (max-width: 1080px) {
  .workspace-grid {
    grid-template-columns: 440px 1fr;
  }
  .bottom-action-panel {
    width: 440px;
  }
}

@media (max-width: 860px) {
  .workspace-grid {
    display: flex;
    flex-direction: column;
  }
  .control-panel {
    max-height: none;
    padding-bottom: 120px;
  }
  .bottom-action-panel {
    width: 100%;
  }
  .mobile-tab-switch {
    display: flex;
  }
  .hide-mobile {
    display: none;
  }
  .mobile-hidden {
    display: none !important;
  }
}

/* ==========================================================================
   YAZDIRMA & PDF SİHİRBAZI MODAL STILLERI
   ========================================================================== */
.print-wizard-summary-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.print-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.print-summary-row .lbl {
  color: var(--text-muted);
}
.print-options-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.print-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-main);
}
.print-check-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-amber);
}
.print-filesize-badge {
  margin-top: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 11.5px;
  color: var(--text-main);
  text-align: center;
}

/* ==========================================================================
   DİREKT HIZLI PDF İLERLEME MODALI (KATALOG MİMARİSİ)
   ========================================================================== */
.progress-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.progress-modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 440px;
  padding: 28px 24px;
  text-align: center;
  animation: modalIn 0.25s ease-out;
}
.progress-modal-card .modal-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(217, 144, 20, 0.12);
  border: 1.5px solid rgba(217, 144, 20, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}
.progress-modal-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.progress-modal-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}
.progress-bar-track {
  width: 100%;
  height: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d99014 0%, #f59e0b 100%);
  border-radius: 999px;
  transition: width 0.2s ease;
  box-shadow: 0 0 10px rgba(217, 144, 20, 0.4);
}
.progress-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}
#pdfProgressStep {
  color: var(--accent-amber);
}
#pdfProgressPercent {
  font-family: var(--font-mono);
  color: var(--text-main);
}

/* ==========================================================================
   PRINT STYLES (PDF / YAZDIRMA - BİREBİR A4)
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  body, html {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .no-print,
  .app-header,
  .control-panel,
  .stage-toolbar,
  .modal-backdrop,
  .toast,
  .transform-overlay-controls,
  .tr-handle,
  .snap-guide-line,
  .smart-guide-line,
  .frame-resize-bar,
  .frame-resize-bar-v,
  .card-corner-resize,
  .inner-edit-badge {
    display: none !important;
  }
  .sheet-attach-body {
    background-image: none !important;
  }
  .app-layout,
  .workspace-grid,
  .preview-stage,
  .paper-viewport {
    display: block !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }
  .a4-pages-wrapper {
    gap: 0 !important;
    transform: none !important;
  }
  .a4-sheet {
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    box-sizing: border-box !important;
  }
  .a4-sheet:last-child {
    page-break-after: auto !important;
  }

  /* Sihirbaz Filtreleri */
  body.print-scope-proposal .sheet-attachment-page {
    display: none !important;
  }
  body.print-scope-attachments .sheet-proposal-page {
    display: none !important;
  }
  body.print-hide-notes .sheet-notes-section {
    display: none !important;
  }
  body.print-hide-sigs .sheet-signatures-section {
    display: none !important;
  }
  body.print-hide-footer .sheet-footer {
    display: none !important;
  }
  body.print-monochrome-mode {
    filter: grayscale(100%) !important;
  }
}

/* PIN Lock Overlay for Teklif */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 7, 10, 0.96);
  backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pin-overlay.hidden { display: none !important; }

.pin-card {
  background: #11141c;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(59, 130, 246, 0.15);
  padding: 40px 32px;
  border-radius: 16px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pin-back-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 18px;
  display: inline-block;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pin-back-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.pin-user-preview {
  margin-bottom: 14px;
  text-align: center;
}

.pin-user-name {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.pin-user-title {
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}

.pin-subtitle {
  font-size: 13px;
  color: #94a3b8;
  margin-bottom: 20px;
}

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

.pin-direct-box {
  margin: 4px 0 14px 0;
}

.pin-direct-input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 32px;
  letter-spacing: 14px;
  text-align: center;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #60a5fa;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pin-direct-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.pin-submit-btn {
  width: 100%;
  padding: 12px;
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}
.pin-submit-btn:hover {
  background: #2563eb;
}

.pin-error {
  color: #f87171;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.pin-error.hidden { display: none !important; }
