/* Furat admin panel.
   The colours are the app's own, so the panel and the shop look like one
   thing rather than two. */

:root {
  --green: #1cd15a;
  --green-dark: #13a946;
  --green-soft: #e7faee;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --divider: #eaeaee;
  --chip: #f2f2f2;
  --ink: #1d1a1f;
  --ink-muted: #8a8a94;
  --ink-faint: #b6b6be;
  --danger: #e90d14;
  --danger-soft: #fdecec;
  --amber: #f5a623;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(29, 26, 31, .06), 0 8px 24px rgba(29, 26, 31, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  /* The typeface the app uses for Kurdish and Arabic. */
  font: 15px/1.6 "IBM Plex Sans Arabic", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Arial, "Noto Naskh Arabic", sans-serif;
}

a { color: var(--green-dark); }

h1 { font-size: 24px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 14px; letter-spacing: -.01em; }

.muted { color: var(--ink-muted); }
.small { font-size: 13px; }

/* --- top bar ------------------------------------------------------------ */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--divider);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -.02em;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
}

.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }

.nav-link {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.nav-link:hover { background: var(--chip); color: var(--ink); }
.nav-link.current { background: var(--green-soft); color: var(--green-dark); }

.who { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.inline { display: inline; margin: 0; }

.link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--green-dark);
  cursor: pointer;
  text-decoration: underline;
}

/* --- page --------------------------------------------------------------- */

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 20px 72px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.card.tight { padding: 0; overflow: hidden; }

/* --- messages ----------------------------------------------------------- */

.flash {
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  margin: 0 0 16px;
  font-weight: 600;
  font-size: 14px;
}

.flash.ok { background: var(--green-soft); color: #0e7a33; }
.flash.error { background: var(--danger-soft); color: #a5060b; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-muted);
}

/* --- forms -------------------------------------------------------------- */

.field { margin-bottom: 18px; }

.field > label,
.field-label {
  display: block;
  font-weight: 650;
  font-size: 13px;
  margin-bottom: 6px;
}

.hint {
  display: block;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 400;
  margin-top: 4px;
}

input[type=text],
input[type=password],
input[type=number],
input[type=search],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(28, 209, 90, .16);
}

textarea { min-height: 96px; resize: vertical; }

input[type=file] { font: inherit; }

.row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.row > .field { flex: 1 1 200px; margin-bottom: 18px; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
}

.check input { width: auto; }

/* The three language slots of one field. */
.langs { display: grid; gap: 10px; }

.lang { display: flex; align-items: flex-start; gap: 10px; }

.lang .tag {
  flex: 0 0 62px;
  padding-top: 11px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.lang [dir=ltr] { text-align: left; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { background: var(--green-dark); }
.btn.wide { width: 100%; text-align: center; }

.btn.ghost {
  background: var(--chip);
  color: var(--ink);
}

.btn.ghost:hover { background: var(--divider); }

.btn.danger { background: var(--danger-soft); color: #a5060b; }
.btn.danger:hover { background: #f9d9da; }

.btn.small { padding: 6px 13px; font-size: 13px; }

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

/* --- tables ------------------------------------------------------------- */

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 12px 16px;
  text-align: start;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-muted);
  background: #fafafb;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fcfcfd; }

td.right, th.right { text-align: end; }

.thumb {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--chip);
  display: block;
}

.thumb.blank {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 18px;
}

.name { font-weight: 650; }
.name a { color: inherit; text-decoration: none; }
.name a:hover { text-decoration: underline; }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 12.5px;
  font-weight: 600;
  color: #5c5c66;
}

.chip.type { background: var(--green-soft); color: var(--green-dark); }

.was {
  color: var(--ink-faint);
  text-decoration: line-through;
  font-size: 12.5px;
}

.off {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: #a5060b;
  font-size: 11.5px;
  font-weight: 700;
}

.stock-out { color: var(--danger); font-weight: 650; }
.stock-low { color: var(--amber); font-weight: 650; }

/* --- filter bar --------------------------------------------------------- */

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

.filters input[type=search] { flex: 1 1 220px; }
.filters select { flex: 0 1 200px; }

/* --- image picker ------------------------------------------------------- */

.picker { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }

.preview {
  width: 128px;
  height: 128px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--chip);
  border: 1px solid var(--divider);
}

.preview.blank {
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

/* An advert is a wide strip, so its preview is one too — a square frame
   would suggest a shape the app never shows. */
.preview.wide {
  width: 100%;
  max-width: 320px;
  height: 80px;
}

.picker .grow { flex: 1 1 220px; }

/* A picture never bursts out of the box it was put in, whatever its own
   size is. The classes below set the shapes; this is only the floor under
   them, for the moment one of them does not apply. */
td img,
.card img {
  max-width: 100%;
}

/* The same strip in the list. */
.banner {
  width: 134px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--chip);
  display: block;
}

/* The live "customer pays" line under the price fields. */
.calc {
  margin-top: 2px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: #0e7a33;
  font-weight: 650;
  font-size: 14px;
}

/* --- the sign-in screen ------------------------------------------------- */

body.signed-out {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.gate { width: 100%; max-width: 380px; }

.gate .card { padding: 28px; margin: 0; }

.gate .brand {
  font-size: 20px;
  margin-bottom: 4px;
}

.gate h1 { font-size: 20px; margin: 16px 0 4px; }

.gate p { margin: 0 0 20px; }

@media (max-width: 620px) {
  /* Brand and account on the first line, the nav on its own line under them,
     rather than the three of them wrapping around each other. */
  .topbar-inner { padding: 10px 16px; gap: 10px; min-height: 0; }
  .brand { order: 1; }
  .who { order: 2; margin-inline-start: auto; }
  .nav { order: 3; flex: 0 0 100%; }

  .page { padding: 18px 16px 56px; }
  .page-head h1 { font-size: 21px; }

  th, td { padding: 10px 8px; }
  th:first-child, td:first-child { padding-inline-start: 12px; }
  th:last-child, td:last-child { padding-inline-end: 12px; }
  .hide-small { display: none; }
  .thumb { width: 40px; height: 40px; }
  .btn.small { padding: 6px 10px; font-size: 12.5px; }

  .lang .tag { flex-basis: 34px; }
}
