/* ============================================
   MOONBOT OFFICE — DESIGN SYSTEM
   "Premium Dark Luxury" • v1.0
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Inter+Tight:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* === COLOR PALETTE === */
  --ink-deep:      #0A0E1A;   /* Midnight base */
  --ink-medium:    #131826;   /* Surface */
  --ink-soft:      #1C2237;   /* Elevated */
  --ink-line:      #2A3147;   /* Borders */

  --gold:          #D4AF37;   /* Moonbot signature */
  --gold-soft:     #E8C77A;
  --gold-deep:     #A8862A;
  --gold-glow:     rgba(212, 175, 55, 0.15);

  --pearl:         #F5F1EA;   /* Primary text */
  --pearl-dim:     #C8C3B8;   /* Secondary text */
  --pearl-muted:   #8A8578;   /* Tertiary text */

  --accent-blue:   #7B8FA1;   /* Info / cool */
  --accent-green:  #6FA890;   /* Success */
  --accent-amber:  #D9A35E;   /* Warning */
  --accent-rose:   #C77B7B;   /* Danger */

  /* === SHADOWS === */
  --shadow-soft:   0 2px 16px rgba(0, 0, 0, 0.3);
  --shadow-glow:   0 0 24px rgba(212, 175, 55, 0.08);
  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(212, 175, 55, 0.05);

  /* === TYPE === */
  --font-display:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Inter Tight', system-ui, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* === SPACING === */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* === RADIUS === */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* === MOTION === */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--ink-deep);
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv01";
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top, rgba(212, 175, 55, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(123, 143, 161, 0.03) 0%, transparent 50%),
    var(--ink-deep);
}

/* === MINI APP CONTAINER (Telegram mobile viewport) === */
.tg-viewport {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--ink-deep);
  position: relative;
  padding-bottom: 100px;
}

.tg-viewport--with-nav {
  padding-bottom: 140px;
}

/* === TYPOGRAPHY === */
.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.display-md {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.15;
}

.label-tiny {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pearl-muted);
  font-feature-settings: "tnum";
}

.label-small {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pearl-dim);
}

.body-md { font-size: 15px; color: var(--pearl-dim); }
.body-sm { font-size: 13px; color: var(--pearl-dim); }

.numeric {
  font-family: var(--font-mono);
  font-feature-settings: "tnum", "lnum";
  letter-spacing: -0.02em;
}

.gold-text { color: var(--gold); }
.pearl-text { color: var(--pearl); }
.dim-text { color: var(--pearl-dim); }
.muted-text { color: var(--pearl-muted); }

/* === HEADER === */
.tg-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ink-line);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.tg-header__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tg-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tg-header__logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold-soft), var(--gold-deep));
  position: relative;
  box-shadow: 0 0 12px var(--gold-glow);
}

.tg-header__logo-mark::after {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink-deep);
}

.tg-header__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tg-header__title-sub {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: -2px;
}

/* === GREETING SECTION === */
.greeting {
  padding: 32px 24px 24px;
}

.greeting__label {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.greeting__title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 6px;
}

.greeting__title em {
  font-style: italic;
  color: var(--gold);
}

.greeting__date {
  font-size: 12px;
  color: var(--pearl-muted);
  letter-spacing: 0.04em;
}

/* === STATUS PILL === */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: rgba(111, 168, 144, 0.1);
  border: 1px solid rgba(111, 168, 144, 0.25);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-green);
}

.status-pill.warn {
  background: rgba(217, 163, 94, 0.1);
  border-color: rgba(217, 163, 94, 0.25);
  color: var(--accent-amber);
}

.status-pill.danger {
  background: rgba(199, 123, 123, 0.1);
  border-color: rgba(199, 123, 123, 0.25);
  color: var(--accent-rose);
}

.status-pill__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === CARD === */
.card {
  background: linear-gradient(180deg, var(--ink-medium) 0%, var(--ink-soft) 100%);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-glow), transparent);
}

.card--gold {
  border-color: rgba(212, 175, 55, 0.3);
  background:
    radial-gradient(ellipse at top right, var(--gold-glow), transparent 60%),
    linear-gradient(180deg, var(--ink-medium) 0%, var(--ink-soft) 100%);
}

/* === LOCKER GRID === */
.locker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 24px;
}

.locker__section {
  grid-column: span 2;
  padding: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.locker__section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--pearl-muted);
}

.locker__section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--ink-line), transparent);
}

.locker__card {
  background: linear-gradient(180deg, var(--ink-medium), var(--ink-soft));
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out);
  cursor: pointer;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.locker__card:active {
  transform: scale(0.97);
  border-color: var(--gold);
}

.locker__card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 100%; height: 100%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}

.locker__card:hover::after { opacity: 1; }

.locker__card-icon {
  font-size: 18px;
  margin-bottom: 8px;
}

.locker__card-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pearl-muted);
  margin-bottom: 4px;
}

.locker__card-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1;
  color: var(--pearl);
  letter-spacing: -0.02em;
}

.locker__card-meta {
  font-size: 11px;
  color: var(--pearl-muted);
  margin-top: 6px;
}

