/* Kube_Habait Daily Forms — mobile-first RTL styles.
   No external fonts, no CDN, no CSS framework. Targets 360px width and up.
   Interactive controls are never smaller than 48px tall. */

:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --ink: #16202e;
  --muted: #5a6b80;
  --line: #d8dfe8;
  --brand: #1f6f54;
  --brand-dark: #17553f;
  --warn-bg: #fdf2d6;
  --warn-ink: #7a5a10;
  --danger-bg: #fdecec;
  --danger-ink: #a12020;
  --radius: 12px;
  --tap: 48px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

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

.site-head {
  text-align: center;
  margin-bottom: 22px;
}

.site-head h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.site-head .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.today {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.card h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 700;
}

.card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 15px;
}

.badge {
  display: inline-block;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

/* ---------- controls ---------- */

.btn {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  line-height: 24px;
  cursor: pointer;
}

.btn:active { background: var(--brand-dark); }

.btn-secondary {
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
}

.field { margin-bottom: 16px; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 19px;
  font-family: inherit;
  text-align: center;
  letter-spacing: 4px;
}

.field input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.error {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border: 1px solid #f2c4c4;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

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

.stats { margin: 0 0 4px; }

.stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.stat:last-child { border-bottom: 0; }

.stat .label { color: var(--muted); font-size: 16px; }

.stat .value { font-size: 24px; font-weight: 700; }

/* ---------- footer ---------- */

.foot {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.foot form { margin: 0; }

.note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.login-wrap { padding-top: 44px; }

/* ---------- form controls ---------- */

.field select,
.field textarea,
.field input[type="time"] {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-family: inherit;
}

.field textarea {
  min-height: 96px;
  text-align: right;
  line-height: 1.5;
  resize: vertical;
}

.field select:focus,
.field textarea:focus,
.field input[type="time"]:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
  border-color: var(--brand);
}

.readonly-value {
  min-height: var(--tap);
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f7f9fb;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

/* radio group styled as large tap targets; the input itself stays in the DOM
   for keyboard/screen-reader users but is visually hidden */
.choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.choice-btn {
  display: block;
  min-height: var(--tap);
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  cursor: pointer;
}

#result_ok:checked ~ label[for="result_ok"] {
  border-color: var(--brand);
  background: #e8f3ee;
  color: var(--brand-dark);
}

#result_issue:checked ~ label[for="result_issue"] {
  border-color: #c9821a;
  background: var(--warn-bg);
  color: var(--warn-ink);
}

/* the issue description only appears once "with a problem" is selected */
.issue-field { display: none; margin-top: 4px; }
#result_issue:checked ~ .issue-field { display: block; }

.issue-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
}

.issue-field textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 17px;
  font-family: inherit;
  text-align: right;
  resize: vertical;
}

.btn-disabled {
  background: #e9edf2;
  color: var(--muted);
  cursor: default;
}

.btn-small {
  display: inline-block;
  width: auto;
  min-height: 44px;
  margin: 4px 0 0 6px;
  padding: 10px 12px;
  font-size: 15px;
}

/* ---------- badges / pills / banners ---------- */

.badge-active { background: #e8f3ee; color: var(--brand-dark); }
.badge-done { background: #e9edf2; color: var(--muted); }

.pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 600;
}

.pill-ok { background: #e8f3ee; color: var(--brand-dark); }
.pill-issue { background: var(--warn-bg); color: var(--warn-ink); }

.ok-banner,
.closed-banner {
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.ok-banner { background: #e8f3ee; color: var(--brand-dark); }
.closed-banner { background: #e9edf2; color: var(--muted); }

.value-text { font-size: 16px; font-weight: 600; text-align: left; }

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

.section-head {
  margin: 22px 0 8px;
  font-size: 18px;
  font-weight: 700;
  padding-right: 10px;
  border-right: 5px solid var(--line);
}

.section-hygiene { border-right-color: #c62828; }
.section-device { border-right-color: #1565c0; }

.card-hygiene { border-right: 5px solid #c62828; }
.card-device { border-right: 5px solid #1565c0; }

.row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.row:last-child { border-bottom: 0; }
.row-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.row-line { font-size: 15px; color: var(--muted); margin-bottom: 2px; }

.row-line code {
  background: #eef2f6;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 14px;
}

.resolve-form { margin-top: 8px; }
.empty { margin: 0; color: var(--muted); font-size: 15px; }
