/* e-Mükellef Reference Theme - GİB E-Arşiv SaaS Portal (Mobile-First & NetteOfis Ready) */
:root {
  --font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  --primary-red: #b71c1c;
  --primary-red-hover: #880e4f;
  --bg-sidebar: #990000;
  --bg-body: #eceff1;
  --bg-card: #ffffff;
  --border-color: #cfd8dc;
  
  --text-dark: #263238;
  --text-muted: #546e7a;
  
  --success: #2e7d32;
  --warning: #f57f17;
  --danger: #c62828;
  --nette-teal: #00a88f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

body {
  background-color: var(--bg-body);
  color: var(--text-dark);
  min-height: 100vh;
}

.hidden { display: none !important; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }
.text-center { text-align: center; }
.text-success { color: var(--success); font-weight: 600; }

/* Login Screen */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #b71c1c 0%, #311b92 100%);
  padding: 1.5rem;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.emukellef-badge {
  width: 60px;
  height: 60px;
  background: var(--primary-red);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.brand-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.brand-header h1 {
  font-size: 1.5rem;
  color: var(--primary-red);
}

/* App Layout */
.app-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: linear-gradient(180deg, #990000 0%, #7b0000 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
}

.tenant-profile-box {
  padding: 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tenant-icon {
  font-size: 2rem;
}

.tenant-info h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
}

.tenant-vkn {
  font-size: 0.75rem;
  opacity: 0.8;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-item:hover, .menu-item.active {
  background: rgba(0, 0, 0, 0.2);
  color: #ffffff;
  border-left: 4px solid #ffffff;
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.items-section { overflow-x: auto; min-width: 0; }
.card { min-width: 0; }

.top-header {
  height: 56px;
  background: #b71c1c;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.header-title {
  font-size: 1.125rem;
  font-weight: 700;
}

.content-view {
  display: none;
  padding: 1.5rem;
}

.content-view.active {
  display: block;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  margin-bottom: 1rem;
  min-width: 0;
  flex-wrap: wrap;
}

.filter-bar > * { min-width: 0; }

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.filter-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* e-Mükellef Table Style */
.table-card {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow-x: auto;
}

.emukellef-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.emukellef-table th {
  background: #f5f5f5;
  padding: 0.75rem 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.emukellef-table td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  border-bottom: 1px solid #e0e0e0;
  vertical-align: middle;
}

.emukellef-table tbody tr:hover {
  background: #fafafa;
}

/* Dropdown Menu ("Tıkla ▾") */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.btn-tikla {
  background: var(--primary-red);
  color: #ffffff;
  padding: 0.42rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-tikla:hover {
  background: var(--primary-red-hover);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  z-index: 220;
  min-width: 210px;
  display: none;
}

.dropdown-container.open .dropdown-menu {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  font-size: 0.83rem;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
}

.dropdown-item:hover {
  background: #f5f5f5;
  color: var(--primary-red);
}

/* Form Controls & Cards */
.card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  background: #ffffff;
}

.form-control:focus {
  border-color: var(--primary-red);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-6 { flex: 1; }

.btn {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

.btn-primary { background: var(--primary-red); color: #fff; }
.btn-danger { background: #d32f2f; color: #fff; }
.btn-success { background: #2e7d32; color: #fff; }
.btn-secondary { background: #78909c; color: #fff; }
.btn-outline-light { background: transparent; border: 1px solid #fff; color: #fff; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.62);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}

.modal-container {
  background: #ffffff;
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  display: flex; flex-direction: column;
}

.modal-lg { max-width: 860px; }
.modal-sm { max-width: 420px; }

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

.modal-close-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: #334155;
  flex-shrink: 0;
}
.modal-body { padding: 1.15rem; overflow-y: auto; }
.modal-footer { padding: 0.9rem 1.2rem; border-top: 1px solid var(--border-color); }

/* Mobil (telefon / APK WebView) uyumluluğu */
html, body { overflow-x: hidden; max-width: 100vw; }

#mobile-menu-toggle { display: none; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
}

@media (max-width: 860px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    height: 100dvh;
    width: 270px;
    max-width: 82vw;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 18px rgba(0,0,0,0.35);
  }

  .sidebar-backdrop { background: rgba(0,0,0,0.5); }
  .sidebar-backdrop.open { display: block; }

  #mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.14);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    flex-shrink: 0;
  }

  .top-header {
    height: 52px;
    padding: 0 0.75rem;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 120;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .header-title {
    font-size: 0.98rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-right {
    gap: 0.5rem;
    flex-shrink: 0;
  }

  #session-mode-badge { display: none; }

  #top-logout-btn { white-space: nowrap; padding: 0.4rem 0.7rem; font-size: 0.78rem; min-height: 34px; }

  .content-view { padding: 0.75rem; }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .col-6 { flex: 1 1 100%; min-width: 0; }

  .summary-box {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.65rem !important;
  }

  .modal-overlay { padding: 0.6rem; }

  .modal-container { max-width: 100%; border-radius: 14px; }
  .modal-header h3 { font-size: 0.98rem; }

  table.emukellef-table { font-size: 0.82rem; }
  .emukellef-table th, .emukellef-table td { padding: 0.55rem 0.6rem; }

  #ai-chat-messages { max-height: 300px; }

  .menu-item {
    padding: 0.9rem 1.25rem;
    font-size: 0.94rem;
    min-height: 46px;
  }

  .btn {
    min-height: 42px;
    padding: 0.6rem 0.95rem;
  }

  .btn-sm {
    min-height: 36px;
    padding: 0.42rem 0.7rem;
    font-size: 0.8rem;
  }

  .card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    padding: 0.95rem;
  }

  .table-card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  }

  .login-wrapper {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .login-card {
    border-radius: 16px;
    padding: 1.35rem 1.1rem !important;
    box-shadow: 0 14px 40px rgba(0,0,0,0.35);
    margin: auto 0;
  }

  .tenant-profile-box { padding: 1.1rem 0.9rem; }
  .tenant-info h3 { font-size: 0.875rem; }

  /* 16px font-size iOS Safari ve Android Chrome'da inputa tıklayınca ekranın kayarak zoom yapmasını önler */
  input, select, textarea, .form-control {
    min-height: 44px;
    font-size: 16px !important;
  }
}

/* Yeni Fatura — tek ekran, mobil öncelikli tasarım */
.invoice-modal-card {
  background: #f5f6f8;
  border-radius: 10px;
  overflow: visible;
  min-width: 0;
}

.invoice-modal-header {
  background: #ffffff;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  border-radius: 10px 10px 0 0;
}

.invoice-modal-header h3 {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-dark);
}

.invoice-tabs {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
}

.invoice-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.9rem 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
}

.invoice-tab.active {
  color: var(--primary-red);
  border-bottom-color: var(--primary-red);
}

.invoice-tab-panel { display: none; padding: 1rem 1.15rem; }
.invoice-tab-panel.active { display: block; }

.invoice-sticky-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 0.65rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1.15rem;
  z-index: 90;
}

.invoice-sticky-footer #btn-save-draft { flex: 0 0 auto; min-width: 105px; min-height: 46px; }
.invoice-sticky-footer #btn-submit-invoice { flex: 1; min-height: 46px; font-size: 0.96rem; }

@media (max-width: 860px) {
  .invoice-modal-card { border-radius: 0; margin: -0.75rem; }
  .invoice-modal-header { padding: 0.85rem 0.95rem; border-radius: 0; }
  .invoice-tab-panel { padding: 0.85rem; }
}

/* Kayıt / KVKK / Ödeme / Giriş Sihirbazı Stilleri */
#auth-card-container {
  max-width: 540px;
  padding: 2rem;
}

.auth-mode-tabs {
  display: flex;
  background: #f1f3f5;
  border-radius: 8px;
  padding: 0.25rem;
  margin-bottom: 1.15rem;
}

.auth-mode-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.6rem 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.auth-mode-tab.active {
  background: #ffffff;
  color: var(--primary-red);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.onboarding-stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.step-pill {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0.25rem;
  border-radius: 6px;
  background: #eceff1;
  color: var(--text-muted);
}

.step-pill.active {
  background: var(--primary-red);
  color: #ffffff;
}

.step-pill.done {
  background: #e8f5e9;
  color: var(--success);
}

.auth-step-banner {
  background: #fff8e1;
  border-left: 4px solid #ffa000;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  margin-bottom: 0.9rem;
  font-size: 0.82rem;
}

.auth-step-banner p {
  margin-top: 0.2rem;
  color: var(--text-muted);
}

.auth-success-banner {
  background: #e8f5e9;
  border-left: 4px solid var(--success);
  color: #1b5e20;
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  font-weight: 500;
}

.legal-scroll-box {
  max-height: 195px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  background: #fafafa;
  border-radius: 6px;
  padding: 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-dark);
}

.legal-scroll-box h4 {
  color: var(--primary-red);
  margin-bottom: 0.35rem;
  font-size: 0.84rem;
}

.legal-scroll-box p {
  margin-bottom: 0.45rem;
}

.pricing-summary-card {
  border: 2px solid var(--primary-red);
  background: #fffafa;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.85rem;
}

.pricing-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  padding: 0.25rem 0;
}

.pricing-total {
  border-top: 1px dashed var(--border-color);
  margin-top: 0.35rem;
  padding-top: 0.45rem;
  font-size: 0.98rem;
  color: var(--primary-red);
}

.bank-transfer-box {
  background: #f5f7f9;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 0.95rem;
  font-size: 0.82rem;
}

.bank-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.22rem 0;
  flex-wrap: wrap;
}

.btn-link-register {
  background: transparent;
  border: none;
  color: var(--primary-red);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.25rem;
  text-decoration: underline;
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.78rem; }

/* Durum Rozetleri */
.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #e0e0e0;
  color: #424242;
}
.badge-live { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-danger { background: #ffebee; color: #c62828; }
.badge-info { background: #e3f2fd; color: #1565c0; }
.badge-nette { background: #ccfbf1; color: #0f766e; }

/* Mobil Alt Navigasyon Barı & Hızlı Modül Çubuğu */
.mobile-bottom-nav,
.mobile-quick-chips {
  display: none;
}

@media (max-width: 860px) {
  .main-content {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .invoice-sticky-footer {
    bottom: calc(62px + env(safe-area-inset-bottom, 0px));
    z-index: 95;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    padding: 0.65rem 0.85rem;
  }

  .mobile-quick-chips {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding: 0.5rem 0.75rem;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-quick-chips::-webkit-scrollbar { display: none; }

  .quick-chip {
    flex-shrink: 0;
    border: 1px solid #dce3ea;
    background: #f8fafc;
    color: var(--text-dark);
    border-radius: 999px;
    padding: 0.36rem 0.78rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 34px;
  }
  .quick-chip.active {
    background: var(--primary-red);
    border-color: var(--primary-red);
    color: #ffffff;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -3px 14px rgba(0,0,0,0.1);
    z-index: 140;
    justify-content: space-around;
    align-items: center;
  }

  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    padding: 0.2rem 0;
  }

  .mob-nav-item small {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 2px;
  }

  .mob-nav-item.active {
    color: var(--primary-red);
  }

  .mob-nav-fab .fab-plus {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-red);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: -12px;
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.35);
  }
  .mob-nav-fab small {
    color: var(--primary-red);
    font-weight: 700;
  }
}

/* =========================================================================
   1. NETTEOFİS & PAKET SEÇİM KARTLARI
   ========================================================================= */
.plan-selector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.plan-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 2px solid #dce3ea;
  background: #ffffff;
  border-radius: 10px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
}

.plan-choice-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.plan-choice-card.active {
  border-color: var(--primary-red);
  background: #fff8f8;
  box-shadow: 0 4px 12px rgba(183, 28, 28, 0.12);
}

.plan-choice-nette.active {
  border-color: var(--nette-teal);
  background: #f0fdfa;
  box-shadow: 0 4px 14px rgba(0, 168, 143, 0.18);
}

.plan-choice-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.plan-choice-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.plan-choice-tag.tag-nette {
  background: #ccfbf1;
  color: #0f766e;
}

.plan-choice-price {
  font-size: 0.96rem;
  color: var(--text-dark);
}
.plan-choice-nette .plan-choice-price {
  color: #0f766e;
}
.plan-choice-price small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-choice-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 0.15rem;
}

.plan-choice-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.netteofis-ref-box {
  background: #f0fdfa;
  border: 1.5px solid #5eead4;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.95rem;
}

.netteofis-ref-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f766e;
  margin-bottom: 0.35rem;
}

.netteofis-ref-box small {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.74rem;
  color: #0f766e;
}

.step3-plan-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.step3-plan-btn {
  border: 1.5px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  border-radius: 8px;
  padding: 0.55rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.step3-plan-btn.active {
  border-color: var(--primary-red);
  background: #fff5f5;
  color: var(--primary-red);
}

#step3-btn-netteofis.active {
  border-color: var(--nette-teal);
  background: #f0fdfa;
  color: #0f766e;
}

.pricing-summary-card.nette-active {
  border-color: var(--nette-teal);
  background: #f0fdfa;
}
.pricing-summary-card.nette-active .pricing-total {
  color: #0f766e;
}

@media (max-width: 540px) {
  .plan-selector-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   2. KOMPAKT FİLTRE BARI & YENİ FATURA FORM KARTLARI
   ========================================================================= */
.compact-mobile-filter {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  padding: 0.85rem 1rem;
}

.filter-primary-row {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.date-filter-details summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-red);
  user-select: none;
  padding: 0.15rem 0;
}

.date-filter-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-top: 0.55rem;
}

