/* e-İDEAL — Web kontrol merkezi kabuğu */

:root { --side-w: 232px; --side-w-min: 68px; --top-h: 62px; }

body.web { background: var(--bg); min-height: 100vh; overflow: hidden; }
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100vh; transition: grid-template-columns var(--dur-3) var(--ease); }
.shell.mini { grid-template-columns: var(--side-w-min) 1fr; }

/* ---------- Sol menü ---------- */
.side {
  background: #111317; color: #E7EAEF; display: flex; flex-direction: column;
  overflow: hidden; border-right: 1px solid #1E222A; z-index: 30;
}
:root[data-theme="dark"] .side { background: #0A0C10; border-right-color: #1A1E26; }
.side-hd { padding: 20px 18px 14px; display: flex; align-items: center; gap: 10px; min-height: var(--top-h); }
.side-hd img { height: 34px; width: auto; }
.shell.mini .side-hd { padding: 20px 10px 14px; justify-content: center; }
.shell.mini .side-hd img { height: 26px; }
.side-toggle {
  margin-left: auto; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  color: #7C8798; flex: none; transition: all var(--dur-1);
}
.side-toggle:hover { background: #1C212A; color: #fff; }
.shell.mini .side-toggle { display: none; }

.side-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 16px; }
.side-scroll::-webkit-scrollbar { width: 6px; }
.side-scroll::-webkit-scrollbar-thumb { background: #262C36; }
.side-lb {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: #5C6675; padding: 16px 10px 7px; white-space: nowrap;
}
.shell.mini .side-lb { opacity: 0; height: 14px; padding: 8px 0 0; }
.side a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: var(--r-sm);
  color: #9AA5B4; font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  transition: background var(--dur-1), color var(--dur-1); position: relative; margin-bottom: 2px;
}
.side a svg { width: 18px; height: 18px; flex: none; }
.side a span { overflow: hidden; text-overflow: ellipsis; }
.side a:hover { background: #1A1F27; color: #fff; }
.side a[aria-current="page"] { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(227,6,19,.35); }
.side a .count-badge { margin-left: auto; }
.shell.mini .side a { justify-content: center; padding: 10px 0; }
.shell.mini .side a span, .shell.mini .side a .count-badge { display: none; }
.side-ft { padding: 12px 10px; border-top: 1px solid #1E222A; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  width: 100%; text-align: left; color: #E7EAEF; transition: background var(--dur-1);
}
.side-user:hover { background: #1A1F27; }
.side-user b { font-size: var(--fs-sm); display: block; }
.side-user small { font-size: var(--fs-xxs); color: #7C8798; }
.shell.mini .side-user > *:not(.avatar) { display: none; }
.shell.mini .side-user { justify-content: center; }

/* ---------- Ana bölge ---------- */
.main-col { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.topbar {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: var(--s3);
  padding: 0 var(--s5); background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text-3); }
.crumb b { color: var(--brand); font-weight: 700; }
.crumb svg { width: 13px; height: 13px; }
.topbar h1 { font-size: var(--fs-xl); letter-spacing: -.025em; }

.gsearch { position: relative; max-width: 420px; width: 100%; }
.gsearch .input { height: 38px; padding-left: 38px; background: var(--surface-2); border-radius: var(--r-pill); }
.gsearch .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
                width: 18px; height: 18px; color: var(--text-3); pointer-events: none; }
.gsearch kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: 10.5px; font-family: var(--font); font-weight: 700; color: var(--text-3);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 7px;
}
.tb-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-2); position: relative; flex: none; transition: all var(--dur-1);
}
.tb-btn:hover { background: var(--surface-3); color: var(--text); }
.tb-btn .count-badge { position: absolute; top: 2px; right: 2px; border: 2px solid var(--surface); }

.web-main { flex: 1; overflow-y: auto; padding: var(--s5); }
.web-main > * { animation: pageIn var(--dur-3) var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }

/* Filtre çubuğu */
.filters { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.fbtn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text); transition: all var(--dur-1);
}
.fbtn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.fbtn svg { width: 16px; height: 16px; color: var(--text-3); }
.fbtn .cnt { background: var(--brand); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 10.5px; }

