/* ==========================================================================
   Shtresa e paneleve (admin / agent / developer).
   Ndertohet mbi tokens.css + base.css; nuk i mbishkruan ato.
   ========================================================================== */

/* ------------------------------------------------------------- struktura */

.app-shell {
  display: grid;
  grid-template-columns: 264px 1fr;
  min-height: 100vh;
  background: var(--bg-subtle);
}

.app-shell.is-collapsed { grid-template-columns: 72px 1fr; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: var(--header-h);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-bold);
  font-size: var(--fs-lg);
  color: var(--text);
  white-space: nowrap;
}

.sidebar-brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text-inverse);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  flex: 0 0 auto;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
}

.nav-group + .nav-group { margin-top: var(--sp-5); }

.nav-group-title {
  padding: 0 var(--sp-3) var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}

.nav-link:hover { background: var(--surface-hover); color: var(--text); }

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: var(--fw-semibold);
}

.nav-link svg { flex: 0 0 auto; width: 18px; height: 18px; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--danger);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-align: center;
}

.sidebar-foot {
  padding: var(--sp-3);
  border-top: 1px solid var(--border);
}

.app-main { display: flex; flex-direction: column; min-width: 0; }

.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  height: var(--header-h);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.app-content { flex: 1; padding: var(--sp-6); max-width: 1600px; width: 100%; }

/* --------------------------------------------------------------- kokë faqe */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-bottom: var(--sp-6);
}

.page-title { margin: 0; font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.page-subtitle { margin: var(--sp-1) 0 0; color: var(--text-muted); font-size: var(--fs-sm); }
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.breadcrumb {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ karta */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.card-title { margin: 0; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.card-body { padding: var(--sp-5); }

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ------------------------------------------------------------- statistika */

.stat {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: 0 0 auto;
}

.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: var(--fs-2xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.stat-hint { font-size: var(--fs-xs); color: var(--text-subtle); }

.stat-success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat-warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat-danger .stat-icon { background: var(--danger-soft); color: var(--danger); }

/* ----------------------------------------------------------------- tabela */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }

.table th {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--surface-hover); }
.table .text-right { text-align: right; }
.table .text-center { text-align: center; }

.cell-main { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.cell-thumb { width: 48px; height: 36px; object-fit: cover; border-radius: var(--radius-xs); flex: 0 0 auto; background: var(--bg-muted); }
.cell-title { font-weight: var(--fw-medium); color: var(--text); }
.cell-sub { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ------------------------------------------------------------- faqosja */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
  padding: var(--sp-4);
  border-top: 1px solid var(--border);
}

.page {
  min-width: 34px;
  height: 34px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.page:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.page.is-active { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); font-weight: var(--fw-semibold); }
.page:disabled { opacity: 0.45; cursor: not-allowed; }
.page-gap { padding: 0 var(--sp-1); color: var(--text-subtle); }
.page-info { margin-left: auto; font-size: var(--fs-xs); color: var(--text-subtle); }

/* -------------------------------------------------------------- formularë */

.field { margin-bottom: var(--sp-4); }
.field-label { display: block; margin-bottom: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text); }
.field-label .req { color: var(--danger); }
.field-hint { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--text-subtle); }
.field-error { margin: var(--sp-1) 0 0; font-size: var(--fs-xs); color: var(--danger); }

.input {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input:disabled { background: var(--bg-muted); color: var(--text-subtle); cursor: not-allowed; }
.textarea { min-height: 96px; resize: vertical; line-height: var(--lh-normal); }

.select {
  appearance: none;
  padding-right: var(--sp-8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6472' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
}

.checkbox { display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.form-row { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-section + .form-section { margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.form-section-title { margin: 0 0 var(--sp-1); font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.form-section-hint { margin: 0 0 var(--sp-5); font-size: var(--fs-sm); color: var(--text-muted); }

/* Kalimi mes paneleve: e sheh vetem ADMIN-i, i vetmi qe i hap te dyja. */
.panel-switch { padding: var(--sp-3) var(--sp-4) 0; border-top: 1px solid var(--border); }
.panel-switch .nav-group-title { margin-bottom: var(--sp-2); }

.panel-switch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius);
  background: var(--bg-muted);
}

.panel-switch-btn {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: center;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.panel-switch-btn:hover { color: var(--text); }
.panel-switch-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* Formulari i prones: te dhenat majtas, fotot djathtas. */
.form-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }

.form-2col { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }

@media (max-width: 1100px) {
  .form-2col { grid-template-columns: minmax(0, 1fr); }
}

.photo-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.photo-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-hover);
}

.photo-item.is-primary { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.photo-item img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }

.photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  padding: var(--sp-2);
  border-top: 1px solid var(--border);
}

/* Parapamja e vendeve te afert te formulari i prones. */
.nearby-preview {
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.nearby-preview-row {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-xs);
}

/* Vizatuesi i shumekendeshit mbi foton e nderteses. */
.marker-canvas {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  background: var(--bg-muted);
}

.marker-canvas.is-closed { cursor: default; }
.marker-canvas img { display: block; width: 100%; height: auto; pointer-events: none; }

.marker-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.marker-shape {
  fill: color-mix(in srgb, var(--accent) 26%, transparent);
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}

.marker-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  stroke-linejoin: round;
}

/* Pikat jane HTML, jo SVG: viewBox-i i shtrire do t'i deformonte ne elipsa. */
.marker-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  pointer-events: none;
}

