/* ============================================================
   Otomurat — Modern B2B Tema
   Koyu mavi + turuncu vurgu (otomotiv endüstrisi hissi)
   ============================================================ */

:root {
  /* Renkler */
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e4e7eb;
  --text: #1a2332;
  --text-muted: #64748b;

  --primary: #1e3a5f;       /* koyu mavi */
  --primary-dark: #142840;
  --primary-light: #3b5c87;

  --accent: #ff6b35;        /* turuncu */
  --accent-dark: #e85a2b;
  --accent-light: #ff8a5f;

  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --blue: #3b82f6;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.1);
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #293548;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --primary: #3b5c87;
  --primary-dark: #1e3a5f;
  --primary-light: #5c7fa8;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Layout — üst şeritli (orkestra'dan farklı!)
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.topbar .brand .logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  color: #fff;
}
.topbar .spacer { flex: 1; }
.topbar nav {
  display: flex;
  gap: 4px;
}
.topbar nav a {
  color: rgba(255,255,255,.85);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  transition: all .15s;
}
.topbar nav a:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  text-decoration: none;
}
.topbar nav a.active {
  background: var(--accent);
  color: #fff;
}
.topbar .user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-left: 1px solid rgba(255,255,255,.2);
  padding-left: 16px;
}
.topbar .user-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.topbar .user-meta { line-height: 1.2; }
.topbar .user-meta .name { font-size: 13px; font-weight: 600; }
.topbar .user-meta .role { font-size: 11px; opacity: .7; }
.topbar a.logout {
  color: rgba(255,255,255,.7);
  font-size: 12px;
  padding: 4px 8px;
}

/* Mobile menü */
.mobile-toggle { display: none; background: transparent; color: #fff; border: 0; font-size: 22px; cursor: pointer; }

/* ============================================================
   Main content
   ============================================================ */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
}
.page-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 600;
}

/* Stat card grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}
.stat-card .label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}
.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  margin: 6px 0;
}
.stat-card .hint { font-size: 12px; color: var(--text-muted); }
.stat-card.primary::before { background: var(--primary); }
.stat-card.green::before   { background: var(--green); }
.stat-card.red::before     { background: var(--red); }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 16px; }
label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
label .required { color: var(--red); }
input[type="text"], input[type="password"], input[type="email"], input[type="number"],
input[type="tel"], input[type="date"], textarea, select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30,58,95,.1);
}
textarea { min-height: 80px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover:not(:disabled) { background: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); text-decoration: none; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; text-decoration: none; color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============================================================
   Tables
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  background: var(--surface-2);
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.badge-primary { background: rgba(30,58,95,.1); color: var(--primary); }
.badge-accent { background: rgba(255,107,53,.1); color: var(--accent); }
.badge-green { background: rgba(16,185,129,.1); color: var(--green); }
.badge-red { background: rgba(239,68,68,.1); color: var(--red); }
.badge-yellow { background: rgba(245,158,11,.1); color: var(--yellow); }
.badge-gray { background: var(--border); color: var(--text-muted); }

/* Status badges */
.status-draft { background: var(--border); color: var(--text-muted); }
.status-sent, .status-pending, .status-submitted { background: rgba(59,130,246,.1); color: var(--blue); }
.status-offered, .status-reviewed { background: rgba(245,158,11,.1); color: var(--yellow); }
.status-ordered, .status-preparing, .status-shipped { background: rgba(255,107,53,.1); color: var(--accent); }
.status-delivered, .status-completed, .status-active { background: rgba(16,185,129,.1); color: var(--green); }
.status-cancelled, .status-suspended { background: rgba(239,68,68,.1); color: var(--red); }

/* ============================================================
   Alerts / Flash messages
   ============================================================ */
.flash-container {
  position: fixed;
  top: 20px; right: 20px;
  z-index: 200;
  max-width: 360px;
}
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 10px;
  background: var(--surface);
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow);
  font-size: 13px;
  animation: slideIn .3s;
}
.flash-success { border-left-color: var(--green); }
.flash-error { border-left-color: var(--red); }
.flash-warning { border-left-color: var(--yellow); }
.flash-info { border-left-color: var(--blue); }

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

