/* SmartBiz theme - overrides on top of Bootstrap 5 */

:root {
  --sb-ink: #1B1F23;
  --sb-paper: #F7F5F1;
  --sb-primary: #2B5D52;      /* deep teal-green: calm, trustworthy, "open for business" */
  --sb-primary-dark: #1E433B;
  --sb-accent: #D97B4F;       /* warm terracotta accent for actions/highlights */
  --sb-line: #E2DED5;
  --sb-muted: #6B6256;
  --sb-success: #2B5D52;
  --sb-danger: #B3503F;
  --sb-warning: #C28A2E;

  --bs-primary: var(--sb-primary);
  --bs-primary-rgb: 43,93,82;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --bs-body-bg: var(--sb-paper);
  --bs-body-color: var(--sb-ink);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap');

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--sb-paper);
  color: var(--sb-ink);
}

h1, h2, h3, .brand-font {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Top nav ---------- */
.sb-topbar {
  background: var(--sb-primary-dark);
  color: #fff;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-topbar .brand {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  letter-spacing: -.01em;
}
.sb-topbar .brand span { color: #E7B98F; }
.sb-topbar .nav-link { color: rgba(255,255,255,.82); }
.sb-topbar .nav-link:hover { color: #fff; }

/* ---------- Sidebar ---------- */
.sb-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: .25rem .5rem;
  margin-right: .5rem;
}
.sb-sidebar {
  background: #fff;
  border-right: 1px solid var(--sb-line);
  min-height: calc(100vh - 60px);
  padding-top: 1rem;
}
.sb-sidebar a {
  display: block;
  padding: .6rem 1.25rem;
  color: var(--sb-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: .92rem;
  border-left: 3px solid transparent;
}
.sb-sidebar a:hover { background: #F1EFEA; color: var(--sb-ink); }
.sb-sidebar a.active {
  background: #EFF4F2;
  color: var(--sb-primary-dark);
  border-left-color: var(--sb-accent);
  font-weight: 600;
}
.sb-sidebar .section-label {
  text-transform: uppercase;
  font-size: .7rem;
  letter-spacing: .08em;
  color: #A39C8E;
  padding: .9rem 1.25rem .3rem;
}
.sb-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,15,15,.4);
  z-index: 1035;
}

/* ---------- Mobile / small-screen layout ---------- */
@media (max-width: 860px) {
  .sb-menu-toggle { display: inline-flex; align-items: center; }
  .sb-topbar .user-meta { display: none; } /* "Powered by SmartBiz" + name/role - keep logout visible, reclaim space */
  .sb-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px !important;
    max-width: 82vw;
    height: 100vh;
    z-index: 1040;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 0 0 28px rgba(0,0,0,.18);
    overflow-y: auto;
  }
  .sb-sidebar.open { transform: translateX(0); }
  .sb-sidebar-backdrop.open { display: block; }
  .sb-main-content { padding: 1rem !important; }
  .sb-stat { padding: .9rem 1rem; }
}

/* ---------- Cards ---------- */
.sb-card {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: 10px;
  padding: 1.25rem;
}
.sb-stat {
  background: #fff;
  border: 1px solid var(--sb-line);
  border-radius: 10px;
  padding: 1.1rem 1.3rem;
}
.sb-stat .num { font-family:'Fraunces',serif; font-size: 1.9rem; font-weight: 600; color: var(--sb-primary-dark); }
.sb-stat .label { font-size: .8rem; color: var(--sb-muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--sb-primary);
  border-color: var(--sb-primary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--sb-primary-dark);
  border-color: var(--sb-primary-dark);
}
.btn-accent {
  background: var(--sb-accent);
  border-color: var(--sb-accent);
  color: #fff;
}
.btn-accent:hover { background: #C26A40; color: #fff; }

/* ---------- Badges / status ---------- */
.status-badge { font-size: .72rem; padding: .25rem .55rem; border-radius: 20px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.status-booked, .status-confirmed { background:#E7EEF0; color:#2B5D52; }
.status-completed { background:#E5EFE9; color:#1E6B3D; }
.status-cancelled { background:#F6E6E2; color:#B3503F; }
.status-no_show { background:#F3E6D8; color:#9C5E1F; }
.status-rescheduled { background:#EFEAF6; color:#5B4B9C; }

/* ---------- Auth page ---------- */
.sb-auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1E433B 0%, #2B5D52 55%, #3C7568 100%);
}
.sb-auth-card {
  background: #fff;
  border-radius: 14px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

/* ---------- Customer portal ---------- */
.portal-hero {
  background: var(--sb-primary-dark);
  color: #fff;
  padding: 2rem 1.25rem 2.5rem;
  border-radius: 0 0 24px 24px;
}
.portal-hero h1 { color: #fff; font-size: 1.6rem; }
.service-card {
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  padding: 1rem;
  background: #fff;
  transition: box-shadow .15s ease;
}
.service-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.06); }

.sb-card { transition: box-shadow .15s ease; }
.sb-card:hover { box-shadow: 0 4px 16px rgba(27,31,35,.04); }
.btn { transition: all .15s ease; }
.form-control:focus, .form-select:focus {
  border-color: var(--sb-primary);
  box-shadow: 0 0 0 3px rgba(43,93,82,.12);
}
.table > thead > tr > th {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--sb-muted);
  border-bottom: 1px solid var(--sb-line);
  font-weight: 600;
}
.table > tbody > tr > td { border-bottom: 1px solid #F1EFEA; vertical-align: middle; }
.table > tbody > tr:hover { background: #FAF8F4; }
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--sb-muted);
}
.nav-icon { display:inline-block; width:1.1rem; text-align:center; margin-right:.4rem; opacity:.8; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #D8D3C7; border-radius: 8px; }
.chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--sb-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  cursor: pointer;
  border: none;
  font-size: 1.4rem;
  z-index: 1050;
}
.chat-panel {
  position: fixed;
  bottom: 88px;
  right: 20px;
  width: 340px;
  max-height: 480px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1050;
}
.chat-panel.open { display: flex; }
.chat-header {
  background: var(--sb-primary-dark);
  color: #fff;
  padding: .75rem 1rem;
  font-weight: 600;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: .75rem;
  background: #FAF9F6;
}
.chat-msg { margin-bottom: .6rem; display:flex; }
.chat-msg.bot .bubble { background:#fff; border:1px solid var(--sb-line); }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.user .bubble { background: var(--sb-primary); color:#fff; }
.bubble { padding: .5rem .75rem; border-radius: 10px; max-width: 85%; font-size: .88rem; line-height:1.4; }
.chat-options { display:flex; flex-wrap:wrap; gap:.4rem; margin-top:.4rem; }
.chat-option-btn {
  background:#fff; border:1px solid var(--sb-primary); color: var(--sb-primary-dark);
  border-radius: 20px; padding:.3rem .75rem; font-size:.8rem; cursor:pointer;
}
.chat-option-btn:hover { background: var(--sb-primary); color:#fff; }
.chat-input-row { display:flex; border-top:1px solid var(--sb-line); }
.chat-input-row input { flex:1; border:none; padding:.6rem .75rem; font-size:.85rem; }
.chat-input-row input:focus { outline:none; }
.chat-input-row button { border:none; background:var(--sb-primary); color:#fff; padding:0 1rem; }

/* ---------- Calendar (drag-and-drop staff view) ---------- */
.cal-event { cursor: grab; border-left: 3px solid rgba(0,0,0,.15); transition: box-shadow .15s ease; }
.cal-event:active { cursor: grabbing; }
.cal-event:hover { box-shadow: 0 2px 6px rgba(0,0,0,.15) !important; z-index: 5; }
.cal-column:hover { background: #FCFBF8; }

/* ---------- Small-screen general polish ---------- */
@media (max-width: 576px) {
  .chat-panel { width: calc(100vw - 24px); right: 12px; }
  .sb-card { padding: 1rem; }
  h1 { font-size: 1.5rem; }
  .portal-hero h1 { font-size: 1.3rem; }
}