/* Pika e pare ndricohet kur forma mund te mbyllet mbi te. */
.marker-dot.is-first {
  width: 15px;
  height: 15px;
  margin: -7.5px 0 0 -7.5px;
  border-width: 3px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

.photo-flag {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: 2px var(--sp-2);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

/* --------------------------------------------------------------- butonat */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0 var(--sp-4);
  height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--dur-fast) var(--ease);
}

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm { height: 32px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn-lg { height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-base); }

.btn-primary { background: var(--accent); color: var(--text-inverse); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-hover); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(0.94); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(0.94); }

.btn.is-loading { pointer-events: none; }

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-lg { width: 28px; height: 28px; border-width: 3px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* -------------------------------------------------------------- shenjat */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  line-height: 1.7;
}

.badge-slate  { background: var(--bg-muted);     color: var(--text-muted); }
.badge-green  { background: var(--success-soft); color: var(--success); }
.badge-blue   { background: var(--info-soft);    color: var(--info); }
.badge-amber  { background: var(--warning-soft); color: var(--warning); }
.badge-orange { background: #fdf0e4;             color: #9a5410; }
.badge-red    { background: var(--danger-soft);  color: var(--danger); }
.badge-violet { background: #f0eafd;             color: #6534c9; }

[data-theme='dark'] .badge-orange { background: #3a2612; color: #f0a95c; }
[data-theme='dark'] .badge-violet { background: #291d47; color: #c1a5f7; }

/* ------------------------------------------------------------------ tabs */

.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5); overflow-x: auto; }

.tab {
  padding: var(--sp-3) var(--sp-4);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}

.tab:hover { color: var(--text); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-count {
  margin-left: var(--sp-2);
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  font-size: var(--fs-xs);
}

.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent-text); }

/* --------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.toolbar .input { min-height: 36px; width: auto; min-width: 180px; }

/* ---------------------------------------------------------------- modale */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: var(--overlay);
  animation: fade-in var(--dur) var(--ease);
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 4rem);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: modal-in var(--dur) var(--ease-out);
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1100px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.modal-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: var(--fw-semibold); }

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.modal-body { padding: var(--sp-5); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }

@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* --------------------------------------------------------------- gjendje */

