:root{
  --bg: #044063;
  --bg2:#022b42;
  --card:#ffffff;
  --text:#0b1f2a;
  --muted:#5a6b75;
  --line:#e6eaee;
  --accent:#337096;
  --accent2:#194a6c;
  --danger:#b3261e;
  --ok:#1b6b2b;
  --shadow: 0 10px 28px rgba(0,0,0,.12);
  --radius: 14px;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background: radial-gradient(1200px 600px at 20% 10%, var(--accent) 0%, var(--bg) 35%, var(--bg2) 100%);
}

a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}

.container{
  width:min(1100px, 100%);
  margin:0 auto;
  padding: 18px 14px 40px;
}

.header{
  display:flex;
  align-items:center;
  gap:14px;
  padding: 10px 0 16px;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  color:#fff;
}

.brand img{
  width:56px;
  height:56px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0,0,0,.22);
  background: rgba(255,255,255,.08);
  padding:6px;
}

.brand h1{
  font-size: 18px;
  line-height:1.2;
  margin:0;
  font-weight: 700;
  letter-spacing: .2px;
}

.brand .sub{
  margin:2px 0 0;
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 500;
}

.topbar{
  margin-left:auto;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.pill{
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  color:#fff;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor:pointer;
  user-select:none;
}
.pill:hover{background: rgba(255,255,255,.16);}

.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-pad{ padding: 16px; }

.nav-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding: 14px 14px 0;
  background: rgba(255,255,255,.06);
}

.tab{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.14);
  color:#fff;
  padding: 10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-size: 13px;
  font-weight: 600;
}
.tab[aria-selected="true"]{
  background:#fff;
  color: var(--text);
  border-color:#fff;
}

.main{
  margin-top: 10px;
  display:grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 12px;
}

@media (max-width: 900px){
  .main{ grid-template-columns: 1fr; }
  .topbar{display:none;}
}

.section-title{
  margin:0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.help{
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
  line-height:1.45;
}

.form-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px){
  .form-grid{ grid-template-columns: 1fr; }
}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 650;
}

input[type="number"],
input[type="text"],
select{
  width:100%;
  padding: 10px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  outline: none;
  font-size: 14px;
  background:#fff;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus{
  border-color: rgba(11,94,168,.45);
  box-shadow: 0 0 0 3px rgba(11,94,168,.14);
}

.inline{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.chk{
  display:flex;
  gap:8px;
  align-items:flex-start;
  font-size: 13px;
  color: var(--text);
}
.chk input{ margin-top: 3px; }

.radio{
  display:flex;
  gap:10px;
  align-items:center;
  font-size: 13px;
}
.radio input{ margin:0; }

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 12px;
}
.btn{
  border:0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor:pointer;
  font-size: 14px;
  font-weight: 750;
}
.btn:disabled{ opacity: .55; cursor: not-allowed; }

.btn-primary{
  background: var(--accent);
  color:#fff;
}
.btn-primary:hover{ background: var(--accent2); }
.btn-ghost{
  background: #f6f8fa;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover{ background:#eef2f5; }

.notice{
  background: #f6fbff;
  border: 1px solid #d6ebff;
  color: #0b3b59;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height:1.4;
}

.results{
  position:sticky;
  top:12px;
  align-self:start;
}
@media (max-width: 900px){
  .results{ position:static; }
}

.kalem{
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.kalem:last-child{border-bottom:0;}
.kalem .name{
  font-size: 13px;
  color: var(--text);
  line-height:1.35;
}
.kalem .amt{
  font-size: 13px;
  font-weight: 800;
  white-space:nowrap;
}

.total{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 2px solid var(--line);
  font-size: 15px;
  font-weight: 900;
}

.small{
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.footer{
  margin-top: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height:1.5;
}
.footer strong{ color:#fff; }
.footer a{ color:#fff; text-decoration:underline; }

.badge{
  display:inline-block;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7ff;
  border: 1px solid #d6ebff;
  color: #0b3b59;
  font-weight: 800;
}

.hidden{display:none !important;}

hr.sep{
  border:0;
  border-top: 1px solid rgba(255,255,255,.16);
  margin: 14px 0;
}


/* Print (PDF) output */
.printHeader{
  display:none;
  align-items:center;
  gap:12px;
  padding: 6px 0 12px;
  margin: 0 0 12px;
  border-bottom: 1px solid #d6dde3;
}
.printHeader img{
  width:64px;
  height:64px;
  border-radius: 12px;
  padding:6px;
  background:#fff;
  border:1px solid #e7edf2;
}
.printHeaderText{display:flex; flex-direction:column; gap:2px;}
.printOwner{font-size:16px; font-weight:800; color:#0b1f2a;}
.printTitle{font-size:13px; font-weight:700; color:#0b1f2a;}
.printMeta{font-size:12px; color:#42525c;}
.printContext{
  display:none;
  font-size:12px;
  color:#0b1f2a;
  padding: 0 0 10px;
  margin: -4px 0 10px;
  border-bottom: 1px dashed #d6dde3;
  line-height:1.35;
}

@media print{
  *{-webkit-print-color-adjust: exact; print-color-adjust: exact;}
  /* Force light background */
  body{ background:#fff !important; }
  a{ color:#000 !important; text-decoration:none !important; }
  .container{ width:100% !important; padding:0 !important; }
  .header, .tabs, .topbar, footer, .notice{ display:none !important; }

  /* Keep only the results card */
  .main{ grid-template-columns: 1fr !important; }
  .main > .card:not(.results){ display:none !important; }
  .card{ box-shadow:none !important; }

  .printHeader{ display:flex !important; }
  .printContext{ display:block !important; }

  /* Hide action buttons and helpers */
  .actions, .help, .print-save-note{ display:none !important; }
  #resultMeta{ display:none !important; }

  /* Tighten spacing */
  .results{ border: 1px solid #d6dde3 !important; }
  .item{ break-inside:avoid; }
  .total{ break-inside:avoid; }
}


.footer .copy{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.18);
  font-weight:600;
  letter-spacing:.2px;
}

@media (max-width: 520px){
  .footer{ font-size:12px; }
  .footer, .small{ word-break:break-word; }
}


@page{ size: A4; margin: 14mm; }
