/* ═══════════════════════════════════════════════════════════════════════
   DASHBOARD — Shared between admin and client panels
   Mobile-first; desktop styles layered on top via @media (min-width: …)
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --gold: #C9A84C;
  --gold-light: #F5E6B8;
  --gold-dark: #8B6914;
  --ink: #1A1208;
  --ink-light: #4A3F2F;
  --paper: #FDFAF4;
  --cream: #F5EDD8;
  --green: #1D7A4E;
  --green-light: #E8F5EE;
  --red: #B83030;
  --red-light: #FBE8E8;
  --bg: #F0EBE0;
  --surface: #FFFFFF;
  --border: #E8DFC8;
  --shadow: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-sm: 0 2px 12px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; }

img { max-width: 100%; height: auto; }

.brand-font { font-family: 'Playfair Display', serif; }

/* ── Subscription banner (top-of-page strip on client pages) ─────────── */
.sub-banner {
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: #1A1208;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  line-height: 1.4;
}
.sub-banner a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  margin-left: 4px;
  white-space: nowrap;
}
.sub-banner-info   { background: #E8F0FE; color: #1967D2; }
.sub-banner-warn   { background: #FFF8E0; color: #8B6914; }
.sub-banner-danger { background: #FBE8E8; color: #B83030; }

/* ════════════════════════════════════════════════════════════════════
   LOGIN / REGISTER PAGES
   ════════════════════════════════════════════════════════════════════ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(201,168,76,0.10) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(201,168,76,0.08) 0%, transparent 50%);
}

.login-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201,168,76,0.15);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 18px; right: 18px;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-dark));
  border-radius: 0 0 4px 4px;
}

.login-logo {
  text-align: center;
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.login-sub {
  text-align: center;
  font-size: 12px;
  color: var(--ink-light);
  margin-bottom: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-form .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
  display: block;
}

.login-form .form-control {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px; /* 16px to prevent mobile-Safari zoom-on-focus */
  background: #FDFAF4;
  margin-bottom: 14px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form .form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.12);
  outline: none;
}

.btn-login {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: var(--ink);
  color: var(--gold);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.btn-login:hover { background: #333; transform: translateY(-1px); }

.demo-creds {
  margin-top: 16px;
  padding: 10px 12px;
  background: var(--cream);
  border-radius: 10px;
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.5;
  word-wrap: break-word;
}

@media (min-width: 480px) {
  .login-card { padding: 40px 36px; border-radius: 24px; }
  .login-logo { font-size: 32px; }
  .login-sub  { font-size: 13px; }
}

/* ════════════════════════════════════════════════════════════════════
   TOP NAVBAR — collapses to hamburger under 900px
   ════════════════════════════════════════════════════════════════════ */
.dash-topbar {
  background: var(--ink);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  gap: 10px;
  flex-wrap: nowrap;
}

/* Push the user/hamburger group to the right (works at all breakpoints) */
.dash-user { margin-left: auto; }

.dash-logo {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  color: var(--gold);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
}
.dash-logo:hover { color: var(--gold); }
.dash-logo span:first-child { font-size: 18px; }

/* Hamburger */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.08);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}
.nav-toggle:hover { background: rgba(255,255,255,0.18); }
.nav-toggle .bar {
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.85);
  display: block;
  position: relative;
}
.nav-toggle .bar::before,
.nav-toggle .bar::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,0.85);
}
.nav-toggle .bar::before { top: -6px; }
.nav-toggle .bar::after  { top:  6px; }

.dash-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--ink);
  padding: 10px 14px 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.06);
}
.dash-nav.is-open { display: flex; }

.dash-nav a {
  color: rgba(255,255,255,0.78);
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
}
.dash-nav a:hover { background: rgba(255,255,255,0.08); color: white; }
.dash-nav a.active { background: var(--gold); color: var(--ink); font-weight: 600; }

.dash-user {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-user-name {
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.18); color: white; }