.state { display: grid; place-items: center; gap: var(--sp-3); padding: var(--sp-12) var(--sp-6); text-align: center; color: var(--text-muted); }
.state h3 { margin: 0; font-size: var(--fs-lg); color: var(--text); }
.state p { margin: 0; font-size: var(--fs-sm); max-width: 46ch; }
.state-icon { color: var(--text-subtle); }
.state-error h3 { color: var(--danger); }

.skeleton-list { padding: var(--sp-4); display: grid; gap: var(--sp-3); }

.skeleton-row {
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-inset) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* --------------------------------------------------------------- alarme */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}

.alert-body { flex: 1; }
.alert-body strong { display: block; margin-bottom: 2px; }
.alert-info    { background: var(--info-soft);    border-color: var(--accent-border); color: var(--accent-text); }
.alert-success { background: var(--success-soft); border-color: var(--success);       color: var(--success); }
.alert-warning { background: var(--warning-soft); border-color: var(--warning);       color: var(--warning); }
.alert-danger  { background: var(--danger-soft);  border-color: var(--danger);        color: var(--danger); }
.alert-close { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.65; }
.alert-close:hover { opacity: 1; }

/* ---------------------------------------------------------------- toasts */

.toasts { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: var(--z-toast); display: grid; gap: var(--sp-2); }

.toast {
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--bg);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-md);
  animation: toast-in var(--dur) var(--ease-out);
}

.toast-success { background: var(--success); color: #fff; }
.toast-error   { background: var(--danger);  color: #fff; }
.toast-info    { background: var(--accent);  color: #fff; }

@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

/* --------------------------------------------------------------- progres */

.progress { height: 8px; border-radius: var(--radius-full); background: var(--bg-muted); overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; transition: width var(--dur-slow) var(--ease); }
.progress-primary { background: var(--accent); }
.progress-success { background: var(--success); }
.progress-warning { background: var(--warning); }
.progress-danger  { background: var(--danger); }

/* --------------------------------------------------------------- avatare */

.avatar { border-radius: var(--radius-full); object-fit: cover; flex: 0 0 auto; }

.avatar-text {
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: var(--fw-semibold);
}

/* ----------------------------------------------------------------- hyrja */

.auth-screen { display: grid; place-items: center; min-height: 100vh; padding: var(--sp-6); background: var(--bg-subtle); }
.auth-card { width: 100%; max-width: 400px; padding: var(--sp-8); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); font-size: var(--fs-xl); font-weight: var(--fw-bold); }
.auth-card h1 { margin: 0 0 var(--sp-2); font-size: var(--fs-xl); }
.auth-card .lead { margin: 0 0 var(--sp-6); color: var(--text-muted); font-size: var(--fs-sm); }
.auth-hint { margin-top: var(--sp-6); padding-top: var(--sp-4); border-top: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-subtle); line-height: var(--lh-normal); }

/* ------------------------------------------------------------- ndihmesa */

.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.strong { font-weight: var(--fw-semibold); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: grid; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-4 { margin-bottom: var(--sp-4); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 264px;
    z-index: var(--z-drawer);
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    box-shadow: var(--shadow-lg);
  }

  .app-shell.is-open .sidebar { transform: none; }
  .app-content { padding: var(--sp-4); }
  .app-header { padding: 0 var(--sp-4); }
}

@media (max-width: 640px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .toasts { right: var(--sp-3); left: var(--sp-3); bottom: var(--sp-3); }
}

/* --------------------------------------------------------- radhet e punes */

.queue-list { display: grid; }

.queue-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

.queue-row:last-child { border-bottom: 0; }
.queue-row:hover { color: var(--text); }
.queue-row.has-items { color: var(--text); font-weight: var(--fw-medium); }

/* ------------------------------------------------------------- grafiket */

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: var(--sp-2);
}

.chart-bar {
  flex: 1;
  min-width: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  opacity: 0.85;
  transition: opacity var(--dur-fast) var(--ease);
}

.chart-bar:hover { opacity: 1; }

