/* ==========================================================================
   TEKNİK SERVİS YÖNETİM SİSTEMİ - MODERN RESPONSIVE STYLES
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-glow: rgba(37, 99, 235, 0.2);
  
  --secondary: #64748b;
  --secondary-light: #f1f5f9;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #06b6d4;
  --info-light: #ecfeff;
  --purple: #8b5cf6;
  --purple-light: #f5f3ff;

  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-sidebar: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.15);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */

#app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  background-color: var(--bg-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition);
  z-index: 100;
}

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

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
}

.sidebar-nav {
  padding: 20px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #94a3b8;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

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

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.system-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 8px var(--success);
}

/* MAIN CONTENT */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

/* HEADER */
.top-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

.header-search-bar {
  position: relative;
  width: 320px;
}

.header-search-bar input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background-color: var(--bg-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.header-search-bar input:focus {
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.header-search-bar svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

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

/* ==========================================================================
   LOGIN & LOCK SCREEN
   ========================================================================== */

.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.login-card-header {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  padding: 32px 24px;
  text-align: center;
  color: #fff;
}

.login-brand-icon {
  background: #ffffff;
  border-radius: var(--radius-md);
  margin: 0 auto 12px auto;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.login-brand-icon img {
  height: 48px;
  max-width: 170px;
  object-fit: contain;
}

.login-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 4px;
}

.login-card-body {
  padding: 28px 24px;
}

.login-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 16px;
  display: none;
  border: 1px solid #fca5a5;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 8px;
}

/* USER PROFILE IN TOP HEADER */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border-color);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo-img {
  height: 40px;
  max-width: 160px;
  object-fit: contain;
  border-radius: 4px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.user-avatar-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.user-profile-info {
  display: flex;
  flex-direction: column;
}

.user-profile-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}

