/* ===========================================================
   Greenmer — Üretim Planlama Paneli
   Tasarım dili: koyu lacivert kenar çubuğu + açık içerik alanı,
   mercan vurgu rengi, yumuşak kartlar.
   =========================================================== */

:root {
  --sidebar: #1B2942;
  --sidebar-hover: #24344f;
  --sidebar-active: #2b3d5c;
  --accent: #E8734A;
  --accent-dark: #d15f38;
  --bg: #F6F7F9;
  --card: #FFFFFF;
  --text: #1A2333;
  --text-muted: #6B7684;
  --text-light: #97A1AE;
  --border: #E6E9ED;
  --border-strong: #D4D9E0;

  --green-bg: #DCFCE7;  --green-fg: #15803D;
  --amber-bg: #FEF3C7;  --amber-fg: #B45309;
  --red-bg: #FEE2E2;    --red-fg: #B91C1C;
  --blue-bg: #DBEAFE;   --blue-fg: #1D4ED8;
  --gray-bg: #EDF0F3;   --gray-fg: #55607080;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Georgia", "Times New Roman", serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Yerleşim ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 262px; flex-shrink: 0; background: var(--sidebar);
  color: #C9D2E0; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 22px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px; background: var(--accent);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.brand-text h1 { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: .1px; }
.brand-text p { font-size: 11.5px; color: #8C99AC; margin-top: 1px; }

.nav { flex: 1; padding: 4px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-sm); color: #C0CAD9; cursor: pointer;
  font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
  transition: background .15s, color .15s; user-select: none;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .9; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: #fff; font-size: 11px;
  font-weight: 700; padding: 1px 7px; border-radius: 999px;
}

.sidebar-foot { padding: 14px 18px 18px; border-top: 1px solid rgba(255,255,255,.07); }
.sidebar-foot .who { font-size: 13px; color: #fff; font-weight: 600; }
.sidebar-foot .role { font-size: 11.5px; color: #8C99AC; }
.sidebar-foot .link {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 12.5px; color: #A7B3C4; cursor: pointer;
}
.sidebar-foot .link:hover { color: #fff; }

.main { flex: 1; min-width: 0; padding: 26px 34px 60px; }

/* ---------- Sayfa başlığı ---------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; margin-bottom: 22px;
}
.page-head h2 { font-family: var(--serif); font-size: 30px; font-weight: 700; letter-spacing: -.3px; }
.page-head p { color: var(--text-muted); font-size: 13.5px; margin-top: 3px; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--card);
  color: var(--text); font-family: inherit; transition: .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { background: #F3F5F7; }
.btn-primary { background: var(--sidebar); color: #fff; }
.btn-primary:hover { background: #24344f; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-outline { border-color: var(--border-strong); background: var(--card); }
.btn-outline:hover { border-color: var(--text-light); }
.btn-danger { background: #DC2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16A34A; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Kartlar ---------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px;
}
.card-pad { padding: 20px 22px; }
.card-head {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.card-head h3 { font-size: 15px; font-weight: 650; }
.card-head p { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

/* ---------- KPI kutuları ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .label { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.kpi .sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.kpi.good .value { color: #15803D; }
.kpi.warn .value { color: #B45309; }
.kpi.bad  .value { color: #B91C1C; }

/* ---------- Tablolar ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left; padding: 13px 18px; font-weight: 600; color: var(--text-muted);
  background: #FAFBFC; border-bottom: 1px solid var(--border); white-space: nowrap;
  font-size: 12.5px;
}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #FAFBFC; }
.t-strong { font-weight: 650; }
.t-muted { color: var(--text-muted); }
.t-mono { font-variant-numeric: tabular-nums; }
.t-right { text-align: right; }

/* ---------- Rozetler ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green-fg); }
.badge-amber { background: var(--amber-bg); color: var(--amber-fg); }
.badge-red   { background: var(--red-bg);   color: var(--red-fg); }
.badge-blue  { background: var(--blue-bg);  color: var(--blue-fg); }
.badge-gray  { background: var(--gray-bg);  color: #55606F; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- Arama kartı ---------- */
.search-card { display: flex; gap: 0; align-items: stretch; }
.search-field { flex: 1; padding: 6px 4px; }
.search-field label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }

/* ---------- Form öğeleri ---------- */
.input, select.input, textarea.input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13.5px; font-family: inherit;
  color: var(--text); background: #fff; outline: none; transition: .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,115,74,.12); }
.input::placeholder { color: var(--text-light); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: #3C4757; }
.field .hint { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px;
  z-index: 100; overflow-y: auto;
}
.modal {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 720px; animation: pop .18s ease-out;
}
.modal.wide { max-width: 940px; }
@keyframes pop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.modal-head h3 { font-size: 18px; font-weight: 700; font-family: var(--serif); }
.modal-head p { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.modal-body { padding: 22px 24px; max-height: 66vh; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.x-btn { background: none; border: none; cursor: pointer; color: var(--text-light); padding: 4px; line-height: 0; }
.x-btn:hover { color: var(--text); }

/* ---------- Seçenek kartı (araya alma) ---------- */
.option {
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  padding: 16px 18px; cursor: pointer; margin-bottom: 12px; transition: .15s;
  display: flex; gap: 14px; align-items: flex-start; background: #fff;
}
.option:hover { border-color: var(--accent); background: #FFF9F6; }
.option.sel { border-color: var(--accent); background: #FFF6F2; box-shadow: 0 0 0 3px rgba(232,115,74,.1); }
.option .num {
  width: 26px; height: 26px; border-radius: 8px; background: var(--gray-bg);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; color: #4A5567;
}
.option.sel .num { background: var(--accent); color: #fff; }
.option h4 { font-size: 14px; font-weight: 650; margin-bottom: 3px; }
.option .desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; }
.option .meta { margin-top: 7px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Gantt ---------- */
.gantt { overflow-x: auto; padding: 4px 0 10px; }
.gantt-inner { min-width: 900px; padding: 0 18px 8px; }
.gantt-axis {
  display: flex; border-bottom: 1px solid var(--border); margin-bottom: 8px;
  padding-left: 58px; position: relative; height: 26px;
}
.gantt-tick { position: absolute; font-size: 11px; color: var(--text-muted); transform: translateX(-50%); white-space: nowrap; }
.gantt-tick i { position: absolute; top: 18px; left: 50%; width: 1px; height: 8px; background: var(--border-strong); }
.gantt-row { display: flex; align-items: center; margin-bottom: 7px; }
.gantt-label { width: 58px; flex-shrink: 0; font-weight: 650; font-size: 13px; color: #3C4757; }
.gantt-track {
  position: relative; flex: 1; height: 30px; background: #F4F6F8;
  border-radius: 6px; overflow: hidden;
}
.gantt-bar {
  position: absolute; top: 4px; height: 22px; border-radius: 4px; cursor: pointer;
  font-size: 10.5px; color: #fff; display: flex; align-items: center; padding: 0 6px;
  overflow: hidden; white-space: nowrap; transition: filter .12s;
}
.gantt-bar:hover { filter: brightness(1.12); }
.gantt-maint { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(45deg, #CBD5E1, #CBD5E1 5px, #E2E8F0 5px, #E2E8F0 10px); opacity: .85; }
.gantt-weekend { position: absolute; top: 0; height: 100%; background: rgba(148,163,184,.13); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 20px 4px; font-size: 12px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---------- Muhtelif ---------- */
.empty { padding: 46px 20px; text-align: center; color: var(--text-muted); }
.empty svg { width: 38px; height: 38px; opacity: .3; margin-bottom: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 3px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 1080px) { .grid-2 { grid-template-columns: 1fr; } }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-muted); }
.kv dd { font-weight: 550; }

.alert { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.alert-warn { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-ok { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

.activity { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity:last-child { border-bottom: none; }
.activity .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.activity .ttl { font-size: 13.5px; font-weight: 600; }
.activity .dtl { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.activity .tm { font-size: 11.5px; color: var(--text-light); margin-top: 3px; }

.toast-wrap { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--sidebar); color: #fff; padding: 13px 18px; border-radius: 10px;
  box-shadow: var(--shadow-lg); font-size: 13.5px; min-width: 260px; max-width: 420px;
  animation: slidein .2s ease-out; display: flex; gap: 10px; align-items: flex-start;
}
.toast.ok { background: #15803D; } .toast.err { background: #B91C1C; } .toast.warn { background: #B45309; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.spinner {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 44px; text-align: center; color: var(--text-muted); }

.progress { height: 7px; background: var(--gray-bg); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  padding: 9px 15px; font-size: 13.5px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.num-input { display: flex; align-items: center; gap: 0; }
.num-input button {
  width: 30px; height: 34px; border: 1px solid var(--border-strong); background: #FAFBFC;
  cursor: pointer; font-size: 15px; color: var(--text-muted); font-family: inherit;
}
.num-input button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.num-input button:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.num-input button:hover { background: #F0F2F5; color: var(--text); }
.num-input input {
  width: 78px; height: 34px; text-align: center; border: 1px solid var(--border-strong);
  border-left: none; border-right: none; font-size: 13.5px; font-family: inherit;
  outline: none; font-variant-numeric: tabular-nums;
}
.num-input input:focus { border-color: var(--accent); }
.changed { color: var(--accent) !important; font-weight: 700; }

/* Sipariş formunda ürün reçetesi gösterimi (hammadde sorulmaz) */
.recipe-box {
  background: var(--soft, #F7F9FC);
  border: 1px solid var(--border, #E3E8EF);
  border-radius: 6px;
  padding: 9px 11px;
}
.recipe-box table td { padding: 3px 4px; border: 0; }

/* Ürün reçetesinde üretim hattı seçimi */
.line-pick {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border: 1px solid var(--border, #E3E8EF);
  border-radius: 6px; cursor: pointer; font-size: 13px;
  background: #fff; transition: all .12s;
}
.line-pick.on { border-color: var(--accent, #E8734A); background: #FFF6F2; }
.line-pick input { margin: 0; }

/* ---------- Premium Login Ekranı ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: radial-gradient(circle at 0% 0%, #1e293b 0%, #0f172a 50%, #020617 100%);
  overflow: hidden;
}
.login-overlay::before {
  content: ''; position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(232,115,74,0.15) 0%, transparent 70%);
  top: -200px; right: -100px; border-radius: 50%;
  animation: floatOrb 10s ease-in-out infinite alternate;
}
@keyframes floatOrb {
  from { transform: translate(0, 0); }
  to { transform: translate(-50px, 50px); }
}
.login-card {
  position: relative;
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 48px 40px; border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  width: 100%; max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}
.login-logo {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #b45309);
  display: grid; place-items: center; color: #fff;
  margin: 0 auto 24px; box-shadow: 0 8px 16px rgba(232,115,74,0.3);
}
.login-title {
  text-align: center; font-family: var(--sans); font-size: 26px; font-weight: 800;
  margin-bottom: 8px; color: #fff; letter-spacing: -0.5px; line-height: 1.2;
}
.login-subtitle {
  text-align: center; color: #94a3b8; font-size: 14px; margin-bottom: 32px;
}
.login-card .field label { color: #cbd5e1; font-weight: 500; font-size: 13px; margin-bottom: 8px; display: block; }
.login-card .input {
  background: rgba(15, 23, 42, 0.6); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff; padding: 12px 16px; border-radius: 10px; font-size: 14.5px;
  transition: all 0.2s ease; width: 100%; outline: none;
}
.login-card .input::placeholder { color: #64748b; }
.login-card .input:focus {
  border-color: var(--accent); background: rgba(15, 23, 42, 0.8);
  box-shadow: 0 0 0 4px rgba(232,115,74,0.15);
}
.login-btn {
  background: var(--accent); color: #fff; border: none; width: 100%;
  padding: 14px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(232,115,74,0.3);
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.login-btn:hover {
  background: var(--accent-dark); transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232,115,74,0.4);
}
