:root {
  --bg-color: #0a0e1a;
  --bg-secondary: #0f1525;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-bg-hover: rgba(255, 255, 255, 0.08);
  --primary: #c8a951;
  --primary-hover: #d4b96a;
  --primary-glow: rgba(200, 169, 81, 0.15);
  --status-yellow: #f0c040;
  --status-blue: #4a9eff;
  --status-orange: #f59e0b;
  --status-green: #34d399;
  --text-primary: #f0f0f5;
  --text-secondary: #8b8fa3;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(200, 169, 81, 0.3);
  --success: #34d399;
  --error: #f87171;
  --input-bg: rgba(255, 255, 255, 0.07);
  --sidebar-width: 260px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Concert One', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

/* ==========================================
   AUTH SCREEN
   ========================================== */
#auth-view {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  background: var(--bg-color);
  background-image: 
    radial-gradient(ellipse at 20% 50%, rgba(200, 169, 81, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 158, 255, 0.05) 0%, transparent 50%);
}
#auth-view.active {
  display: flex;
}

.auth-box {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: authAppear 0.5s ease-out;
}

@keyframes authAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-box .brand {
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 2rem;
}

.auth-box form {
  text-align: left;
}

.auth-toggle {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-toggle a {
  margin-left: 0.3rem;
  font-weight: 500;
}

/* ==========================================
   APP LAYOUT
   ========================================== */
#app-container {
  display: none;
  min-height: 100vh;
}
#app-container.active {
  display: flex;
}

/* Views (inside main) */
.app-view {
  display: none;
  animation: viewFadeIn 0.35s ease-out;
}
.app-view.active {
  display: block;
}

@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: transform var(--transition);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2.5rem;
}

.brand i {
  width: 32px;
  height: 32px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 5px; /* for scrollbar */
}
/* Scrollbar styling for nav-links */
.nav-links::-webkit-scrollbar {
  width: 4px;
}
.nav-links::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.nav-links::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-radius: 10px;
  transition: all var(--transition);
  font-size: 0.95rem;
  font-weight: 400;
}

.nav-link:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}

.nav-link.active {
  background: var(--primary-glow);
  color: var(--primary);
  font-weight: 500;
}

.nav-link i {
  width: 20px;
  height: 20px;
}

/* Sidebar Accordion */
.nav-group {
  margin-bottom: 0.2rem;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
}

.nav-group-header:hover {
  background: var(--card-bg);
  color: var(--text-primary);
}

.nav-group-title {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-group-title i {
  width: 20px;
  height: 20px;
}

.nav-group-header .chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease;
}

.nav-group.open .nav-group-header {
  color: var(--text-primary);
}

.nav-group.open .chevron {
  transform: rotate(180deg);
}

.nav-group-items {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-left: 2.2rem; /* Indent sub-items */
}

.nav-group.open .nav-group-items {
  max-height: 500px; /* Arbitrary large max-height for animation */
  margin-top: 0.3rem;
  margin-bottom: 0.5rem;
}

.nav-group-items .nav-link {
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
}

.nav-group-items .nav-link i {
  width: 18px;
  height: 18px;
}

.logout-btn {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 1rem;
  color: var(--error);
  cursor: pointer;
  border-radius: 10px;
  transition: background-color var(--transition);
  font-size: 0.95rem;
}
.logout-btn:hover {
  background: rgba(248, 113, 113, 0.1);
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 2.5rem;
  width: calc(100% - var(--sidebar-width));
  max-width: 1400px;
}

/* Mobile Nav */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-nav-toggle:hover {
  background: var(--card-bg-hover);
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
.sidebar-overlay.active {
  display: block;
}

/* ==========================================
   COMPONENTS
   ========================================== */

/* Card */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--transition);
}

/* Buttons */
.btn {
  background: var(--primary);
  color: var(--bg-color);
  border: none;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-family: 'Concert One', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 169, 81, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover {
  background: var(--primary-glow);
  box-shadow: none;
}

.btn-danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
}
.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
  box-shadow: none;
}

.btn-sm {
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 400;
}

.form-control {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.1);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.5rem;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

/* ==========================================
   PAGE HEADER
   ========================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

/* ==========================================
   DASHBOARD — Status Tiles
   ========================================== */
.status-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.status-tile {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.status-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
  opacity: 0.8;
  transition: opacity 0.3s;
}

.status-tile:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 25px 30px -10px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.15);
  border-color: rgba(255,255,255,0.15);
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.status-tile:hover .tile-icon {
  transform: scale(1.15) rotate(5deg);
}

