:root{
  --bg:#f6f8fb; --surface:#ffffff; --text:#1e293b; --muted:#64748b; --border:#e2e8f0;
  --brand:#0f766e; --brand-dark:#0b5c56; --brand-light:#ccfbf1;
  --pos:#059669; --pos-bg:#ecfdf5; --pos-border:#a7f3d0;
  --neg:#e11d48; --neg-bg:#fff1f2; --neg-border:#fecdd3;
  --neu:#2563eb; --neu-bg:#eff6ff; --neu-border:#bfdbfe;
  --danger:#dc2626;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:14px; line-height:1.45;
}
a{color:inherit}
button,input,select,textarea{font:inherit}
h1,h2,h3{margin:0}

.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:230px; flex:none; background:var(--surface); border-right:1px solid var(--border);
  display:flex; flex-direction:column; padding:20px 14px; position:sticky; top:0; height:100vh;
  z-index:40;
}
.hamburger-btn{
  display:none; background:none; border:1px solid var(--border); border-radius:10px;
  padding:8px 11px; font-size:17px; cursor:pointer; margin-right:10px; line-height:1;
}
.sidebar-backdrop{display:none; position:fixed; inset:0; background:rgba(15,23,42,.45); z-index:39}
.sidebar-brand{display:flex; align-items:center; gap:10px; padding:6px 8px 22px; font-weight:700; color:var(--brand-dark); font-size:16px}
.sidebar-brand .logo{width:34px;height:34px;border-radius:10px;background:var(--brand-light);display:flex;align-items:center;justify-content:center;font-size:18px}
.nav{display:flex; flex-direction:column; gap:2px; flex:1}
.nav a{
  display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px;
  color:var(--muted); text-decoration:none; font-weight:500; font-size:13.5px;
}
.nav a:hover{background:#f1f5f9; color:var(--text)}
.nav a.active{background:var(--brand-light); color:var(--brand-dark)}
.sidebar-user{border-top:1px solid var(--border); padding-top:12px; margin-top:12px}
.sidebar-user .who{font-size:12px; color:var(--muted); margin-bottom:8px; word-break:break-all}
.sidebar-user .who b{display:block; color:var(--text); font-size:13px}

.main{flex:1; min-width:0; display:flex; flex-direction:column}
.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:22px 28px 4px;
}
.topbar h1{font-size:24px}
.content{padding:20px 28px 40px}

.grid{display:grid; gap:16px}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-4{grid-template-columns:repeat(4,1fr)}
.form-grid-2{grid-template-columns:1fr 1fr; gap:12px}
@media(max-width:900px){.grid-3,.grid-4{grid-template-columns:1fr 1fr}}

/* --- Mobil / tablet: kenar cubugu acilir menuye donusur --- */
@media (max-width:860px){
  .hamburger-btn{display:inline-flex; align-items:center; justify-content:center}
  .sidebar{
    position:fixed; left:0; top:0; height:100vh;
    transform:translateX(-100%); transition:transform .2s ease;
    box-shadow:0 20px 45px rgba(15,23,42,.25);
  }
  .app-shell.sidebar-open .sidebar{transform:translateX(0)}
  .app-shell.sidebar-open .sidebar-backdrop{display:block}
  .topbar{padding:16px 16px 4px}
  .content{padding:14px 16px 32px}
  .topbar h1{font-size:19px}
}
@media (max-width:560px){
  .grid-3,.grid-4,.form-grid-2{grid-template-columns:1fr}
  .modal-backdrop{padding:16px 8px}
  .modal{padding:18px; border-radius:14px}
  .toolbar{gap:8px}
  .toolbar input[type=text],.toolbar select{flex:1 1 auto; min-width:0}
  table{font-size:12.5px}
  th,td{padding:9px 8px}
  .map-row{grid-template-columns:1fr; gap:4px; padding:10px 0}
  .import-steps{flex-direction:column}
}

.card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px}
.stat-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px}
.stat-card .label{font-weight:600; font-size:13.5px; margin-bottom:10px}
.stat-card .count{font-size:32px; font-weight:800}
.stat-card .open-list{display:flex; justify-content:space-between; align-items:center; margin-top:4px}
.stat-card .open-list span{font-size:12.5px; font-weight:600; color:var(--muted); cursor:pointer}
.stat-card .open-list span:hover{color:var(--brand)}

