:root{
  --bg:#f6f8fc;--card:#ffffff;--text:#14213d;--muted:#64748b;--line:#e6edf6;
  --primary:#2563eb;--primary2:#1d4ed8;--soft:#eff6ff;--green:#16a34a;--amber:#f59e0b;
  --red:#dc2626;--shadow:0 18px 45px rgba(15,23,42,.07);--shadow2:0 8px 22px rgba(15,23,42,.06);
  --radius:22px
}
*{box-sizing:border-box}
body{margin:0;font-family:Inter,Arial,Helvetica,sans-serif;background:radial-gradient(circle at top left,#eef6ff 0,#f7f9fc 34%,#f5f7fb 100%);color:var(--text)}
.hidden{display:none!important}
button,input,select,textarea{font:inherit}
.btn{border:1px solid var(--line);background:#fff;color:#1f2937;border-radius:14px;padding:11px 15px;font-weight:850;cursor:pointer;box-shadow:0 1px 0 rgba(15,23,42,.03);transition:.16s ease}
.btn:hover{transform:translateY(-1px);border-color:#cbd5e1;background:#f8fafc}
.btn.primary{background:linear-gradient(135deg,#2563eb,#1d4ed8);border-color:#2563eb;color:#fff;box-shadow:0 12px 24px rgba(37,99,235,.20)}
.btn.primary:hover{background:linear-gradient(135deg,#1d4ed8,#1e40af)}
.btn.white{background:#fff;color:#1d4ed8;border:0}
.btn.ghost{background:#f8fafc}
.btn.danger{background:#fff1f2;color:var(--red);border-color:#fecdd3}
.btn.small{padding:8px 11px;font-size:13px}
.btn.full{width:100%;display:flex;align-items:center;justify-content:center;gap:8px}
.login-wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px;position:relative;overflow:hidden}
.login-bg span{position:absolute;border-radius:999px;filter:blur(3px);opacity:.55}
.login-bg span:nth-child(1){width:220px;height:220px;background:#dbeafe;top:12%;left:17%}
.login-bg span:nth-child(2){width:180px;height:180px;background:#dcfce7;right:18%;bottom:18%}
.login-bg span:nth-child(3){width:140px;height:140px;background:#fef3c7;right:26%;top:18%}
.login-card{width:100%;max-width:470px;background:rgba(255,255,255,.88);backdrop-filter:blur(18px);border:1px solid rgba(226,232,240,.85);border-radius:30px;padding:34px;box-shadow:0 30px 90px rgba(15,23,42,.12);position:relative}
.brand-row,.side-brand{display:flex;align-items:center;gap:14px}
.brand-logo{width:58px;height:58px;border-radius:20px;background:linear-gradient(135deg,#0f172a,#334155);color:#facc15;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:22px;box-shadow:0 12px 30px rgba(15,23,42,.18)}
.brand-logo.small{width:46px;height:46px;border-radius:16px;font-size:17px}
h1,h2,h3,h4,p{margin:0}.login-card h1{font-size:27px}.login-card p,.topbar p,.modal-head p,.soft{color:var(--muted);font-size:14px}
.login-form{display:flex;flex-direction:column;gap:11px;margin-top:30px}
label{display:block;font-size:13px;font-weight:850;color:#334155;margin-bottom:7px}
input,select,textarea{width:100%;border:1px solid var(--line);border-radius:14px;padding:12px 13px;background:#fff;color:var(--text);outline:none;transition:.15s ease}
input:focus,select:focus,textarea:focus{border-color:#93c5fd;box-shadow:0 0 0 4px rgba(37,99,235,.08)}
textarea{resize:vertical}.error{color:var(--red);min-height:18px;font-size:14px}.warning{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;border-radius:14px;padding:11px 13px;margin:12px 0 0;font-weight:850}
.app{display:flex;min-height:100vh}.sidebar{width:280px;background:rgba(255,255,255,.82);backdrop-filter:blur(18px);border-right:1px solid rgba(226,232,240,.85);padding:22px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh}
.side-brand{padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:20px}.side-brand strong{display:block;font-size:18px}.side-brand span{display:block;color:var(--muted);font-size:13px;margin-top:3px}
.menu{display:flex;flex-direction:column;gap:9px}.nav{text-align:left;background:transparent;border:0;box-shadow:none;border-radius:16px;padding:13px 14px;color:#334155;font-weight:900;cursor:pointer;display:flex;align-items:center;gap:12px;transition:.16s ease}
.nav:hover{background:#f1f5f9}.nav.active{background:linear-gradient(135deg,#eff6ff,#eaf2ff);color:#1d4ed8;box-shadow:inset 0 0 0 1px #dbeafe}.nav-ico{width:30px;height:30px;border-radius:11px;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 10px rgba(15,23,42,.05)}
.sidebar-note{margin-top:22px;background:linear-gradient(135deg,#f8fafc,#eef6ff);border:1px solid var(--line);border-radius:18px;padding:14px;display:flex;gap:10px}
.sidebar-note p{margin-top:3px;color:var(--muted);font-size:12px;line-height:1.45}.note-icon{min-width:28px;height:28px;border-radius:10px;background:#2563eb;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900}.logout{margin-top:auto}
.main{flex:1;padding:30px;overflow:auto}.topbar{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:26px}.topbar h2{font-size:31px;letter-spacing:-.02em}.top-actions{display:flex;gap:10px;flex-wrap:wrap}.eyebrow{font-size:12px;font-weight:950;letter-spacing:.08em;text-transform:uppercase;color:#2563eb;margin-bottom:6px}
.hero{background:linear-gradient(135deg,#2563eb,#1e40af);color:#fff;border-radius:28px;padding:26px 28px;box-shadow:0 22px 60px rgba(37,99,235,.24);display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:20px;overflow:hidden;position:relative}
.hero:after{content:"";position:absolute;right:-55px;top:-70px;width:220px;height:220px;border-radius:999px;background:rgba(255,255,255,.10)}
.hero h3{font-size:26px;margin:8px 0 8px;max-width:760px}.hero p{color:rgba(255,255,255,.82);max-width:760px}.pill{display:inline-flex;border-radius:999px;background:rgba(255,255,255,.16);color:#fff;padding:7px 11px;font-size:12px;font-weight:950}.pill.light{background:#eff6ff;color:#1d4ed8}
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(170px,1fr));gap:16px;margin-bottom:20px}.stats-grid.compact{grid-template-columns:repeat(4,minmax(180px,1fr))}
.stat-card{background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow2);position:relative;overflow:hidden;min-height:126px}
.stat-card:hover{box-shadow:var(--shadow)}.stat-card span{display:block;color:var(--muted);font-size:13px;font-weight:850;margin-top:12px}.stat-card strong{display:block;font-size:27px;margin-top:7px}.stat-ico{width:42px;height:42px;border-radius:15px;display:flex;align-items:center;justify-content:center;font-weight:950}
.blue{background:#dbeafe;color:#1d4ed8}.cyan{background:#cffafe;color:#0e7490}.violet{background:#ede9fe;color:#6d28d9}.amber{background:#fef3c7;color:#92400e}.green{background:#dcfce7;color:#166534}.orange{background:#ffedd5;color:#c2410c}.slate{background:#e2e8f0;color:#334155}.indigo{background:#e0e7ff;color:#3730a3}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-bottom:20px}.panel,.quick-card,.table-card,.smart-card{background:rgba(255,255,255,.92);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow2)}.panel{padding:20px}.panel-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.panel-head p{color:var(--muted);font-size:13px;margin-top:3px}.mini-icon{width:38px;height:38px;border-radius:14px;background:#eff6ff;color:#1d4ed8;display:flex;align-items:center;justify-content:center;font-weight:950}
.mini-list,.cards-list{display:flex;flex-direction:column;gap:11px}.mini-item,.business-card{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:13px 14px}.mini-item strong,.business-card strong{display:block}.mini-item span,.business-card span{color:var(--muted);font-size:13px}
.smart-card{padding:20px;margin-bottom:18px;background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(239,246,255,.88))}
.smart-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px}
.smart-head h3{margin-top:8px}.smart-head p{color:var(--muted);font-size:14px;margin-top:4px;max-width:760px}
.smart-actions{display:flex;gap:10px;flex-wrap:wrap}
.smart-textarea{height:165px;background:#fbfdff;line-height:1.55}
.smart-preview{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}
.smart-preview div{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px}
.smart-preview span{display:block;color:var(--muted);font-size:12px;font-weight:850;margin-bottom:5px}
.smart-preview strong{font-size:14px}
.quick-card{padding:20px;margin-bottom:18px}.quick-title{margin-bottom:14px}.quick-title h3{margin-top:8px}.quick-title p{color:var(--muted);font-size:14px;margin-top:3px}
.quick-form{display:grid;grid-template-columns:1.35fr .95fr .82fr .82fr 1.12fr .9fr .88fr 1.2fr auto;gap:11px}
.filters{display:grid;grid-template-columns:2fr .9fr 1fr 1fr 1fr auto;gap:11px;margin-bottom:16px}.table-card{overflow:auto}.table-card.flat{box-shadow:none;border-radius:16px}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:1150px}th,td{padding:15px;border-bottom:1px solid var(--line);text-align:left;font-size:14px;vertical-align:middle}th{background:#f8fafc;color:#475569;font-size:12px;text-transform:uppercase;letter-spacing:.04em}tr:hover td{background:#fbfdff}
.badge{display:inline-block;border-radius:999px;padding:7px 10px;background:#f1f5f9;color:#334155;font-size:12px;font-weight:950}.badge.blue{background:#dbeafe;color:#1d4ed8}.badge.green{background:#dcfce7;color:#166534}.badge.red{background:#fee2e2;color:#991b1b}.badge.amber{background:#fef3c7;color:#92400e}
.actions{display:flex;gap:7px;align-items:center}.actions select{min-width:145px;padding:9px;border-radius:12px}
.goals-panel{display:grid;grid-template-columns:1fr 2fr;gap:22px;align-items:start}.goals-form{display:grid;grid-template-columns:repeat(5,1fr) auto;gap:11px;align-items:end}
.progress-list{display:grid;gap:14px;margin-top:14px}.progress-item span{display:flex;justify-content:space-between;font-size:14px;font-weight:850;margin-bottom:8px}.progress-item em{font-style:normal;color:var(--muted)}.progress-bar{height:12px;background:#eef2f7;border-radius:999px;overflow:hidden}.progress-bar b{display:block;height:100%;background:linear-gradient(90deg,#60a5fa,#2563eb);border-radius:999px}
.message-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}.template-card textarea{height:175px;margin:13px 0;background:#fbfdff}.template-head{display:flex;align-items:center;gap:10px}.template-head span{width:34px;height:34px;background:#eff6ff;color:#1d4ed8;border-radius:13px;display:flex;align-items:center;justify-content:center;font-weight:950}
dialog{border:0;border-radius:28px;padding:0;box-shadow:0 30px 90px rgba(15,23,42,.28);width:min(1060px,calc(100% - 24px))}dialog::backdrop{background:rgba(15,23,42,.42);backdrop-filter:blur(3px)}.modal-form{padding:24px;background:#fff}.modal-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:18px}.modal-head h3{margin-top:8px}.icon-btn{border:0;background:#f1f5f9;border-radius:14px;padding:7px 13px;font-size:24px;cursor:pointer}
.modal-section{border:1px solid var(--line);border-radius:20px;padding:16px;margin-bottom:14px;background:#fbfdff}.modal-section h4{margin-bottom:12px;color:#1e293b}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.date-box{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;background:#f8fafc;border:1px solid var(--line);border-radius:16px;padding:13px;margin:10px 0 14px}.date-box span{color:#64748b;font-size:13px}.date-box b{display:block;color:#111827;margin-top:3px}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
@media(max-width:1200px){.quick-form,.filters,.goals-form,.smart-preview{grid-template-columns:1fr 1fr}.stats-grid,.stats-grid.compact{grid-template-columns:repeat(2,1fr)}.two-col,.message-grid,.goals-panel{grid-template-columns:1fr}.sidebar{width:260px}.smart-head{display:block}.smart-actions{margin-top:12px}}
@media(max-width:800px){.app{display:block}.sidebar{position:relative;width:100%;height:auto}.main{padding:16px}.topbar{display:block}.top-actions{margin-top:12px}.hero{display:block}.hero .btn{margin-top:16px}.quick-form,.filters,.goals-form,.form-grid,.stats-grid,.stats-grid.compact,.date-box,.smart-preview{grid-template-columns:1fr}}


/* V5.1 temizlik */
.tool-toggle-row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:16px;
}
.collapse-area{
  animation:softDrop .16s ease;
}
@keyframes softDrop{
  from{opacity:.55;transform:translateY(-4px)}
  to{opacity:1;transform:translateY(0)}
}
.sidebar-note{
  display:none!important;
}
.badge{
  padding:6px 9px;
  font-size:11px;
  line-height:1.15;
}
.actions{
  gap:6px;
  justify-content:flex-start;
}
.actions select{
  min-width:142px;
  max-width:155px;
  padding:9px 10px;
  font-size:13px;
}
.icon-action{
  width:39px;
  height:39px;
  padding:0;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:17px;
  font-weight:950;
}
.icon-action.wa{
  color:#128c3a;
  background:#ecfdf5;
  border-color:#bbf7d0;
}
.icon-action.wa:hover{
  background:#dcfce7;
}
.icon-action.detail{
  color:#1d4ed8;
  background:#eff6ff;
  border-color:#dbeafe;
}
.icon-action.detail:hover{
  background:#dbeafe;
}
.phone-link{
  color:#475569;
  text-decoration:none;
}
.phone-link:hover{
  color:#128c3a;
  text-decoration:underline;
}
.smart-card,.quick-card{
  margin-bottom:16px;
}
@media(max-width:800px){
  .tool-toggle-row .btn{
    flex:1;
  }
}


/* V5.2 ikon düzeltmesi */
.icon-action{
  position:relative;
  overflow:hidden;
}
.wa-svg{
  width:24px;
  height:24px;
  display:block;
}
.wa-svg circle{
  fill:#25D366;
}
.wa-svg .wa-tail{
  fill:#25D366;
}
.wa-svg .wa-phone{
  fill:#fff;
  transform:scale(.72);
  transform-origin:center;
}
.icon-action.wa{
  background:#eafff1;
  border-color:#b7f7cf;
}
.icon-action.wa:hover{
  background:#dcfce7;
  box-shadow:0 8px 18px rgba(37,211,102,.16);
}
.detail-svg{
  width:20px;
  height:20px;
  display:block;
}
.detail-svg path{
  fill:none;
  stroke:#2563eb;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