.tile-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--surface);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.status-tile.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 8px 24px rgba(200, 169, 81, 0.15);
  transform: translateY(-3px);
}

.tile-icon i {
  width: 24px;
  height: 24px;
}

.tile-yellow { background: rgba(240, 192, 64, 0.15); color: var(--status-yellow); }
.tile-blue { background: rgba(74, 158, 255, 0.15); color: var(--status-blue); }
.tile-orange { background: rgba(245, 158, 11, 0.15); color: var(--status-orange); }
.tile-green { background: rgba(52, 211, 153, 0.15); color: var(--success); }
.tile-gray { background: rgba(139, 143, 163, 0.15); color: var(--text-secondary); }

.tile-count {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.tile-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Expandable Order List */
.tile-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tile-list-header h3 {
  color: var(--primary);
  font-size: 1.05rem;
}

/* Order List Items */
.order-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin-bottom: 0.6rem;
  transition: all var(--transition);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.order-list-item:hover {
  border-color: var(--border-hover);
  background: var(--card-bg-hover);
}

.order-list-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.order-list-name {
  font-weight: 600;
  font-size: 0.95rem;
  min-width: 150px;
}

.order-list-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.order-list-actions {
  display: flex;
  gap: 0.5rem;
}

.order-list-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Badges */
.badge {
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-yellow {
  background: rgba(240, 192, 64, 0.12);
  color: var(--status-yellow);
  border: 1px solid rgba(240, 192, 64, 0.2);
}

.badge-blue {
  background: rgba(74, 158, 255, 0.12);
  color: var(--status-blue);
  border: 1px solid rgba(74, 158, 255, 0.2);
}

.badge-orange {
  background: rgba(245, 158, 11, 0.12);
  color: var(--status-orange);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-green {
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-gray {
  background: rgba(139, 143, 163, 0.12);
  color: var(--text-secondary);
  border: 1px solid rgba(139, 143, 163, 0.2);
}

.badge-red {
  background: rgba(248, 113, 113, 0.12);
  color: var(--error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ==========================================
   TABLES
   ========================================== */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

td {
  font-size: 0.9rem;
  vertical-align: middle;
}

/* Table inputs (compact) */
td .form-control {
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  min-width: 80px;
}

td select.form-control {
  min-width: 120px;
}

/* ==========================================
   TOASTS
   ========================================== */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  padding: 0.9rem 1.3rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
  animation: toastSlideIn 0.35s ease-out forwards;
  pointer-events: auto;
  font-size: 0.9rem;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }

.toast i {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.toast.success i { color: var(--success); }
.toast.error i { color: var(--error); }

@keyframes toastSlideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================
   LOADING
   ========================================== */
#global-loader {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  flex-direction: column;
  gap: 1rem;
  transition: opacity 0.3s ease;
}

#global-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(200, 169, 81, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loader-text {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.9rem;
}

/* ==========================================
   DETAIL PAGE
   ========================================== */
.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h3 {
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.detail-item label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 400;
}

.detail-item span {
  font-size: 0.95rem;
  font-weight: 500;
}

.status-select-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.order-timeline {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-color);
}

.timeline-item {
  margin-bottom: 1.5rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.65rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--bg-color);
}

/* ==========================================
   UTILITIES
   ========================================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.text-gold {
  color: var(--primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

/* ==========================================
   PRODUCT ROWS (Ölçü & Ürün Ekle)
   ========================================== */
.product-row {
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition);
}

.product-row:hover {
  border-color: var(--border-hover);
}

.product-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.product-row-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-glow);
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
}

.product-row-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem 1rem;
}

.product-row-grid .form-group {
  margin-bottom: 0.5rem;
}

.product-row-grid .form-group-wide {
  grid-column: span 2;
}

/* Güneşlik Section */
.guneslik-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
}

.guneslik-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.8rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Stok Section */
.stok-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stok-section .form-group {
  margin-bottom: 0;
}

/* Searchable Dropdown */
.search-select-container {
  position: relative;
}

.search-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-top: none;
  border-radius: 0 0 10px 10px;
  z-index: 50;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.search-select-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition);
}

.search-select-item:hover {
  background: var(--primary-glow);
}

.search-select-item .item-name {
  font-weight: 500;
  color: var(--text-primary);
}

.search-select-item .item-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.search-select-item.selected {
  background: var(--primary-glow);
  border-left: 3px solid var(--primary);
}

