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

:root {
  --primary: #F59E0B;
  --primary-light: #FBBF24;
  --warning: #F59E0B;
  --success: #10B981;
  --error: #EF4444;
  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --foreground: #1A1F36;
  --muted: #6B7280;
  --border: #E2E8F0;
  --sidebar-bg: #1E293B;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--foreground);
  line-height: 1.5;
}

.hidden { display: none !important; }

/* Login Page */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1E293B 0%, #334155 100%);
}

.login-container {
  width: 360px;
  background: var(--surface);
  border-radius: 12px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.form-input:focus, .search-input:focus, .date-input:focus {
  border-color: var(--primary);
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground);
}

/* Forms */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .search-input, .date-input {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 14px;
  color: var(--foreground);
  background: var(--bg);
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .search-input:focus, .date-input:focus {
  border-color: var(--primary);
}

.error-msg {
  width: 100%;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--error);
}

/* Buttons */
.btn-primary {
  height: 42px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.9; }

.btn-success {
  height: 42px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-warning {
  height: 42px;
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-full { width: 100%; }

.btn-logout {
  width: 100%;
  height: 38px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Main App Layout */
#main-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
#sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.sidebar-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.nav-list {
  list-style: none;
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(245,158,11,0.2);
  color: var(--warning);
}

.nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Content */
#content {
  margin-left: 220px;
  flex: 1;
  padding: 32px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

.page-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
}

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-primary { color: var(--primary); }
.text-warning { color: var(--warning); }

/* Banner */
.banner {
  background: #1E293B;
  border-radius: 10px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.banner-label {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
}

.banner-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}

/* Tables */
.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.table-card-header {
  background: var(--bg);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
}

.table-body {
  padding: 8px 0;
}

.table-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 12px 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 12px 20px;
  font-size: 13px;
  color: var(--foreground);
  border-bottom: 1px solid #F1F5F9;
}

