/* =========================================================
   INVENTORY – Light UI (uniform)
   File: public/assets/css/app.css
   ========================================================= */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 10px 25px rgba(17, 24, 39, .08);
  --radius: 14px;

  --primary: #111827;
  --primaryText: #ffffff;

  --danger: #dc2626;
  --dangerBg: #fef2f2;

  --success: #16a34a;
  --successBg: #f0fdf4;

  --focus: rgba(37, 99, 235, .25);
}

/** {*/
/*  box-sizing: border-box;*/
/*}*/


html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

/* Layout helpers */
.container {
  width: min(1300px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.page {
  padding-top: 14px;
}

/* Typography */
.h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
}

.p {
  margin: 6px 0 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.toolbar__left {
  min-width: 0;
}

.toolbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: transform .04s ease, background .15s ease, border-color .15s ease, filter .15s ease;
}

.btn:hover {
  background: var(--surface-2);
  border-color: #d1d5db;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus);
}

/* Primary */
.btn-primary {
  background: var(--primary);
  color: var(--primaryText);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary);
  /* mos u bej e bardhe */
  color: var(--primaryText);
  /* safety */
  border-color: var(--primary);
  filter: brightness(1.08);
  /* efekt i lehte */
}

/* Danger */
.btn-danger {
  background: var(--dangerBg);
  border-color: #fecaca;
  color: #991b1b;
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
}

/* Disabled */
.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}


/* Inputs */
.input {
  width: auto;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.input::placeholder {
  color: #9ca3af;
}

.input:focus {
  box-shadow: 0 0 0 4px var(--focus);
  border-color: #93c5fd;
}

/* Table */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  background: var(--surface-2);
}

.table tbody tr:nth-child(even) {
  background: #fcfcfd;
}

