/* FAI Hesap · Yönetim: proje farkı. Değerler kit `fai.css` değişkenlerinden (o dosya değiştirilmez). */
html,body{margin:0;background:#070D1C}
html[data-theme="light"],html[data-theme="light"] body{background:#F3F5F9}
.app{--ease:cubic-bezier(.2,.7,.2,1);--t-hover:120ms;--t-state:220ms;position:relative}
.app [hidden]{display:none!important}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.app :focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.app .input:focus-visible{outline-offset:-1px}
.app button[disabled],.app .btn[disabled]{opacity:.45;cursor:not-allowed}
.app .btn,.app .iconbtn,.app .seg button,.app .pager button,.app .tabs button,.app .nav a{transition:background-color var(--t-hover) var(--ease),color var(--t-hover) var(--ease),border-color var(--t-hover) var(--ease)}
.app .btn.danger.solid{background:var(--neg);border-color:var(--neg);color:#fff}
.app .btn.danger:not(.solid):hover{background:var(--neg-soft)}
.app .btn.ghost{border-color:transparent;color:var(--muted);align-self:flex-start}
.app .btn.ghost:hover{color:var(--text)}
.app .btn.wide{width:100%}
.h3{font-size:13px;font-weight:600;margin:0}
.row.wrap{flex-wrap:wrap}
.row.end{justify-content:flex-end}
.ell{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.brk,.app .tbl td.brk{overflow-wrap:anywhere;white-space:normal;min-width:0}
code.mono{font-size:12px}

/* üst bar */
.logo{display:grid;place-items:center;width:24px;height:24px;border-radius:7px;background:var(--primary);color:#fff;font-size:13px;font-weight:700}
.nav a{cursor:pointer}
.scope .sel{height:34px;width:auto;max-width:200px}
.menu-wrap{position:relative}
.menu{position:absolute;right:0;top:44px;width:240px;z-index:10;display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--surface);border:1px solid var(--border2);border-radius:10px;box-shadow:var(--shadow)}
.menu .seg{align-self:flex-start}
.menu-who:empty{display:none}
.menu-who{padding-bottom:8px;border-bottom:1px solid var(--border)}
.who-name{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.input.sel{height:36px;width:auto;padding:0 8px;cursor:pointer}

/* durum kutuları */
.state-box{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:32px 16px;text-align:center;color:var(--muted);min-height:160px}
.state-title{font-size:14px;font-weight:600;color:var(--text)}
.state-box.error .state-title{color:var(--neg)}
.state-text{max-width:440px;font-size:12.5px}
.spin{width:18px;height:18px;border-radius:50%;border:2px solid var(--border2);border-top-color:var(--primary);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.center{flex:1;display:grid;place-items:center;padding:16px;min-height:0}
.err{margin:0;color:var(--neg);font-size:12.5px}
.err:empty{display:none}

/* giriş */
.card.login{width:min(420px,100%);padding:24px;gap:12px}
.or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--border)}
.gbtn{min-height:44px;display:flex;justify-content:center}
.tg-wait{display:flex;flex-direction:column;gap:10px}

/* araç çubuğu */
.toolbar{flex:none;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.toolbar .search{width:300px;height:36px}
.field.inline{flex-direction:row;align-items:center;gap:8px}
.field.inline .input{width:140px;height:36px}

/* kullanıcılar: sol tablo + sağ ayrıntı */
.split{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 400px;gap:12px;position:relative}
.list{overflow:hidden;display:flex;flex-direction:column}
.tbl-wrap{flex:1;min-height:0;overflow:auto}
.app .tbl{table-layout:fixed}
.app .tbl th{position:sticky;top:0;background:var(--surface);z-index:1;height:34px;padding-top:0;padding-bottom:0}
.app .tbl td{overflow:hidden;text-overflow:ellipsis}
.app .tbl td.acts{overflow:visible}
.tbl td .btn.sm{height:28px}
col.c-id{width:84px}col.c-uid{width:152px}col.c-acc{width:96px}col.c-app{width:168px}col.c-date{width:96px}
col.c-kind{width:112px}col.c-appn{width:104px}col.c-mail{width:260px}col.c-prov{width:180px}col.c-time{width:148px}col.c-acts{width:196px}
col.c-actor{width:160px}col.c-act{width:170px}
.rtbl td{height:40px}
tr.urow{cursor:pointer}
tr.urow.sel td{background:var(--primary-soft)}
tr.urow.sel td:first-child{box-shadow:inset 2px 0 0 var(--primary)}
.nm{font-weight:500;color:var(--text)}
.prov{display:inline-flex;align-items:center;height:18px;padding:0 5px;border-radius:4px;border:1px solid var(--border2);font-size:10.5px;color:var(--muted);vertical-align:1px}
.c-name .prov{margin-left:2px}
.c-name .em{margin-left:8px;font-size:12px}
.sm-until{font-size:11.5px;margin-left:2px}
.list-foot{flex:none;height:46px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 12px;border-top:1px solid var(--border)}
.pager button.on{cursor:default}
.detail{padding:0;gap:0;overflow:hidden}
.detail-head{flex:none;display:flex;justify-content:flex-end;padding:6px 8px 0;min-height:8px}
.detail-head .m-back,.detail-head .d-close{display:none}
.detail-body{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:14px;padding:4px 16px 16px}
.detail-body .h2{font-size:17px;outline:none}
.detail-body>div:first-child{display:flex;flex-direction:column;gap:6px}
.kv{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;padding:4px 0;font-size:12.5px;min-width:0}
.appbox{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface2)}
.appbox .input{background:var(--surface)}
.danger-zone{border-color:color-mix(in srgb,var(--neg) 30%,var(--border))}
.mform{display:flex;flex-direction:column;gap:10px}
.grid2{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:8px}
.grid2 .input.sel{width:100%}
.until .row{gap:6px}
.until .input.sel{flex:1;min-width:0}
.until input[type="date"]{flex:1.2;min-width:0;height:36px;padding:0 8px}
.sw-label{font-size:12.5px;cursor:pointer}
.cards{display:flex;flex-direction:column;gap:8px;padding:10px}
.ucard{display:flex;flex-direction:column;gap:6px;width:100%;text-align:left;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface)}
.ucard.sel{border-color:var(--primary)}
.ucard .nm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.uc-app{display:flex;align-items:center;justify-content:space-between;gap:8px}

/* davetler */
.inv-grid{flex:1;min-height:0;overflow:auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:12px;align-content:start}
.inv{gap:12px}
.inv-part{display:flex;flex-direction:column;gap:10px}
.end-row{align-items:flex-end}
.field.days{width:140px}
.result{display:flex;flex-direction:column;gap:6px;padding:10px 12px;border:1px dashed var(--border2);border-radius:8px;background:var(--surface2)}

/* birleştir */
.merge{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:12px}
.merge>.card{flex:none}
.field.idf{width:200px}
.merge-pair{display:grid;grid-template-columns:minmax(0,1fr) 32px minmax(0,1fr);gap:8px;align-items:stretch;flex:none}
.merge-arrow{display:grid;place-items:center;font-size:20px;color:var(--muted)}
.mcard{min-height:200px}
.mcard.keep{border-color:color-mix(in srgb,var(--pos) 40%,var(--border))}
.mcard.drop{border-color:color-mix(in srgb,var(--warn) 45%,var(--border))}
.mcard .state-box{min-height:120px;padding:16px}
.check{align-items:flex-start;cursor:pointer}
.check input{width:16px;height:16px;margin:1px 0 0;accent-color:var(--primary);flex:none}

/* toast + modal */
.toasts{position:fixed;right:16px;bottom:16px;z-index:30;display:flex;flex-direction:column;gap:8px;max-width:min(380px,calc(100% - 32px))}
.toast{padding:10px 14px;border-radius:10px;border:1px solid var(--border2);border-left-width:3px;background:var(--surface);color:var(--text);box-shadow:var(--shadow);font-size:12.5px;opacity:0;transform:translateY(8px);transition:opacity var(--t-state) var(--ease),transform var(--t-state) var(--ease)}
.toast.in{opacity:1;transform:none}
.toast.pos{border-left-color:var(--pos)}
.toast.neg{border-left-color:var(--neg)}
#modal-root .scrim{position:fixed;z-index:20;padding:16px}
.modal.sm{width:min(460px,100%)}
.modal .field textarea{min-height:60px}

/* kompakt 900–1279: ayrıntı paneli tablonun üstüne açılır */
@media (max-width:1279px) and (min-width:900px){
  .split{grid-template-columns:minmax(0,1fr)}
  .split .detail{position:absolute;top:0;right:0;bottom:0;width:400px;z-index:3;box-shadow:var(--shadow);display:none}
  .split.has-sel .detail{display:flex}
  .detail-head .d-close{display:grid}
}

/* telefon <900: tek sütun liste, ayrıntı ayrı görünüm, sayfa kayar */
@media (max-width:899px){
  .app.responsive>.main{gap:10px}
  .top{gap:8px;flex-wrap:nowrap;height:56px;padding:0 12px}
  .brand .session{display:none}
  .tools{padding-left:0;margin-left:auto;min-width:0}
  .scope{min-width:0}
  .scope .sel{max-width:150px}
  .toolbar .search{width:100%;flex:1 1 100%}
  .toolbar .grow{display:none}
  .split{grid-template-columns:minmax(0,1fr);flex:none}
  .split .detail{display:none}
  .split.show-detail .list{display:none}
  .split.show-detail .detail{display:flex}
  .list,.detail{overflow:visible}
  .detail-body{overflow:visible}
  .detail-head{justify-content:flex-start;padding:10px 12px 0}
  .detail-head .m-back{display:inline-flex}
  .card.flat.list{background:transparent;border:0}
  .cards{padding:0}
  .list-foot{border-top:0;padding:0 2px}
  .inv-grid,.merge{overflow:visible;flex:none}
  .inv-grid{grid-template-columns:minmax(0,1fr)}
  .merge-pair{grid-template-columns:minmax(0,1fr)}
  .merge-arrow{transform:rotate(90deg);height:24px}
  .field.idf{width:calc(50% - 4px)}
  .grid2{grid-template-columns:minmax(0,1fr)}
  .toasts{bottom:84px}
  .center{padding:8px 0}
}

@media (prefers-reduced-motion:reduce){
  .app{--t-hover:0ms;--t-state:0ms}
  .app *{animation-duration:0s!important;transition-duration:0s!important}
}

/* uzun metin (ru / en) */
.app .tbl th{overflow:hidden;text-overflow:ellipsis}
.tabbar a span{max-width:100%;padding:0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:899px){
  .toolbar .seg{max-width:100%;overflow-x:auto;scrollbar-width:none}
  .toolbar .seg button{padding:0 9px;flex:none}
  .tabbar a{font-size:10.5px}
}
.badges{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.badges:empty{display:none}
.inv-open{margin:-4px 0 2px}
