:root {
  /* style */
  --bg: #f5f5f7;
  --bg-alt: #f5f5f7;
  --card: rgba(255, 255, 255, 0.9);
  --border: rgba(0, 0, 0, 0.06);
  --text: #111111;
  --text-muted: rgba(0, 0, 0, 0.55);
  --text-soft: rgba(0, 0, 0, 0.38);
  --accent: #000000;
  --danger: #3be928;

  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.05);
}

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

/* ---------------- GLOBAL ---------------- */

body {
  margin: 0;
  padding: 0;
  background: #f5f5f7; 
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
}

.app {
  min-height: 100vh;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  display: flex;
  flex-direction: column;
  background: transparent; 
}

/* Header */
.app-header {
  padding: 8px 4px 16px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245,245,247,0.98);  
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0,0,0,0.03); 
}


/* Butik-badge */
.current-store-label {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.current-store-label span#current-store-name {
  font-weight: 600;
  color: #ffffff;
  background: #000000;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
}

/* Butik-til-butik ikon */

.app-incoming-button {
  border: none;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.app-incoming-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  background: #ffffff;
}

.incoming-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff3b30;
  color: white;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.incoming-badge.hidden {
  display: none;
}

/* Hus-ikon / app-menu-knap */

.app-menu-button {
  border: none;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  transition: box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.app-menu-button svg {
  display: block;
}

.app-menu-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
  background: #ffffff;
}

/* ---------------- TITLER & VIEWS ---------------- */

h2 {
  margin: 8px 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.view {
  display: none;
  flex: 1;
}

.view-active {
  display: block;
}

/* ---------------- CARDS, INPUTS, FORM ---------------- */

.card {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 16px 18px;
  box-shadow: var(--shadow-subtle);
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

input,
textarea,
select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(0,0,0,0.4);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
  background: #ffffff;
}

/* 2-kolonne layout til felterne */

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

.field-half {
  flex: 1;
  min-width: 0;
}

.field-full {
  width: 100%;
}

/* Textarea til bemærkninger */

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

input::placeholder,
textarea::placeholder {
  color: #a0a0a0;
  font-size: 0.8rem;
  font-family: inherit;
  opacity: 1;
}

/* ---------------- BUTTONS ---------------- */

button {
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:active {
  transform: scale(0.97);
  opacity: 0.8;
}

.btn-primary {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  padding: 10px 16px;
  background: #ffffff;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.btn-secondary {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.1);
  padding: 10px 16px;
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
}

.btn-danger {
  border-radius: 999px;
  border: 1px solid rgba(59,233,40,0.5);
  padding: 10px 16px;
  background: #ffffff;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 500;
}

/* ---------------- ORDER LIST ---------------- */

.order-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.order-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
}

/* Selve kortet med info */
.order-card {
  border-radius: 20px;
  width: 100%;
  border: 1px solid var(--border);
  padding: 14px 16px;
  background: rgba(255,255,255,0.96);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-subtle);
}

/* HEADER + DROPDOWN */

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.order-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.order-customer {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.order-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.order-style {
  font-weight: 500;
}

.order-sep {
  opacity: 0.5;
}

.order-product {
  font-weight: 400;
}

/* Status-label til butik-til-butik */

.order-supplier-status {
  font-size: 0.75rem;
  padding: 2px 0;
  border-radius: 999px;
  color: var(--text-soft);
  white-space: nowrap;
}

.order-supplier-status.pending {
  color: #ff9500;
}

.order-supplier-status.sent {
  color: #2d8a2d;
}

/* Toggle-knap */

.order-toggle {
  border: none;
  background: transparent;
  font-size: 0.76rem;
  color: var(--text-soft);
  padding: 4px 0;
}

/* Body-del */

.order-body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Linjerne inde i kortet */

.order-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.order-label {
  font-weight: 500;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.order-value {
  color: var(--text);
  text-align: right;
}

/* Bemærkninger må gerne være multi-line */

.order-line.order-notes {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 4px;
}

.order-line.order-notes .order-value {
  text-align: left;
  margin-top: 2px;
  margin-bottom: 12px;
}

/* Collapse-tilstand */

.order-item.collapsed .order-body {
  display: none;
}

/* Actions UNDER kortet */

.order-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.order-list.empty-state {
  align-items: center;
  justify-content: center;
  min-height: 80px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

/* ---------------- DETAIL PANEL ---------------- */

.detail-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-subtle);
}

.detail-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.detail-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.detail-notes {
  flex-direction: column;
  align-items: flex-start;
}

.detail-notes span:last-child {
  margin-top: 2px;
  color: var(--text);
  font-size: 0.85rem;
}

.hidden {
  display: none !important;
}

/* ---------------- TAB BAR ---------------- */

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 380px;
  padding: 8px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 10px 25px rgba(0,0,0,0.16);
}

