/* ── ADMIN PANEL ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --a-bg:       #F4F3F0;
  --a-surface:  #FFFFFF;
  --a-border:   #E2DFD9;
  --a-text:     #1A1A18;
  --a-dim:      #6B6760;
  --a-accent:   #C9B47A;
  --a-accent-d: #9C844A;
  --a-header:   #1A1A18;
  --a-danger:   #B83232;
  --a-new:      #2E7D52;
  --a-radius:   6px;
  --a-shadow:   0 2px 12px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  background: var(--a-bg);
  color: var(--a-text);
  min-height: 100vh;
}

/* ── LOGIN ──────────────────────────────────────────────────────── */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: 12px;
  padding: 48px 40px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: var(--a-shadow);
}

.login-logo {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 28px;
  letter-spacing: 0.18em;
  color: var(--a-accent-d);
  margin-bottom: 6px;
  text-decoration: none;
}
.login-logo:hover { color: var(--a-accent); }

.login-sub {
  font-size: 12px;
  color: var(--a-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 32px;
}

.login-form { display: flex; flex-direction: column; gap: 12px; }

.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: var(--a-bg);
}
.login-input:focus { border-color: var(--a-accent); }

.login-error {
  display: none;
  color: var(--a-danger);
  font-size: 12px;
  text-align: left;
}

