/* Reset, tipografi, forma dhe butona – pa dijeni për layout-in. */

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` duhet të fitojë mbi rregullat e klasave (p.sh. .note-box{display:flex}),
   përndryshe kutitë e fshehura shfaqen bosh. */
[hidden] { display: none !important; }

html { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -.025em;
}
h1 { font-size: var(--fs-3xl); line-height: 1.1; }
h2 { font-size: var(--fs-lg); }
h3 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted);
}
p { margin: 0; }
a { color: var(--text-strong); }
button, input, select, textarea { font-family: inherit; }

.icon-svg {
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- Fusha --- */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > .label,
.field > span:first-child {
  font-size: var(--fs-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .075em;
  color: var(--text-muted);
}
.field.inline { flex-direction: row; align-items: center; gap: var(--s-2); }
.field.check { flex-direction: row; align-items: flex-start; gap: var(--s-2); }
.field.check > span { text-transform: none; letter-spacing: 0; font-size: var(--fs-md); color: var(--text); font-weight: 400; }

input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="month"],
input[type="password"], select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  min-width: 0;
  min-height: 36px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
input:hover:not(:disabled), select:hover, textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
}
input:disabled { background: var(--surface-3); color: var(--text-muted); cursor: not-allowed; }
input::placeholder { color: var(--text-muted); opacity: .7; }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
input[type="checkbox"] { accent-color: var(--accent); width: 17px; height: 17px; }
textarea { resize: vertical; line-height: 1.5; }

/* Largo shigjetat e input[type=number] – ngatërrohen me hyrjen me tastierë */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* --- Butona --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600; white-space: nowrap; cursor: pointer;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: background .16s, border-color .16s, color .16s, transform .16s;
}
.btn:hover {
  background: var(--surface-3);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }
.btn:active { transform: translateY(1px); }

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.quiet { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn.quiet:hover { background: var(--surface-3); color: var(--text); }

.btn.danger { color: var(--bad-fg); border-color: transparent; background: transparent; }
.btn.danger:hover { background: var(--bad-bg); }

.btn.sm { min-height: 31px; padding: 5px 10px; font-size: var(--fs-sm); }
.btn.icon { padding: 0; width: 38px; height: 38px; font-size: var(--fs-md); }

/* --- Ndihmësa --- */

.mono { font-family: var(--mono); font-size: var(--fs-sm); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-muted); }
.strong { font-weight: 650; }
.hint { font-size: var(--fs-sm); color: var(--text-muted); }
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-end; }
.row.center { align-items: center; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: var(--s-6); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.pos { color: var(--ok-fg); }
.neg { color: var(--bad-fg); }
.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;
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .btn.icon { width: 44px; height: 44px; }
  input[type="text"], input[type="email"], input[type="number"], input[type="date"], input[type="month"],
  input[type="password"], select, textarea { min-height: 44px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