.user-profile-role {
  font-size: 11px;
  color: var(--text-muted);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.role-admin {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.role-technician {
  background: #fdf4ff;
  color: #86198f;
  border: 1px solid #f5d0fe;
}

.role-staff {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background-color: var(--secondary-light);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-success {
  background-color: var(--success);
  color: #fff;
}
.btn-success:hover {
  background-color: #059669;
}

.btn-danger {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}
.btn-danger:hover {
  background-color: var(--danger);
  color: #fff;
}

.btn-icon-only {
  padding: 8px;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   CONTENT VIEWS
   ========================================================================== */

.content-body {
  padding: 24px 28px;
  flex: 1;
}

.view-section {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   DASHBOARD STATS CARDS
   ========================================================================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.cyan { background: var(--info-light); color: var(--info); }

.stat-info {
  display: flex;
  flex-direction: column;
}

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

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 2px;
  line-height: 1.2;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   FILTER BAR & TABS
   ========================================================================== */

.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn {
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-main);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.tab-badge {
  padding: 1px 6px;
  font-size: 10px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.1);
}
.tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

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

.filter-select {
  padding: 7px 12px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-main);
  color: var(--text-main);
  outline: none;
}

/* ==========================================================================
   DATA TABLE & CARDS
   ========================================================================== */

.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.custom-table th {
  background-color: #f8fafc;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.custom-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  vertical-align: middle;
}

.custom-table tbody tr {
  transition: var(--transition);
}

.custom-table tbody tr:hover {
  background-color: #f8fafc;
}

.custom-table tbody tr:last-child td {
  border-bottom: none;
}

/* TICKET ID BADGE */
.ticket-badge {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

/* STATUS BADGES */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.status-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-received {
  background: #fef3c7;
  color: #92400e;
}
.status-received::before { background: #d97706; }

.status-diagnosing {
  background: #e0f2fe;
  color: #0369a1;
}
.status-diagnosing::before { background: #0284c7; }

.status-waiting-approval {
  background: #ffedd5;
  color: #c2410c;
}
.status-waiting-approval::before { background: #ea580c; }

.status-waiting-parts {
  background: #f3e8ff;
  color: #6b21a8;
}
.status-waiting-parts::before { background: #9333ea; }

.status-ready {
  background: #dcfce7;
  color: #166534;
}
.status-ready::before { background: #22c55e; }

.status-delivered {
  background: #f1f5f9;
  color: #475569;
}
.status-delivered::before { background: #64748b; }

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}
.status-cancelled::before { background: #ef4444; }

/* SUPER ADMIN IMPERSONATION BANNER */
.impersonate-banner {
  background: linear-gradient(90deg, #1e1b4b, #312e81);
  color: #fff;
  padding: 10px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  border-bottom: 2px solid #6366f1;
}

.impersonate-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.impersonate-btn {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.impersonate-btn:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

/* PAYMENT STATUS BADGES */
.pay-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  width: fit-content;
}

.pay-badge i {
  font-style: normal;
  font-weight: 900;
}

.pay-badge-paid {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.pay-badge-partial {
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fef08a;
}

.pay-badge-pending {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.pay-badge-refund {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* DYNAMIC OPTION TAGS (KONTROL PANELİ ETİKETLERİ) */
.custom-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
  min-height: 38px;
  padding: 8px;
  background: #f8fafc;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
}

.custom-option-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tag-remove-btn {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.tag-remove-btn:hover {
  background: var(--danger-light);
}

/* QUICK ISSUE CHIP BUTTONS */
.quick-issues-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.chip-btn {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* CUSTOMER PICKER MODAL LIST */
.picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.picker-item {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
}

.picker-item:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateX(4px);
}

.action-btn.pay:hover {
  background: #ecfdf5;
  color: #10b981;
  border-color: #10b981;
}

/* ACTION BUTTONS GROUP */
.table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.action-btn:hover {
  background: var(--bg-main);
  color: var(--text-main);
  border-color: #cbd5e1;
}

.action-btn.print:hover {
  background: #eff6ff;
  color: var(--primary);
  border-color: var(--primary);
}

.action-btn.whatsapp:hover {
  background: #ecfdf5;
  color: #10b981;
  border-color: #10b981;
}

.action-btn.delete:hover {
  background: #fef2f2;
  color: var(--danger);
  border-color: var(--danger);
}

/* ==========================================================================
   MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  height: auto;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: var(--transition);
  overflow: hidden;
  position: relative;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-container form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  height: 100%;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  flex-shrink: 0;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background-color: #e2e8f0;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto !important;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  max-height: calc(90vh - 130px);
  -webkit-overflow-scrolling: touch;
}

/* Belirgin ve Şık Kaydırma Çubuğu (Scrollbar) */
.modal-body::-webkit-scrollbar {
  width: 8px;
}
.modal-body::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #f8fafc;
  flex-shrink: 0;
}

/* FORM GRID */
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.form-grid.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.form-grid.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.form-label .required {
  color: var(--danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--text-main);
  background-color: #fff;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea {
  min-height: 75px;
  resize: vertical;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  padding-left: 36px;
}

.input-with-icon svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

/* QUICK SUGGESTIONS / AUTOCOMPLETE */
.customer-autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
  display: none;
}

.customer-autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
}

.customer-autocomplete-item:hover {
  background-color: var(--primary-light);
}

.customer-autocomplete-name {
  font-weight: 600;
  font-size: 13px;
}

.customer-autocomplete-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   DETAIL MODAL STYLES
   ========================================================================== */

.detail-header-card {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.detail-ticket-id {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-family: monospace;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.detail-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #fff;
}

.detail-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px dashed #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row-label {
  color: var(--text-muted);
  font-weight: 500;
}

.detail-row-val {
  font-weight: 600;
  color: var(--text-main);
  text-align: right;
}

/* ==========================================================================
   PRINT PREVIEW MODAL
   ========================================================================== */

.print-preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.print-type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.print-sheet {
  background: #fff;
  box-shadow: 0 0 15px rgba(0,0,0,0.15);
  border: 1px solid #cbd5e1;
  padding: 16px;
  margin: 0 auto;
}

.print-sheet.thermal-58 {
  width: 220px;
  font-size: 11px;
}

.print-sheet.thermal-80 {
  width: 300px;
  font-size: 12px;
}

.print-sheet.a4-preview {
  width: 100%;
  max-width: 600px;
  font-size: 13px;
  padding: 24px;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px auto;
  color: #cbd5e1;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.empty-state-text {
  font-size: 13px;
  margin-top: 4px;
  margin-bottom: 16px;
}

/* ==========================================================================
   NOTIFICATIONS / TOAST
   ========================================================================== */

#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out;
  min-width: 250px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { background-color: var(--success); }
.toast-error { background-color: var(--danger); }
.toast-info { background-color: var(--primary); }

/* ==========================================================================
   HIDDEN PRINT RENDER AREA
   ========================================================================== */
#print-render-area {
  display: none;
}

/* ==========================================================================
   MOBILE & RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -260px;
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }

  .form-grid.col-3 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .top-header {
    padding: 10px 16px;
  }

  .header-search-bar {
    width: 180px;
  }

  .content-body {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-value {
    font-size: 20px;
  }

  .form-grid, .form-grid.col-2, .form-grid.col-3 {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  /* Mobil kart görünümü için responsive tablo ayarı */
  .table-container {
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .custom-table, .custom-table thead, .custom-table tbody, .custom-table th, .custom-table td, .custom-table tr {
    display: block;
  }

  .custom-table thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }

  .custom-table tbody tr {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }

  .custom-table td {
    border: none;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .custom-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
  }

  .custom-table td.actions-cell {
    border-top: 1px dashed var(--border-color);
    margin-top: 8px;
    padding-top: 10px;
    justify-content: flex-end;
  }
}

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

/* ==========================================================================
   CREDENTIALS & PERMISSION SYSTEM STYLES
   ========================================================================== */

.credential-box {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  min-width: 140px;
}

.credential-password-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.btn-icon-xs {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  padding: 1px 4px;
  font-size: 11px;
  line-height: 1;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-xs:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.input-with-action {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-action .form-input {
  padding-right: 38px;
}

.action-inside-btn {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}

.action-inside-btn:hover {
  transform: scale(1.1);
}

/* Yetki Checkbox Grid */
.permissions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 8px;
  background: #f8fafc;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  max-height: 220px;
  overflow-y: auto;
}

.permission-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  background: #ffffff;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.permission-checkbox-item:hover {
  border-color: var(--primary);
  background: #eff6ff;
}

.permission-checkbox-item input[type="checkbox"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ========================================== */
/* FİNANSAL RAPORLAR & KÂR / ZARAR STİLLERİ  */
/* ========================================== */
.report-period-btn.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.financial-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  font-size: 13px;
  background: #ffffff;
}

.financial-table th {
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
  font-size: 12px;
  padding: 12px 14px;
  border-bottom: 2px solid #cbd5e1;
  border-right: 1px solid #e2e8f0;
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.financial-table th:last-child {
  border-right: none;
}

.financial-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #e2e8f0;
  border-right: 1px solid #f1f5f9;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 13px;
}

.financial-table td:last-child {
  border-right: none;
}

.financial-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.financial-table tbody tr:hover {
  background: #eff6ff;
}

.financial-table tfoot tr {
  background: #f8fafc;
  font-weight: 800;
  border-top: 2px solid #cbd5e1;
}

.financial-table tfoot td {
  padding: 13px 14px;
  border-top: 2px solid #cbd5e1;
  border-bottom: none;
}

/* ========================================== */
/* SAAS TAB BUTONLARI                         */
/* ========================================== */
.saas-tab-btn.active {
  background: var(--primary) !important;
  color: #ffffff !important;
  border-color: var(--primary) !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

