/* GranaFarm — stil aliniat la branding-ul site-ului (Poppins/Open Sans,
   auriu-portocaliu + verde frunză, charcoal, gri deschis) */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Open+Sans:wght@400;600;700&display=swap');

:root {
  /* paleta de brand */
  --gold: #FFA726;
  --gold-light: #FFB74D;
  --gold-dark: #FF9800;
  --green: #4CAF50;
  --green-light: #66BB6A;
  --green-dark: #388E3C;
  --green-deep: #2E7D32;
  --charcoal: #22302A;
  --charcoal-soft: #4a5a52;
  --light-gray: #F5F7F6;
  --sky: #00B0FF;
  --white: #ffffff;

  --ink: var(--charcoal);
  --muted: #6b7d74;
  --line: #e4eae7;
  --bg: var(--light-gray);
  --card: var(--white);
  --danger: #d64541;
  --amber: #c07d1a;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 8px rgba(34, 48, 42, 0.08);
  --shadow-lift: 0 4px 16px rgba(34, 48, 42, 0.14);
  --focus-ring: 0 0 0 3px rgba(255, 167, 38, 0.25);

  --font-heading: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------- header --- */

header.site {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px 20px;
}

header.site .wrap {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; min-width: 0; }

.brand-logo { height: 48px; width: auto; display: block; flex: none; }

.brand-tag {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding-left: 16px;
  max-width: 420px;
}

.admin-tag { color: var(--green-dark); font-weight: 700; }

.header-link {
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--green);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  transition: all 0.3s ease;
  white-space: nowrap;
}
.header-link:hover { background: var(--green); color: #fff; transform: translateY(-2px); }

.hero-points {
  max-width: 1100px;
  margin: 18px auto 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-points span {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--charcoal-soft);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* ------------------------------------------------------------------ main --- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 90px;
}

h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--charcoal);
  margin: 36px 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h2 .step {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.35);
}

.section-hint { color: var(--muted); margin: 0 0 16px; font-size: 0.95rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

/* -------------------------------------------------------- catalog produse --- */

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 16px;
}

.cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--charcoal);
  margin: 28px 0 14px;
  letter-spacing: -0.3px;
}
.cat-title:first-child { margin-top: 6px; }

.cat-title .count {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: var(--green);
  padding: 2px 11px;
  border-radius: 999px;
}

.cat-title::after {
  content: '';
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 167, 38, 0.5), transparent);
}

.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.4s ease both;
}

.product:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.product.selected {
  border-color: var(--green);
  border-width: 2px;
  padding: 17px;
  background: linear-gradient(180deg, #ffffff, #f3faf4);
}

.product .top { display: flex; align-items: center; gap: 12px; }

.product .emoji {
  font-size: 1.5rem;
  width: 50px;
  height: 50px;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--light-gray);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.product.selected .emoji { background: #e6f4e7; border-color: #c5e6c7; }

.product .name { font-family: var(--font-heading); font-weight: 600; font-size: 1rem; color: var(--charcoal); line-height: 1.3; }
.product .desc { font-size: 0.8rem; color: var(--muted); margin: 2px 0; }

.product .price {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--font-heading);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.95rem;
}
.product .price span { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.qty-row { display: flex; align-items: center; gap: 8px; }

.qty-row button {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  background: var(--light-gray);
  color: var(--green-dark);
  border-radius: 11px;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.qty-row button:hover { background: var(--green); color: #fff; border-color: var(--green); }
.qty-row button:active { transform: scale(0.92); }

.qty-row input {
  width: 76px;
  text-align: center;
  padding: 9px 4px;
  border: 2px solid var(--line);
  border-radius: 11px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: var(--font-body);
  color: var(--charcoal);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.qty-row input:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus-ring); }

.qty-row .unit { color: var(--muted); font-size: 0.84rem; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }

.field label { font-size: 0.85rem; font-weight: 700; color: var(--charcoal); }
.field label .req { color: var(--gold-dark); }

.field input,
.field select,
.field textarea {
  padding: 12px 14px;
  border: 2px solid rgba(76, 175, 80, 0.35);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--ink);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--focus-ring);
}

/* --------------------------------------------------------- sumar comandă --- */

.summary table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.summary th, .summary td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
.summary th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.summary td.num, .summary th.num { text-align: right; white-space: nowrap; }
.summary tbody tr { transition: background 0.2s ease; }
.summary tbody tr:hover { background: var(--light-gray); }
.summary tfoot td {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  border-bottom: none;
  color: var(--green-dark);
  padding-top: 15px;
}
.summary .empty { color: var(--muted); text-align: center; padding: 28px 0; }
.summary .empty .big { font-size: 2rem; display: block; margin-bottom: 8px; }

/* --------------------------------------------------------------- butoane --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 14px 30px;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  min-height: 48px;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 167, 38, 0.35);
}
.btn-primary:hover { background: var(--gold-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 152, 0, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--green);
  color: var(--green-dark);
}
.btn-ghost:hover { background: var(--green); color: #fff; transform: translateY(-2px); }

.actions { margin-top: 22px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.msg { padding: 13px 16px; border-radius: var(--radius-sm); font-size: 0.95rem; margin: 14px 0; animation: fadeUp 0.25s ease both; }
.msg-error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }
.msg-success { background: #e6f4e7; color: var(--green-deep); border: 1px solid var(--green-light); }

.hidden { display: none !important; }

/* ------------------------------------------------------- bară coș sticky --- */

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--charcoal);
  color: #fff;
  border-radius: 999px;
  padding: 10px 12px 10px 26px;
  box-shadow: 0 12px 34px rgba(34, 48, 42, 0.4);
  animation: slideUp 0.3s ease both;
  max-width: calc(100vw - 32px);
}

