/* ===== Global Theme ===== */
:root{
  --app-bg:#f4f4f5;
  --app-surface:#ffffff;
  --app-border:#e5e7eb;
  --app-text:#101010;
  --app-muted:#6b7280;
  --app-primary:#c1121f;
  --app-primary-dark:#850c16;
  --app-accent:#121212;
}
body{
  color:var(--app-text);
  font-family:"Manrope","Segoe UI",Tahoma,sans-serif;
}
html, body{
  min-height:100%;
}
body.bg-light{
  min-height:100vh;
  background:
    radial-gradient(circle at 10% -12%, rgba(193,18,31,.16), transparent 38%),
    radial-gradient(circle at 98% 95%, rgba(0,0,0,.08), transparent 33%),
    linear-gradient(180deg, #fbfbfb 0%, var(--app-bg) 100%);
  background-repeat:no-repeat;
  background-size:cover;
  background-attachment:fixed;
}
.navbar.bg-dark{
  background:linear-gradient(105deg, #0f0f10 0%, #191919 58%, #45090f 100%) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.28);
}
.navbar .nav-link,
.navbar .navbar-text{
  color:rgba(255,255,255,.9) !important;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus{
  color:#fff !important;
}
.navbar .nav-link.active{
  font-weight:700;
}
.navbar .navbar-brand img{
  filter:drop-shadow(0 2px 5px rgba(0,0,0,.4));
}
.dropdown-menu{
  border-radius:12px;
  border:1px solid var(--app-border);
  box-shadow:0 14px 28px rgba(0,0,0,.14);
}
.dropdown-item{
  font-weight:600;
}
.dropdown-item:active{
  background:linear-gradient(135deg, var(--app-primary), var(--app-accent));
}
.card{
  border-radius:14px;
  border:1px solid var(--app-border);
  box-shadow:0 10px 22px rgba(17,17,17,.07);
}
.btn{
  border-radius:10px;
  font-weight:700;
}
.btn-primary{
  border:none;
  background:linear-gradient(135deg, var(--app-primary), var(--app-primary-dark));
}
.btn-primary:hover{
  filter:brightness(.97);
}
.btn-outline-primary{
  border-color:var(--app-primary);
  color:var(--app-primary);
}
.btn-outline-primary:hover{
  background:var(--app-primary);
  border-color:var(--app-primary);
}
.btn-customer-detail{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  border:1px solid #171717;
  background:#fff;
  color:#171717;
  padding:.38rem .74rem;
  line-height:1.1;
  box-shadow:0 3px 10px rgba(0,0,0,.08);
}
.btn-customer-detail .glyph{
  width:20px;
  height:20px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, #111 0%, #c1121f 100%);
  color:#fff;
  font-size:12px;
  font-weight:800;
}
.btn-customer-detail:hover,
.btn-customer-detail:focus{
  background:linear-gradient(135deg, #171717 0%, #a90f1b 100%);
  color:#fff;
  border-color:#a90f1b;
  box-shadow:0 8px 16px rgba(193,18,31,.22);
}
.btn-customer-detail:hover .glyph,
.btn-customer-detail:focus .glyph{
  background:rgba(255,255,255,.2);
  color:#fff;
}
.form-control,
.form-select{
  border-radius:10px;
  border-color:#d5d7db;
}
.form-control:focus,
.form-select:focus{
  border-color:#d2444f;
  box-shadow:0 0 0 .2rem rgba(193,18,31,.18);
}
.table thead th{
  color:#3f3f46;
  font-size:.86rem;
  font-weight:700;
}
.text-muted{
  color:var(--app-muted) !important;
}
.dash-hero{
  border:none;
  color:#fff;
  overflow:hidden;
  position:relative;
  background:linear-gradient(110deg, #0f0f10 0%, #191919 48%, #c1121f 100%);
}
.dash-hero > *{
  position:relative;
  z-index:1;
}
.dash-hero::after{
  content:"";
  position:absolute;
  width:320px;
  height:320px;
  right:-140px;
  top:-180px;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  pointer-events:none;
}
.dash-kpi{
  background:#fff;
  border:1px solid var(--app-border);
  border-left:4px solid var(--app-primary);
  border-radius:14px;
  padding:14px 16px;
  height:100%;
}
.dash-kpi .kicker{
  color:var(--app-muted);
  font-size:.78rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.dash-kpi .value{
  font-size:1.8rem;
  line-height:1.1;
  font-weight:800;
  margin-top:4px;
}
.dash-kpi .meta{
  color:var(--app-muted);
  font-size:.82rem;
  margin-top:4px;
}
.dash-panel .list-group-item{
  background:transparent;
  border-color:#eceff3;
}
.dash-empty{
  border:1px dashed #d8dde5;
  border-radius:12px;
  padding:18px;
  background:#fafafa;
  color:var(--app-muted);
  font-size:.92rem;
}
.dash-pill{
  display:inline-block;
  border-radius:999px;
  border:1px solid rgba(193,18,31,.25);
  color:#9a1020;
  background:rgba(193,18,31,.08);
  padding:2px 10px;
  font-size:.75rem;
  font-weight:700;
}
.dash-progress{
  height:8px;
  background:#eceff3;
}
@media (prefers-reduced-motion:no-preference){
  .card{
    animation:card-in .25s ease-out;
  }
  @keyframes card-in{
    from{opacity:0; transform:translateY(3px);}
    to{opacity:1; transform:translateY(0);}
  }
}
@media print{
  body.bg-light{ background:#fff !important; }
  .card{ box-shadow:none !important; }
}
/* ===== Şematik Plan (screen) ===== */
.plan-stage{ width:100%; overflow:auto; background:#f8fafc; border:1px solid #e5e7eb; border-radius:12px; padding:12px;}
.plan-canvas{ position:relative; display:inline-block; margin:0 auto; max-width:100%; }
.plan-image{ display:block; max-width:100%; height:auto; border-radius:8px; box-shadow:0 1px 10px rgba(0,0,0,.04); }
.plan-overlay{ position:absolute; inset:0; z-index:2; pointer-events:none; }

/* marker */
.plan-marker{ position:absolute; transform:translate(-50%,-50%); width:30px; height:30px; border-radius:7px; color:#fff; font-weight:800; font-size:12px; display:flex; align-items:center; justify-content:center; box-shadow:0 2px 10px rgba(0,0,0,.18); pointer-events:auto; cursor:grab; user-select:none; touch-action:none; }
.plan-marker.dragging{ cursor:grabbing; opacity:.92; }
.plan-marker .lbl{ pointer-events:none; }
.plan-marker .del{ position:absolute; right:-8px; top:-8px; width:18px; height:18px; border-radius:999px; background:#dc2626; color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; line-height:1; cursor:pointer; }

/* legend + palette */
.plan-dot{ display:inline-block; width:10px; height:10px; border-radius:3px; margin-right:6px; vertical-align:-1px; }
.plan-palette{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.plan-token{ display:inline-flex; align-items:center; justify-content:center; min-width:38px; height:30px; padding:0 10px; border-radius:9px; color:#fff; font-weight:900; letter-spacing:.2px; user-select:none; cursor:grab; box-shadow:0 2px 10px rgba(0,0,0,.12); }
.plan-token:active{ cursor:grabbing; }
.plan-token small{ font-weight:700; opacity:.9; }

/* code badges */
.plan-code-badge{ display:inline-flex; align-items:center; justify-content:center; min-width:40px; height:26px; padding:0 10px; border-radius:999px; color:#fff; font-weight:800; font-size:12px; box-shadow:0 1px 8px rgba(0,0,0,.08); }

/* type colors */
.m-yem, .dot-yem{ background:#ef4444; }
.m-canli, .dot-canli{ background:#22c55e; }
.m-isikli, .dot-isikli{ background:#3b82f6; }
.m-hasere, .dot-hasere{ background:#f59e0b; }
.m-guve, .dot-guve{ background:#a855f7; }

.plan-stage.dragover{ outline:3px dashed rgba(59,130,246,.35); outline-offset:4px; }

@media print{
  .plan-stage{ border:none !important; padding:0 !important; overflow:hidden !important; background:#fff !important; }
  .plan-token, #planPalette, #planTypeSel, .plan-filter, .btn, .navbar, .no-print{ display:none !important; }
  .plan-code-badge{ box-shadow:none !important; }
}
