/* FROOZT admin — read on a phone, in a hurry, often outside the shop.
 * The day's takings lead, on the brand's yellow; everything else is quiet
 * ink-on-paper lists. */

@font-face { font-family: "Poppins"; src: url("fonts/Poppins-SemiBold.ttf"); font-weight: 600; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Medium.ttf"); font-weight: 500; }
@font-face { font-family: "Noto Sans Arabic"; src: url("fonts/NotoSansArabic-SemiBold.ttf"); font-weight: 600; }
@font-face { font-family: "Noto Sans Arabic"; src: url("fonts/NotoSansArabic-Medium.ttf"); font-weight: 500; }

:root {
  --ink: #171717;
  --paper: #ffffff;
  --page: #f4f4f2;
  --line: #e4e4e0;
  --muted: #6b6b66;
  --badge: #f2ec7a;
  --coffee: #d9b8e8;
  --icecream: #f7a8c4;
  --ok: #2f9e5b;
  --alert: #d93636;
  --font: "Noto Sans Arabic", "Poppins", system-ui, sans-serif;
  --num: "Poppins", "Noto Sans Arabic", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }

/* ---- login ---- */

.login {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
  background: var(--ink);
  color: var(--paper);
}
.login__badge { width: 112px; height: 112px; border-radius: 50%; }
.login h1 { font-size: 24px; font-weight: 600; }
.login form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; width: 100%; max-width: 320px; }
.login input, .login button { width: 100%; min-width: 0; }
.login label { font-size: 15px; color: #c8c8c2; }
.login input {
  height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: #2a2a2a;
  font-size: 18px;
  direction: ltr;
}
.login button {
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--badge);
  color: var(--ink);
  font-weight: 600;
  font-size: 17px;
}
.login__error { min-height: 24px; color: #ff8a8a; font-size: 15px; }

/* ---- layout ---- */

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px calc(32px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 0 14px;
}
.top__badge { width: 44px; height: 44px; border-radius: 50%; }
.top__title { flex: 1; }
.top__title h1 { font-size: 20px; font-weight: 600; line-height: 1.2; }
.top__title p { font-size: 13px; color: var(--muted); }
.top__out {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
}

.ranges {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.ranges button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
}
.ranges button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---- the takings ---- */

.sales {
  padding: 20px 20px 16px;
  border-radius: 20px;
  background: var(--badge);
}
.sales__label { font-size: 15px; font-weight: 500; }
.sales__amount {
  font-family: var(--num);
  font-size: clamp(40px, 13vw, 64px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  direction: ltr;
  text-align: right;
}
.sales__amount small { font-size: 0.35em; letter-spacing: 0; }
.sales__facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.sales__facts div { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.55); }
.sales__facts dt { font-size: 12px; color: #4d4a1f; }
.sales__facts dd { font-family: var(--num); font-size: 20px; font-weight: 600; direction: ltr; text-align: right; }

.days { display: block; width: 100%; height: 72px; margin-top: 12px; }
.days.is-empty { display: none; }
.days rect { fill: var(--ink); }
.days text { font-family: var(--num); font-size: 9px; fill: #4d4a1f; }

/* ---- blocks ---- */

.block { margin-top: 22px; }
.block h2 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.block ul { list-style: none; }

.machines { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.machine {
  padding: 14px;
  border-radius: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 6px solid var(--tint, var(--line));
}
.machine--coffee { --tint: var(--coffee); }
.machine--icecream { --tint: var(--icecream); }
.machine h3 { font-size: 16px; font-weight: 600; }
.machine__state { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 500; }
.machine__state::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--dot, var(--muted));
}
.machine__state--ready { --dot: var(--ok); }
.machine__state--busy { --dot: #e0a400; }
.machine__state--fault, .machine__state--offline { --dot: var(--alert); color: var(--alert); }
.machine__note { margin-top: 4px; font-size: 13px; color: var(--muted); }
.machine__sales { margin-top: 10px; font-size: 13px; color: var(--muted); }
.machine__sales b { font-family: var(--num); color: var(--ink); font-size: 16px; }

.problems li {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: #fdecec;
  border-inline-start: 4px solid var(--alert);
  font-size: 14px;
}
.problems li b { display: block; font-size: 15px; }
.problems .none { background: var(--paper); border-inline-start-color: var(--ok); color: var(--muted); }

.products li {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--paper);
  overflow: hidden;
}
.products li::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--share, 0%);
  background: rgba(242, 236, 122, 0.6);
}
.products span { position: relative; }
.products .count { font-family: var(--num); font-weight: 600; }

.recent li {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.recent .no { font-family: var(--num); font-weight: 600; font-size: 17px; }
.recent .what { color: var(--ink); }
.recent .when { font-family: var(--num); color: var(--muted); font-size: 13px; }
.recent .failed .what { color: var(--alert); }

.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

@media (min-width: 640px) {
  .machines { grid-template-columns: 1fr 1fr; }
  .sales { padding: 28px; }
}
