/* Varsha Admin — layered on top of ../assets/css/site.css (tokens, .btn, .field). Mobile first. */

.admin { min-height: 100dvh; }
.a-loading { padding: 48px 16px; text-align: center; color: var(--ink-3); }

/* inputs */
.a-input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-2); background: var(--surface); font-size: 1rem;
}
.a-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(31, 74, 69, 0.12); }
select.a-input { appearance: auto; }
.field .a-input { min-height: 48px; padding: 12px 14px; background: var(--surface); }
.field textarea.a-input { min-height: 0; resize: vertical; line-height: 1.5; }
.a-color { width: 72px; height: 48px; padding: 4px; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }
.a-error { color: #b3261e; font-size: var(--fs-sm); font-weight: 600; }
.a-error:empty { display: none; }
.a-link { color: var(--brand); font-size: var(--fs-sm); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login__card {
  width: 100%; max-width: 400px; display: grid; gap: 18px; padding: 32px 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.login__card h1 { font-size: 1.75rem; }
.a-pass { position: relative; }
.field .a-pass input { padding-right: 52px; }
.a-pass__toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px;
  display: grid; place-items: center; border-radius: var(--r-sm); color: var(--ink-3);
}
.a-pass__toggle:hover { color: var(--ink); }
.a-pass__toggle svg { width: 20px; height: 20px; }
.a-pass__toggle .i-hide, .a-pass__toggle[aria-pressed="true"] .i-show { display: none; }
.a-pass__toggle[aria-pressed="true"] .i-hide { display: block; }
.login__card .logo__mark { width: 48px; height: 48px; font-size: 1.3rem; }

/* top bar + tabs */
.a-bar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.a-bar__row, .a-tabs, .a-main { max-width: 1100px; margin-inline: auto; padding-inline: 16px; }
.a-bar__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.a-bar__title { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.a-bar__title .logo__mark { width: 32px; height: 32px; font-size: 0.9rem; }
.a-bar__actions { display: flex; gap: 8px; }
.a-bar__actions .btn { min-height: 38px; padding: 0 14px; }
.a-tabs { display: flex; gap: 4px; overflow-x: auto; }
.a-tabs button {
  padding: 12px 14px; font-weight: 700; font-size: 0.9375rem; color: var(--ink-3); white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.a-tabs button span { font-weight: 600; font-size: 0.8125rem; color: var(--ink-3); }
.a-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
@media (max-width: 520px) { .a-bar__title { font-size: 0; gap: 0; } .a-bar__title .logo__mark { font-size: 0.9rem; } }

/* toolbar + list */
.a-main { padding-block: 20px 64px; }
.a-tools { display: grid; gap: 10px; margin-bottom: 14px; }
.a-tools__hint { color: var(--ink-3); font-size: var(--fs-sm); }
@media (min-width: 760px) {
  .a-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  #tab-products .a-tools { grid-template-columns: minmax(0, 1fr) 200px 200px auto; }
}
.a-count { font-size: var(--fs-sm); color: var(--ink-3); margin-bottom: 8px; }
.a-list { display: grid; gap: 8px; }
.a-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 4px 14px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.a-row__img { width: 56px; height: 56px; border-radius: var(--r-sm); background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.a-row__img img { width: 100%; height: 100%; object-fit: contain; }
.a-row__main { display: grid; gap: 2px; min-width: 0; }
.a-row__main strong { font-size: 0.9375rem; }
.a-row__main small { color: var(--ink-3); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.a-row__actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; justify-content: flex-end; }
.a-row__actions .btn { min-height: 38px; padding: 0 16px; }
@media (min-width: 640px) {
  .a-row { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .a-row__actions { grid-column: auto; }
}
.a-del { color: #b3261e; font-weight: 700; font-size: var(--fs-sm); padding: 8px 4px; }
.a-del:hover { text-decoration: underline; }
.a-empty { padding: 32px 16px; text-align: center; color: var(--ink-3); }
.a-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; font-size: var(--fs-sm); }
.a-pager:empty { display: none; }
.a-pager .btn:disabled { opacity: 0.4; cursor: default; }

/* add / edit dialog: full screen on phones, centred sheet on larger screens */
.a-dialog {
  width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0;
  background: var(--bg); color: var(--ink);
}
.a-dialog::backdrop { background: rgba(27, 25, 22, 0.5); }
@media (min-width: 720px) {
  .a-dialog { width: min(680px, 100% - 48px); height: auto; max-height: calc(100dvh - 48px); margin: auto; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
}
.a-dialog form { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
.a-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.a-dialog__head h2 { font-size: 1.25rem; }
.a-dialog__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 18px; padding: 20px; }
.a-dialog__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.a-dialog__foot .a-error { flex: 1 1 100%; }
.a-dialog__foot .btn:disabled { opacity: 0.6; cursor: progress; }
.a-two { display: grid; gap: 18px; }
@media (min-width: 560px) { .a-two { grid-template-columns: 1fr 1fr; } }

.a-specs { display: grid; gap: 12px; }
.a-spec { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-md); }
.field .a-spec .a-input { min-height: 44px; }

.a-photo__box { display: flex; align-items: center; gap: 16px; }
.a-photo__preview {
  width: 112px; height: 112px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--bg-2); border-radius: var(--r-md); color: var(--ink-3); font-size: var(--fs-xs);
}
.a-photo__preview img { width: 100%; height: 100%; object-fit: contain; }
.a-photo__btns { display: grid; gap: 10px; justify-items: start; }
.a-photo__btns .btn { cursor: pointer; }

/* toast */
.a-toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 100; width: max-content; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--r-md); background: var(--ink); color: var(--on-dark);
  font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.a-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
