/* TuviServe owner portal: professional layer (loaded after tuviserve-theme.css).
   Light, quiet surfaces; icons for actions; phone-first reports. */
:root {
  --pp-ink: #0F172A;
  --pp-text: #334155;
  --pp-muted: #64748B;
  --pp-line: #E2E8F0;
  --pp-soft: #F8FAFC;
  --pp-brand: #0F766E;
  --pp-brand-soft: #E6F4F2;
  --pp-radius: 14px;
}

body { font-size: 15px; }
.min-w-0 { min-width: 0; }
.font-mono { font-family: 'Space Mono', ui-monospace, monospace; }
.badge.font-mono, .form-label.font-mono, .text-muted.font-mono { font-family: inherit !important; letter-spacing: .02em; }
.bg-darker { background: var(--pp-soft) !important; }

/* Calmer form fields */
.form-control, input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"], select, .form-select {
  font-weight: 500 !important;
  padding: 10px 12px !important;
  font-size: .93rem !important;
}
.form-control-sm, input.form-control-sm { padding: 6px 10px !important; font-size: .85rem !important; }
.form-label { font-size: .8rem !important; letter-spacing: 0 !important; color: var(--pp-text) !important; }
.input-group-text { padding: 0 12px !important; }

/* ---------- Icon buttons ---------- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: 0 0 auto;
  border-radius: 10px; border: 1px solid var(--pp-line); background: #fff;
  color: var(--pp-text); font-size: 1.05rem; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--pp-soft); border-color: #CBD5E1; color: var(--pp-ink); }
.icon-btn:focus-visible { outline: 3px solid rgba(15,118,110,.3); outline-offset: 1px; }
.icon-btn-danger { color: #B91C1C; }
.icon-btn-danger:hover { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }
.icon-btn-brand { background: var(--pp-brand); border-color: var(--pp-brand); color: #fff; }
.icon-btn-brand:hover { background: #115E59; color: #fff; }

/* ---------- Top bar ---------- */
.tuviserve-nav { padding-top: .6rem !important; padding-bottom: .6rem !important; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--pp-line); border-radius: 999px; font-size: .8rem; color: var(--pp-ink); background: #fff; }
.nav-user .small { font-size: .7rem; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--pp-brand-soft); color: var(--pp-brand); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Store header ---------- */
.store-hero { background: #fff; border-bottom: 1px solid var(--pp-line); padding: 18px 0 14px; }
.store-avatar { width: 52px; height: 52px; border-radius: 14px; background: var(--pp-brand-soft); color: var(--pp-brand); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; flex: 0 0 auto; }
.store-name { font-size: 1.55rem; font-weight: 800; color: var(--pp-ink); letter-spacing: -.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; color: var(--pp-text); background: var(--pp-soft) !important; border: 1px solid var(--pp-line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
#hdrHotelIdBadge, #hdrWsStatus { color: var(--pp-text) !important; }
.chip-success { color: #047857; background: #ECFDF5 !important; border-color: #A7F3D0; }
.chip .pulse-dot { width: 7px; height: 7px; box-shadow: none; }
.hero-meta { gap: 22px; padding: 10px 16px; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); background: var(--pp-soft); }
.hero-meta > div { display: flex; flex-direction: column; }
.meta-label { font-size: .7rem; color: var(--pp-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.meta-label .bi { margin-right: 3px; }
.meta-value { font-size: .88rem; font-weight: 700; color: var(--pp-ink); }
.store-subline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: .8rem; color: var(--pp-text); }
.store-subline .bi { margin-right: 3px; }

/* ---------- Tabs: segmented pills ---------- */
.portal-tabs { gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); flex-wrap: wrap; }
.portal-tabs .nav-link { display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: .88rem; color: var(--pp-muted); background: transparent; white-space: nowrap; }
.portal-tabs .nav-link .bi { font-size: 1rem; }
.portal-tabs .nav-link:hover { color: var(--pp-ink); background: var(--pp-soft); }
.portal-tabs .nav-link.active { color: var(--pp-brand); background: var(--pp-brand-soft); }

/* ---------- Cards / panels ---------- */
.portal-card { border-radius: var(--pp-radius); box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.portal-card:hover { box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.portal-card h3 { font-size: 1.3rem; }
.panel { background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); padding: 16px 18px; }
.panel-accent { border-left: 4px solid #F59E0B; background: #FFFBEB; }
.panel-accent .text-muted { color: #78716C !important; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: var(--pp-ink); font-size: .95rem; margin-bottom: 12px; }
.panel-head .bi { color: var(--pp-brand); margin-right: 6px; }
.section-title { font-size: 1.2rem; font-weight: 800; color: var(--pp-ink); letter-spacing: -.01em; }
.section-title .bi { color: var(--pp-brand); margin-right: 4px; }
.eyebrow { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--pp-brand); margin-bottom: 6px; }
.empty-state { color: var(--pp-muted); text-align: center; padding: 22px 8px; font-size: .9rem; }
.empty-state .bi { display: block; font-size: 1.8rem; opacity: .45; margin-bottom: 6px; }

/* Tags (replace shouty monospace badges) */
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.tag-green { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.tag-amber { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.tag-blue { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.tag-gray { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.tag-red { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }

/* Key / value lists */
.kv { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px 14px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--pp-muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--pp-ink); font-weight: 600; word-break: break-word; }
.kv dd span:empty::before { content: '—'; color: #CBD5E1; font-weight: 400; }

.steps { padding-left: 1.2rem; font-size: .9rem; line-height: 1.8; margin: 0; }
.pair-code { font-size: 2rem; font-weight: 700; color: #B45309; letter-spacing: .08em; }

/* ---------- Reports ---------- */
.reports-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 3px; background: #F1F5F9; border-radius: 11px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-size: .85rem; font-weight: 600; color: var(--pp-muted); border-radius: 8px; }
.seg button.active { background: #fff; color: var(--pp-ink); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.custom-range input { width: 145px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--pp-line); border-radius: var(--pp-radius); padding: 14px 16px; min-width: 0; }
.kpi-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.05rem; margin-bottom: 10px; }
.bg-brand-soft { background: var(--pp-brand-soft); color: var(--pp-brand); }
.bg-blue-soft { background: #EFF6FF; color: #1D4ED8; }
.bg-amber-soft { background: #FFFBEB; color: #B45309; }
.bg-red-soft { background: #FEF2F2; color: #B91C1C; }
.kpi-label { font-size: .78rem; color: var(--pp-muted); font-weight: 600; }
.kpi-value { font-size: 1.6rem; font-weight: 800; color: var(--pp-ink); letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .76rem; color: var(--pp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bar { height: 6px; background: #F1F5F9; border-radius: 99px; overflow: hidden; margin-top: 5px; }
.bar.thin { height: 4px; }
.bar > span { display: block; height: 100%; background: var(--pp-brand); border-radius: 99px; }
.split-row + .split-row { margin-top: 10px; }
.split-row { font-size: .88rem; }
.rank-row { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; font-size: .9rem; }
.rank-row + .rank-row { border-top: 1px solid #F1F5F9; }
.rank { width: 24px; height: 24px; border-radius: 7px; background: #F1F5F9; color: var(--pp-muted); font-size: .75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; margin-top: 1px; }
.rank-row:first-child .rank { background: var(--pp-brand-soft); color: var(--pp-brand); }

.trend-chart { min-height: 210px; }
.trend-chart .bars { display: flex; align-items: flex-end; gap: 6px; height: 210px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.col-bar { flex: 1 0 34px; max-width: 64px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.col-bar .b { width: 70%; min-height: 3px; background: linear-gradient(180deg, #14B8A6, var(--pp-brand)); border-radius: 6px 6px 2px 2px; }
.col-bar:hover .b { background: #115E59; }
.col-bar .v { font-size: .66rem; color: var(--pp-muted); white-space: nowrap; }
.col-bar .l { font-size: .7rem; color: var(--pp-text); white-space: nowrap; font-weight: 600; }

.spin { display: inline-block; animation: pp-spin .8s linear infinite; }
@keyframes pp-spin { to { transform: rotate(360deg); } }

.portal-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 2000; background: #0F172A; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .88rem; transition: opacity .2s, transform .2s; box-shadow: 0 8px 24px rgba(15,23,42,.25); }
.portal-toast.show { opacity: 1; transform: translate(-50%, 0); }
.portal-toast.error { background: #991B1B; }

/* ---------- Phones ---------- */
@media (max-width: 767.98px) {
  body { font-size: 14px; }
  .container-xl { padding-left: 14px; padding-right: 14px; }
  .store-hero { padding: 12px 0 10px; }
  .store-avatar { width: 42px; height: 42px; font-size: 1.2rem; border-radius: 12px; }
  .store-name { font-size: 1.2rem; }
  .store-subline { font-size: .74rem; gap: 2px 12px; }
  /* Tabs: one scrolling row stuck under the top bar */
  .portal-tabs { position: sticky; top: 58px; z-index: 900; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-radius: 12px; margin-left: -4px; margin-right: -4px; box-shadow: 0 4px 12px rgba(15,23,42,.06); }
  .portal-tabs::-webkit-scrollbar { display: none; }
  .portal-tabs .nav-link { padding: 7px 11px; font-size: .82rem; }
  #portalTabsContent { padding-bottom: 32px; }
  .portal-card { padding: 18px !important; }
  .portal-card h3 { font-size: 1.12rem; }
  .panel { padding: 14px; }
  .reports-toolbar { flex-direction: column; align-items: stretch; }
  .seg { display: flex; }
  .seg button { flex: 1; }
  .custom-range { display: flex; }
  .custom-range input { width: auto; flex: 1; min-width: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-icon { width: 30px; height: 30px; font-size: .95rem; margin-bottom: 8px; }
  .kpi-value { font-size: 1.3rem; }
  .trend-chart, .trend-chart .bars { height: 180px; min-height: 180px; }
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { font-size: .76rem; margin-top: 8px; }
  .pair-code { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .portal-toast { transition: none; } }

/* Legacy dark-theme text classes on the light portal */
.portal-card .text-light { color: var(--pp-ink) !important; }
.portal-card .bg-dark .text-light { color: #F8FAFC !important; }
.portal-card .border-secondary { border-color: var(--pp-line) !important; }
@media (max-width: 767.98px) {
  .reports-toolbar > .d-flex { width: 100%; }
  .reports-toolbar .seg { width: 100%; }
}
