/* PominkiCare Mini App — Memorial Green Design System */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&family=Inter:wght@400;500;600&display=swap');

:root {
  --brand-primary: #2a7a63;
  --brand-primary-2: #3a9a7f;
  --brand-primary-light: #e6f5f0;
  --brand-teal: #1a6b56;
  --brand-amber: #d4a843;
  --brand-amber-light: #fdf6e3;
  --brand-cream: #f4f9f7;
  --brand-cream-2: #f9fcfb;
  --text-900: #1b211f;
  --text-700: #2d3748;
  --text-500: #6b7772;
  --text-400: #9ca3af;
  --surface: #ffffff;
  --surface-2: #f4f7f6;
  --surface-3: #e9f0ee;
  --border: #d4e0db;
  --border-light: #e6f0ec;
  --shadow-card: 0 4px 24px rgba(27, 33, 31, 0.06), 0 1px 4px rgba(27, 33, 31, 0.04);
  --shadow-card-hover: 0 12px 32px rgba(27, 33, 31, 0.10), 0 4px 12px rgba(27,33,31,0.06);
  --shadow-float: 0 16px 40px rgba(42,122,99,0.18), 0 4px 12px rgba(0,0,0,0.08);
  --shadow-nav: 0 -8px 32px rgba(27,33,31,0.08), 0 -1px 0 rgba(27,33,31,0.04);
  --radius-xl: 24px;
  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 12px;
  --radius-pill: 999px;
  --tg-theme-bg-color: var(--surface-2);
  --tg-theme-text-color: var(--text-900);
  --tg-theme-hint-color: var(--text-400);
  --tg-theme-button-color: var(--brand-primary);
  --tg-theme-button-text-color: #FFFFFF;
  --tg-theme-secondary-bg-color: var(--surface-3);
}
:root[data-theme="dark"] {
  --text-900: #f0f4f2;
  --text-700: #e2e8f0;
  --text-500: #94a3b8;
  --text-400: #64748b;
  --surface: #1a1f1d;
  --surface-2: #121514;
  --surface-3: #222826;
  --border: #2a3230;
  --border-light: #2e3634;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-card-hover: 0 12px 32px rgba(0,0,0,0.4);
  --brand-cream: #1a1f1d;
  --brand-cream-2: #222826;
}

* { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; -webkit-text-size-adjust:100%; scroll-behavior:smooth; height:100%; }
html, body { height:100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--surface-2);
  color: var(--text-900);
  line-height: 1.5;
  min-height:100vh; min-height:100dvh; height:100dvh;
  -webkit-font-smoothing: antialiased; overscroll-behavior:none;
}
#app { display:flex; flex-direction:column; height:100dvh; min-height:100dvh; max-height:100dvh; overflow:hidden; }