/* ------------------------------------------- vetem ne ekrane te vegjel */

.only-mobile { display: none; }

@media (max-width: 1024px) {
  .only-mobile { display: inline-flex; }
}

/* ==========================================================================
   Shtesa per panelin e agjencise (agent).
   ========================================================================== */

/* ------------------------------------------------- hapat e formularit */

.stepper {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.stepper-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}

.stepper-item:hover { background: var(--surface-hover); color: var(--text); }
.stepper-item.is-active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-text); }
.stepper-item.is-done { color: var(--success); }

.stepper-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

.stepper-item.is-active .stepper-num { background: var(--accent); color: var(--text-inverse); }
.stepper-item.is-done .stepper-num { background: var(--success-soft); color: var(--success); }

/* -------------------------------------- rrjeta e kutizave te zgjedhjes */

.check-grid { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.check-group + .check-group { margin-top: var(--sp-5); }
.check-group-title { margin: 0 0 var(--sp-3); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); }

/* --------------------------------------------- menyrat e marreveshjes */

.deal-option {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.deal-option + .deal-option { margin-top: var(--sp-3); }
.deal-option.is-on { border-color: var(--accent-border); background: var(--accent-soft); }
.deal-option.is-locked { opacity: 0.7; background: var(--bg-subtle); }
.deal-disclaimer { margin: var(--sp-2) 0 0 26px; font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-normal); }
.deal-sub { margin: var(--sp-4) 0 0 26px; padding-top: var(--sp-4); border-top: 1px dashed var(--border); }

/* ------------------------------------------------------------- fotot */

.media-grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

.media-item {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-muted);
}

.media-item.is-primary { border-color: var(--accent); }
.media-item img { display: block; width: 100%; height: 120px; object-fit: cover; }
.media-actions { display: flex; gap: var(--sp-1); padding: var(--sp-2); flex-wrap: wrap; }
.media-flag { position: absolute; top: var(--sp-2); left: var(--sp-2); }

.media-drop {
  display: grid;
  place-items: center;
  gap: var(--sp-2);
  padding: var(--sp-8);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------------------------------------------------------- kalendari */

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.calendar-dow { padding: var(--sp-2); background: var(--bg-subtle); text-align: center; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); text-transform: uppercase; }

.calendar-day { min-height: 104px; padding: var(--sp-2); background: var(--surface); display: flex; flex-direction: column; gap: var(--sp-1); }
.calendar-day.is-out { background: var(--bg-subtle); color: var(--text-subtle); }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
.calendar-date { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }

.calendar-event {
  width: 100%;
  padding: 2px var(--sp-2);
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--accent-soft);
  color: var(--accent-text);
  font: inherit;
  font-size: var(--fs-xs);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event:hover { filter: brightness(0.96); }
.calendar-event.is-done { background: var(--success-soft); color: var(--success); }
.calendar-event.is-off { background: var(--bg-muted); color: var(--text-subtle); text-decoration: line-through; }

/* ------------------------------------------------ vija kohore e ngjarjeve */

.timeline { display: grid; gap: var(--sp-4); }
.timeline-item { display: grid; grid-template-columns: 26px 1fr; gap: var(--sp-3); }
.timeline-dot { width: 10px; height: 10px; margin: 5px auto 0; border-radius: var(--radius-full); background: var(--accent); }
.timeline-item.is-muted .timeline-dot { background: var(--border-strong); }
.timeline-body { font-size: var(--fs-sm); }
.timeline-meta { font-size: var(--fs-xs); color: var(--text-subtle); }

.note-card { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); font-size: var(--fs-sm); }
.note-card + .note-card { margin-top: var(--sp-2); }

/* -------------------------------------------- lista e cifteve emer/vlere */

.detail-list { display: grid; gap: 0; margin: 0; }

.detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
}

.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--text-muted); }
.detail-row dd { margin: 0; text-align: right; font-weight: var(--fw-medium); }