.login-btn {
  padding: 12px;
  background: var(--a-text);
  color: #FAF9F6;
  border: none;
  border-radius: var(--a-radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: #2d2d2b; }

.login-back {
  display: block;
  margin-top: 20px;
  font-size: 12px;
  color: var(--a-dim);
  text-decoration: none;
  text-align: center;
  transition: color 0.2s;
}
.login-back:hover { color: var(--a-text); }

/* ── HEADER ─────────────────────────────────────────────────────── */
.admin-header {
  background: var(--a-header);
  color: #FAF9F6;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.admin-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-logo {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--a-accent);
}

.admin-header-actions { display: flex; gap: 8px; align-items: center; }

/* ── MAIN ───────────────────────────────────────────────────────── */
.admin-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
}

/* ── TABS ───────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--a-border);
}

.admin-tab {
  padding: 10px 20px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--a-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.admin-tab:hover { color: var(--a-text); }
.admin-tab.active { color: var(--a-accent-d); border-bottom-color: var(--a-accent-d); }

/* ── SHARED CONTROLS ────────────────────────────────────────────── */
.admin-input, .admin-select, .admin-textarea {
  padding: 9px 12px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: var(--a-surface);
  color: var(--a-text);
  transition: border-color 0.2s;
  width: 100%;
}
.admin-input:focus, .admin-select:focus, .admin-textarea:focus {
  border-color: var(--a-accent);
}
.admin-textarea { resize: vertical; min-height: 72px; }

.admin-btn-primary {
  padding: 10px 20px;
  background: var(--a-text);
  color: #FAF9F6;
  border: none;
  border-radius: var(--a-radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}
.admin-btn-primary:hover { background: #2d2d2b; }

.admin-btn-outline {
  padding: 8px 16px;
  background: transparent;
  color: var(--a-accent);
  border: 1px solid var(--a-accent);
  border-radius: var(--a-radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.admin-btn-outline:hover { background: var(--a-accent); color: var(--a-header); }

.admin-btn-ghost {
  padding: 8px 16px;
  background: transparent;
  color: rgba(250,249,246,0.55);
  border: 1px solid rgba(250,249,246,0.2);
  border-radius: var(--a-radius);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.admin-btn-ghost:hover { color: #FAF9F6; border-color: rgba(250,249,246,0.5); }

.admin-btn-danger {
  padding: 10px 20px;
  background: transparent;
  color: var(--a-danger);
  border: 1px solid var(--a-danger);
  border-radius: var(--a-radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.admin-btn-danger:hover { background: var(--a-danger); color: #fff; }

/* ── PRICE EDITOR ───────────────────────────────────────────────── */
.price-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.price-toolbar #price-search { flex: 1; min-width: 0; }
.price-toolbar #price-cat { flex: 0 0 170px; }

.badge-modified {
  font-size: 11px;
  font-weight: 600;
  background: rgba(201,180,122,0.15);
  color: var(--a-accent-d);
  border: 1px solid rgba(201,180,122,0.4);
  border-radius: 9999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.price-table {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--a-border);
  transition: background 0.15s;
}
.price-row:last-child { border-bottom: none; }
.price-row:hover { background: #FAFAF8; }
.price-row.modified { background: rgba(201,180,122,0.06); border-left: 3px solid var(--a-accent); }
.price-row.is-new { background: rgba(46,125,82,0.05); border-left: 3px solid var(--a-new); }

.price-row-info {
  flex: 1;
  min-width: 0;
}

.price-row-name {
  display: block;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-row-cat {
  display: block;
  font-size: 11px;
  color: var(--a-dim);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.price-row-price {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.admin-price-input {
  width: 80px;
  padding: 5px 8px;
  border: 1px solid var(--a-border);
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Inter', monospace;
  font-weight: 500;
  outline: none;
  text-align: right;
  transition: border-color 0.2s;
  background: var(--a-bg);
}
.admin-price-input:focus { border-color: var(--a-accent); background: #fff; }

.price-row-eur { font-size: 12px; color: var(--a-dim); }

.admin-price-undo,
.admin-newitem-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--a-dim);
  font-size: 14px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.admin-price-undo:hover,
.admin-newitem-remove:hover { color: var(--a-danger); background: rgba(184,50,50,0.08); }

.tag-new {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--a-new);
  color: #fff;
  border-radius: 3px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 6px;
}

.price-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.no-results {
  padding: 32px;
  text-align: center;
  color: var(--a-dim);
  font-size: 13px;
}

.price-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px;
  border-top: 1px solid var(--a-border);
  background: #FAFAF8;
}

.page-btn {
  padding: 6px 14px;
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  background: var(--a-surface);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--a-text);
  transition: background 0.15s, border-color 0.15s;
}
.page-btn:hover:not(:disabled) { background: var(--a-bg); border-color: var(--a-accent); }
.page-btn:disabled { opacity: 0.35; cursor: default; }

.page-info {
  font-size: 12px;
  color: var(--a-dim);
  white-space: nowrap;
  min-width: 100px;
  text-align: center;
}

/* ── ADD FORM ────────────────────────────────────────────────────── */
.add-form {
  background: var(--a-surface);
  border: 1px solid var(--a-border);
  border-radius: var(--a-radius);
  padding: 24px;
  margin-bottom: 24px;
  max-width: 520px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--a-dim);
}
.form-optional { font-weight: 400; text-transform: none; }

.form-actions { margin-top: 20px; }

/* ── ADDED ITEMS LIST ───────────────────────────────────────────── */
.new-items-list {
  background: var(--a-surface);
  border: 1px solid rgba(46,125,82,0.25);
  border-radius: var(--a-radius);
  padding: 16px 20px;
  max-width: 520px;
}

.new-items-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--a-new);
  margin-bottom: 12px;
}

.new-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--a-border);
  font-size: 13px;
}
.new-item-row:last-child { border-bottom: none; }
.new-item-row > span:first-child { flex: 1; font-weight: 500; }
.new-item-cat { font-size: 11px; color: var(--a-dim); }
.new-item-price { font-weight: 600; color: var(--a-accent-d); white-space: nowrap; }

/* ── TOAST ──────────────────────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--a-text);
  color: #FAF9F6;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
.admin-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .admin-main { padding: 12px; }
  .price-toolbar #price-cat { flex: 0 0 130px; }
  .admin-price-input { width: 68px; }
  .add-form { padding: 16px; }
}
