/* Tecnomed Saha — shared tokens and components (phone app + admin panel).
   Colours follow tecnomedgas.com: navy + logo cyan, green only for "done". */
:root {
  color-scheme: light;
  --navy-950: #012a3d;
  --navy-900: #003f5a;
  --navy-800: #005070;
  --blue-600: #0a7aa6;
  --sky-400: #00b9fe;
  --sky-100: #e3f5fd;
  --green-600: #4d8a1f;
  --green-100: #ecf6e2;
  --amber-700: #8a5a00;
  --amber-100: #fff4d6;
  --red-700: #a3231a;
  --red-100: #fdeceb;
  --ink: #0f1c26;
  --text: #2a3b47;
  --muted: #6b7c89;
  --line: #e1e8ee;
  --bg: #ffffff;
  --bg-soft: #f5f8fb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(1, 42, 61, 0.06), 0 6px 20px rgba(1, 42, 61, 0.07);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-soft);
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0;
}

a {
  color: var(--blue-600);
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.7em 1.1em;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  text-decoration: none;
  background: var(--bg);
  color: var(--navy-900);
  border-color: var(--line);
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--sky-400) 55%, transparent);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--navy-900);
  color: #fff;
  border-color: var(--navy-900);
}
.btn-primary:hover:not(:disabled) {
  background: var(--navy-800);
}
.btn-go {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}
.btn-danger {
  color: var(--red-700);
  border-color: color-mix(in srgb, var(--red-700) 30%, var(--line));
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-block {
  width: 100%;
}
.btn-sm {
  min-height: 34px;
  padding: 0.35em 0.75em;
  font-size: 0.9rem;
}

/* ---------- forms ---------- */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.field > span,
.label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}
.hint {
  font-size: 0.8125rem;
  color: var(--muted);
}
input[type='text'],
input[type='password'],
input[type='tel'],
input[type='search'],
input[type='date'],
input[type='number'],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid #c9d5de;
  border-radius: var(--radius-sm);
  padding: 0.65em 0.8em;
  min-height: 44px;
}
textarea {
  resize: vertical;
  min-height: 90px;
}
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.check input {
  width: 18px;
  height: 18px;
}

/* chips: radio buttons that look like pills */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  position: relative;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: inline-block;
  padding: 0.55em 0.95em;
  border: 1px solid #c9d5de;
  border-radius: 999px;
  background: var(--bg);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--ink);
}
.chip input:checked + span {
  background: var(--navy-900);
  border-color: var(--navy-900);
  color: #fff;
}
.chip input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--sky-400) 55%, transparent);
  outline-offset: 2px;
}

/* ---------- surfaces ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--muted);
  white-space: nowrap;
}
.badge-ok {
  background: var(--green-100);
  color: var(--green-600);
}
.badge-open {
  background: var(--sky-100);
  color: var(--blue-600);
}
.badge-warn {
  background: var(--amber-100);
  color: var(--amber-700);
}
.badge-bad {
  background: var(--red-100);
  color: var(--red-700);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.92rem;
  background: var(--red-100);
  color: var(--red-700);
  margin-bottom: 14px;
}
.alert-info {
  background: var(--sky-100);
  color: var(--navy-800);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(92vw, 460px);
  background: var(--navy-950);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  z-index: 100;
  font-size: 0.95rem;
  text-align: center;
  pointer-events: none; /* never swallow a tap meant for the button underneath */
}

.muted {
  color: var(--muted);
}
.empty {
  color: var(--muted);
  text-align: center;
  padding: 18px 8px;
}

.busy {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 90;
  font-weight: 600;
  color: var(--navy-900);
}
.busy::before {
  content: '';
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--sky-100);
  border-top-color: var(--blue-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