/* ----------------------------------------------- gypi i fazave te leads */

.funnel { display: grid; gap: var(--sp-3); }
.funnel-row { display: grid; grid-template-columns: 130px 1fr 52px; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); }
.funnel-row .funnel-count { text-align: right; font-weight: var(--fw-semibold); }
.funnel-row button.funnel-label { border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.funnel-row button.funnel-label:hover { color: var(--accent); }

/* ------------------------------- perdorimi kunder kufirit te planit */

.usage-row { display: grid; gap: var(--sp-2); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.usage-row:last-child { border-bottom: 0; }
.usage-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }

/* ------------------------------------------ faqe me kolone anesore */

.layout-side { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); align-items: start; }

@media (max-width: 900px) {
  .layout-side { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: 100px 1fr 44px; }
  .calendar-day { min-height: 72px; }
}

/* ------------------------------------------- cifte celes-vlere ne detaje */

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--sp-4); }
.kv-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv-key { font-size: var(--fs-xs); color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }
.kv-val { font-size: var(--fs-sm); color: var(--text); word-break: break-word; }

/* ----------------------------- blloku JSON (auditimi, ngarkesa e aprovimeve) */

.json-view {
  margin: 0;
  padding: var(--sp-3);
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-inset);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-xs);
  line-height: var(--lh-normal);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------- kartat e radhes se moderimit */

.mod-thumb {
  display: block;
  width: 100%;
  height: 148px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}

.mod-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.mod-actions .btn { flex: 1; }

/* Karta e prones qe pret moderim dhe permban nje marreveshje te ndjeshme. */
.mod-flagged { border-color: var(--warning); }

/* ------------------------------------- rreshtat inline te taksonomive */

.tax-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--border);
}

.tax-row:last-child { border-bottom: 0; }
.tax-row .input { min-height: 34px; }
.tax-row-name { flex: 1; min-width: 160px; }

/* ------------------------------------------------- ndihmesa te vogla */

.mb-2 { margin-bottom: var(--sp-2); }
.mt-2 { margin-top: var(--sp-2); }
.gap-2 { gap: var(--sp-2); }

/* ------------------------------------ fleta e njesive (tabele e editueshme) */

.sheet-scroll { max-height: 62vh; overflow: auto; }
.sheet { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }

.sheet th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

.sheet td { padding: 2px var(--sp-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.sheet tbody tr:hover td { background: var(--surface-hover); }
.sheet tbody tr.is-dirty td { background: var(--warning-soft); }
.sheet tbody tr.is-selected td { background: var(--accent-soft); }

.sheet-input {
  width: 100%;
  min-width: 62px;
  height: 30px;
  padding: 0 var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text);
  font: inherit;
}

.sheet-input:hover { border-color: var(--border); }

.sheet-input:focus {
  outline: none;
  border-color: var(--border-focus);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.sheet-input.is-num { text-align: right; font-variant-numeric: tabular-nums; }
.sheet-calc { display: block; padding: 0 var(--sp-2); color: var(--text-subtle); text-align: right; font-variant-numeric: tabular-nums; }

/* --------------------------------- rrjeta vizuale e njesive sipas kateve */

.unit-grid { display: grid; gap: var(--sp-2); }
.unit-floor { display: flex; align-items: flex-start; gap: var(--sp-3); }
.unit-floor-label { flex: 0 0 72px; padding-top: var(--sp-1); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.unit-cells { display: flex; flex-wrap: wrap; gap: 4px; }

.unit-cell {
  min-width: 62px;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  text-align: center;
  cursor: pointer;
}

.unit-available { background: var(--success-soft); color: var(--success); }
.unit-reserved  { background: var(--warning-soft); color: var(--warning); }
.unit-sold      { background: var(--danger-soft);  color: var(--danger); }
.unit-blocked   { background: var(--bg-muted);     color: var(--text-muted); }
.unit-cell.is-picked { border-color: currentColor; }

.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); font-size: var(--fs-xs); color: var(--text-muted); }
.legend-item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.legend-dot { width: 10px; height: 10px; border-radius: var(--radius-xs); }

/* ------------------------------------------------- media e projektit */

.media-item { position: relative; overflow: hidden; background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.media-item img { display: block; width: 100%; height: 108px; object-fit: cover; }
.media-file { display: grid; place-items: center; height: 108px; font-size: var(--fs-2xl); color: var(--text-subtle); }
.media-meta { padding: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); }

.media-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(16, 20, 28, 0.65);
  color: #fff;
  line-height: 1;
  cursor: pointer;
}