/* Izgara */
.grid { display: grid; gap: var(--s4); }
.g-kpi  { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.g-2    { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.g-3    { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-mini { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
/* Etiket + değer çiftleri */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s4); }
.kv > div { min-width: 0; }
.kv .k { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 5px; }
.kv .k svg { width: 14px; height: 14px; }
.kv .v { display: block; font-size: var(--fs-sm); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.g-main { grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr); }
.g-wide { grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); }
@media (max-width: 1180px) { .g-main, .g-wide { grid-template-columns: 1fr; } }

/* Sayfa başlığı */
.page-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.page-hd h2 { letter-spacing: -.028em; }
.page-hd p { color: var(--text-2); font-size: var(--fs-sm); margin-top: 4px; }

/* Canlı akış */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 11px var(--s4); border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.feed-ic svg { width: 15px; height: 15px; }
.feed-t { font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; }
.feed-m { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.feed-time { font-size: var(--fs-xs); color: var(--text-3); flex: none; }

/* Şube haritası */
.map-wrap { position: relative; aspect-ratio: 4/3; border-radius: var(--r-md); overflow: hidden;
            background: var(--surface-3); border: 0; }
.map-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
:root[data-theme="dark"] .map-wrap iframe { filter: invert(.92) hue-rotate(180deg) saturate(.75); }
.map-bar { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 4px; margin-bottom: var(--s3); }
.map-bar::-webkit-scrollbar { display: none; }
.map-bar .chip { flex: none; }
/* Harita üzerine bindirilen şube pinleri */
.map-pins { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.map-pins > * { pointer-events: auto; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer;
}
.map-pin .pin-badge {
  position: absolute; top: -7px; right: -9px; transform: rotate(-45deg);
  min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: #171717; color: #fff; font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center; border: 2px solid #fff; box-shadow: var(--sh-sm);
}
.map-pin .pin-badge.urgent { background: var(--danger); }
.map-pin.on .dot { transform: rotate(45deg) scale(1.2); box-shadow: 0 6px 18px rgba(227,6,19,.5); }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.map-pin .dot {
  position: relative; width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(45deg);
  background: var(--brand); color: #fff; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; box-shadow: var(--sh-md); transition: transform var(--dur-2) var(--ease);
}
.map-pin .dot span { transform: rotate(-45deg); }
.map-pin:hover .dot { transform: rotate(45deg) scale(1.14); }
.map-pin.crit .dot { background: var(--danger); }
.map-pin.ok .dot { background: var(--success); }
.map-lb {
  font-size: 10.5px; font-weight: 700; background: var(--surface); color: var(--text);
  padding: 3px 8px; border-radius: 99px; box-shadow: var(--sh-sm); white-space: nowrap;
  opacity: 0; transform: translateY(-3px); transition: opacity var(--dur-2), transform var(--dur-2);
  pointer-events: none;
}
.map-pin:hover .map-lb, .map-pin.on .map-lb, .map-pin:focus-visible .map-lb { opacity: 1; transform: none; }
.map-pin:hover { z-index: 5; }

/* Zaman çizelgesi (gantt) */
.gantt { overflow-x: auto; }
.gantt-row { display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: var(--s3); min-height: 40px; }
.gantt-row + .gantt-row { border-top: 1px solid var(--line); }
.gantt-lb { font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); }
.gantt-track { position: relative; height: 30px; min-width: 620px; }
.gantt-bar {
  position: absolute; top: 5px; height: 20px; border-radius: 6px; font-size: 10.5px; font-weight: 600;
  display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden;
  border: 1px solid; cursor: default;
}
.gantt-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--brand); z-index: 2; }
.gantt-now::before {
  content: attr(data-t); position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  background: var(--brand); color: #fff; font-size: 9.5px; font-weight: 800; padding: 1px 6px; border-radius: 5px;
}
.gantt-scale { display: grid; grid-template-columns: 92px 1fr; gap: var(--s3); }
.gantt-ticks { display: flex; min-width: 620px; font-size: 10px; color: var(--text-3); }
.gantt-ticks span { flex: 1; }

/* Komut paleti */
.cmdk { position: fixed; inset: 0; z-index: var(--z-modal); background: rgba(12,14,18,.5);
        backdrop-filter: blur(4px); display: flex; justify-content: center; padding-top: 12vh; }
.cmdk-box { width: min(620px, 92vw); background: var(--surface); border: 1px solid var(--line);
            border-radius: var(--r-lg); box-shadow: var(--sh-xl); overflow: hidden; height: fit-content;
            animation: modalIn var(--dur-3) var(--ease); }
.cmdk-in { display: flex; align-items: center; gap: 11px; padding: 15px var(--s5); border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; border: 0; outline: 0; background: none; font-size: var(--fs-lg); }
.cmdk-list { max-height: 46vh; overflow-y: auto; padding: var(--s2); }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 10px var(--s3); border-radius: var(--r-sm);
             width: 100%; text-align: left; font-size: var(--fs-sm); }
.cmdk-item:hover, .cmdk-item.on { background: var(--surface-3); }
.cmdk-item .k { margin-left: auto; font-size: var(--fs-xxs); color: var(--text-3); }

 /* Temizlik planı işaret kutusu */
.chk-cell {
  width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center;
  background: var(--surface-3); color: transparent; transition: all var(--dur-1);
}
.chk-cell:hover { background: var(--line); }
.chk-cell.on { background: var(--success); color: #fff; }
.chk-cell svg { width: 16px; height: 16px; }

/* Yetki matrisi */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.matrix .yes { color: var(--success); }
.matrix .no  { color: var(--line-strong); }

/* Modül önizleme */
.preview-hero {
  border-radius: var(--r-lg); padding: var(--s6); color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
}
.preview-hero::after { content:""; position:absolute; right:-50px; top:-60px; width:220px; height:220px;
  border-radius:50%; background:rgba(255,255,255,.1); }
.preview-hero > * { position: relative; }

/* Mobil/tablet uyum */
.side-backdrop { display: none; }
@media (max-width: 1024px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); transform: translateX(-100%);
          transition: transform var(--dur-3) var(--ease); }
  .shell.open .side { transform: none; }
  .shell.open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(12,14,18,.5); z-index: 25; }
  .menu-toggle { display: grid !important; }
  .web-main { padding: var(--s4); }
  .topbar { padding: 0 var(--s4); }
  .topbar h1 { font-size: var(--fs-lg); }
}
@media (min-width: 1025px) { .menu-toggle { display: none !important; } }
@media (max-width: 700px) {
  .gsearch { display: none; }
  .page-hd h2 { font-size: var(--fs-xl); }
}