.data-table tbody tr:hover {
  background: #F8FAFC;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.badge-paid { background: #D1FAE5; color: #065F46; }
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-cancel { background: #FEE2E2; color: #991B1B; }
.badge-musteri { background: rgba(16,185,129,0.1); color: #10B981; }
.badge-tedarikci { background: rgba(245,158,11,0.1); color: #F59E0B; }
.badge-gelir { background: #D1FAE5; color: #065F46; }
.badge-gider { background: #FEE2E2; color: #991B1B; }

/* Filter Buttons */
.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { color: var(--foreground); }
.filter-btn.active {
  background: #1E293B;
  color: #fff;
  border-color: #1E293B;
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--foreground);
}

.product-field {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.product-field-label { color: var(--muted); }
.product-field-value { font-weight: 600; }

.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.action-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.action-edit { background: #FEF3C7; color: #92400E; }
.action-delete { background: #FEF2F2; color: var(--error); }

/* Date Filter Bar */
.filter-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* Row Actions */
.row-actions {
  display: flex;
  gap: 6px;
}

.action-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  border: none;
}

.action-icon.edit { background: var(--primary); color: #fff; }
.action-icon.delete { background: var(--error); color: #fff; }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body .form-group {
  margin-bottom: 0;
}

/* Amount styling */
.amount-positive { color: var(--success); font-weight: 600; }
.amount-negative { color: var(--error); font-weight: 600; }

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .tables-grid { grid-template-columns: 1fr; }
}

/* Mobile-only / Desktop-only helpers */
.mobile-only { display: none !important; }
.desktop-only { display: block; }

@media (max-width: 768px) {
  .mobile-only { display: flex !important; }
  .desktop-only { display: none !important; }

  #main-app {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }

  /* Mobile Header */
  #mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 12px;
    padding-top: env(safe-area-inset-top, 0);
    background: var(--sidebar-bg);
    align-items: center;
    gap: 12px;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
  }

  .mobile-header-page {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
  }

  /* Sidebar as drawer */
  #sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  #sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
  }

  #content {
    margin-left: 0;
    margin-top: 56px;
    margin-top: calc(56px + env(safe-area-inset-top, 0));
    padding: 16px;
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0));
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 22px;
  }

  .page-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .search-input {
    flex: 1;
    min-width: 120px;
  }

  .filter-group {
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 18px; }

  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 14px 16px;
  }

  .banner-value { font-size: 22px; }

  /* Bottom Navigation */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: var(--surface);
    border-top: 1px solid var(--border);
    justify-content: space-around;
    align-items: center;
    z-index: 50;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    padding: 6px 4px;
    transition: color 0.2s;
  }

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

  .bottom-nav-icon {
    font-size: 20px;
    line-height: 1;
  }

  .bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
  }

  /* Tables → horizontal scroll on mobile */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 640px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Product grid */
  .product-grid {
    grid-template-columns: 1fr;
  }

  /* Modal full-width on mobile */
  .modal-content {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
    max-height: 90dvh;
    margin: 8px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
  }

  /* Login */
  .login-container {
    width: calc(100% - 32px);
    max-width: 360px;
    padding: 32px 24px;
  }

  #login-page {
    padding: 16px;
    padding-top: env(safe-area-inset-top, 16px);
  }

  /* Touch-friendly buttons */
  .btn-primary,
  .btn-success,
  .btn-warning {
    min-height: 44px;
  }

  .action-icon {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .filter-btn {
    padding: 8px 12px;
    min-height: 36px;
  }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media (min-width: 769px) {
  #mobile-header,
  .bottom-nav,
  .sidebar-overlay {
    display: none !important;
  }
}


/* ============================================================
   DETAY PENCERELERİ
   Cari Hareket Detayı + Fatura Detayı
   ============================================================ */

@media (min-width: 769px) {

  .modal-content.modal-detail {
    width: 950px !important;
    max-width: 92vw !important;
    height: 84vh;
    max-height: 900px;
    overflow: hidden;
  }

  .modal-content.modal-detail .modal-header {
    flex-shrink: 0;
  }

  .modal-content.modal-detail .modal-body {
    height: calc(84vh - 73px);
    max-height: none;
    overflow-y: auto;
    overflow-x: auto;
    padding: 24px;
  }

  .modal-content.modal-detail table {
    width: 100%;
  }

  .modal-content.modal-detail th {
    white-space: nowrap;
  }

  .modal-content.modal-detail td {
    white-space: nowrap;
  }

}


/* ============================================================
   DAHA KÜÇÜK MASAÜSTÜ / TABLET
   ============================================================ */

@media (min-width: 769px) and (max-width: 1050px) {

  .modal-content.modal-detail {
    width: 94vw !important;
    max-width: 94vw !important;
  }

}


/* ============================================================
   MOBİL
   Mevcut mobil tasarıma dokunmuyoruz.
   ============================================================ */

@media (max-width: 768px) {

  .modal-content.modal-detail {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh;
  }

  .modal-content.modal-detail .modal-body {
    overflow-x: auto;
    overflow-y: auto;
  }

}

/* Cari Detay & Modal içi butonlar için */
.btn-secondary {
  height: 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-secondary:hover {
  opacity: 0.9;
}

/* More menu (mobile) */
.more-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  min-height: 88px;
  transition: background 0.2s, border-color 0.2s;
}

.more-menu-item:active {
  background: #FEF3C7;
  border-color: var(--primary);
}

.more-menu-icon {
  font-size: 28px;
}
/* Hammaddeler mevcut ürün kartı tasarımını bilinçli olarak paylaşır. */
#page-hammaddeler .product-card {
  position: relative;
}

/* ============================================================
   HIZLI SATIŞ / POS
   ============================================================ */

.pos-page {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(360px, 0.9fr);
    gap: 20px;
    min-height: calc(100vh - 96px);
}

.pos-products,
.pos-cart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.pos-products {
    padding: 22px;
}

.pos-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.pos-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.pos-status {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #ECFDF5;
    color: #047857;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.pos-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
}

.pos-search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.pos-search {
    width: 100%;
    height: 52px;
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 0 16px;
    font-size: 16px;
    outline: none;
}

.pos-search:focus {
    border-color: var(--primary);
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 12px;
}

.pos-product-card {
    appearance: none;
    text-align: left;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    padding: 16px;
    min-height: 135px;
    cursor: pointer;
    transition: 0.15s;
}

.pos-product-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.07);
}

.pos-product-card:active {
    transform: scale(0.98);
}

.pos-product-card.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-product-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 12px;
}

.pos-product-price {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

.pos-product-stock {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}

.pos-no-products {
    grid-column: 1 / -1;
    padding: 50px;
    text-align: center;
    color: var(--muted);
}


/* CART */
.pos-cart {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.pos-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.pos-cart-header h3 {
    font-size: 18px;
}

#pos-cart-count {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.pos-clear-cart {
    border: 0;
    background: transparent;
    color: var(--error);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    min-height: 180px;
}

.pos-empty-cart {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    gap: 5px;
    text-align: center;
}

.pos-empty-icon {
    font-size: 42px;
    margin-bottom: 8px;
}

/* Ürün | Fiyat | Miktar | Toplam | Sil */
.pos-cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 90px 50px 80px 24px;
    align-items: center;
    gap: 8px;
    padding: 8px 4px;
    min-height: 44px;
    border-bottom: 1px solid var(--border);
}