/* -------------------------------------------- lista celes-vlere (profili) */

.def-list { display: grid; }
.def-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.def-row:last-child { border-bottom: 0; }
.def-row dt { margin: 0; color: var(--text-muted); }
.def-row dd { margin: 0; text-align: right; font-weight: var(--fw-medium); }

/* --------------------------------- matesi i perdorimit ndaj kufirit te planit */

.meter { display: grid; gap: var(--sp-2); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.meter:last-child { border-bottom: 0; }
.meter-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm); }

/* ------------------------------------------- historiku i nje kerkese (lead) */

.timeline-item { display: grid; gap: 2px; padding-left: var(--sp-4); border-left: 2px solid var(--border); }
.timeline-time { font-size: var(--fs-xs); color: var(--text-subtle); }

/* ---------------------------------------- etiketa te zgjedhshme (features) */

.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.chip.is-on { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-text); }

/* ------------------------------------------------ hapesira shtese ndihmese */

.mb-6 { margin-bottom: var(--sp-6); }

/* Fundi i nje karte me butona veprimi (p.sh. hapat e formularit). */
.card-foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--border);
}

/* ------------------------------------------- redaktori i planit te katit 3D */

/* Kanavaca majtas, lista e dhomave djathtas; ne ekrane te vegjel njera mbi tjetren. */
.plan-editor {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  align-items: start;
}

.plan-canvas-wrap {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  overflow: hidden;
}

/* `touch-action: none` e ndal rreshqitjen e faqes gjate terheqjes se dhomave. */
.plan-canvas { display: block; width: 100%; height: 440px; touch-action: none; }
.plan-canvas.is-adding { cursor: crosshair; }

/* Njoftimi i modalitetit te hapjeve, mbi kanavace. */
.plan-hint {
  position: absolute;
  left: var(--sp-3);
  bottom: var(--sp-3);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  background: var(--overlay);
  color: #fff;
  font-size: var(--fs-xs);
  pointer-events: none;
}

/* Lista anesore e dhomave dhe e hapjeve. */
.plan-side { max-height: 560px; overflow-y: auto; padding-right: var(--sp-1); }

.plan-row {
  padding: var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

.plan-row + .plan-row { margin-top: var(--sp-2); }
.plan-row.is-active { border-color: var(--accent-border); background: var(--accent-soft); }
.plan-row-head { display: flex; align-items: center; gap: var(--sp-2); }
.plan-row-head .sheet-input { flex: 1; min-width: 0; }

.plan-swatch { width: 12px; height: 12px; border-radius: var(--radius-xs); flex: 0 0 auto; }

.plan-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-1); margin-top: var(--sp-2); }
.plan-num { display: grid; gap: 2px; }
.plan-num span { font-size: 10px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }

/* Paneli i vizites 3D: sfondi i njejte me qiellin e skenes qe te mos pulsoje. */
.plan-preview {
  height: 380px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #bcd4e8;
  overflow: hidden;
}

.plan-preview-off { display: grid; place-items: center; height: 100%; background: var(--bg-muted); color: var(--text-muted); font-size: var(--fs-sm); }

@media (max-width: 1080px) {
  .plan-editor { grid-template-columns: minmax(0, 1fr); }
  .plan-side { max-height: 380px; }
}