.search-select-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-select-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.search-select-dropdown::-webkit-scrollbar-thumb {
  background: rgba(200, 169, 81, 0.3);
  border-radius: 3px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
  .main-content {
    padding: 1.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-top: 4rem;
  }

  .mobile-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .status-tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .auth-box {
    margin: 1rem;
    padding: 1.5rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .status-select-group {
    flex-direction: column;
    width: 100%;
  }

  .status-select-group .btn {
    width: 100%;
  }
}

/* ==========================================
   ATÖLYE FİŞ & ÇİZİM STİLLERİ
   ========================================== */
.schematic-box {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0; /* Minimized margin for ultra tight spacing */
  border-top: 2px solid var(--text-primary);
  border-right: 2px solid var(--text-primary);
  border-left: 2px solid var(--text-primary);
  padding: 0.5rem;
  background-color: transparent;
}

.schematic-width {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.schematic-height {
  position: absolute;
  right: -55px;
  bottom: -20px; /* moved slightly lower */
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}

.schematic-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem; /* smaller font for 150px box */
  line-height: 1.1;
  overflow: hidden;
}

/* ==========================================
   PRINT STYLES
   ========================================== */
/* =============================================
   AUTOCOMPLETE COMBOBOX STYLES
   ============================================= */
.custom-select-wrapper {
  position: relative;
}
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0 0;
  z-index: 1050;
}
.autocomplete-list li {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-primary);
  font-size: 0.95rem;
}
.autocomplete-list li:last-child {
  border-bottom: none;
}
.autocomplete-list li:hover {
  background: var(--primary-glow);
  color: var(--primary);
  padding-left: 1.2rem;
}
.autocomplete-list .ac-subtext {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

@media print {
  /* Hide everything by default */
  body * {
    visibility: hidden;
  }
  
  /* Make the print area and its children visible */
  #view-atolye-fis.active,
  #view-atolye-fis.active .print-area,
  #view-atolye-fis.active .print-area * {
    visibility: visible;
  }
  
  /* Reset positioning so it aligns at top-left of page */
  #view-atolye-fis.active .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    background: transparent;
  }

  /* Hide specific non-print elements inside the print view if any */
  .no-print {
    display: none !important;
  }

  /* Force light theme for printing */
  :root {
    --bg-color: #ffffff !important;
    --bg-secondary: #ffffff !important;
    --card-bg: transparent !important;
    --card-bg-hover: transparent !important;
    --text-primary: #000000 !important;
    --text-secondary: #333333 !important;
    --border-color: #000000 !important;
    --input-bg: transparent !important;
  }
  
  body, .app-container, .main-content, #view-atolye-fis {
    background-color: #ffffff !important;
    color: #000000 !important;
  }
  
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  .schematic-box {
    border-top: 2px solid black;
    border-right: 2px solid black;
  }
}

/* =============================================
   ESTETİK AKSİYON BUTONLARI (TABLOLAR İÇİN)
   ============================================= */
.action-btn-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.btn-action-edit,
.btn-action-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  line-height: 1;
  border: 1px solid transparent;
}

.btn-action-edit {
  background: var(--primary-glow);
  color: var(--primary);
  border-color: rgba(99, 102, 241, 0.25);
}

.btn-action-edit:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-action-delete {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-action-delete:hover {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Kar Analizi Detay Accordion */
.kar-detail-row { display: none; background: rgba(0,0,0,0.02); }
.kar-detail-row.open { display: table-row; }
.kar-detail-content { padding: 1rem; border-left: 3px solid var(--primary); }
.kar-master-row { cursor: pointer; transition: background 0.2s; }
.kar-master-row:hover { background: rgba(0,0,0,0.04); }
.dark-mode .kar-detail-row { background: rgba(255,255,255,0.02); }
.dark-mode .kar-master-row:hover { background: rgba(255,255,255,0.04); }
.kar-subtable { width: 100%; font-size: 0.85rem; border-collapse: collapse; margin-top: 0.5rem; }
.kar-subtable th, .kar-subtable td { padding: 0.5rem; border-bottom: 1px solid var(--border-color); text-align: left; }
.kar-subtable th { font-weight: 600; color: var(--text-secondary); }
.kar-subtable tr:last-child td { border-bottom: none; }
@ m e d i a   p r i n t   {   . h i d e - o n - p r i n t   {   d i s p l a y :   n o n e   ! i m p o r t a n t ;   }   }  
 