:root {
  --bg: #0e0f12;
  --elev: #151720;
  --text: #e6e6e9;
  --muted: #a4a7ae;
  --accent: #6aa6ff;
  --accent-2: #7bd389;
  --danger: #ff6a6a;
  --border: #232632;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  /* Hide scrollbars but keep scrolling functionality */
  overflow-x: hidden;
}

/* Hide scrollbars for all browsers */
::-webkit-scrollbar {
  width: 0px;
  background: transparent;
}

/* Firefox */
html {
  scrollbar-width: none;
}

/* IE and Edge */
body {
  -ms-overflow-style: none;
}

header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
header h1 { font-size: 20px; margin: 0; }
header .tagline { margin: 0; color: var(--muted); font-size: 13px; }

main { max-width: 1100px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}

.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 980px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; }
label { color: var(--muted); font-size: 13px; }
input[type="text"], input[type="number"], button {
  background: #0f1117;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
}

input:focus, button:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.checkbox { flex-direction: row; align-items: center; gap: 10px; margin-top: 22px; }
input[type="checkbox"] { width: 18px; height: 18px; }

.actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
button { cursor: pointer; }
button#saveApiUrl { background: #0f1117; }
button[type="submit"] { background: var(--accent); border-color: var(--accent); color: #081220; font-weight: 600; }
button[disabled] { opacity: 0.6; cursor: not-allowed; }
button#saveCsvBtn { background: #0f1117; border-color: var(--border); }

#status { color: var(--muted); font-size: 13px; }

h2 { margin: 6px 0 12px; font-size: 16px; }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.summary-grid .item { background: #10131a; border: 1px solid var(--border); border-radius: 6px; padding: 10px; }
.summary-grid .label { color: var(--muted); font-size: 12px; }
.summary-grid .value { font-size: 16px; font-weight: 600; }

.table-wrap { 
  overflow: auto; 
  border: 1px solid var(--border); 
  border-radius: 6px;
  /* Hide scrollbars but keep scrolling */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}
.table-wrap::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}
table { border-collapse: collapse; width: 100%; min-width: 760px; }
thead th { position: sticky; top: 0; background: #10131a; border-bottom: 1px solid var(--border); text-align: left; padding: 10px; font-weight: 600; font-size: 13px; }
tbody td { padding: 10px; border-bottom: 1px solid #1b1e29; font-size: 14px; }
tbody tr:hover { background: #121520; }

.pos { color: var(--accent-2); }
.neg { color: var(--danger); }

.toggle { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.sep { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.rate-mode { display: flex; gap: 20px; align-items: center; margin: 8px 0; }
.radio-row { flex-direction: row; align-items: center; gap: 10px; }
.variable-controls { padding-top: 8px; border: 1px solid var(--border); border-radius: 6px; padding: 12px; background: #10131a; }
.variable-controls[hidden] { display: none !important; }
.variable-controls { margin-top: 10px; }
.variable-controls .hint { color: var(--muted); font-size: 12px; margin-top: 6px; }
.exp summary { cursor: pointer; color: var(--muted); }
.exp { border: 1px solid var(--border); border-radius: 6px; padding: 12px; background: var(--elev); margin-bottom: 16px; }
.exp details[open] summary { color: var(--accent); }

.fixed-controls { padding-top: 8px; margin-top: 10px; }
.fixed-controls[hidden] { display: none !important; }
/* Make fixed-rate input narrower on desktop */
#kamatna_stopa { width: 280px; }
@media (max-width: 640px) { #kamatna_stopa { width: 100%; } }

/* Ensure hidden attribute works everywhere */
[hidden] { display: none !important; }

