/* ═══════════════════════════════════════════════
   ROMAN OS — Shared Stylesheet
   ═══════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f2f6f4;
  color: #1a2822;
  min-height: 100vh;
}

/* ── DESIGN TOKENS ──────────────────────────────
  --bg:          #f2f6f4
  --green:       #0F6E56
  --green-light: #e6f4ef
  --border:      #d8e8e2
  --text:        #1a2822
  --muted:       #6a8a78
  --white:       #ffffff
──────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════
   NAV MENU
   ═══════════════════════════════════════════════ */

/* Hamburger trigger */
.nav-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 400;
  width: 40px;
  height: 40px;
  background: #fff;
  border: 1px solid #d8e8e2;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.15s;
}
.nav-toggle:hover { box-shadow: 0 4px 14px rgba(15,110,86,0.2); }
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #1a2822;
  border-radius: 2px;
}

/* Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 22, 0.45);
  z-index: 450;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}
.nav-overlay.open { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Slide-in panel */
.nav-panel {
  position: fixed;
  top: 0;
  left: -280px;
  width: 260px;
  height: 100vh;
  background: #fff;
  z-index: 500;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}
.nav-panel.open { left: 0; }

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid #e8f0ec;
}
.nav-brand { font-size: 15px; font-weight: 800; color: #0F6E56; letter-spacing: -0.3px; }
.nav-close {
  width: 30px;
  height: 30px;
  border: none;
  background: #f2f6f4;
  border-radius: 7px;
  font-size: 16px;
  cursor: pointer;
  color: #6a8a78;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.nav-close:hover { background: #e0ece8; color: #1a2822; }

.nav-items { display: flex; flex-direction: column; padding: 12px 10px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  text-decoration: none;
  color: #1a2822;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: #f2f6f4; color: #0F6E56; }
.nav-item.active { background: #e6f4ef; color: #0F6E56; font-weight: 700; }
.nav-item .nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }

.nav-footer {
  padding: 16px 20px;
  border-top: 1px solid #e8f0ec;
  font-size: 10px;
  color: #aac4b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════
   PAGE WRAPPER & HEADER
   ═══════════════════════════════════════════════ */

.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.page-header {
  margin-bottom: 28px;
  padding-right: 56px;
}
.page-header .app-name {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #0F6E56;
  margin-bottom: 6px;
}
.page-header h1 {
  font-size: 26px;
  font-weight: 800;
  color: #1a2822;
  letter-spacing: -0.5px;
  line-height: 1.15;
}
.page-header .page-sub {
  font-size: 13px;
  color: #6a8a78;
  margin-top: 5px;
}

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */

.card {
  background: #fff;
  border: 1px solid #d8e8e2;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.card + .card { margin-top: 14px; }
.card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #6a8a78;
  margin-bottom: 18px;
}

/* ═══════════════════════════════════════════════
   FORM INPUTS
   ═══════════════════════════════════════════════ */

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #1a2822;
  margin-bottom: 8px;
}
.field label .label-hint {
  font-weight: 400;
  color: #6a8a78;
  font-size: 12px;
  margin-left: 4px;
}

.field input[type="number"],
.field input[type="text"],
.field textarea {
  width: 100%;
  padding: 10px 14px;
  background: #f8faf9;
  border: 1px solid #d8e8e2;
  border-radius: 8px;
  font-size: 14px;
  color: #1a2822;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.field input[type="number"]:focus,
.field input[type="text"]:focus,
.field textarea:focus {
  border-color: #0F6E56;
  background: #fff;
}
.field input::placeholder,
.field textarea::placeholder { color: #aac4b8; }
.field textarea { resize: vertical; min-height: 80px; }
.field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button { opacity: 0; }

/* Sub-field revealed conditionally */
.sub-field {
  margin-top: 10px;
  padding: 14px;
  background: #f8faf9;
  border: 1px solid #e0ece8;
  border-radius: 8px;
}
.sub-field label { font-size: 12px; color: #6a8a78; font-weight: 500; margin-bottom: 6px; }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: all 0.15s;
}
.btn-primary {
  background: #0F6E56;
  color: #fff;
  width: 100%;
  padding: 13px;
  font-size: 15px;
}
.btn-primary:hover { background: #0d5e4a; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: #1a2822;
  border: 1px solid #d8e8e2;
}
.btn-secondary:hover { border-color: #0F6E56; color: #0F6E56; }

/* ═══════════════════════════════════════════════
   TOGGLE BUTTONS (Yes / No)
   ═══════════════════════════════════════════════ */

.toggle-row { display: flex; gap: 8px; }
.toggle-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid #d8e8e2;
  background: #f8faf9;
  color: #6a8a78;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.toggle-btn:hover { border-color: #b0ccbf; color: #1a2822; }
.toggle-btn.yes { border-color: #0F6E56; color: #0F6E56; background: #e6f4ef; }
.toggle-btn.no  { border-color: #f0c0b8; color: #b04040; background: #fff4f2; }

/* ═══════════════════════════════════════════════
   EMOJI MOOD SELECTOR
   ═══════════════════════════════════════════════ */

.mood-row { display: flex; gap: 8px; }
.mood-btn {
  flex: 1;
  padding: 10px 6px;
  font-size: 22px;
  border-radius: 8px;
  border: 1px solid #d8e8e2;
  background: #f8faf9;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1;
}
.mood-btn:hover { border-color: #b0ccbf; background: #f2f6f4; }
.mood-btn.selected { border-color: #0F6E56; background: #e6f4ef; }

/* ═══════════════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════════════ */

.prog-track {
  background: #e0ece8;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.prog-fill {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #0F6E56, #2dd4a0);
  transition: width 0.6s ease;
}

/* ═══════════════════════════════════════════════
   STAT CARDS
   ═══════════════════════════════════════════════ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media(max-width:560px){ .stat-grid { grid-template-columns: repeat(2,1fr); } }

.stat-card {
  background: #fff;
  border: 1px solid #d8e8e2;
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.stat-card .stat-val {
  font-size: 22px;
  font-weight: 800;
  color: #0F6E56;
  line-height: 1;
}
.stat-card .stat-label {
  font-size: 10px;
  font-weight: 600;
  color: #7a9a8a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}
.stat-card .stat-sub {
  font-size: 9px;
  color: #aac4b8;
  margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   SUCCESS BANNER
   ═══════════════════════════════════════════════ */

.success-banner {
  position: fixed;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  background: #0F6E56;
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  z-index: 999;
  box-shadow: 0 6px 24px rgba(15,110,86,0.35);
  transition: top 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.success-banner.show { top: 20px; }

/* ═══════════════════════════════════════════════
   ALREADY-LOGGED NOTICE
   ═══════════════════════════════════════════════ */

.already-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #e6f4ef;
  border: 1px solid #a8d8c8;
  border-radius: 10px;
  font-size: 13px;
  color: #0F6E56;
  font-weight: 500;
  margin-bottom: 16px;
}
.already-notice .notice-icon { font-size: 18px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   UTILITY
   ═══════════════════════════════════════════════ */

.hidden { display: none !important; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.divider { border: none; border-top: 1px solid #e8f0ec; margin: 20px 0; }

/* ═══════════════════════════════════════════════
   FINANCIAL ADVISOR — floating widget (Financial dashbord)
   ═══════════════════════════════════════════════ */

.fa-widget-fab {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 600;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: #0F6E56;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(15, 110, 86, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fa-widget-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(15, 110, 86, 0.5);
}
.fa-widget-fab.open {
  transform: scale(0.92);
}

.fa-widget-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  z-index: 590;
  width: min(380px, calc(100vw - 32px));
  max-height: min(520px, 70vh);
  background: #fff;
  border: 1px solid #d8e8e2;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.fa-widget-panel.open {
  display: flex;
  animation: faWidgetIn 0.22s ease;
}
@keyframes faWidgetIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fa-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8faf9;
  border-bottom: 1px solid #e8f0ec;
}
.fa-widget-title {
  font-size: 14px;
  font-weight: 800;
  color: #1a2822;
}
.fa-widget-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #fff;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  color: #6a8a78;
  cursor: pointer;
}
.fa-widget-close:hover {
  background: #e6f4ef;
  color: #0F6E56;
}

.fa-widget-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a2822;
  min-height: 120px;
  max-height: 340px;
}
.fa-widget-msg {
  margin-bottom: 12px;
}
.fa-widget-msg-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aac4b8;
  margin-bottom: 4px;
}
.fa-widget-msg.user .fa-widget-msg-label {
  color: #0F6E56;
}
.fa-widget-msg-bubble {
  padding: 8px 11px;
  border-radius: 10px;
  background: #f2f6f4;
}
.fa-widget-msg.user .fa-widget-msg-bubble {
  background: #e6f4ef;
  color: #1a2822;
}
.fa-widget-msg-bubble p {
  margin: 0 0 6px;
}
.fa-widget-msg-bubble p:last-child {
  margin-bottom: 0;
}
.fa-widget-typing {
  font-style: italic;
  color: #6a8a78;
}

.fa-widget-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e8f0ec;
  background: #fff;
}
.fa-widget-input-row textarea {
  flex: 1;
  min-height: 40px;
  max-height: 100px;
  padding: 9px 11px;
  border: 1px solid #d8e8e2;
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.fa-widget-input-row textarea:focus {
  outline: none;
  border-color: #0F6E56;
}
.fa-widget-input-row button {
  padding: 9px 14px;
  background: #0F6E56;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  align-self: flex-end;
}
.fa-widget-input-row button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.fa-widget-input-row button.fa-widget-cam-btn {
  padding: 9px 10px;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  flex-shrink: 0;
  align-self: flex-end;
}
.fa-widget-meal-preview {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #e8f0ec;
  background: #f8fbf9;
}
.fa-widget-meal-preview.open {
  display: flex;
}
.fa-widget-meal-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8e8e2;
}
.fa-widget-meal-preview-cancel {
  margin-left: auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #e8f0ec;
  color: #333;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.fa-widget-meal-preview-cancel:hover {
  background: #dde8e4;
}