.pos-cart-item-main {
    min-width: 0;
}

.pos-cart-item-main strong {
    display: block;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-price-editor {
    min-width: 0;
}

.pos-price-editor label {
    display: none;
}

.pos-price-input-wrap {
    display: flex;
    align-items: center;
    width: 100%;
}

.pos-price-input-wrap input {
    width: 100%;
    height: 30px;
    padding: 3px 5px;
    font-size: 12px;
}

.pos-price-input-wrap span {
    flex: 0 0 auto;
    margin-left: 2px;
    font-size: 11px;
}

.pos-cart-item-actions {
    display: contents;
}

/* Miktar inputu tek başına kullanılıyor; eski +/- butonları gizli. */
.pos-cart-item-actions > button:not(.pos-remove-item) {
    display: none !important;
}

.pos-cart-item-actions input {
    width: 42px;
    height: 30px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
}



.pos-cart-line-total {
    margin: 0;
    font-size: 12px;
    text-align: right;
    white-space: nowrap;
}

.pos-cart-item-actions .pos-remove-item {
    width: 22px;
    height: 28px;
    color: var(--error);
    border: 0;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
}


/* SUMMARY */

.pos-summary {
    border-top: 1px solid var(--border);
    padding: 16px 20px;
}

.pos-summary-row,
.pos-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pos-summary-row {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.pos-total-row {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
    font-size: 19px;
}

.pos-total-row strong {
    color: var(--primary);
    font-size: 25px;
}


/* PAYMENT */

.pos-payment {
    padding: 18px 20px 20px;
    border-top: 1px solid var(--border);
}

.pos-payment-title {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.pos-payment-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.pos-payment-btn {
    height: 48px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.pos-payment-btn.active {
    background: #1E293B;
    color: #fff;
    border-color: #1E293B;
}

.pos-cash-area {
    margin-top: 12px;
}

.pos-cash-area label {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.pos-cash-input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 16px;
}

.pos-change {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
}

.pos-change strong {
    color: var(--success);
}

.pos-complete-btn {
    width: 100%;
    height: 58px;
    margin-top: 14px;
    border: 0;
    border-radius: 10px;
    background: var(--success);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
}

.pos-complete-btn:hover {
    opacity: 0.92;
}

.pos-complete-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}


/* RESPONSIVE POS */

@media (max-width: 1050px) {
    .pos-page {
        grid-template-columns: 1fr;
    }

    .pos-cart {
        min-height: 600px;
    }
}

@media (max-width: 768px) {

    .pos-page {
        display: block;
        min-height: auto;
    }

    .pos-products,
    .pos-cart {
        border-radius: 10px;
    }

    .pos-products {
        padding: 14px;
        margin-bottom: 12px;
    }

    .pos-header {
        margin-bottom: 12px;
    }

    .pos-header .page-title {
        font-size: 20px;
    }

    .pos-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .pos-product-card {
        min-height: 120px;
        padding: 12px;
    }

    .pos-product-price {
        font-size: 17px;
    }

    .pos-cart {
        min-height: 550px;
    }
}

/* KDV ayarı */
.pos-kdv-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px;
    border-top: 1px solid var(--border);
}

.pos-kdv-setting label {
    font-size: 12px;
    color: var(--muted);
}

.pos-kdv-input-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pos-kdv-input-wrap input {
    width: 48px;
    height: 28px;
    padding: 2px 5px;
    border: 1px solid var(--border);
    border-radius: 5px;
    text-align: center;
    font-size: 13px;
}

.pos-kdv-input-wrap span {
    font-size: 12px;
    color: var(--muted);
}

.pos-kdv-input-wrap input[type="number"]::-webkit-inner-spin-button,
.pos-kdv-input-wrap input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-kdv-input-wrap input[type="number"] {
    appearance: textfield;
}

/* Responsive compact cart */
@media (max-width: 768px) {
    .pos-cart-item {
        grid-template-columns: minmax(0, 1fr) 82px 46px 72px 20px;
        gap: 6px;
        padding: 7px 2px;
    }

    .pos-cart-item-main strong {
        font-size: 11px;
    }

    .pos-price-input-wrap input {
        height: 30px;
        font-size: 12px;
    }

    .pos-cart-item-actions input {
        width: 38px;
        height: 30px;
    }

    .pos-cart-line-total {
        font-size: 11px;
    }

    .pos-cart-item-actions .pos-remove-item {
        width: 20px;
        font-size: 16px;
    }
}

/* Kullanıcı Yönetimi */
.badge-success { background: #D1FAE5; color: #065F46; }
.info-box {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
}

/* Çok kullanıcılı sistem - işlem yetkileri */
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #F8FAFC;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.permission-item input { width: 16px; height: 16px; }

/* Hızlı Satış - Mobil Barkod Okuyucu */
.pos-scan-btn { white-space: nowrap; }
.pos-scanner {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.78);
}
.pos-scanner.hidden { display: none; }
.pos-scanner-panel {
  width: min(520px, 100%); background: var(--card-bg, #fff);
  border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.pos-scanner-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; }
.pos-scanner-close { border:0; background:transparent; font-size:30px; line-height:1; cursor:pointer; padding:2px 8px; }
.pos-scanner-video-wrap { position:relative; width:100%; aspect-ratio: 4/3; background:#000; overflow:hidden; }
.pos-scanner-video-wrap video { width:100%; height:100%; object-fit:cover; display:block; }
.pos-scanner-frame { position:absolute; left:12%; right:12%; top:28%; bottom:28%; border:3px solid #fff; border-radius:10px; box-shadow:0 0 0 9999px rgba(0,0,0,.12); pointer-events:none; }
.pos-scanner-hint { padding:12px 16px 16px; text-align:center; font-size:14px; }
@media (max-width: 700px) {
  .pos-search-row { flex-wrap: wrap; }
  .pos-search-row .pos-search { flex: 1 1 100%; order:1; }
  .pos-search-row .pos-scan-btn { flex:1; order:2; min-height:46px; }
  .pos-search-row #pos-clear-search { flex:1; order:2; min-height:46px; }
  .pos-scanner { padding:8px; }
  .pos-scanner-panel { border-radius:12px; }
}

/* Hızlı Satış - Mobil Barkod Okuyucu */
.pos-scan-btn { white-space: nowrap; }
.pos-scanner {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0,0,0,.78);
}
.pos-scanner.hidden { display: none; }
.pos-scanner-panel {
  width: min(520px, 100%); background: var(--card-bg, #fff);
  border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.pos-scanner-header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px; }
.pos-scanner-close { border:0; background:transparent; font-size:30px; line-height:1; cursor:pointer; padding:2px 8px; }
.pos-scanner-video-wrap { position:relative; width:100%; aspect-ratio: 4/3; background:#000; overflow:hidden; }
.pos-scanner-video-wrap video { width:100%; height:100%; object-fit:cover; display:block; }
.pos-scanner-frame { position:absolute; left:12%; right:12%; top:28%; bottom:28%; border:3px solid #fff; border-radius:10px; box-shadow:0 0 0 9999px rgba(0,0,0,.12); pointer-events:none; }
.pos-scanner-hint { padding:12px 16px 16px; text-align:center; font-size:14px; }
@media (max-width: 700px) {
  .pos-search-row { flex-wrap: wrap; }
  .pos-search-row .pos-search { flex: 1 1 100%; order:1; }
  .pos-search-row .pos-scan-btn { flex:1; order:2; min-height:46px; }
  .pos-search-row #pos-clear-search { flex:1; order:2; min-height:46px; }
  .pos-scanner { padding:8px; }
  .pos-scanner-panel { border-radius:12px; }
}

/* ============================================================
   TURUNCUN - İLK AÇILIŞ / HOŞ GELDİNİZ
   ============================================================ */

.welcome-page {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(249, 115, 22, 0.14),
            transparent 35%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(251, 146, 60, 0.10),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #fff7ed 0%,
            #ffffff 50%,
            #fffaf5 100%
        );
}

.welcome-page::before,
.welcome-page::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.welcome-page::before {
    width: 320px;
    height: 320px;
    top: -150px;
    right: -100px;
    background: rgba(249, 115, 22, 0.08);
}

.welcome-page::after {
    width: 260px;
    height: 260px;
    bottom: -130px;
    left: -100px;
    background: rgba(251, 146, 60, 0.08);
}

.welcome-content {
    position: relative;
    z-index: 1;

    width: min(760px, 100%);
    padding: 55px 35px;

    text-align: center;

    border-radius: 28px;
    background: rgba(255, 255, 255, 0.90);

    border: 1px solid rgba(249, 115, 22, 0.15);

    box-shadow:
        0 25px 70px rgba(15, 23, 42, 0.10),
        0 5px 20px rgba(249, 115, 22, 0.08);

    backdrop-filter: blur(10px);
}

.welcome-logo {
    width: 78px;
    height: 78px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 22px;

    background: linear-gradient(
        135deg,
        #f97316,
        #fb923c
    );

    box-shadow:
        0 12px 30px rgba(249, 115, 22, 0.30);

    font-size: 38px;

    animation: welcomeFloat 3s ease-in-out infinite;
}

.welcome-brand {
    margin-bottom: 14px;

    font-size: 15px;
    font-weight: 800;
    letter-spacing: 5px;

    color: #f97316;
}

.welcome-content h1 {
    margin: 0;

    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.15;
    font-weight: 800;

    color: #1e293b;
}

.welcome-content h1 span {
    color: #f97316;
}

.welcome-content p {
    margin: 22px auto 0;

    color: #64748b;

    font-size: 16px;
    line-height: 1.7;
}

.welcome-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 18px;

    margin: 34px auto 28px;
}

.welcome-features > div {
    min-width: 135px;

    padding: 14px 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    border-radius: 14px;

    background: #fff7ed;

    border: 1px solid rgba(249, 115, 22, 0.12);

    color: #334155;
}

.welcome-features span {
    font-size: 20px;
}

.welcome-features strong {
    font-size: 14px;
}

.welcome-line {
    width: 70px;
    height: 3px;

    margin: 8px auto 18px;

    border-radius: 10px;

    background: linear-gradient(
        90deg,
        #f97316,
        #fb923c
    );
}

.welcome-content small {
    color: #94a3b8;

    font-size: 12px;
    letter-spacing: 1px;
}

@keyframes welcomeFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}


/* MOBİL */
@media (max-width: 768px) {

    .welcome-page {
        min-height: calc(100vh - 120px);
        padding: 20px 14px;
    }

    .welcome-content {
        padding: 38px 20px;
        border-radius: 22px;
    }

    .welcome-logo {
        width: 64px;
        height: 64px;

        border-radius: 18px;

        font-size: 30px;
    }

    .welcome-brand {
        font-size: 12px;
        letter-spacing: 4px;
    }

    .welcome-content h1 {
        font-size: 29px;
        line-height: 1.2;
    }

    .welcome-content p {
        font-size: 14px;
        line-height: 1.6;
        margin-top: 18px;
    }

    .welcome-desktop {
        display: none;
    }

    .welcome-features {
        gap: 9px;
        margin-top: 26px;
    }

    .welcome-features > div {
        min-width: 0;
        flex: 1 1 28%;

        padding: 11px 8px;

        flex-direction: column;

        gap: 4px;
    }

    .welcome-features span {
        font-size: 18px;
    }

    .welcome-features strong {
        font-size: 12px;
    }
}


/* 2026-08-19 onaylı geliştirme stilleri */
.compact-select { min-width: 170px; height: 42px; }
.modal-content.modal-wide { width: 92vw; max-width: 1180px; max-height: 90vh; }
.vade-alert-card { margin-top: 18px; }
.vade-alert-list { display: flex; flex-direction: column; gap: 8px; padding: 14px 20px; }
.vade-alert-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #FFFBEB; color: #78350F; }
.vade-alert-row.is-danger { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.vade-alert-row.is-today { background: #FFF7ED; border-color: #FED7AA; color: #9A3412; }
.vade-alert-row small { display: block; margin-top: 3px; color: inherit; opacity: .8; }
.vade-empty { color: var(--muted); padding: 14px 0; }
.pos-last-barcode { display: flex; align-items: center; gap: 10px; padding: 7px 12px; margin: 8px 0 0; border: 1px solid var(--border); border-radius: 8px; background: #F8FAFC; color: var(--muted); font-size: 12px; }
.pos-last-barcode code { color: var(--primary); font-size: 14px; font-weight: 700; word-break: break-all; }
.pos-price-editor label { display: block; font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.cek-belge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cek-belge-preview { display: block; width: 100%; max-height: 240px; object-fit: contain; margin-top: 6px; border: 1px solid var(--border); border-radius: 8px; background: #F8FAFC; }
.cek-belge-empty { display: flex; align-items: center; justify-content: center; min-height: 120px; margin-top: 6px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 12px; }
.firma-logo-preview { display: block; max-width: 220px; max-height: 100px; margin-top: 10px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; padding: 6px; background: #fff; }
.detail-toolbar { display: flex; align-items: center; gap: 10px; }
.detail-toolbar .form-input { max-width: 300px; }
.detail-two-col { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-warning { cursor: pointer; }
.badge-info { background: #DBEAFE; color: #1D4ED8; }
@media (max-width: 768px) {
  .compact-select { min-width: 140px; flex: 1; }
  .modal-content.modal-wide { width: 95vw; max-width: 95vw; }
  .detail-two-col, .cek-belge-grid { grid-template-columns: 1fr; }
  .pos-cart-item { grid-template-columns: minmax(0, 1fr) 78px 45px 70px 24px; gap: 5px; }
}