/* Topbar */
.topbar {
  position:sticky; top:0; z-index:110;
  background: var(--surface);
  border-bottom:1px solid var(--border);
  box-shadow: 0 1px 12px rgba(27,33,31,0.06);
}
.topbar-inner {
  max-width:1280px; margin:0 auto;
  display:flex; align-items:center; gap:16px;
  height:64px; padding:0 16px;
}
.topbar-left { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.logo {
  width:42px; height:42px; border-radius:14px;
  background: linear-gradient(135deg, #2a7a63, #1a6b56);
  display:flex; align-items:center; justify-content:center;
  font-size:22px; box-shadow: 0 4px 12px rgba(42,122,99,0.25);
}
.brand { display:flex; flex-direction:column; line-height:1; gap:6px; }
.brand-title { font-family:'Manrope',sans-serif; font-size:19px; font-weight:800; letter-spacing:-0.03em; color: var(--text-900); }
.brand-sub { font-size:11px; font-weight:700; letter-spacing:0.14em; text-transform:uppercase; color: var(--brand-primary); margin-top:2px; }
.topbar-right { display:flex; align-items:center; gap:10px; flex-shrink:0; margin-left:auto; }
.topbar-action {
  display:none; align-items:center; gap:8px; padding:10px 16px;
  background: linear-gradient(135deg, #2a7a63 0%, #3a9a7f 100%); color:white; border:none; border-radius:12px;
  font-size:13px; font-weight:700; cursor:pointer; box-shadow: 0 6px 16px rgba(42,122,99,0.25); transition: all 0.2s ease;
}
@media(min-width:900px){ .topbar-action{display:inline-flex} }
.topbar-action:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(42,122,99,0.32); }
.topbar-action-icon { width:20px; height:20px; background: rgba(255,255,255,0.22); border-radius:999px; display:flex; align-items:center; justify-content:center; font-size:14px; }
.topbar .icon-btn { background: var(--surface-3); border:1px solid var(--border); color: var(--text-700); width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition: all 0.2s ease; }
.topbar .icon-btn:hover { background: var(--surface); border-color: var(--brand-primary); color: var(--brand-primary); }
.icon-btn {
  width:44px; height:44px; border-radius:14px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(8px);
  border:1.5px solid rgba(255,255,255,0.25);
  color:white; display:flex; align-items:center; justify-content:center;
  cursor:pointer; transition: all 0.2s ease; position:relative;
}
.topbar-cats {
  max-width:1280px; margin:0 auto; padding:10px 16px 12px;
  display:flex; gap:8px; overflow-x:auto; scrollbar-width:none; border-top:1px solid var(--border);
}
.topbar-cats::-webkit-scrollbar{display:none}
.cat-pill {
  display:inline-flex; align-items:center; gap:6px; padding:8px 14px;
  background: var(--surface-3); border:1px solid var(--border); border-radius:999px;
  font-size:13px; font-weight:600; color: var(--text-700); white-space:nowrap; cursor:pointer; transition: all 0.2s ease;
}
.cat-pill:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--surface); }
.cat-pill.active { background: var(--text-900); color:white; border-color: var(--text-900); box-shadow: 0 4px 12px rgba(27,33,31,0.18); }

/* Layout */
.layout {
  max-width:1280px; margin:0 auto; width:100%;
  display:flex; gap:20px; padding:16px;
  align-items: flex-start;
  flex:1; min-height:0; overflow:visible;
}
.main { flex:1; min-height:0; overflow-y:auto; overflow-x:hidden; padding-bottom:180px; scrollbar-width:thin; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; touch-action: pan-y; }
.tab-content { padding:16px; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from{opacity:0; transform:translateY(8px)} to{opacity:1; transform:translateY(0)} }
.content-head { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:14px; }
.content-head h2 { font-family:'Manrope',sans-serif; font-size:22px; font-weight:800; letter-spacing:-0.02em; }
.orders-list { display:flex; flex-direction:column; gap:14px; }

