/* ============================================
   BBS BESİCİLİK — Et Tesisi Yönetim Sistemi
   Ortak Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* === Renk Paleti === */
  --primary: #DC2626;
  --primary-dark: #991B1B;
  --primary-light: #FEE2E2;
  --primary-gradient: linear-gradient(135deg, #DC2626, #991B1B);

  --sidebar: #0F172A;
  --sidebar-hover: #1E293B;
  --sidebar-active: #1E3A5F;

  --bg: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;

  --text: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;

  --success: #22C55E;
  --success-light: #DCFCE7;
  --success-dark: #15803D;

  --warning: #F97316;
  --warning-light: #FFEDD5;
  --warning-dark: #C2410C;

  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-dark: #B91C1C;

  --info: #3B82F6;
  --info-light: #DBEAFE;
  --info-dark: #1E40AF;

  /* === Tipografi === */
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, Consolas, monospace;

  /* === Spacing === */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* === Gölgeler === */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 30px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 20px 60px rgba(15, 23, 42, 0.15);

  /* === Layout === */
  --sidebar-width: 240px;
  --topbar-height: 64px;
}

/* === Reset === */
* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* === Layout: Sidebar + Main === */
.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar);
  color: #fff;
  padding: 20px 0;
  flex-shrink: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid #1E293B;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}

.brand-text {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.brand-sub {
  font-size: 10px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-top: 1px;
}

.nav { padding: 16px 0; }

.nav-section {
  font-size: 10px;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 18px 20px 6px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #CBD5E1;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left: 3px solid var(--info);
  padding-left: 17px;
}

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

/* TOPBAR + MAIN */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

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

.page-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.3px;
}

.page-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text);
}

.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.user-info { font-size: 13px; line-height: 1.3; }
.user-name { font-weight: 700; color: var(--text); }
.user-role { font-size: 11px; color: var(--text-muted); }

.content { padding: 28px; }

/* === Komponentler === */

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

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

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

.section-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 12px;
}

/* Buttons */
.btn {
  padding: 11px 20px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(220, 38, 38, 0.35); }

.btn-success {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.25);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), var(--warning-dark));
  color: #fff;
}

.btn-info {
  background: linear-gradient(135deg, #8B5CF6, #6D28D9);
  color: #fff;
}

.btn-secondary {
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-secondary:hover { background: var(--bg); color: var(--text); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-lg { padding: 14px 26px; font-size: 14px; }

/* Forms */
.field { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 800;
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

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

.input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--card);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.input.filled {
  border-color: #BAE6FD;
  background: #F0F9FF;
  font-weight: 600;
}

.input.mono { font-family: var(--font-mono); }

.input-wrapper { position: relative; }
.input-wrapper .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  pointer-events: none;
}
.input-wrapper.icon-left .input { padding-left: 40px; }

/* Tags / Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-success { background: var(--success-light); color: var(--success-dark); border: 1px solid #86EFAC; }
.tag-warning { background: var(--warning-light); color: var(--warning-dark); border: 1px solid #FDBA74; }
.tag-danger  { background: var(--danger-light); color: var(--danger-dark); border: 1px solid #FCA5A5; }
.tag-info    { background: var(--info-light); color: var(--info-dark); border: 1px solid #93C5FD; }
.tag-neutral { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.tag-dark    { background: #1E293B; color: #fff; }

.code-tag {
  background: #1E293B;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: 0.3px;
}

/* Metric Cards */
.metric {
  background: var(--card);
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.metric::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent, var(--info));
}

.metric.blue   { --accent: var(--info); }
.metric.green  { --accent: var(--success); }
.metric.orange { --accent: var(--warning); }
.metric.red    { --accent: var(--danger); }
.metric.purple { --accent: #8B5CF6; }

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.metric-sub {
  font-size: 11.5px;
  color: var(--success-dark);
  margin-top: 5px;
  font-weight: 600;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}

.table thead th {
  background: #1F3864;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 12px 16px;
  text-align: left;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13.5px;
}

.table tbody tr:nth-child(even) { background: #F8FAFC; }
.table tbody tr:hover { background: #EFF6FF; }

/* === Mobil Responsive === */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
}

@media (max-width: 768px) {
  .content { padding: 18px; }
  .topbar { padding: 0 18px; }
  .page-title { font-size: 16px; }
  .page-sub { display: none; }
  .user-info { display: none; }

  .card { padding: 16px; border-radius: var(--radius); }
  .metric { padding: 14px 16px; }
  .metric-value { font-size: 22px; }
  .btn { padding: 10px 16px; font-size: 13px; }
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* Utility */
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 4px; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.text-mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.font-bold { font-weight: 700; }