.cart-bar .info { display: flex; flex-direction: column; line-height: 1.3; }
.cart-bar .info .count { font-size: 0.78rem; color: rgba(255, 255, 255, 0.7); }
.cart-bar .info .total { font-family: var(--font-heading); font-weight: 700; font-size: 1.08rem; white-space: nowrap; }

.cart-bar button {
  border: none;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  font-family: var(--font-body);
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.cart-bar button:hover { background: var(--gold-dark); transform: translateY(-1px); }

@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ------------------------------------------------------------ confirmare --- */

.confirmation { text-align: center; padding: 56px 24px; }

.confirmation .icon {
  font-size: 2.6rem;
  width: 96px;
  height: 96px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  background: #e6f4e7;
  border: 2px solid var(--green);
  border-radius: 999px;
  animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

.confirmation h2 { justify-content: center; margin-top: 8px; }
.confirmation .order-no {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: #fff6e9;
  border: 1px dashed var(--gold);
  display: inline-block;
  padding: 8px 26px;
  border-radius: 12px;
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------- admin --- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeUp 0.35s ease both;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }

.stat .icon {
  font-size: 1.35rem;
  width: 52px;
  height: 52px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #e6f4e7;
  border: 1px solid #c5e6c7;
}
.stat.accent-amber .icon { background: #fff3e0; border-color: #ffe0b2; }
.stat.accent-blue .icon  { background: #e1f5fe; border-color: #b3e5fc; }
.stat.accent-plum .icon  { background: #f3e5f5; border-color: #e1bee7; }

.stat .label { font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }
.stat .value { font-family: var(--font-heading); font-size: 1.55rem; font-weight: 700; color: var(--charcoal); line-height: 1.2; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }

.chip {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}
.chip:hover { border-color: var(--green); background: var(--light-gray); }
.chip:active { transform: scale(0.96); }
.chip.active {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 3px 10px rgba(255, 167, 38, 0.3);
}

.order-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  animation: fadeUp 0.35s ease both;
}
.order-card:hover { box-shadow: var(--shadow-lift); }
.order-card.open { border-color: var(--green); }

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  cursor: pointer;
  flex-wrap: wrap;
  transition: background 0.2s ease;
}
.order-head:hover { background: var(--light-gray); }

.order-head .who { display: flex; flex-direction: column; }
.order-head .who .name { font-family: var(--font-heading); font-weight: 600; color: var(--charcoal); }
.order-head .who .meta { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.order-head .right { display: flex; align-items: center; gap: 14px; }
.order-head .total { font-family: var(--font-heading); font-weight: 700; color: var(--green-dark); white-space: nowrap; font-size: 1.05rem; }
.order-head .chev { color: var(--muted); font-size: 0.8rem; transition: transform 0.3s ease; }
.order-card.open .chev { transform: rotate(180deg); }

.badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.badge-noua       { background: #fff3e0; color: var(--amber); border: 1px solid #ffe0b2; }
.badge-confirmata { background: #e1f5fe; color: #0277bd; border: 1px solid #b3e5fc; }
.badge-in_livrare { background: #f3e5f5; color: #7b1fa2; border: 1px solid #e1bee7; }
.badge-livrata    { background: #e6f4e7; color: var(--green-deep); border: 1px solid var(--green-light); }
.badge-anulata    { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c0; }

.order-body {
  border-top: 1px solid var(--line);
  background: var(--light-gray);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 22px;
}

.order-body h4 { font-family: var(--font-heading); margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; }
.order-body table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.order-body td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.order-body td.num { text-align: right; white-space: nowrap; }
.order-body .detail-line { font-size: 0.92rem; margin: 4px 0; }
.order-body .detail-line b { color: var(--charcoal); }
.order-body a { color: var(--green-dark); font-weight: 600; }

.status-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 15px;
}
.status-row select {
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  background: #fff;
  cursor: pointer;
}
.status-row select:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus-ring); }

/* --------------------------------------------------- tabel produse admin --- */

.table-wrap { overflow-x: auto; }
table.admin { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--card); }
table.admin th, table.admin td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; }
table.admin th {
  font-family: var(--font-heading);
  background: var(--light-gray);
  color: var(--charcoal);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
table.admin tbody tr { transition: background 0.2s ease; }
table.admin tbody tr:hover { background: #fafcfb; }
table.admin td.num { text-align: right; }
table.admin input, table.admin select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
table.admin input:focus, table.admin select:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus-ring); }
table.admin input[type="text"] { width: 100%; min-width: 130px; }
table.admin input[type="number"] { width: 90px; text-align: right; }

.btn-small {
  padding: 9px 15px;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}
.btn-small:hover { background: var(--light-gray); }
.btn-small:active { transform: scale(0.95); }
.btn-small.danger { color: var(--danger); border-color: #f5c6c0; }
.btn-small.danger:hover { background: #fdecea; }
.btn-small.save { color: #fff; border-color: var(--green); background: var(--green); }
.btn-small.save:hover { background: var(--green-dark); border-color: var(--green-dark); }

/* ----------------------------------------------------------------- login --- */

.login-box { max-width: 400px; margin: 70px auto; padding: 32px; }
.login-box .field { margin-bottom: 16px; }
.login-box .lock {
  font-size: 1.6rem;
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: #fff3e0;
  border: 1px solid #ffe0b2;
  border-radius: 18px;
}
.login-box h2 { justify-content: center; margin: 0 0 20px; }

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 30px 20px 36px;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}

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

@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .order-body { grid-template-columns: 1fr; }
  .brand-tag { display: none; }
  main { padding-bottom: 110px; }
}

/* --- telefoane --- */
@media (max-width: 640px) {
  header.site { padding: 13px 16px; }
  .brand { gap: 11px; }
  .brand-logo { height: 38px; }
  .header-link { padding: 7px 14px; font-size: 0.82rem; }

  .hero-points { margin-top: 12px; gap: 7px; }
  .hero-points span { font-size: 0.74rem; padding: 6px 11px; }

  main { padding: 18px 13px 130px; }
  .card { padding: 16px; border-radius: 14px; }
  h2 { font-size: 1.18rem; margin: 26px 0 5px; }
  h2 .step { width: 30px; height: 30px; font-size: 0.9rem; }
  .section-hint { font-size: 0.87rem; }
  .cat-title { font-size: 1.02rem; margin: 22px 0 11px; }

  /* două produse pe rând, carduri compacte;
     min-width: 0 împiedică lățirea paginii de către input[type=number] */
  .products-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .product { padding: 12px; gap: 9px; border-radius: 13px; min-width: 0; }
  .product.selected { padding: 11px; }
  .product .top { flex-direction: column; align-items: flex-start; gap: 7px; }
  .product .emoji { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 12px; }
  .product .name { font-size: 0.9rem; }
  .product .desc { font-size: 0.73rem; }
  .product .price { font-size: 0.85rem; }
  .qty-row { gap: 5px; }
  .qty-row button { width: 40px; height: 40px; border-radius: 10px; flex: none; }
  .qty-row input { flex: 1 1 0; width: 0; min-width: 0; font-size: 16px; padding: 9px 2px; }
  .qty-row .unit { display: none; }

  .summary { overflow-x: auto; }
  .summary th, .summary td { padding: 9px 4px; font-size: 0.85rem; }
  .summary th { font-size: 0.68rem; }
  .summary tfoot td { font-size: 1.05rem; }

  .field input, .field select, .field textarea { font-size: 16px; padding: 12px 13px; }

  .actions { flex-direction: column; align-items: stretch; text-align: center; }
  .actions .btn { width: 100%; }

  .cart-bar {
    left: 12px; right: 12px; bottom: 12px;
    transform: none; max-width: none;
    justify-content: space-between;
    padding: 9px 10px 9px 20px;
    animation: slideUpMobile 0.3s ease both;
  }
  .cart-bar button { padding: 12px 18px; font-size: 0.86rem; }

  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat { padding: 13px 14px; gap: 11px; }
  .stat .icon { width: 42px; height: 42px; font-size: 1.1rem; border-radius: 12px; }
  .stat .value { font-size: 1.25rem; }
  .stat .label { font-size: 0.66rem; }

  .chip { padding: 8px 14px; font-size: 0.82rem; }

  .order-head { padding: 13px 15px; gap: 8px; }
  .order-head .who .name { font-size: 0.93rem; }
  .order-head .who .meta { font-size: 0.76rem; }
  .order-head .right { gap: 9px; width: 100%; justify-content: space-between; }
  .order-body { padding: 15px; gap: 16px; }
  .status-row { align-items: stretch; flex-direction: column; }
  .status-row select { font-size: 16px; }
  .status-row .btn-small { padding: 12px 14px; text-align: center; }

  table.admin th, table.admin td { padding: 9px 10px; font-size: 0.85rem; }
  table.admin input, table.admin select { font-size: 16px; }

  .login-box { margin: 34px auto; padding: 24px; }
}

@keyframes slideUpMobile {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================ nav admin === */

.admin-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 10px;
  margin: 0 -20px 8px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  scrollbar-width: none;
}
.admin-nav::-webkit-scrollbar { display: none; }

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-tab:hover { background: var(--light-gray); color: var(--charcoal); }
.nav-tab.active { background: var(--gold); color: #fff; }

.nav-tab .badge-count {
  background: rgba(255, 255, 255, 0.35);
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}
.nav-tab:not(.active) .badge-count { background: var(--gold); color: #fff; }

.admin-section { animation: fadeUp 0.25s ease both; }

/* ==================================================== statistici / grafice === */

.range-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
}

.custom-range {
  display: none;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.custom-range.active { display: flex; }
.custom-range input[type="date"] {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
}

.stats-hint { color: var(--muted); font-size: 0.85rem; margin: -10px 0 18px; }

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.chart-card h4 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 14px;
}
.chart-card .chart-empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 0.9rem; }

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .bar { transition: opacity 0.15s ease; }
.chart-svg .bar:hover { opacity: 0.75; }
.chart-svg .axis-label { font-family: var(--font-body); font-size: 9px; fill: var(--muted); }
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-svg .bar-value { font-family: var(--font-body); font-size: 9px; fill: var(--charcoal-soft); font-weight: 700; }

/* ======================================================= configurare === */

.settings-card { margin-bottom: 20px; }
.settings-card h3 {
  font-family: var(--font-heading);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--charcoal);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.settings-card .settings-desc { color: var(--muted); font-size: 0.85rem; margin: 0 0 16px; }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}
.switch-row .switch-label { font-weight: 700; font-size: 0.92rem; color: var(--charcoal); }
.switch-row .switch-hint { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: none;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--line); border-radius: 999px; transition: background 0.2s ease;
}
.switch .slider::before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.status-pill.on { background: #e6f4e7; color: var(--green-deep); }
.status-pill.off { background: var(--light-gray); color: var(--muted); }
.status-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.token-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}
.token-legend code {
  background: var(--light-gray);
  border: 1px solid var(--line);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-family: 'Roboto Mono', monospace;
  color: var(--green-dark);
}

.field textarea.template-input { font-family: 'Roboto Mono', monospace; font-size: 0.85rem; line-height: 1.6; }

.export-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.export-count { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 760px) {
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .admin-nav { margin: 0 -13px 6px; padding: 8px; }
  .nav-tab { padding: 9px 13px; font-size: 0.85rem; }
  .charts-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-card { padding: 15px; }
}

/* ==================================================== client: profil salvat === */

.welcome-back {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  background: #e6f4e7;
  border: 1px solid var(--green-light);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  margin-bottom: 14px;
  font-size: 0.92rem;
  color: var(--green-deep);
  animation: fadeUp 0.3s ease both;
}
.welcome-back button {
  background: transparent;
  border: 1px solid var(--green-light);
  color: var(--green-deep);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.welcome-back button:hover { background: rgba(255,255,255,0.5); }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--charcoal-soft);
  margin-top: 12px;
  cursor: pointer;
}
.check-row input { width: 18px; height: 18px; flex: none; margin-top: 1px; accent-color: var(--green); cursor: pointer; }