.btn{
  border:1px solid var(--border); background:var(--surface); color:var(--text);
  border-radius:10px; padding:9px 16px; font-weight:600; font-size:13.5px; cursor:pointer;
  min-height:38px; display:inline-flex; align-items:center; gap:6px;
}
.btn:hover{background:#f8fafc}
.btn:disabled{opacity:.55; cursor:not-allowed}
.btn-primary{background:var(--brand); border-color:var(--brand); color:#fff}
.btn-primary:hover{background:var(--brand-dark)}
.btn-danger{background:#fff; border-color:var(--neg-border); color:var(--neg)}
.btn-danger:hover{background:var(--neg-bg)}
.btn-sm{padding:6px 11px; font-size:12.5px; min-height:30px}
.btn-ghost{border-color:transparent; background:transparent}
.btn-ghost:hover{background:#f1f5f9}

label.field{display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; color:#334155}
.field input[type=text],.field input[type=tel],.field input[type=date],.field input[type=email],
.field input[type=password],.field input[type=file],.field select,.field textarea{
  border:1px solid var(--border); border-radius:10px; padding:9px 11px; font-size:13.5px;
  background:#fff; color:var(--text); width:100%;
}
.field textarea{resize:vertical; min-height:80px}
.field .hint{font-weight:400; color:var(--muted); font-size:12px}
.checkbox-row{display:flex; align-items:center; gap:8px; font-weight:600; font-size:13.5px}
.checkbox-row input{width:18px;height:18px}

.badge{display:inline-flex; align-items:center; gap:5px; padding:4px 10px; border-radius:999px; font-size:12.5px; font-weight:700; border:1px solid transparent}
.badge-pos{background:var(--pos-bg); border-color:var(--pos-border); color:var(--pos)}
.badge-neg{background:var(--neg-bg); border-color:var(--neg-border); color:var(--neg)}
.badge-neu{background:var(--neu-bg); border-color:var(--neu-border); color:var(--neu)}
.badge-gray{background:#f1f5f9; border-color:var(--border); color:var(--muted)}
.badge-amber{background:#fffbeb; border-color:#fde68a; color:#b45309}

table{width:100%; border-collapse:collapse; font-size:13.5px}
th{text-align:left; padding:10px 12px; font-weight:700; color:var(--muted); font-size:12.5px; border-bottom:1px solid var(--border); white-space:nowrap}
td{padding:11px 12px; border-bottom:1px solid var(--border); vertical-align:middle}
tr:last-child td{border-bottom:none}
.table-wrap{overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--border); border-radius:var(--radius)}
.table-wrap table{border:none; min-width:720px}

.toolbar{display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin-bottom:16px}
.toolbar input[type=text],.toolbar select{
  border:1px solid var(--border); border-radius:10px; padding:8px 11px; font-size:13.5px; background:#fff;
}
.toolbar .search-input{min-width:200px}
@media (max-width:560px){.toolbar .search-input{min-width:0; width:100%}}
.spacer{flex:1}

.modal-backdrop{position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:flex-start; justify-content:center; padding:40px 16px; overflow:auto; z-index:50}
.modal{background:#fff; border-radius:18px; width:100%; max-width:640px; padding:24px; box-shadow:0 30px 60px rgba(15,23,42,.25)}
.modal.modal-wide{max-width:900px}
.modal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px}
.modal-head h2{font-size:18px}

.toast-stack{position:fixed; top:16px; right:16px; display:flex; flex-direction:column; gap:8px; z-index:100}
.toast{background:#0f172a; color:#fff; padding:11px 16px; border-radius:10px; font-size:13.5px; box-shadow:0 12px 24px rgba(0,0,0,.2)}
.toast.error{background:var(--danger)}
.toast.success{background:var(--pos)}

.empty-state{padding:34px; text-align:center; color:var(--muted)}
.muted{color:var(--muted)}
.text-sm{font-size:12.5px}
.link-btn{background:none;border:none;color:var(--brand);font-weight:600;cursor:pointer;padding:0;font-size:inherit}
.link-btn:hover{text-decoration:underline}
.tag-chip{display:inline-flex; align-items:center; gap:6px; background:#f1f5f9; border:1px solid var(--border); border-radius:999px; padding:3px 10px; font-size:12px; font-weight:600}

.login-wrap{min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:20px}
.login-card{background:#fff; border-radius:20px; padding:36px; width:100%; max-width:380px; box-shadow:0 20px 45px rgba(15,23,42,.08); border:1px solid var(--border)}
.login-card .logo{width:48px;height:48px;border-radius:14px;background:var(--brand-light);display:flex;align-items:center;justify-content:center;font-size:22px;margin-bottom:14px}
.login-card h1{font-size:20px; margin-bottom:4px}
.login-card p.sub{color:var(--muted); font-size:13px; margin:0 0 22px}
.login-card .field{margin-bottom:14px}
.login-error{background:var(--neg-bg); border:1px solid var(--neg-border); color:var(--neg); padding:9px 12px; border-radius:10px; font-size:13px; margin-bottom:14px}

.pager{display:flex; align-items:center; gap:10px; justify-content:flex-end; margin-top:14px; font-size:13px}
.import-steps{display:flex; gap:8px; margin-bottom:18px}
.import-step{flex:1; text-align:center; padding:8px; border-radius:10px; background:#f1f5f9; color:var(--muted); font-weight:700; font-size:12.5px}
.import-step.active{background:var(--brand-light); color:var(--brand-dark)}
.map-row{display:grid; grid-template-columns:1fr 1fr; gap:10px; align-items:center; padding:8px 0; border-bottom:1px solid var(--border)}
.map-row:last-child{border-bottom:none}
.skeleton{color:var(--muted); padding:24px; text-align:center}
