@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --accent:#0a1a3c;
  --accent-2:#132a5c;
  --accent-soft:#e7eaf3;
  --bg:#f4f5f8;
  --surface:#ffffff;
  --border:#e3e5ec;
  --text:#1b2130;
  --text-muted:#6b7280;
  --success:#16793f;
  --success-bg:#e7f6ed;
  --danger:#c0342c;
  --danger-bg:#fbeae9;
  --warn-bg:#fff6e0;
  --radius:12px;
  --shadow:0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.04);
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{margin:0 0 4px 0; font-weight:700; letter-spacing:-.01em;}
p{margin:0;}
a{color:inherit;}
button{font-family:inherit;}

/* ---------- LOGIN ---------- */
.login-wrap{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(160deg,var(--accent) 0%,var(--accent-2) 55%, #1c3a7a 100%);
  padding:20px;
}
.login-card{
  background:var(--surface); border-radius:20px; padding:40px 36px; width:100%; max-width:380px;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}
.login-card h1{font-size:22px; color:var(--accent);}
.login-card .sub{color:var(--text-muted); font-size:14px; margin-bottom:24px;}
.login-card label{display:block; font-size:13px; font-weight:600; margin:14px 0 6px;}
.login-card input{width:100%; padding:11px 13px; border:1.5px solid var(--border); border-radius:10px; font-size:14px;}
.login-card input:focus{outline:none; border-color:var(--accent);}
.login-btn{
  width:100%; margin-top:20px; padding:12px; background:var(--accent); color:#fff; border:none;
  border-radius:10px; font-weight:600; font-size:14px; cursor:pointer; transition:.15s;
}
.login-btn:hover{background:var(--accent-2);}
.login-err{color:var(--danger); font-size:13px; margin-top:12px; min-height:16px;}

/* ---------- APP SHELL ---------- */
.app-shell{display:flex; min-height:100vh;}
.sidebar{
  width:230px; background:var(--accent); color:#fff; flex-shrink:0;
  display:flex; flex-direction:column; padding:22px 14px; position:fixed; top:0; bottom:0; left:0;
  z-index:50;
}
.sidebar .brand{display:flex; align-items:center; gap:10px; padding:0 8px 22px; border-bottom:1px solid rgba(255,255,255,.12); margin-bottom:14px;}
.sidebar .brand img{width:32px; height:32px; object-fit:contain; border-radius:6px; background:#fff;}
.sidebar .brand span{font-weight:700; font-size:15px; line-height:1.2;}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:11px 12px; border-radius:9px; color:rgba(255,255,255,.75);
  text-decoration:none; font-size:14px; font-weight:500; cursor:pointer; margin-bottom:2px; transition:.12s;
}
.nav-item svg{width:18px; height:18px; flex-shrink:0;}
.nav-item:hover{background:rgba(255,255,255,.08); color:#fff;}
.nav-item.active{background:rgba(255,255,255,.14); color:#fff;}
.sidebar .spacer{flex:1;}
.nav-item.logout{color:rgba(255,255,255,.55); font-size:13px;}

.main{margin-left:230px; flex:1; padding:28px 34px; max-width:100%;}
.topbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:22px; flex-wrap:wrap; gap:12px;}
.topbar h2{font-size:22px;}
.topbar .date{color:var(--text-muted); font-size:13px;}

.btn{
  display:inline-flex; align-items:center; gap:8px; padding:10px 16px; border-radius:9px; border:none;
  font-weight:600; font-size:13.5px; cursor:pointer; transition:.12s;
}
.btn-primary{background:var(--accent); color:#fff;}
.btn-primary:hover{background:var(--accent-2);}
.btn-ghost{background:var(--surface); color:var(--text); border:1.5px solid var(--border);}
.btn-ghost:hover{border-color:var(--accent);}
.btn-danger{background:var(--danger-bg); color:var(--danger);}
.btn-sm{padding:6px 11px; font-size:12.5px; border-radius:7px;}
.btn:disabled{opacity:.5; cursor:not-allowed;}

/* ---------- CARDS / GRID ---------- */
.cards-row{display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:16px; margin-bottom:24px;}
.stat-card{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow);}
.stat-card .label{font-size:12.5px; color:var(--text-muted); font-weight:600; text-transform:uppercase; letter-spacing:.03em;}
.stat-card .value{font-size:24px; font-weight:800; margin-top:6px; color:var(--accent);}
.stat-card .sub{font-size:12px; color:var(--text-muted); margin-top:2px;}

.panel{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow); padding:22px; margin-bottom:20px;}
.panel h3{font-size:15px; margin-bottom:14px;}

/* ---------- TABLE ---------- */
table.data-table{width:100%; border-collapse:collapse; font-size:13.5px;}
table.data-table th{
  text-align:left; padding:10px 12px; font-size:11.5px; text-transform:uppercase; letter-spacing:.04em;
  color:var(--text-muted); border-bottom:2px solid var(--border); font-weight:700;
}
table.data-table td{padding:12px; border-bottom:1px solid var(--border); vertical-align:top;}
table.data-table tr:hover td{background:#fafbfd;}
.row-actions{display:flex; gap:6px; flex-wrap:wrap;}
.empty-state{padding:40px 20px; text-align:center; color:var(--text-muted); font-size:14px;}

.badge{display:inline-block; padding:3px 10px; border-radius:20px; font-size:11.5px; font-weight:700;}
.badge-taslak{background:var(--warn-bg); color:#8a5a00;}
.badge-gonderildi{background:var(--success-bg); color:var(--success);}
.badge-gelir{background:var(--success-bg); color:var(--success);}
.badge-gider{background:var(--danger-bg); color:var(--danger);}

/* ---------- FORMS ---------- */
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px 16px;}
.form-grid.cols-3{grid-template-columns:1fr 1fr 1fr;}
.field{display:flex; flex-direction:column; gap:6px;}
.field.full{grid-column:1/-1;}
.field label{font-size:12.5px; font-weight:600; color:var(--text);}
.field .hint{font-size:11px; color:var(--text-muted); font-weight:400;}
input[type=text],input[type=number],input[type=email],input[type=date],input[type=password],textarea,select{
  padding:9px 11px; border:1.5px solid var(--border); border-radius:8px; font-size:13.5px; font-family:inherit; width:100%;
  background:#fff; color:var(--text);
}
input:focus,textarea:focus,select:focus{outline:none; border-color:var(--accent);}
textarea{resize:vertical; min-height:70px;}

/* ---------- MODAL ---------- */
.modal-overlay{
  position:fixed; inset:0; background:rgba(10,16,32,.55); display:flex; align-items:flex-start; justify-content:center;
  padding:32px 16px; overflow-y:auto; z-index:100;
}
.modal{background:#fff; border-radius:16px; width:100%; max-width:620px; box-shadow:0 20px 60px rgba(0,0,0,.3); animation:pop .15s ease;}
.modal.wide{max-width:960px;}
@keyframes pop{from{transform:translateY(8px); opacity:0;} to{transform:translateY(0); opacity:1;}}
.modal-head{display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border);}
.modal-head h3{font-size:16px;}
.modal-close{background:none; border:none; font-size:20px; cursor:pointer; color:var(--text-muted); line-height:1;}
.modal-body{padding:22px; max-height:70vh; overflow-y:auto;}
.modal-foot{padding:16px 22px; border-top:1px solid var(--border); display:flex; justify-content:flex-end; gap:10px;}

/* ---------- DYNAMIC LIST ROWS (diğer bilgiler / notlar) ---------- */
.dyn-row{display:flex; gap:8px; margin-bottom:8px; align-items:center;}
.dyn-row input{flex:1;}
.dyn-remove{background:var(--danger-bg); color:var(--danger); border:none; border-radius:7px; width:32px; height:32px; cursor:pointer; font-size:15px; flex-shrink:0;}
.dyn-add{background:var(--accent-soft); color:var(--accent); border:none; padding:8px 13px; border-radius:8px; font-size:12.5px; font-weight:600; cursor:pointer; margin-top:2px;}

/* ---------- TABS ---------- */
.tabs{display:flex; gap:6px; margin-bottom:18px; border-bottom:1px solid var(--border);}
.tab{padding:10px 4px; margin-right:18px; font-size:13.5px; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2.5px solid transparent;}
.tab.active{color:var(--accent); border-bottom-color:var(--accent);}

/* ---------- LOGO UPLOAD ---------- */
.logo-upload{display:flex; align-items:center; gap:16px;}
.logo-preview{width:76px; height:76px; border-radius:10px; border:1.5px dashed var(--border); display:flex; align-items:center; justify-content:center; background:#fafbfd; overflow:hidden; flex-shrink:0;}
.logo-preview img{width:100%; height:100%; object-fit:contain;}

/* toast */
.toast{position:fixed; bottom:24px; right:24px; background:var(--accent); color:#fff; padding:13px 18px; border-radius:10px; font-size:13.5px; font-weight:600; box-shadow:0 8px 24px rgba(0,0,0,.25); z-index:200; animation:pop .15s ease;}
.toast.err{background:var(--danger);}

@media (max-width: 900px){
  .sidebar{transform:translateX(-100%); transition:.2s; box-shadow:0 0 0 9999px rgba(0,0,0,0);}
  .sidebar.open{transform:translateX(0); box-shadow:0 0 40px rgba(0,0,0,.3);}
  .main{margin-left:0; padding:18px;}
  .form-grid, .form-grid.cols-3{grid-template-columns:1fr;}
  .menu-toggle{display:flex !important;}
}
.menu-toggle{display:none; align-items:center; justify-content:center; width:38px; height:38px; border-radius:8px; background:var(--surface); border:1px solid var(--border); cursor:pointer;}
