﻿:root {
  --bg: #f1efe9;
  --ink: #172217;
  --muted: #546054;
  --accent: #0f3d2e;
  --accent-2: #e4a949;
  --card: #ffffff;
  --stroke: #d5d0c4;
  --shadow: 0 16px 30px rgba(23, 34, 23, 0.12);
  --radius: 16px;
  --font: "Poppins", "Segoe UI", sans-serif;
  --label-width-mm: 90mm;
  --label-height-mm: 29mm;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(228, 169, 73, 0.15), transparent 55%),
    radial-gradient(circle at 20% 50%, rgba(15, 61, 46, 0.08), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-bottom: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: contain;
  background: #fff;
}

.title {
  font-weight: 700;
  font-size: 18px;
}

.subtitle {
  color: var(--muted);
  font-size: 13px;
}

.session {
  display: flex;
  align-items: center;
  gap: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  padding: 24px 28px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.list-item {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #faf9f5;
}

.list-item strong {
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.auth-signup-text {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.link-button {
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  font-family: var(--font);
  font-size: 14px;
}

.photo-preview {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  object-fit: cover;
  display: none;
  background: #fff;
}

.photo-preview.is-visible {
  display: block;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.phone-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.phone-prefix {
  color: var(--ink);
  font-weight: 600;
}

.phone-row input {
  min-width: 0;
}

#signupPhoneDdd {
  width: 56px;
  text-align: center;
}

.checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
}

.pill {
  background: rgba(15, 61, 46, 0.12);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.room-current {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed var(--stroke);
  font-size: 14px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filters input,
.filters select {
  flex: 1;
  min-width: 160px;
}

.checkin-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px dashed var(--stroke);
  background: #fdfbf6;
}

.summary {
  font-size: 14px;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f2e8;
  border: 1px solid var(--stroke);
}

.label-title {
  font-size: 18px;
  font-weight: 700;
}

.dialog::backdrop {
  background: rgba(23, 34, 23, 0.45);
}

.dialog-body {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--stroke);
  min-width: min(520px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.label {
  width: var(--label-width-mm);
  height: var(--label-height-mm);
  border: 0.2mm solid #111;
  padding: 1.4mm;
  border-radius: 1.2mm;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.95mm;
  font-size: 3.2mm;
  line-height: 1.1;
  font-family: Arial, "Segoe UI", sans-serif;
  color: #111;
  box-sizing: border-box;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.label-name {
  text-align: center;
  font-size: 4.8mm;
  font-weight: 700;
  width: 100%;
  word-break: break-word;
  line-height: 1.08;
  overflow-wrap: anywhere;
  margin-bottom: 1.4mm;
  padding-bottom: 0.8mm;
  border-bottom: 0.2mm solid #222;
}

.label-line {
  width: 100%;
  text-align: center;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.12;
}

.label-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.95mm;
}

.room-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-open-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-open-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #faf9f5;
  font-size: 14px;
}

@media (max-width: 720px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .session {
    width: 100%;
    justify-content: space-between;
  }
}

@media print {
  @page {
    size: 90mm 29mm;
    margin: 0;
  }

  html,
  body {
    width: 90mm;
    height: 29mm;
    overflow: hidden;
  }

  body {
    background: #fff;
    margin: 0;
  }

  .app-header,
  main,
  .dialog-actions,
  #labelDialog h3 {
    display: none;
  }

  body.print-label > * {
    display: none !important;
  }

  body.print-label #labelDialog {
    display: block !important;
    position: static;
    margin: 0;
    padding: 0;
    border: 0;
    width: var(--label-width-mm);
    max-width: var(--label-width-mm);
    overflow: hidden;
  }

  body.print-label #labelDialog .dialog-body {
    display: block;
    border: 0;
    padding: 0;
    min-width: auto;
    background: #fff;
    box-shadow: none;
    overflow: hidden;
  }

  body.print-label .label {
    border: 0.2mm solid #000;
    margin: 0;
    overflow: hidden;
  }
}