/* Knapper */
.tab-button {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Standard farve */
.tab-button svg {
  stroke: var(--text-soft);
  transition: stroke 0.18s ease, background 0.18s ease, transform 0.12s ease;
}

/* Aktiv farve */
.tab-button.active svg {
  stroke: #000000;
}

.tab-button.active {
  background: rgba(0,0,0,0.04);
}

/* ---------------- STORE SELECT OVERLAY ---------------- */

.store-select-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(circle at top, rgba(255,255,255,0.98), rgba(240,240,244,0.96));
  z-index: 999;
}

.store-select-box {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.9);
  border-radius: 22px;
  padding: 1.8rem 1.9rem 1.6rem;
  box-shadow: 0 22px 60px rgba(0,0,0,0.18);
  border: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.store-select-box h2 {
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}

.store-select-box p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.store-select-box select,
.store-select-box input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 1rem;
  outline: none;
  margin-bottom: 0.75rem;
}

.store-select-box .btn-primary {
  width: 100%;
  margin-top: 1rem;
}

/* =============== SIDE PANEL / APP MENU =============== */

.side-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 40;
}

.side-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* Selve panelet – gemt som default */
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 260px;
  background: rgba(250,250,252,0.98);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  z-index: 41;
  border-left: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.side-panel.open {
  transform: translateX(0);
}

.side-panel-inner {
  height: 100%;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.side-panel-header p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.side-panel-section {
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.side-panel-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 2px;
}

.side-panel-value {
  font-size: 0.95rem;
  font-weight: 500;
}

.side-panel-logout {
  margin-top: auto;
  width: 100%;
}

/* =============== INCOMING PANEL (BUTIK-ORDRER) =============== */

.incoming-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: rgba(250,250,252,0.98);
  transform: translateX(100%);
  transition: transform 0.22s ease-out;
  z-index: 42;
  border-left: 1px solid rgba(0,0,0,0.06);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
}

.incoming-panel.open {
  transform: translateX(0);
}

.incoming-panel-inner {
  height: 100%;
  padding: 18px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;

  /* scroll inde i panelet */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}




.incoming-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.incoming-panel-header p {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Empty state */

.incoming-empty {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Liste med indgående ordrer */

.incoming-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* INCOMING ORDER CARD */

.incoming-item {
  background: #fff;
  border-radius: 22px;
  padding: 18px 20px;
  border: none;
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* TOP: butik + dato */
.incoming-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.incoming-from {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111;
}

.incoming-date {
  font-size: 0.85rem;
  color: rgba(0,0,0,0.45);
}

/* Vare info */
.incoming-label {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(0,0,0,0.45);
  margin-bottom: 2px;
}

.incoming-value {
  font-size: 0.75rem;
  font-weight: 500;
  color: #222;
  line-height: 1.35;
}

/* Tokens */
.incoming-value span {
  margin-right: 6px;
}

.incoming-value .dot {
  opacity: 0.4;
  margin: 0 4px;
}

/* KNAP */
.incoming-action button {
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 10px 16px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  width: auto;
}


/* Genbrug .hidden */

.hidden {
  display: none !important;
}
