/* =============================================================
   Stahla — Brand Stylesheet
   Fruitful Marketing 2026 · xfox.ai
   =============================================================

   TABLE OF CONTENTS
   -----------------
   1.  Design Tokens (CSS Variables)
   2.  Reset & Base
   3.  Layout — Sidebar + Main
   4.  Sidebar Navigation
   5.  Page Header & Body
   6.  Stat Cards
   7.  Content Cards
   8.  Tables
   9.  Badges & Source Tags
   10. Alerts
   11. Forms, Inputs & Buttons
   12. Auth Pages (Login / Verify)
   13. Compatibility Shims (legacy class names)
   14. Responsive (≤768px)
   ============================================================= */


/* -------------------------------------------------------
   1. Design Tokens
   ------------------------------------------------------- */

:root {
  /* Brand palette */
  --blue:     #0097cf;   /* primary — active nav, links, buttons */
  --navy:     #004e72;   /* sidebar background, dark headers */
  --gold:     #ffb548;   /* section labels, CTAs, highlights */
  --coral:    #f3523f;   /* alerts, badges, HubSpot source tag */
  --teal:     #00a27e;   /* success states, Samsara source tag */
  --gray:     #cfd2d4;   /* borders, dividers, inactive */
  --black:    #101820;   /* body text */
  --purple:   #8b5cf6;   /* health / personal section */

  /* Surface & layout */
  --bg:         #f5f7fa;
  --surface:    #ffffff;
  --text-muted: #6b7280;
  --border:     #e5e7eb;
  --sidebar-w:  240px;

  /* Typography */
  --font: 'Poppins', system-ui, sans-serif;
}


/* -------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--black);
  background: var(--bg);
  display: flex;
  min-height: 100vh;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--black);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--black);
}


/* -------------------------------------------------------
   3. Layout — Sidebar + Main
   ------------------------------------------------------- */

.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  overflow-y: auto;
}

.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}


/* -------------------------------------------------------
   4. Sidebar Navigation
   ------------------------------------------------------- */

.sidebar-brand {
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand a {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
}

.sidebar-brand a span {
  color: var(--gold);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}

/* Section group labels (BUSINESS / PERSONAL / TOOLS) */
.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  padding: 10px 16px 3px;
}

/* Source badge row (HubSpot / Samsara / etc.) */
.nav-source {
  display: flex;
  align-items: center;
  padding: 5px 16px 2px;
}

.nav-source-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
}

.badge-hubspot    { background: var(--coral);              color: #fff; }
.badge-samsara    { background: var(--teal);               color: #fff; }
.badge-smartsheet { background: var(--blue);               color: #fff; }
.badge-financial  { background: var(--gold);               color: var(--black); }
.badge-ops        { background: rgba(255, 255, 255, 0.15); color: #fff; }
.badge-health     { background: var(--purple);             color: #fff; }

/* Nav links */
.nav-link {
  display: block;
  padding: 6px 16px 6px 28px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}

.nav-link.active {
  color: #fff;
  background: rgba(0, 151, 207, 0.2);
  border-left-color: var(--blue);
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 16px;
}

/* Bottom links (Data Health, Logout) */
.nav-bottom {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-bottom .nav-link {
  padding-left: 16px;
}

/* Mobile hamburger button */
.hamburger {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--navy);
  border: none;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  line-height: 1;
}


/* -------------------------------------------------------
   5. Page Header & Body
   ------------------------------------------------------- */

.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 13px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.page-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--black);
}

.user-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.page-body {
  padding: 22px 24px;
  flex: 1;
  overflow-y: auto;
}


/* -------------------------------------------------------
   6. Stat Cards
   ------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

.stat-value {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--black);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}


/* -------------------------------------------------------
   7. Content Cards
   ------------------------------------------------------- */

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

.content-card h3,
.content-card h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--black);
}

.overflow-auto {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.overflow-auto table {
  border: none;
}


/* -------------------------------------------------------
   8. Tables
   ------------------------------------------------------- */

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  background: #f8fafc;
  white-space: nowrap;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--black);
  font-size: 13px;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f8fafc;
}


/* -------------------------------------------------------
   9. Badges & Source Tags
   ------------------------------------------------------- */

/* Inline color badges (green/red/yellow/blue/gray) */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.badge-green  { background: rgba(0, 162, 126, 0.10); color: #007a60; }
.badge-red    { background: rgba(243, 82, 63, 0.10);  color: #c73225; }
.badge-yellow { background: rgba(255, 181, 72, 0.15); color: #8a5e00; }
.badge-blue   { background: rgba(0, 151, 207, 0.10);  color: #0077a3; }
.badge-gray   { background: rgba(207, 210, 212, 0.50); color: #555; }

/* Page-level source tags (shown below page title) */
.source-tag,
.src-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 4px;
  margin-bottom: 14px;
  margin-right: 6px;
}

.src-hubspot    { background: rgba(243, 82, 63, 0.10);  color: #c73225; }
.src-samsara    { background: rgba(0, 162, 126, 0.10);  color: #007a60; }
.src-smartsheet { background: rgba(0, 151, 207, 0.10);  color: #0077a3; }
.src-financial  { background: rgba(255, 181, 72, 0.15); color: #8a5e00; }
.src-ops        { background: rgba(0, 78, 114, 0.10);   color: #004e72; }
.src-health     { background: rgba(139, 92, 246, 0.10); color: #6d28d9; }


/* -------------------------------------------------------
   10. Alerts
   ------------------------------------------------------- */

.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 13px;
}

.alert-warn   { background: rgba(255, 181, 72, 0.10);  border-left: 3px solid var(--gold); }
.alert-danger { background: rgba(243, 82, 63, 0.08);   border-left: 3px solid var(--coral); }
.alert-info   { background: rgba(0, 151, 207, 0.08);   border-left: 3px solid var(--blue); }


/* -------------------------------------------------------
   11. Forms, Inputs & Buttons
   ------------------------------------------------------- */

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 151, 207, 0.1);
}

button,
[role="button"] {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover,
[role="button"]:hover {
  background: var(--navy);
}

button.secondary {
  background: var(--surface);
  color: var(--blue);
  border: 1.5px solid var(--blue);
}

button.outline {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}

mark {
  font-size: 0.85em;
  padding: 2px 7px;
  border-radius: 4px;
}


/* -------------------------------------------------------
   12. Auth Pages (Login / Verify)
   ------------------------------------------------------- */

body.auth-page {
  background: #f0f4f8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.logo-dot {
  width: 36px;
  height: 36px;
  background: var(--navy);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-dot span {
  font-size: 19px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -0.05em;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-card h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 6px;
}

.auth-card p {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 18px;
}

.auth-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
  margin-top: 14px;
}

.auth-card input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.auth-card input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 151, 207, 0.12);
}

.btn {
  display: block;
  width: 100%;
  padding: 11px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 18px;
  text-align: center;
  text-decoration: none;
}

.btn:hover {
  background: var(--navy);
}

.note {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 12px;
  text-align: center;
}


/* -------------------------------------------------------
   13. Compatibility Shims
   (legacy class names still used in some page templates)
   ------------------------------------------------------- */

.metric-box {
  text-align: center;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.metric-box .value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--black);
}

.metric-box .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.status-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.status-card header {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}


/* -------------------------------------------------------
   14. Responsive (≤768px)
   ------------------------------------------------------- */

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
  }

  .page-header {
    padding: 13px 16px 13px 52px;
  }

  .page-body {
    padding: 14px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