.locker__card-meta--positive { color: var(--accent-green); }
.locker__card-meta--negative { color: var(--accent-rose); }

.locker__card--full {
  grid-column: span 2;
}

.locker__card--gold {
  border-color: rgba(212, 175, 55, 0.25);
}
.locker__card--gold .locker__card-value { color: var(--gold); }

/* === BUTTON === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
  width: 100%;
}

.btn--primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: var(--ink-deep);
  box-shadow: 0 4px 16px var(--gold-glow);
}

.btn--primary:active { transform: scale(0.98); box-shadow: 0 2px 8px var(--gold-glow); }

.btn--ghost {
  background: transparent;
  color: var(--pearl);
  border: 1px solid var(--ink-line);
}

.btn--ghost:active { background: var(--ink-soft); }

.btn--danger {
  background: transparent;
  color: var(--accent-rose);
  border: 1px solid rgba(199, 123, 123, 0.3);
}

/* === CHIP / TAG === */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  font-size: 12px;
  color: var(--pearl-dim);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.chip--active {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

/* === FORM === */
.field {
  margin-bottom: 20px;
}

.field__label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pearl-muted);
  margin-bottom: 10px;
}

.field__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-md);
  color: var(--pearl);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s var(--ease-out);
}

.field__input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.field__input::placeholder { color: var(--pearl-muted); }

/* === CHOICE GRID (Tap-tap selection) === */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.choice {
  padding: 14px 12px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--pearl);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  font-weight: 500;
}

.choice:active { transform: scale(0.97); }

.choice--active {
  background: var(--gold-glow);
  border-color: var(--gold);
  color: var(--gold);
}

.choice--icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 70px;
  justify-content: center;
}

.choice__icon {
  font-size: 22px;
}

.choice__label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* === LIST ROW === */
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--ink-medium);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
}

.list-row:active { background: var(--ink-soft); }

.list-row__avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-deep);
  flex-shrink: 0;
}

.list-row__body { flex: 1; min-width: 0; }
.list-row__title { font-size: 14px; color: var(--pearl); font-weight: 500; }
.list-row__meta { font-size: 11px; color: var(--pearl-muted); margin-top: 2px; letter-spacing: 0.04em; }

.list-row__action {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === PROGRESS BAR === */
.progress {
  height: 4px;
  background: var(--ink-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 8px 0;
}

.progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-soft));
  border-radius: var(--radius-pill);
  transition: width 0.6s var(--ease-out);
}

.progress__fill--success { background: var(--accent-green); }
.progress__fill--warn { background: var(--accent-amber); }
.progress__fill--danger { background: var(--accent-rose); }

/* === DIVIDER === */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink-line), transparent);
  margin: 24px 0;
}

.divider--gold {
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

/* === BOTTOM NAV === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--ink-line);
  padding: 12px 24px 24px;
  display: flex;
  justify-content: space-around;
  z-index: 50;
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--pearl-muted);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s;
}

.bottom-nav__item--active { color: var(--gold); }

.bottom-nav__icon { font-size: 18px; }

/* === FLOATING BACK === */
.back-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ink-line);
  position: sticky;
  top: 0;
  background: rgba(10, 14, 26, 0.92);
  backdrop-filter: blur(20px);
  z-index: 100;
}

.back-bar__arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pearl);
  cursor: pointer;
  transition: all 0.2s;
}

.back-bar__arrow:active { background: var(--gold-glow); border-color: var(--gold); }

.back-bar__title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
}

/* === ANIMATIONS === */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.6s var(--ease-out) both; }
.fade-up-d1 { animation: fadeUp 0.6s var(--ease-out) 0.08s both; }
.fade-up-d2 { animation: fadeUp 0.6s var(--ease-out) 0.16s both; }
.fade-up-d3 { animation: fadeUp 0.6s var(--ease-out) 0.24s both; }
.fade-up-d4 { animation: fadeUp 0.6s var(--ease-out) 0.32s both; }

/* === HEATMAP CELL === */
.heatmap {
  display: grid;
  grid-template-columns: auto repeat(5, 1fr);
  gap: 4px;
  font-size: 10px;
}

.heatmap__label {
  display: flex;
  align-items: center;
  color: var(--pearl-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.heatmap__cell {
  aspect-ratio: 1.4;
  border-radius: 4px;
  background: var(--ink-soft);
  border: 1px solid var(--ink-line);
}

.heatmap__cell.h1 { background: rgba(212, 175, 55, 0.15); }
.heatmap__cell.h2 { background: rgba(212, 175, 55, 0.30); }
.heatmap__cell.h3 { background: rgba(212, 175, 55, 0.55); }
.heatmap__cell.h4 { background: rgba(212, 175, 55, 0.85); }

/* === FLOOR PULSE === */
.floor-list { padding: 0 24px; }

.floor-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--ink-line);
}

.floor-row__num {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--gold);
  width: 32px;
  text-align: center;
}

.floor-row__body { flex: 1; }
.floor-row__name { font-size: 13px; color: var(--pearl); font-weight: 500; }
.floor-row__detail { font-size: 11px; color: var(--pearl-muted); margin-top: 2px; }

.floor-row__count {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--pearl);
  font-weight: 500;
}