.table tbody tr:hover {
  background: #f9fafb;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.text-muted {
  color: var(--muted);
  font-size: 13px;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.badge-ok {
  border-color: #bbf7d0;
  background: var(--successBg);
  color: #166534;
}

/* Flash messages */
.flash {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}

.flash.success {
  border-color: #bbf7d0;
  background: var(--successBg);
}

.flash.error {
  border-color: #fecaca;
  background: var(--dangerBg);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 999;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.modal__title {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 800;
}

.modal__sub {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 13px;
}

.form-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.nav__brand {
  font-weight: 900;
  letter-spacing: -.01em;
}

.nav__links {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.nav__link {
  text-decoration: none;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14px;
}

.nav__link:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.inline-form {
  display: inline;
}

.nav__link.is-active {
  background: var(--primary);
  color: var(--primaryText);
  border-color: var(--primary);
}



/* Warning / Edit button */
.btn-warning {
  background: #fffbeb;
  /* amber-50 */
  border-color: #fde68a;
  /* amber-200 */
  color: #92400e;
  /* amber-800 */
}

.btn-warning:hover {
  background: #fef3c7;
  /* amber-100 */
  border-color: #fcd34d;
  /* amber-300 */
}

/* Small helpers for forms */
.field {
  min-width: 0;
}

.help {
  margin: 10px 0 0 0;
  color: var(--muted);
  font-size: 13px;
}

.label {
  margin: 0 0 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width:720px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Filters row */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters .input {
  min-width: 240px;
}

.filters .select {
  min-width: 200px;
}


/* Modal – make it clearer / more premium */
.modal {
  width: min(720px, 100%);
  padding: 18px;
}

.modal__title {
  font-size: 20px;
}

.modal__sub {
  margin-bottom: 14px;
}

/* Labels + spacing inside modal */
.modal .label {
  margin: 0 0 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* Make inputs/selects full width inside modal */
.modal .input,
.modal .select {
  width: 100%;
}

/* Better actions area */
.modal-actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Slightly stronger backdrop so modal pops */
.modal-backdrop {
  background: rgba(17, 24, 39, .55);
}


/* Form layout helpers */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 860px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.col-span-2 {
  grid-column: span 2;
}

@media (max-width: 860px) {
  .col-span-2 {
    grid-column: auto;
  }
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.m0 {
  margin: 0;
}

.mt8 {
  margin-top: 8px;
}

.mt12 {
  margin-top: 12px;
}

.mt16 {
  margin-top: 16px;
}

.customer-suggest {
  margin-top: 8px;
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.customer-suggest__item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.customer-suggest__item:hover {
  background: var(--surface-2);
}

.customer-suggest__name {
  font-weight: 700;
}

.customer-suggest__sub {
  color: var(--muted);
  font-size: 12px;
}

.hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}



/* Select (dropdown) – make it look like input */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 10px 40px 10px 12px;
  /* space for arrow */
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M6 8l4 4 4-4' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px 18px;

  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

/* .select:hover {
  background: var(--surface-2);
  border-color: #d1d5db;
} */

.select:focus {
  outline: none;
  box-shadow: 0 0 0 1px var(--focus);
  border-color: #cbd5e1;
}

/* Disabled */
.select:disabled {
  opacity: .6;
  cursor: not-allowed;
}





/* Page header row */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Filters card */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.filters .field {
  min-width: 180px;
}

.filters .field--wide {
  min-width: 260px;
  flex: 1;
}

/* Totals row */
.totals {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.total-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.total-card .k {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.total-card .v {
  font-size: 16px;
  font-weight: 800;
}

/* Table wrapper */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

/* Table polish */
/* .history-table {
  min-width: 1240px;
} */

.table thead th {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.table tbody tr:nth-child(even) {
  background: rgba(17, 24, 39, .02);
}

.table tbody tr:hover {
  background: rgba(17, 24, 39, .04);
}

/* Action buttons small */
.btn-sm {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.btn-ghost {
  background: transparent;
}

.btn-ghost:hover {
  background: var(--surface-2);
}


.ts-dropdown,
.ts-control,
.ts-wrapper {
  z-index: 99999 !important;
}


/* =========================================================
   POLISH: rregullime vizuale per gjithe app-in.
   Te njejtat ngjyra dhe font; vetem rreshtim, madhesi dhe hapesira te njetrajtshme.
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Gjeresi e njejte per te gjitha faqet (index.php + disa faqe kane .container brenda .container) */
.container .container {
  width: 100%;
  padding: 0;
}

.container .page {
  padding-top: 0;
}

main.page {
  padding-top: 6px;
}

/* Kartat njera pas tjetres */
.card + .card {
  margin-top: 14px;
}

/* ---------- Fushat, select-et dhe butonat: e njejta lartesi ---------- */
.input,
.select {
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  line-height: 1.2;
}

.select {
  padding-right: 38px;
}

input.input[type="date"] {
  padding-right: 8px;
  font-family: inherit;
}

textarea.input {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
}

.input::placeholder {
  color: #9ca3af;
}

/* Brenda nje fushe / forme, fusha zen gjithe kolonen */
.field .input,
.field .select,
.form-grid .input,
.form-grid .select,
.grid-2 .input,
.grid-2 .select,
.table td .input,
.table td .select {
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  vertical-align: middle;
}

.btn-sm {
  height: 32px;
  padding: 0 10px;
}

a.btn:hover {
  text-decoration: none;
}

.label {
  display: block;
}

/* ---------- Koka e faqes: titulli majtas, veprimi kryesor djathtas ---------- */
.toolbar,
.page-head {
  align-items: center;
  flex-wrap: wrap;
}

.toolbar__right {
  flex-wrap: wrap;
}

/* ---------- Filtrat: nje rresht i rregullt me lartesi te njejte ---------- */
.filters {
  align-items: flex-end;
}

.filters .input,
.filters .select {
  min-width: 170px;
}

/* Shirit filtrash poshte kokes se faqes: kerkimi zgjerohet */
.filter-bar {
  margin-bottom: 12px;
  background: var(--surface-2);
}

.filter-bar .filter-search {
  flex: 1 1 280px;
}

/* ---------- Tabelat ---------- */
.table th,
.table td {
  padding: 11px 12px;
}

.table th {
  white-space: nowrap;
  text-transform: none;
  letter-spacing: .01em;
}

.table td .btn + .btn,
.table td .btn + form,
.table td form + .btn,
.table td form + form {
  margin-left: 6px;
}

.table td form.inline-form,
.table td form[style*="inline"] {
  display: inline-flex;
  vertical-align: middle;
}

/* Tabela brenda .table-wrap: kufiri e ka wrapper-i */
.table-wrap > .table {
  border: 0;
  border-radius: 0;
}

/* Etiketat dhe butonat e veprimeve nuk ndahen ne dy rreshta */
.table .badge {
  white-space: nowrap;
}

.table td:last-child {
  white-space: nowrap;
}

/* Tabela e artikujve: kolonat e shkurtra ne nje rresht; vetem Emri mbeshtillet */
#itemsTable td {
  white-space: nowrap;
}

#itemsTable td:nth-child(3) {
  white-space: normal;
}

/* Datat, shumat dhe statuset ne nje rresht ne tabelat e listave */
#pagedTable td {
  white-space: nowrap;
}

/* Historia e porosive: shume kolona -> me kompakte qe te nxere ne ekran, edhe Veprime */
.history-table th,
.history-table td {
  padding: 10px 8px;
  font-size: 13.5px;
}

/* ... emrat dhe shenimet e gjata mbeshtillen */
.history-table td:nth-child(3),
.history-table td:nth-child(4),
.history-table td:nth-child(11) {
  white-space: normal;
  min-width: 110px;
}

.history-table td:nth-child(11) {
  max-width: 180px;
}

/* Filtrat ne rrjete (Historia e furnitoreve etj.): fushat zene gjithe kolonen */
.hf-grid .input,
.hf-grid .select {
  width: 100%;
}

/* Boxet e permbledhjes (Historia e furnitoreve etj.): rrjete e rregullt */
.kpi {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.kpi .box {
  min-width: 0 !important;
}

/* TomSelect (lista e produkteve / klienteve): nje kornize e vetme si fushat e tjera */
.ts-wrapper.select,
.ts-wrapper.input {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.ts-wrapper .ts-control {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  box-shadow: none;
}

.ts-wrapper.focus .ts-control {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px var(--focus);
}

.ts-dropdown {
  border-radius: 12px;
  border-color: var(--border);
  box-shadow: var(--shadow);
}

/* ---------- Boxet e totaleve ---------- */
.totals {
  margin: 14px 0 0;
}

.total-card {
  min-width: 180px;
}

/* Tekst ndihmes i vogel (disa faqe e kane edhe vete) */
.small {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Mesazhet ---------- */
.flash {
  font-size: 14px;
}

/* ---------- Footer ---------- */
footer,
.footer {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- NAVBAR: grupe me ndarese, nje rresht ---------- */
.nav__inner {
  width: min(1300px, 100%);
  padding: 10px 18px;
}

.nav__links {
  flex: 1;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav__link {
  padding: 7px 10px;
  font-size: 13.5px;
  white-space: nowrap;
}

.nav__sep {
  flex: 0 0 1px;
  align-self: stretch;
  margin: 6px 6px;
  background: var(--border);
}

.nav__link--logout {
  margin-left: auto;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .nav__links {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}


