/* Arı CRM — MyBasicCRM'e alışkın kullanıcılar için benzer yerleşim: mavi üst bar, sol menü, ortada kartlar, turuncu işlem düğmeleri */
:root {
  --bar: #3b5998;
  --side: #5f7ec4;
  --side-on: #3b5998;
  --bg: #f3f5fa;
  --card: #fff;
  --ink: #1c2230;
  --quiet: #667085;
  --line: #c9d2e6;
  --soft: #e6eaf4;
  --label: #a8554f;
  --link: #3b5998;
  --accent: #f47a20;
  --accent-ink: #fff;
  --bad: #b3392f;
  --ok: #2f7d4f;
  --chip: #e9edf7;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font:
    14px/1.45 Roboto,
    'Segoe UI',
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
}
a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
.top {
  position: fixed;
  inset: 0 0 auto 0;
  height: 44px;
  background: var(--bar);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  z-index: 20;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.top .burger {
  background: none;
  border: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
}
.top .logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.3px;
  color: #fff;
  text-decoration: none;
}
.top .logo b {
  color: var(--accent);
}
/* Arama kutusu ortadaki sütunun sol kenarıyla aynı hizada durur (--sw: yan menü, --cw: sütun genişliği) */
.top {
  --sw: 216px;
  --cw: 740px;
  --rw: 0px;
}
.top.wide {
  --cw: 1040px;
}
body.noside .top {
  --sw: 0px;
}
.top .search {
  position: absolute;
  left: max(170px, calc(var(--sw) + 16px + max(0px, (100% - var(--sw) - var(--rw) - 32px - var(--cw)) / 2)));
  width: 340px;
  min-width: 0;
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 18px;
  padding: 0 12px;
  height: 30px;
}
.top .search input {
  border: 0;
  outline: 0;
  background: none;
  width: 100%;
  color: var(--ink);
  padding: 0 6px;
}
.top .search span {
  color: var(--bar);
  font-size: 15px;
}
.top .who {
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
}
.top .who a {
  color: #fff;
  opacity: 0.85;
  margin-left: 8px;
}
.side {
  position: fixed;
  top: 44px;
  bottom: 0;
  left: 0;
  width: 216px;
  background: var(--side);
  padding: 10px 8px;
  overflow: auto;
  z-index: 15;
  transition: transform 0.15s;
}
.side a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  padding: 9px 12px;
  border-radius: 6px;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 13.5px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}