/* Loading & Empty */
.loading { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px; gap:14px; color: var(--text-400); }
.spinner { width:30px; height:30px; border:3px solid var(--border); border-top-color: var(--brand-primary); border-radius:50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to{transform:rotate(360deg)} }
.empty-state {
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:48px 24px; text-align:center; gap:14px;
  background: var(--surface); border:1.5px dashed var(--border); border-radius: var(--radius-l);
}
.empty-illust {
  width:84px; height:84px; border-radius:24px;
  background: linear-gradient(135deg, #e6f5f0 0%, #d4e8e0 100%);
  border:1.5px solid var(--border-light);
  display:flex; align-items:center; justify-content:center; font-size:42px;
  box-shadow: 0 8px 24px rgba(42,122,99,0.12);
}
.empty-state h3 { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; color: var(--text-900); }
.empty-state p { font-size:14px; color: var(--text-500); max-width:300px; line-height:1.5; }

/* Buttons */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:13px 18px; border:none; border-radius: var(--radius-s);
  font-size:14px; font-weight:700; cursor:pointer; transition: all 0.2s ease;
  text-decoration:none; white-space:nowrap; letter-spacing:-0.01em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: linear-gradient(135deg, #2a7a63 0%, #3a9a7f 100%);
  color:white; box-shadow: 0 8px 20px rgba(42,122,99,0.28), 0 2px 6px rgba(42,122,99,0.2);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(42,122,99,0.32); filter: brightness(1.03); }
.btn-secondary { background: var(--surface); border:1.5px solid var(--border); color: var(--text-700); box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.btn-secondary:hover { border-color: var(--brand-primary); color: var(--brand-primary); background: var(--brand-primary-light); }
.btn-ghost { background: transparent; color: var(--text-500); }
.btn-danger { background: #c0392b; color:white; box-shadow: 0 6px 16px rgba(192,57,43,0.25); }
.btn.small { padding:9px 14px; font-size:13px; border-radius:10px; }

/* FAB */
.fab {
  position:fixed; bottom:88px; right:16px;
  display:flex; align-items:center; gap:10px;
  padding:14px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #2a7a63 0%, #3a9a7f 100%);
  color:white; border:none;
  box-shadow: var(--shadow-float);
  cursor:pointer; transition: all 0.25s ease; z-index:1000;
  font-family:'Manrope',sans-serif; font-size:14px; font-weight:800; letter-spacing:-0.01em;
}
.fab:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 20px 40px rgba(42,122,99,0.3); }
.fab:active { transform: scale(0.97); }
.fab.hidden { opacity:0; pointer-events:none; transform: translateY(12px) scale(0.9); }
.fab .fab-icon { width:22px; height:22px; display:flex; align-items:center; justify-content:center; background: rgba(255,255,255,0.22); border-radius:999px; }

/* Bottom nav */
.bottom-nav {
  position:fixed; bottom:12px; left:12px; right:12px;
  display:flex; align-items:center; justify-content:space-around;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(16px) saturate(180%);
  border:1px solid rgba(255,255,255,0.8); border-radius: 22px;
  padding:6px; box-shadow: var(--shadow-nav);
  z-index:1000;
}
:root[data-theme="dark"] .bottom-nav { background: rgba(26,31,29,0.92); border-color: rgba(255,255,255,0.08); }
.nav-item {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
  padding:8px 6px; border-radius:16px; background:transparent; border:none;
  color: var(--text-400); cursor:pointer; transition: all 0.2s ease; position:relative;
}
.nav-item:hover { color: var(--text-700); }
.nav-item.active { color: var(--brand-primary); background: var(--brand-primary-light); }
:root[data-theme="dark"] .nav-item.active { background: rgba(42,122,99,0.15); }
.nav-item .nav-icon {
  width:28px; height:28px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  transition: all 0.2s ease;
}
.nav-item.active .nav-icon { background: var(--brand-primary); color:white; box-shadow: 0 4px 12px rgba(42,122,99,0.3); }
.nav-item.active .nav-icon svg { stroke:white; }
.nav-item span { font-size:10.5px; font-weight:700; letter-spacing:0.02em; }

/* Order Card */
.order-card {
  background: var(--surface);
  border-radius: var(--radius-l);
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  cursor:pointer;
}
.order-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card-hover); border-color: var(--border-light); }
.order-image {
  width:100%; aspect-ratio: 16/10; position:relative; overflow:hidden;
  background: linear-gradient(135deg, #e6f5f0 0%, #d4e8e0 100%);
  display:flex; align-items:center; justify-content:center;
}
.order-image .img-emoji { font-size:64px; filter: drop-shadow(0 8px 16px rgba(0,0,0,0.08)); }
.order-image img { width:100%; height:100%; object-fit:cover; }
.badge-row { position:absolute; top:12px; left:12px; right:12px; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; z-index:2; }
.badge-left, .badge-right { display:flex; gap:6px; flex-wrap:wrap; }
.pill {
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px; border-radius:999px;
  font-size:11px; font-weight:800; letter-spacing:0.04em; text-transform:uppercase;
  backdrop-filter: blur(8px); border:1px solid rgba(255,255,255,0.5);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.pill-status-open { background: var(--brand-primary); color:white; }
.pill-status-accepted { background: #3498db; color:white; }
.pill-status-reported { background: #f39c12; color:white; }
.pill-status-done { background: #27ae60; color:white; }
.pill-status-cancelled { background: #95a5a6; color:white; }
.pill-status-disputed { background: #e74c3c; color:white; }
.pill-distance { background: rgba(42,122,99,0.9); color:white; }
.pill-service { background: rgba(255,255,255,0.92); color: var(--text-700); }

.order-content { padding:14px 16px 16px; }
.order-header { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:10px; }
.order-type { display:flex; align-items:center; gap:8px; font-size:12px; font-weight:700; letter-spacing:0.05em; text-transform:uppercase; color: var(--text-400); }
.order-title { font-family:'Manrope',sans-serif; font-size:17px; font-weight:800; letter-spacing:-0.02em; color: var(--text-900); line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:6px; }
.order-location { font-size:13px; color: var(--text-500); display:flex; align-items:center; gap:6px; margin-bottom:8px; }
.order-location svg { width:14px; height:14px; color: var(--text-400); flex-shrink:0; }
.order-footer { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; padding-top:12px; border-top:1px solid var(--border); }
.order-price { display:inline-flex; align-items:center; gap:7px; padding:8px 12px; background: var(--brand-amber-light); border:1px solid #e8d8a0; border-radius:999px; font-size:12.5px; font-weight:700; color: #8a5a00; }
.order-actions { display:flex; align-items:center; gap:8px; }

/* Modal */
.modal-overlay {
  position:fixed; inset:0; background: rgba(27,33,31,0.45); backdrop-filter: blur(12px) saturate(140%);
  z-index:2000; display:flex; align-items:flex-end; justify-content:center; padding:0; animation: fadeIn 0.2s ease;
}
.modal {
  width:100%; max-width:520px; max-height:82vh; background: var(--surface);
  border-radius: 24px 24px 0 0; overflow:hidden; display:flex; flex-direction:column;
  box-shadow: 0 -16px 48px rgba(0,0,0,0.18); animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1);
  border:1px solid var(--border);
  margin-bottom: 84px;
}
.modal::before { content:''; width:40px; height:4px; background: var(--border); border-radius:999px; margin:10px auto 0; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:18px 20px 14px; border-bottom:1px solid var(--border); position:sticky; top:0; background: var(--surface); z-index:1; }
.modal-header h2 { font-family:'Manrope',sans-serif; font-size:18px; font-weight:800; letter-spacing:-0.02em; }
.modal-close { width:36px; height:36px; border-radius:12px; background: var(--surface-3); border:1px solid var(--border); color: var(--text-700); display:flex; align-items:center; justify-content:center; cursor:pointer; transition: all 0.2s ease; }
.modal-close:hover { background: var(--surface); border-color: var(--text-400); }
.modal-body { padding:20px; overflow-y:auto; flex:1; }
.modal-footer { display:flex; gap:12px; padding:16px 20px; border-top:1px solid var(--border); background: var(--surface-2); position:sticky; bottom:0; }
.modal-footer .btn { flex:1; }

/* Forms */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:12px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color: var(--text-500); margin-bottom:8px; }
.form-group input, .form-group select, .form-group textarea {
  width:100%; padding:13px 14px; background: var(--surface); border:1.5px solid var(--border);
  border-radius: var(--radius-s); font-size:15px; font-weight:500; color: var(--text-900); font-family:inherit;
  transition: all 0.2s ease; box-shadow: 0 1px 4px rgba(0,0,0,0.02);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline:none; border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(42,122,99,0.12), 0 4px 12px rgba(0,0,0,0.06); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }

/* Toast */
.toast-container { position:fixed; bottom:100px; left:16px; right:16px; max-width:420px; margin:0 auto; z-index:300; display:flex; flex-direction:column; gap:10px; pointer-events:none; }
.toast {
  display:flex; align-items:center; gap:12px; padding:14px 16px;
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 4px 12px rgba(0,0,0,0.08);
  animation: slideInToast 0.35s cubic-bezier(0.16,1,0.3,1); pointer-events:auto;
}
@keyframes slideInToast { from{opacity:0; transform:translateY(16px) scale(0.98)} to{opacity:1; transform:translateY(0) scale(1)} }
.toast.success { border-left:4px solid #27ae60; }
.toast.error { border-left:4px solid #c0392b; }
.toast.warning { border-left:4px solid #d4a843; }
.toast-message { flex:1; font-size:13.5px; font-weight:600; color: var(--text-700); line-height:1.4; }
.toast-close { width:30px; height:30px; border-radius:10px; background: var(--surface-3); border:1px solid var(--border); color: var(--text-400); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; }

/* Footer */
.site-footer {
  margin-top:24px; padding:18px 0 8px; border-top:1px solid var(--border);
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px;
  font-size:12.5px; color: var(--text-400);
}

/* Responsive */
@media (max-width: 900px) {
  .topbar-inner { height:auto; min-height:56px; flex-wrap:wrap; padding:8px 16px; gap:10px; }
  .topbar-left { flex:1; }
  .topbar { height:auto; }
  .topbar-cats { padding:10px 16px 12px; }
  .layout { flex-direction:column; padding:12px; gap:12px; }
  .listings-grid { grid-template-columns:1fr; }
  .content-head { flex-direction:column; align-items:stretch; }
}
@media (min-width: 901px) {
  .main { padding-bottom:100px; }
  .fab { bottom:24px; }
  .orders-list { display:grid; grid-template-columns: repeat(2, 1fr); gap:16px; }
}
@media (min-width: 1100px) {
  .orders-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width:480px) { .modal { border-radius:24px 24px 0 0; } .fab { bottom:88px; right:14px; padding:14px 16px; } }

/* Website vs Mini App scroll fix */
html.is-website #app { height:auto; min-height:100vh; max-height:none; overflow:visible; }
html.is-website body { height:auto; min-height:100vh; overflow:auto; -webkit-overflow-scrolling:touch; }
html.is-website .layout { overflow:visible; flex:none; min-height:auto; }
html.is-website .main { flex:none; min-height:auto; overflow:visible; height:auto; max-height:none; padding-bottom:100px; }

/* Map */
.map-container { width:100%; height:400px; border-radius: var(--radius-l); overflow:hidden; border:1px solid var(--border); box-shadow: var(--shadow-card); }
@media(max-width:600px) { .map-container { height:320px; } }

/* Feed Controls */
.feed-controls { display:flex; gap:10px; margin-bottom:14px; align-items:center; }
.search-box {
  flex:1; display:flex; align-items:center; gap:8px; padding:10px 14px;
  background: var(--surface); border:1.5px solid var(--border); border-radius: var(--radius-s);
  transition: all 0.2s ease;
}
.search-box:focus-within { border-color: var(--brand-primary); box-shadow: 0 0 0 4px rgba(42,122,99,0.12); }
.search-box svg { color: var(--text-400); flex-shrink:0; }
.search-box input { border:none; outline:none; background:none; font-size:14px; color: var(--text-900); width:100%; font-family:inherit; }
.search-box input::placeholder { color: var(--text-400); }
.sort-select {
  padding:10px 14px; background: var(--surface); border:1.5px solid var(--border);
  border-radius: var(--radius-s); font-size:13px; font-weight:600; color: var(--text-700);
  cursor:pointer; appearance:auto; min-width:140px;
}
@media(max-width:600px) { .feed-controls { flex-direction:column; } .sort-select { width:100%; } }

/* Status Tracker */
.status-tracker { display:flex; align-items:center; gap:0; padding:12px 0; }
.tracker-step { display:flex; flex-direction:column; align-items:center; gap:4px; flex-shrink:0; }
.tracker-dot {
  width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:14px; background: var(--surface-3); border:2px solid var(--border); transition: all 0.3s;
}
.tracker-step.done .tracker-dot { background: #27ae60; border-color: #27ae60; color:white; font-size:12px; }
.tracker-step.active .tracker-dot { background: var(--brand-primary); border-color: var(--brand-primary); color:white; box-shadow: 0 4px 12px rgba(42,122,99,0.3); }
.tracker-label { font-size:10px; font-weight:600; color: var(--text-400); }
.tracker-step.done .tracker-label, .tracker-step.active .tracker-label { color: var(--text-700); }
.tracker-line { flex:1; height:2px; background: var(--border); margin:0 -4px; margin-bottom:16px; }
.tracker-step.done ~ .tracker-line { background: #27ae60; }

/* Photo Scroll */
.photo-scroll { display:flex; gap:8px; overflow-x:auto; padding:4px 0; scrollbar-width:none; }
.photo-scroll::-webkit-scrollbar { display:none; }