@media (min-width: 900px) {
  .dash-topbar { padding: 14px 28px; }
  .dash-logo { font-size: 19px; gap: 10px; }
  .dash-logo span:first-child { font-size: 22px; }
  .nav-toggle { display: none; }
  .dash-nav {
    display: flex;
    flex-direction: row;
    position: static;
    background: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
    gap: 4px;
    margin-left: auto;
  }
  .dash-nav a { padding: 8px 14px; font-size: 13px; }
  .dash-user-name { max-width: 220px; }
}

/* ════════════════════════════════════════════════════════════════════
   PAGE CONTAINER
   ════════════════════════════════════════════════════════════════════ */
.dash-body {
  padding: 18px 14px 60px;
  max-width: 1280px;
  margin: 0 auto;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.2;
}

.page-sub {
  font-size: 13.5px;
  color: var(--ink-light);
  margin-bottom: 22px;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .dash-body { padding: 28px; }
  .page-title { font-size: 28px; }
  .page-sub   { font-size: 14px; margin-bottom: 26px; }
}

/* ════════════════════════════════════════════════════════════════════
   STAT CARDS — 2 cols on mobile, auto-fit on tablet+
   ════════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,168,76,0.12);
  min-width: 0; /* allow text truncation if needed */
}

.stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.1;
  word-break: break-word;
}

.stat-lbl {
  font-size: 10.5px;
  color: var(--ink-light);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (min-width: 600px) {
  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
  }
  .stat-card { padding: 20px; border-radius: 16px; }
  .stat-num  { font-size: 30px; }
  .stat-lbl  { font-size: 11px; }
}

/* ════════════════════════════════════════════════════════════════════
   SURFACE CARDS
   ════════════════════════════════════════════════════════════════════ */
.surface {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,168,76,0.12);
  margin-bottom: 16px;
}

.surface-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

@media (min-width: 768px) {
  .surface { padding: 24px; border-radius: 16px; margin-bottom: 20px; }
  .surface-title { font-size: 20px; margin-bottom: 16px; }
}

/* ════════════════════════════════════════════════════════════════════
   BUTTONS — bigger tap targets on mobile
   ════════════════════════════════════════════════════════════════════ */
.btn-primary-gold,
.btn-primary-dark,
.btn-ghost-cream,
.btn-danger-soft {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.02em;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  min-height: 40px;
}