/* ============================================================
   Login page
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo .mark {
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 12px;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900;
  font-size: 28px;
  color: #fff;
}
.auth-title { font-size: 22px; font-weight: 700; }
.auth-subtitle { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.auth-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Utility
   ============================================================ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.flex { display: flex; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-bold { font-weight: 600; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* Empty state */
.empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty .icon { font-size: 48px; margin-bottom: 12px; }
.empty .title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty .hint { font-size: 13px; margin-bottom: 16px; }

/* Responsive */
@media (max-width: 768px) {
  .topbar-inner { padding: 0 16px; }
  .topbar nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--primary-dark); flex-direction: column; padding: 12px; gap: 2px; }
  .topbar nav.open { display: flex; }
  .topbar nav a { padding: 12px 16px; }
  .mobile-toggle { display: block; }
  .topbar .user-meta { display: none; }
  .main { padding: 16px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   v0.2.0 EKLEMELERI — Modal, Filter Bar, Tabs, Card Highlight
   ============================================================ */

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filter-pill {
  padding: 6px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
}
.filter-pill:hover {
  background: var(--border);
}
.filter-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tab-btn {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Card highlight (unread) */
.card-highlight {
  border-left: 3px solid var(--accent);
  background: linear-gradient(to right, rgba(255,107,53,0.04), transparent 30%);
}

/* Flash close */
.flash {
  cursor: pointer;
  position: relative;
  padding-right: 40px;
}
.flash-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 700;
  opacity: 0.6;
}
.flash:hover .flash-close {
  opacity: 1;
}

/* Badge variations */
.badge-red {
  background: #fee2e2;
  color: #991b1b;
}
.badge-yellow {
  background: #fef3c7;
  color: #92400e;
}
.badge-green {
  background: #d1fae5;
  color: #065f46;
}
.badge-gray {
  background: var(--surface-2);
  color: var(--text-muted);
}

/* Status badges */
.status-draft { background: var(--surface-2); color: var(--text-muted); }
.status-sent { background: #dbeafe; color: #1e40af; }
.status-offered { background: #fef3c7; color: #92400e; }
.status-pending { background: #fed7aa; color: #9a3412; }
.status-submitted { background: #d1fae5; color: #065f46; }
.status-accepted { background: #a7f3d0; color: #064e3b; }
.status-ordered { background: #bfdbfe; color: #1e3a8a; }
.status-reviewed { background: #e0e7ff; color: #3730a3; }
.status-preparing { background: #fef3c7; color: #92400e; }
.status-shipped { background: #ddd6fe; color: #5b21b6; }
.status-delivered { background: #d1fae5; color: #065f46; }
.status-completed { background: #a7f3d0; color: #064e3b; }
.status-cancelled { background: #fee2e2; color: #991b1b; }
.status-rejected { background: #fecaca; color: #991b1b; }
.status-requested { background: #fef3c7; color: #92400e; }
.status-approved { background: #d1fae5; color: #065f46; }
.status-active { background: #d1fae5; color: #065f46; }
.status-suspended { background: #fee2e2; color: #991b1b; }
.status-deleted { background: var(--surface-2); color: var(--text-muted); }

/* Profile/Logout buttons in topbar */
.profile-link, .logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 4px;
  transition: all 0.15s;
}
.profile-link:hover, .logout:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Text accent helper */
.text-accent { color: var(--accent); }
.btn-danger {
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
}
.btn-danger:hover {
  background: #dc2626;
}

/* Required indicator */
.required { color: var(--red); }

/* Code tag */
code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  color: var(--accent-dark);
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .modal-content {
    padding: 16px;
  }
  .tabs {
    gap: 0;
  }
  .tab-btn {
    padding: 8px 10px;
    font-size: 13px;
  }
  .filter-bar {
    padding: 8px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Checkbox grid fix */
label[style*="display:flex"] input[type="checkbox"] {
  flex-shrink: 0;
}

/* Badge fallback */
.badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--surface-2);
  color: var(--text);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