.side a:hover {
  background: rgba(255, 255, 255, 0.2);
}
.side a.on {
  background: var(--side-on);
  color: var(--side-on-ink, #fff);
}
.side a .ic {
  width: 18px;
  text-align: center;
  font-size: 15px;
}
.side .add {
  background: var(--accent);
  color: var(--accent-ink);
  justify-content: center;
  margin-top: 10px;
}
.side .add:hover {
  background: var(--accent);
  filter: brightness(0.93);
}
.side .sep {
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  margin: 10px 4px;
}
body.noside .side {
  transform: translateX(-100%);
}
main {
  margin: 44px 0 0 216px;
  padding: 10px 16px 90px;
  transition: margin 0.15s;
}
body.noside main {
  margin-left: 0;
}
.col {
  max-width: 740px;
  margin: 0 auto;
}
.col.wide {
  max-width: 1040px;
}
@media (max-width: 900px) {
  .side {
    transform: translateX(-100%);
    width: 240px;
    box-shadow: none;
  }
  body.side-open .side,
  body.side-open.noside .side {
    transform: none;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
  }
  main,
  body.noside main {
    margin-left: 0;
  }
  body.side-open .shade {
    display: block;
  }
  .top .search {
    position: relative;
    left: auto;
    width: auto;
    flex: 0 1 340px;
  }
  .top .who {
    font-size: 0;
  }
  .top .who a {
    font-size: 13px;
  }
}
.shade {
  display: none;
  position: fixed;
  inset: 44px 0 0 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 14;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.panel {
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.12);
  padding: 12px;
  margin-bottom: 12px;
}
.ptitle {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  margin: 2px 2px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ptitle .right {
  margin-left: auto;
  font-weight: 600;
  font-size: 13px;
  text-transform: none;
  color: var(--quiet);
}
h1 {
  font-size: 19px;
  margin: 0 0 10px;
}
h2 {
  font-size: 15px;
  margin: 0 0 8px;
}
.row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.quiet {
  color: var(--quiet);
}
.small {
  font-size: 12px;
}
input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 7px 9px;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #b9c8ee;
  border-color: var(--bar);
}
textarea {
  min-height: 70px;
  resize: vertical;
}
label {
  display: block;
  font-size: 12px;
  color: var(--label);
  margin: 8px 0 3px;
}
.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}
.btn:hover {
  background: var(--soft);
  text-decoration: none;
}
.btn.primary {
  background: var(--bar);
  border-color: var(--bar);
  color: var(--bar-ink, #fff);
}
.btn.orange {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.danger {
  color: var(--bad);
}
.btn.sm {
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 500;
}
.chip {
  display: inline-block;
  background: var(--chip);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}
.err {
  color: var(--bad);
  margin-top: 8px;
}
.warn {
  border: 1px solid var(--accent);
  background: #fff5ec;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 6px;
}
.tile {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  background: #fff;
}
.tile .num {
  font-size: 26px;
  font-weight: 700;
  color: var(--bar);
}
.tile .cap {
  font-size: 13px;
  margin-top: 2px;
}
.tile table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  text-align: left;
}
.tile td {
  padding: 2px 0;
  border: 0;
}
.tile td:last-child {
  text-align: right;
  font-weight: 700;
}
@media (max-width: 640px) {
  .tiles {
    grid-template-columns: 1fr;
  }
}
.feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.it {
  display: flex;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 7px;
  background: #fff;
}
.it.new {
  animation: flash 2.5s ease-out;
}
@keyframes flash {
  from {
    background: #ffe9d3;
  }
  to {
    background: #fff;
  }
}
.it .ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #8a6a5c;
  align-self: center;
}
.it .body {
  flex: 1;
  min-width: 0;
}
.it .head {
  font-size: 14px;
}
.it .more {
  margin-top: 3px;
  font-size: 13.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.it .more.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.it .extra {
  display: none;
  margin-top: 4px;
}
.it.open .extra {
  display: block;
}
.it.open .more.clamp {
  display: block;
}
.it .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
}
.it .tog {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 6px;
  font-weight: 700;
}
.it.open .tog {
  transform: rotate(180deg);
}
.it .meta {
  margin-left: auto;
  background: var(--chip);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.it .meta b {
  color: var(--link);
  font-weight: 600;
}
.it .chg {
  font-size: 13.5px;
}
.it .del {
  background: none;
  border: 0;
  color: var(--bad);
  cursor: pointer;
  font-size: 12px;
}
.cc {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-bottom: 8px;
  cursor: pointer;
}
.cc:hover {
  border-color: var(--bar);
  box-shadow: 0 1px 4px rgba(59, 89, 152, 0.18);
}
.cc .nm {
  padding: 8px 12px 2px;
  font-weight: 600;
  font-size: 14.5px;
}
.cc .in {
  display: flex;
  gap: 12px;
  padding: 4px 12px 8px;
}
.cc .ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: #fdf1c7;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}
.cc .kv {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 16px;
  min-width: 0;
}
.cc .kv div {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.cc .kv small {
  display: block;
  color: var(--label);
  font-size: 11px;
}
.cc .ft {
  margin: 0 12px 8px auto;
  width: max-content;
  max-width: calc(100% - 24px);
  background: var(--chip);
  border-radius: 4px;
  padding: 2px 10px;
  font-size: 12px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.dhead {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--head, #dfe5f1);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  padding: 10px 14px;
}
.dhead h1 {
  margin: 0;
  font-size: 18px;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.dhead .id {
  color: var(--quiet);
  font-weight: 600;
  font-size: 13px;
}
.dhead .x {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bar);
  text-decoration: none;
  font-size: 15px;
}
.dbody {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  align-items: start;
}
@media (max-width: 700px) {
  .two {
    grid-template-columns: 1fr;
  }
}
.fs {
  border: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 6px 0 0 0;
  margin: 0 0 6px;
  padding: 0 6px 6px 10px;
  min-height: 42px;
  min-width: 0;
}
.fs legend {
  color: var(--label);
  font-size: 12.5px;
  padding: 0 5px;
  margin-left: -2px;
}
.fs .v {
  font-size: 15px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.fs .n {
  color: var(--label);
  font-size: 12px;
  display: inline-block;
  width: 20px;
}
.halves {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.fgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0 14px;
  align-items: start;
}
h2.section {
  grid-column: 1/-1;
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
details summary {
  cursor: pointer;
}
.multi .item {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.fabs {
  position: fixed;
  right: 28px;
  bottom: 22px;
  display: flex;
  gap: 10px;
  z-index: 18;
}
.fab {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.fab:hover {
  filter: brightness(1.07);
  text-decoration: none;
}
.fab.blue {
  background: var(--fab2, #6f8fd8);
  color: #fff;
}
.fabmenu {
  position: fixed;
  right: 28px;
  bottom: 80px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 19;
  min-width: 180px;
  padding: 4px;
}
.fabmenu button,
.fabmenu a {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--ink);
  border-radius: 5px;
}
.fabmenu button:hover,
.fabmenu a:hover {
  background: var(--soft);
  text-decoration: none;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--soft);
  vertical-align: top;
}
th {
  font-size: 12px;
  color: var(--quiet);
  font-weight: 600;
}
pre.detail {
  white-space: pre-wrap;
  font-size: 11.5px;
  margin: 0;
  max-height: 120px;
  overflow: auto;
  color: var(--quiet);
}
.login {
  max-width: 340px;
  margin: 14vh auto;
  text-align: left;
}
.login .logo {
  font-weight: 800;
  font-size: 28px;
  color: var(--bar);
  text-align: center;
  margin-bottom: 8px;
}
.login .logo b {
  color: var(--accent);
}
.sres {
  position: absolute;
  top: 36px;
  left: 0;
  width: min(460px, 92vw);
  max-height: 70vh;
  overflow: auto;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  padding: 4px;
  z-index: 30;
}
.sres .sh {
  font-size: 11px;
  color: var(--label);
  text-transform: uppercase;
  padding: 6px 8px 2px;
}
.sres a {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sres a:hover,
.sres a:focus {
  background: var(--soft);
  text-decoration: none;
}
.sres a small {
  color: var(--quiet);
  margin-left: 6px;
}
.sres a.all {
  color: var(--link);
  font-weight: 600;
  border-top: 1px solid var(--soft);
  margin-top: 4px;
}
a.tile {
  display: block;
  color: inherit;
}
a.tile:hover {
  border-color: var(--bar);
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(59, 89, 152, 0.18);
}
.cc .nm a {
  color: var(--ink);
}
.cc .nm a:hover {
  color: var(--link);
}
.wa {
  font-size: 12px;
  background: #e6f6ec;
  color: #1d7a43;
  border-radius: 4px;
  padding: 1px 7px;
  margin-left: 6px;
}
.it .meta a {
  text-decoration: none;
}
.chip a {
  margin-left: 4px;
  font-weight: 700;
}

/* Ana sayfa, müşteri ve aktivite sayfaları: solda içerik, sağda kayıtlı raporlar */
.homegrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}
.homegrid > aside {
  position: sticky;
  top: 54px;
  max-height: calc(100vh - 64px);
  overflow: auto;
}
.replist {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rep;
}
.replist li {
  counter-increment: rep;
  position: relative;
  padding: 7px 4px 7px 26px;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.replist li::before {
  content: counter(rep);
  position: absolute;
  left: 4px;
  top: 7px;
  font-size: 11px;
  color: #999;
}
.replist a {
  display: block;
  text-decoration: none;
  font-weight: 600;
}
.replist li.on a {
  color: var(--accent);
}
.replist a:hover {
  text-decoration: underline;
}
@media (max-width: 1100px) {
  .homegrid {
    grid-template-columns: minmax(0, 1fr);
  }
  .homegrid > aside {
    position: static;
    max-height: none;
  }
}

/* Claude asistanı: sağda açılır-kapanır sohbet sütunu (client/assistant.js). Geniş ekranda sayfa sola kayar, dar ekranda üstüne açılır. */
.top .aibtn {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 14px;
  padding: 3px 11px;
  font-size: 13px;
  cursor: pointer;
  margin-left: auto;
  white-space: nowrap;
}
.top .aibtn:hover,
.top .aibtn.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.top .aibtn + .who {
  margin-left: 0;
}
#aiside {
  position: fixed;
  top: 44px;
  right: 0;
  bottom: 0;
  width: var(--aw, 380px);
  max-width: 100vw;
  background: var(--card);
  border-left: 1px solid var(--line);
  box-shadow: -2px 0 8px rgba(20, 30, 60, 0.12);
  z-index: 18;
  display: none;
  flex-direction: column;
}
body.ai-open #aiside {
  display: flex;
}
.aihead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.aihead b {
  margin-right: auto;
}
.aix {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--quiet);
  padding: 0 4px;
}
.aimsgs {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aim {
  padding: 8px 11px;
  border-radius: 10px;
  max-width: 92%;
  overflow-wrap: anywhere;
}
.aim.me {
  align-self: flex-end;
  background: var(--link);
  color: #fff;
}
.aim.ai {
  align-self: flex-start;
  background: var(--soft);
}
.aim.bad {
  align-self: flex-start;
  background: #fbe9e7;
  color: var(--bad);
}
.aim.wait {
  color: var(--quiet);
  font-style: italic;
}
.aim code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0 3px;
  border-radius: 3px;
}
.ainote {
  color: var(--quiet);
  background: var(--soft);
  border-radius: 10px;
  padding: 10px 12px;
}
.aiex {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
}
.aiform {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.airow {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.aiattach {
  padding: 6px 9px;
  cursor: pointer;
}
.aifiles,
.aimfiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.aifiles:not(:empty) {
  margin-bottom: 6px;
}
.aimfiles {
  margin-bottom: 4px;
}
.aichip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  background: var(--chip);
  color: var(--ink);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.aichip img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
}
.aichip small {
  color: var(--quiet);
}
.aichip button {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--quiet);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}
#aiside.drop {
  outline: 3px dashed var(--accent);
  outline-offset: -6px;
}
.aiform textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
}
@media (min-width: 1101px) {
  body.ai-open main {
    margin-right: 380px;
  }
  body.ai-open .top {
    --rw: 380px;
  }
}