@media (max-width: 768px) {
  .filter-primary-row {
    flex-wrap: nowrap;
  }
  .filter-primary-row .btn {
    width: auto !important;
    white-space: nowrap;
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
  }
  .date-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
}

.form-section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem;
}

.form-section-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #f1f5f9;
}

.invoice-totals-card {
  background: #fffafa;
  border: 1.5px solid #fecaca;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.summary-line.total-line {
  border-top: 1px dashed #fca5a5;
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  font-size: 1.08rem;
  color: var(--primary-red);
}

/* =========================================================================
   3. MOBİL TABLO -> KART DÖNÜŞÜMÜ (FATURA KALEMLERİ & TÜM LİSTELER)
   ========================================================================= */
@media (max-width: 768px) {
  /* 3A. Fatura / Teklif / Gelen Kalem Giriş Tabloları -> Mobil Kalem Kartları */
  .items-section {
    overflow-x: visible;
  }
  table.items-entry-table,
  table.items-entry-table tbody {
    display: block;
    width: 100%;
  }
  table.items-entry-table thead {
    display: none;
  }
  table.items-entry-table tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 0.75rem;
  }
  table.items-entry-table tbody td {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
    padding: 0 !important;
    border: none !important;
    white-space: normal !important;
    min-width: 0;
  }
  table.items-entry-table tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }
  table.items-entry-table tbody td.item-col-full {
    grid-column: 1 / -1;
  }
  table.items-entry-table tbody td.item-col-summary {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    padding: 0.45rem 0.65rem !important;
  }
  table.items-entry-table tbody td.item-col-remove {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
  }

  /* 3B. Veri Listesi Tabloları -> Şık Mobil Kartlar */
  .table-card {
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  table.mobile-cards,
  table.mobile-cards tbody {
    display: block;
    width: 100%;
  }
  table.mobile-cards thead {
    display: none;
  }
  table.mobile-cards tbody tr {
    display: block;
    background: #ffffff;
    border: 1px solid #dde4eb;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  }
  table.mobile-cards tbody td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.38rem 0 !important;
    border-bottom: 1px dashed #eef2f6 !important;
    white-space: normal !important;
    text-align: right;
    word-break: break-word;
  }
  table.mobile-cards tbody td[colspan] {
    display: block;
    text-align: center !important;
    border-bottom: none !important;
    padding: 1rem 0.5rem !important;
  }
  table.mobile-cards tbody td:first-child:not([colspan]) {
    display: block;
    text-align: left;
    padding-top: 0 !important;
    padding-bottom: 0.55rem !important;
    margin-bottom: 0.15rem;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 0.92rem;
  }
  table.mobile-cards tbody td:first-child::before {
    display: none !important;
  }
  table.mobile-cards tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.76rem;
    font-weight: 600;
    color: #64748b;
    text-align: left;
    flex-shrink: 0;
  }
  table.mobile-cards tbody td.td-actions,
  table.mobile-cards tbody td:last-child:not([colspan]) {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0.65rem !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
  }
  table.mobile-cards tbody td.td-actions::before,
  table.mobile-cards tbody td:last-child:not([data-label])::before {
    display: none !important;
  }
}