.btn-primary-gold { background: var(--gold);    color: var(--ink);     }
.btn-primary-gold:hover { background: #B8962A; }

.btn-primary-dark { background: var(--ink);     color: var(--gold);    }
.btn-primary-dark:hover { background: #333; color: var(--gold); }

.btn-ghost-cream  { background: var(--cream);   color: var(--ink-light); font-weight: 500; }
.btn-ghost-cream:hover { background: #EDE3C8; color: var(--ink); }

.btn-danger-soft  { background: var(--red-light); color: var(--red); font-weight: 500; }
.btn-danger-soft:hover { background: #F5CCCC; }

/* ════════════════════════════════════════════════════════════════════
   BUSINESS CARDS
   ════════════════════════════════════════════════════════════════════ */
.biz-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.biz-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(201,168,76,0.12);
  transition: box-shadow 0.2s, transform 0.2s;
}
.biz-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

.biz-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.biz-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.biz-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 2px;
  word-break: break-word;
}

.biz-card-cat {
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.biz-mini-stats {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.biz-mini {
  flex: 1;
  background: #F8F5EE;
  border-radius: 10px;
  padding: 9px 6px;
  text-align: center;
  min-width: 0;
}

.biz-mini-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-family: 'Playfair Display', serif;
}

.biz-mini-lbl {
  font-size: 9.5px;
  color: var(--ink-light);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.biz-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.biz-card-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 9px 6px;
  border-radius: 8px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.02em;
  min-height: 38px;
  white-space: nowrap;
}

@media (min-width: 600px) {
  .biz-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
  .biz-card { padding: 18px; border-radius: 18px; }
  .biz-mini-num { font-size: 18px; }
  .biz-mini-lbl { font-size: 10px; }
}

/* ════════════════════════════════════════════════════════════════════
   FEEDBACK LIST
   ════════════════════════════════════════════════════════════════════ */
.feedback-list { display: flex; flex-direction: column; gap: 12px; }

.feedback-item {
  background: var(--surface);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
  border-top: 1px solid rgba(201,168,76,0.10);
  border-right: 1px solid rgba(201,168,76,0.10);
  border-bottom: 1px solid rgba(201,168,76,0.10);
}

.feedback-item.status-open { border-left-color: var(--red); }
.feedback-item.status-in_progress { border-left-color: var(--gold); }
.feedback-item.status-resolved { border-left-color: var(--green); opacity: 0.85; }
.feedback-item.status-closed { border-left-color: #888; opacity: 0.7; }

.feedback-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.feedback-name { font-weight: 600; font-size: 14.5px; color: var(--ink); word-break: break-word; }
.feedback-meta { font-size: 12px; color: var(--ink-light); margin-top: 2px; }

.feedback-msg {
  font-size: 13.5px;
  color: var(--ink-light);
  line-height: 1.6;
  padding: 10px 12px;
  background: #FAF7F0;
  border-radius: 10px;
  margin: 8px 0;
  word-break: break-word;
}

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

.fb-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}

@media (min-width: 600px) {
  .feedback-item { padding: 18px; }
  .feedback-msg { font-size: 14px; padding: 10px 14px; }
}

/* ════════════════════════════════════════════════════════════════════
   FILTERS
   ════════════════════════════════════════════════════════════════════ */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: stretch;
}

.filter-input, .filter-select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  min-height: 40px;
}
.filter-input:focus, .filter-select:focus { border-color: var(--gold); }
.filter-input  { flex: 1 1 100%; min-width: 160px; }
.filter-select { flex: 1 1 calc(50% - 4px); }

@media (min-width: 600px) {
  .filter-row { gap: 10px; margin-bottom: 18px; }
  .filter-input  { flex: 1 1 200px; min-width: 200px; font-size: 13px; padding: 9px 14px; min-height: 0; }
  .filter-select { flex: 0 1 auto; font-size: 13px; padding: 9px 14px; min-height: 0; }
}

/* Bootstrap forms — make them mobile-friendly */
.form-control, .form-select {
  font-size: 16px; /* prevent iOS zoom-on-focus */
  min-height: 42px;
}
@media (min-width: 600px) {
  .form-control, .form-select { font-size: 14px; min-height: 38px; }
}

/* ════════════════════════════════════════════════════════════════════
   TABLES — horizontal scroll on mobile, full table on desktop
   ════════════════════════════════════════════════════════════════════ */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
}
.table { font-size: 13px; }
.table th, .table td { white-space: nowrap; padding: 10px 8px; }

@media (min-width: 768px) {
  .table { font-size: 14px; }
  .table th, .table td { padding: 12px; white-space: normal; }
}

/* ════════════════════════════════════════════════════════════════════
   MODALS — full-width on mobile
   ════════════════════════════════════════════════════════════════════ */
.modal-content {
  border-radius: 18px !important;
  border: 1px solid rgba(201,168,76,0.15) !important;
}
.modal-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--ink);
}
@media (max-width: 575px) {
  .modal-dialog { margin: 8px; }
  .modal-body   { padding: 18px !important; }
  .modal-content { border-radius: 14px !important; }
}

/* ════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ════════════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--ink-light);
}
.empty-icon { font-size: 42px; margin-bottom: 12px; }
.empty-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
@media (min-width: 600px) {
  .empty-state { padding: 60px 20px; }
  .empty-icon  { font-size: 48px; margin-bottom: 14px; }
  .empty-title { font-size: 20px; }
}

/* ════════════════════════════════════════════════════════════════════
   QR DISPLAY
   ════════════════════════════════════════════════════════════════════ */
.qr-box {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  background: white;
  border: 3px solid var(--gold);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-url-display {
  font-size: 11px;
  word-break: break-all;
  color: var(--ink-light);
  background: #F8F5EE;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: left;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════════════
   PRINT
   ════════════════════════════════════════════════════════════════════ */
@media print {
  .dash-topbar, .sub-banner, .nav-toggle, .btn-logout,
  .filter-row, .biz-card-actions { display: none !important; }
  .dash-body { padding: 0; }
  .surface, .biz-card, .stat-card { box-shadow: none; border: 1px solid #ccc; }
}
