:root {
  --blue: #1f5f8b; --blue-d: #164766; --bg: #f3f5f8; --line: #dde3ea; --text: #1d2733; --muted: #6b7785;
  --green: #1d8a4e; --red: #c0392b; --orange: #d9822b;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, Arial, sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
.hidden { display: none !important; }
a { color: var(--blue); text-decoration: none; }
.muted { color: var(--muted); }
.error { color: var(--red); margin-top: 8px; min-height: 18px; }

/* Giriş */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f5f8b, #0f2f46); }
.login-box { background: #fff; padding: 32px; border-radius: 12px; width: 340px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.login-box label { display: block; margin-top: 12px; }
.brand { font-weight: 800; font-size: 20px; color: #fff; padding: 18px 16px 14px; letter-spacing: .3px; }
.brand a { color: #fff; }
.brand span { font-weight: 400; opacity: .8; }
.brand.big { color: var(--blue); font-size: 28px; padding: 0 0 4px; }

/* Yerleşim: üstte modül butonları, solda İşlemler paneli, altta durum çubuğu */
.app { display: flex; flex-direction: column; height: 100vh; }
.ribbon { display: flex; align-items: stretch; gap: 10px; background: linear-gradient(#fdfdfe, #e9eef4); border-bottom: 3px solid var(--blue); padding: 6px 10px 0; flex-shrink: 0; }
.tabs { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.tab { font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 74px; padding: 6px 6px 7px;
  background: linear-gradient(#ffffff, #eef2f6); border: 1px solid #cdd6e0; border-bottom: 0; border-radius: 8px 8px 0 0; cursor: pointer;
  color: #2b3a48; font-size: 12px; white-space: nowrap; }
.tab span { font-size: 24px; line-height: 1.1; margin-bottom: 3px; }
.tab:hover { background: linear-gradient(#ffffff, #dfeaf5); }
.tab.active { background: linear-gradient(#e3effa, #c7def2); border-color: #7aa9d1; color: var(--blue-d); font-weight: 600; box-shadow: inset 0 -3px 0 var(--blue); }
.ribbon-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; padding-bottom: 6px; gap: 4px; }
.logo { font-size: 19px; font-weight: 800; color: var(--blue); white-space: nowrap; }
.logo span { font-weight: 400; color: #c0392b; }
.user { font-size: 12px; white-space: nowrap; }
.body { flex: 1; display: flex; min-height: 0; }
.side { width: 230px; flex-shrink: 0; background: #f7f9fb; border-right: 1px solid var(--line); overflow-y: auto; }
.side-title { font-weight: 700; text-align: center; padding: 9px; background: linear-gradient(#eef3f8, #dde6ef); border-bottom: 1px solid var(--line); color: #2b3a48; }
.side-search { padding: 8px; }
.side-search input { padding: 6px 8px; font-size: 13px; }
#sideItems a { display: flex; gap: 8px; align-items: flex-start; padding: 7px 12px; color: #24313e; border-bottom: 1px solid #edf0f3; font-size: 13.5px; }
#sideItems a i { font-style: normal; width: 16px; text-align: center; color: var(--blue); }
#sideItems a small { display: block; color: var(--muted); font-size: 11px; }
#sideItems a small.tag { display: inline; background: #eef2f6; border-radius: 6px; padding: 0 5px; font-size: 10px; }
#sideItems a:hover, #sideItems a.sel { background: #e6f0f9; }
#sideItems a.active { background: #fff6d6; font-weight: 600; border-left: 3px solid var(--orange); padding-left: 9px; }
#sideItems a.soon { color: #9aa5b1; }
.main { flex: 1; min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.page-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 0; }
.page-head h1 { font-size: 17px; margin: 0; }
#menuToggle { display: none; }
.content { padding: 12px 16px 18px; }
.statusbar { display: flex; gap: 0; background: #e9eef4; border-top: 1px solid #cdd6e0; font-size: 12px; color: #3b4855; flex-shrink: 0; }
.statusbar span { padding: 4px 12px; border-right: 1px solid #cdd6e0; white-space: nowrap; }
.statusbar .grow { flex: 1; text-align: center; font-weight: 600; }
.list-foot { display: flex; justify-content: space-between; background: #eef2f6; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 10px 10px; padding: 7px 12px; font-weight: 600; }

/* Form elemanları */
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid #c8d1db; border-radius: 6px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e0; border-color: var(--blue); }
label { font-size: 13px; color: #44515f; }
label > input, label > select, label > textarea { margin-top: 3px; }
.btn { font: inherit; border: 1px solid #c8d1db; background: #fff; padding: 7px 14px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #f0f3f6; }
.btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn.primary:hover { background: var(--blue-d); }
.btn.green { background: var(--green); color: #fff; border-color: var(--green); }
.btn.danger { color: var(--red); }
.btn.small { padding: 3px 9px; font-size: 12px; }
.btn.wide { width: 100%; margin-top: 18px; padding: 10px; }
.btn.icon { font-size: 18px; padding: 3px 10px; }
.btn.big { font-size: 17px; padding: 12px 22px; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.row > label { flex: 1; min-width: 140px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 12px; font-size: 15px; }

/* Kutucuklar */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.stat .t { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; }
.stat.warn .v { color: var(--orange); }

/* Tablo */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 10px; border-bottom: 1px solid #edf0f3; text-align: left; white-space: nowrap; }
th { background: #f7f9fb; font-size: 12px; color: #55626f; font-weight: 600; position: sticky; top: 0; }
tr:hover td { background: #fafcfe; }
td.num, th.num { text-align: right; }
tfoot td { font-weight: 700; background: #f7f9fb; }
.pos { color: var(--green); } .neg { color: var(--red); }
td input { padding: 4px 6px; min-width: 70px; }

/* Satış ekranı */
.pos-grid { display: grid; grid-template-columns: 1fr 320px; gap: 14px; }
.search-box { position: relative; }
.search-box input { font-size: 17px; padding: 10px 12px; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px; z-index: 10; max-height: 320px; overflow-y: auto; box-shadow: 0 6px 18px rgba(0,0,0,.1); }
.suggest div { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.suggest div:hover, .suggest div.sel { background: #eaf3fa; }
.total-box { font-size: 30px; font-weight: 800; text-align: right; color: var(--blue); margin: 10px 0; }

/* Modal & bildirim */
.modal { position: fixed; inset: 0; background: rgba(15,30,45,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 12px; z-index: 50; overflow-y: auto; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px; width: 100%; max-width: 900px; position: relative; }
.modal-close { position: absolute; right: 12px; top: 8px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.modal-box h2 { margin: 0 0 14px; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px); background: #17324a; color: #fff; padding: 10px 18px; border-radius: 8px; transition: transform .25s; z-index: 60; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }
.soon-box { text-align: center; padding: 60px 20px; color: var(--muted); }
.soon-box .ic { font-size: 44px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #eef2f6; font-size: 12px; }

@media (max-width: 900px) {
  .ribbon-right .logo { display: none; }
  .tab { min-width: 70px; font-size: 11.5px; } .tab span { font-size: 20px; }
  #menuToggle { display: inline-block; }
  .side { position: fixed; left: -250px; top: 0; bottom: 0; z-index: 30; transition: left .2s; }
  .side.open { left: 0; box-shadow: 0 0 30px rgba(0,0,0,.35); }
  .pos-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 10px; }
  .statusbar span:not(.grow) { display: none; }
}
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}

.sub { color: #44515f; padding-left: 14px; }
.badge.st-portfoy, .badge.st-verildi { background: #fff3d6; color: #8a5a00; }
.badge.st-tahsil, .badge.st-odendi { background: #dff3e7; color: var(--green); }
.badge.st-karsiliksiz { background: #fde2df; color: var(--red); }
label.btn input[type=file] { display: none; }
.small-link { display: inline-block; font-size: 12px; margin-top: 6px; }
#dbBox { background: #f3f7fb; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 8px; margin-top: 10px; }
#sbDb { font-weight: 600; color: var(--blue-d); }
td.wrap { white-space: normal; min-width: 220px; }
.badge.link { background: #e3effa; color: var(--blue-d); text-decoration: none; }
.badge.link:hover { background: #c7def2; }

.seg { display: inline-flex; border: 1px solid #c8d1db; border-radius: 8px; overflow: hidden; }
.seg button { font: inherit; border: 0; background: #fff; padding: 6px 12px; cursor: pointer; }
.seg button + button { border-left: 1px solid #c8d1db; }
.seg button.on { background: var(--blue); color: #fff; }
table.totals { width: 100%; margin: 10px 0; border-collapse: collapse; }
table.totals td { padding: 4px 2px; border: 0; border-bottom: 1px dashed #e3e8ee; }
table.totals td:last-child { text-align: right; font-weight: 600; }
table.totals tr.grand td { font-size: 20px; font-weight: 800; color: var(--blue); border-bottom: 0; padding-top: 8px; }
.modal-box table.totals { width: 340px; margin-left: auto; }

/* Cari hareketleri ekranı */
.cari-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #3d4954; color: #fff; padding: 12px 16px; border-radius: 10px 10px 0 0; }
.cari-head .cn { font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.cari-head .cs { font-size: 12px; opacity: .8; margin-top: 2px; }
.cari-head .cb { font-size: 20px; font-weight: 800; text-align: right; white-space: nowrap; }
.cari-head .cb .pos, .cari-head .cb .neg { color: #fff; }
.cari-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 18px; background: #fff; border: 1px solid var(--line); border-top: 0; padding: 10px 16px; font-size: 13px; }
.ci-col div { display: flex; gap: 8px; padding: 2px 0; }
.ci-col span { color: var(--muted); min-width: 120px; }
.ci-col b { font-weight: 600; }
.cari-body { display: grid; grid-template-columns: 220px 1fr; gap: 0; margin-top: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; min-height: 420px; }
.cari-menu { border-right: 1px solid var(--line); background: #f7f9fb; border-radius: 10px 0 0 10px; padding-bottom: 8px; }
.cm-title { font-weight: 700; text-align: center; padding: 8px; background: linear-gradient(#eef3f8, #dde6ef); border-bottom: 1px solid var(--line); border-radius: 10px 0 0 0; }
.cari-menu a { display: block; padding: 6px 12px 6px 28px; color: #24313e; cursor: pointer; font-size: 13px; }
.cari-menu a.top { padding-left: 12px; font-weight: 600; border-bottom: 1px solid #edf0f3; }
.cari-menu a:hover { background: #e6f0f9; }
.cari-menu a.on { background: #fff6d6; font-weight: 600; }
.cari-menu a.soon { color: #9aa5b1; }
.cari-menu summary { padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 13px; border-bottom: 1px solid #edf0f3; list-style: none; }
.cari-menu summary::before { content: '⊞ '; color: var(--muted); font-weight: 400; }
.cari-menu details[open] summary::before { content: '⊟ '; }
.cari-menu small.tag { background: #eef2f6; border-radius: 6px; padding: 0 5px; font-size: 10px; }
.cari-main { padding: 10px 14px; min-width: 0; }
.cari-title { font-weight: 700; text-align: center; background: #3d4954; color: #fff; margin: -10px -14px 10px; padding: 6px; border-radius: 0 10px 0 0; }
a.cari-a { color: var(--text); font-weight: 600; }
a.cari-a:hover { color: var(--blue); text-decoration: underline; }
.print-only { display: none; }
@media print { .print-only { display: block; } }
@media (max-width: 900px) { .cari-info { grid-template-columns: 1fr; } .cari-body { grid-template-columns: 1fr; } .cari-menu { border-right: 0; } }

body.no-side .side { display: none; }
body.no-side #menuToggle { display: inline-block; }
body.no-side.side-peek .side { display: block; position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; box-shadow: 0 0 30px rgba(0,0,0,.35); }
.pos-grid > div { min-width: 0; }
.cari-main .pos-grid { grid-template-columns: 1fr 290px; }
.cari-main .pos-grid td, .cari-main .pos-grid th { padding: 7px 6px; }
input.ro { background: #f1f4f7; color: #44515f; }

.tc-g { margin: 18px 0 8px; font-size: 16px; }
.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tc-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tc-t { font-weight: 700; font-size: 15px; }
.tc-d { font-size: 13px; color: #44515f; flex: 1; }
.tc-h { font-size: 12px; color: var(--muted); background: #f5f7f9; border-radius: 6px; padding: 5px 8px; }
.tc-card .btn { align-self: flex-start; }

table.kv { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
table.kv th { text-align: left; width: 200px; background: #f7f9fb; font-weight: 600; vertical-align: top; }
table.kv td, table.kv th { border-bottom: 1px solid #edf0f3; padding: 6px 8px; white-space: normal; }
table.kv.diff tr.chg td, table.kv.diff tr.chg th { background: #fff6d6; }
table.kv.diff tr.chg td:last-child { font-weight: 700; color: var(--blue-d); }
pre.jv { margin: 0; font-size: 11px; white-space: pre-wrap; max-height: 160px; overflow: auto; }
.modal-box h3 { font-size: 15px; margin: 14px 0 6px; } .modal-box h4 { margin: 10px 0 4px; font-size: 13px; }
.small-t td, .small-t th { white-space: normal; font-size: 12px; padding: 5px 7px; }

.req-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:6px 14px}
label.chk{display:flex;align-items:center;gap:8px;flex-direction:row;font-weight:normal;cursor:pointer}
label.chk input{width:auto;margin:0}
