/*
 * Samy – Stylesheet für Apps als eigene Seite (wie Polaris für eingebettete Shopify-Apps)
 * Einbinden: <link rel="stylesheet" href="https://samy.sinio.io/embed/samy.css">
 * Anleitung: https://samy.sinio.io/docs/seiten
 *
 * Die Seite füllt die App unter dem Kopf von Samy, ist so breit wie der Bildschirm und darf scrollen.
 */

@font-face {
  font-family: "Lato";
  src: url("fonts/Lato-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("fonts/Lato-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Lato";
  src: url("fonts/Lato-Black.ttf") format("truetype");
  font-weight: 900;
  font-display: swap;
}

/* Farben der App */
:root {
  --samy-bg: #ffffff;
  --samy-text: #15171c;
  --samy-text-2: #5b6070;
  --samy-text-3: #9a9eab;
  --samy-icon: #3d414c;
  --samy-cta: #343e63;
  --samy-on-cta: #ffffff;
  --samy-field: #f3f4f7;
  --samy-selected: #eceff7;
  --samy-bar: #dde2ee;
  --samy-divider: rgba(21, 23, 28, 0.06);
  --samy-ok: #2fb36b;
  --samy-warn: #e5484d;
  --samy-radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--samy-bg);
  color: var(--samy-text);
  font: 15px/1.4 Lato, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

p,
h1,
h2,
h3 {
  margin: 0;
}

/* Rahmen der Seite: 16 px Innenabstand, Bausteine untereinander */
.samy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
  padding: 16px;
}

/* Text */
.samy-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.samy-big {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.samy-sub {
  font-size: 13px;
  color: var(--samy-text-2);
}

.samy-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--samy-text-2);
}

.samy-note {
  font-size: 11px;
  color: var(--samy-text-3);
}

/* Anordnung */
.samy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.samy-spread {
  justify-content: space-between;
}

.samy-grow {
  flex: 1;
  min-width: 0;
}

.samy-push {
  margin-top: auto;
}

/* Knöpfe: mindestens 44 px hoch, damit sie gut antippbar sind */
.samy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: var(--samy-cta);
  color: var(--samy-on-cta);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.samy-button.is-secondary {
  background: var(--samy-field);
  color: var(--samy-text);
}

.samy-button.is-small {
  min-height: 32px;
  padding: 0 14px;
  border-radius: 16px;
  font-size: 13px;
}

.samy-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Umschalter zwischen Ansichten */
.samy-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: var(--samy-field);
}

.samy-tabs button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--samy-text-2);
  cursor: pointer;
}

.samy-tabs button[aria-selected="true"] {
  background: #fff;
  color: var(--samy-text);
  box-shadow: 0 1px 3px rgba(21, 23, 28, 0.1);
}

/* Liste mit feinen Trennlinien */
.samy-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.samy-list > li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.samy-list > li + li {
  box-shadow: 0 -1px 0 var(--samy-divider);
}

/* Tabelle: Zahlen mit .is-num rechtsbündig */
.samy-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.samy-table th,
.samy-table td {
  padding: 9px 0 9px 14px;
  text-align: left;
}

.samy-table th:first-child,
.samy-table td:first-child {
  padding-left: 0;
}

.samy-table th {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--samy-text-2);
}

.samy-table td {
  border-top: 1px solid var(--samy-divider);
}

.samy-table .is-num {
  text-align: right;
}

/* Eingabe */
.samy-field {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--samy-radius);
  background: var(--samy-field);
  font: inherit;
  color: var(--samy-text);
  outline: none;
}

.samy-field::placeholder {
  color: var(--samy-text-3);
}

/* Kleine Kennzeichen */
.samy-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: var(--samy-selected);
  font-size: 12px;
  font-weight: 700;
}

.samy-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--samy-ok);
  box-shadow: 0 0 0 4px rgba(47, 179, 107, 0.15);
}

.samy-dot.is-warn {
  background: var(--samy-warn);
  box-shadow: 0 0 0 4px rgba(229, 72, 77, 0.15);
}

/* Kleines Balkendiagramm: <div class="samy-bars"><i style="height:40%"></i>…</div> */
.samy-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
}

.samy-bars > i {
  flex: 1;
  border-radius: 4px;
  background: var(--samy-bar);
}

.samy-bars > i.is-active {
  background: var(--samy-cta);
}