/* =========================================================================
   4. RESMİ GİB A4 FATURA ÖNİZLEME & PAYLAŞIM EKRANI (PREVIEW MODAL)
   ========================================================================= */
.preview-modal-sheet {
  max-width: 920px;
  width: 96vw;
  height: 92vh;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-modal-header {
  padding: 0.75rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.preview-created-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  background: linear-gradient(90deg, #ecfdf5 0%, #d1fae5 100%);
  border-bottom: 1px solid #6ee7b7;
  padding: 0.6rem 1rem;
  color: #065f46;
  font-size: 0.84rem;
  flex-shrink: 0;
}

.preview-created-info {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.preview-created-check {
  font-size: 1.2rem;
}

.preview-created-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-preview-new {
  background: #059669;
  color: #fff;
  padding: 0.35rem 0.7rem;
  min-height: 32px !important;
  font-size: 0.76rem;
}

.btn-preview-list {
  background: #ffffff;
  color: #065f46;
  border: 1px solid #34d399;
  padding: 0.35rem 0.7rem;
  min-height: 32px !important;
  font-size: 0.76rem;
}

.preview-zoom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.preview-zoom-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.zoom-pill {
  background: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 28px !important;
}

.zoom-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
}

.zoom-pill-pdf {
  background: #dc2626;
  border-color: #ef4444;
  color: #ffffff;
}

.preview-paper-stage {
  flex: 1;
  background: #cbd5e1;
  padding: 0.75rem 0.5rem;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.gib-a4-scaler {
  background: #ffffff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.24);
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  margin: 0 auto;
}

.preview-modal-footer {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  padding: 0.65rem 0.85rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.preview-primary-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  width: 100%;
}

.preview-primary-actions .btn {
  min-height: 42px;
  padding: 0.5rem 0.4rem;
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  border-radius: 8px;
}

.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
}

.preview-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  width: 100%;
}

.btn-light-pill {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0.32rem 0.6rem !important;
  min-height: 32px !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}

@media (max-width: 768px) {
  #preview-modal.modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .preview-modal-sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0 !important;
  }
  #preview-zoom-hint {
    display: none;
  }
  .preview-zoom-bar {
    justify-content: center;
  }
}

/* Yazdırma (Fatura / Teklif / Cari Ekstre PDF) */
@media print {
  .sidebar, .top-header, .mobile-bottom-nav, .mobile-quick-chips, .modal-header, .modal-footer, .preview-created-banner, .preview-zoom-bar {
    display: none !important;
  }
  .modal-overlay:not(.hidden) {
    position: static !important;
    background: #fff !important;
    padding: 0 !important;
  }
  .modal-container {
    max-width: 100% !important;
    max-height: none !important;
    height: auto !important;
    box-shadow: none !important;
  }
}
