/* =====================================================================
   /PARTNERS/includes/styles.css  — Partners Portal shell
   ===================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
  line-height: 1.5;
  /* Stop a horizontal scroll turning into a browser Back. On a Mac trackpad,
     scrolling left past the end of a wide table hands the gesture to the browser,
     which navigates away and loses whatever was part way through. Matches the
     rule applied across TAPP in includes/header.php. Horizontal axis only —
     vertical overscroll and pull-to-refresh are unaffected. */
  overscroll-behavior-x: none;
}

a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
.partners-header {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}
.partners-header img.logo { height: 32px; }
.partners-header .user-block { font-size: 14px; color: #4b5563; }
.partners-header .user-block strong { color: #111827; }
.partners-header .user-block .switch-link,
.partners-header .user-block .logout-link {
  margin-left: 14px;
}

/* --- Main shell --- */
.partners-main {
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 24px;
}

/* --- Cards --- */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.card h2 { margin: 0 0 12px 0; font-size: 18px; }
.card .muted { color: #6b7280; font-size: 14px; }

/* --- Auth (login / pick supplier / messages) --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
}
.auth-card {
  background: #fff;
  width: 100%;
  max-width: 420px;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}
.auth-card img.logo { display: block; margin: 0 auto 16px; height: 40px; }
.auth-card h1 { margin: 0 0 4px 0; font-size: 22px; text-align: center; }
.auth-card .subtitle { text-align: center; color: #6b7280; margin-bottom: 24px; }
.auth-card label { display: block; font-size: 14px; margin-bottom: 6px; color: #374151; }
.auth-card input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}
.auth-card button {
  margin-top: 16px;
  width: 100%;
  padding: 12px;
  background: #1d4ed8;
  color: #fff;
  border: none;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
}
.auth-card button:hover { background: #1e40af; }
.auth-card .alert {
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}
.auth-card .alert.info    { background: #eff6ff; color: #1e3a8a; }
.auth-card .alert.success { background: #ecfdf5; color: #065f46; }
.auth-card .alert.error   { background: #fef2f2; color: #991b1b; }
.auth-card .small         { font-size: 13px; color: #6b7280; text-align: center; margin-top: 20px; }

/* --- Supplier picker --- */
.supplier-list { list-style: none; padding: 0; margin: 0; }
.supplier-list li button {
  width: 100%;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 15px;
  margin-bottom: 8px;
  cursor: pointer;
}
.supplier-list li button:hover { background: #eff6ff; border-color: #1d4ed8; }

/* --- Dashboard tiles --- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tile {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  color: #1f2937;
  text-decoration: none;
  transition: transform 0.1s, box-shadow 0.1s;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.tile h3 { margin: 0 0 6px 0; font-size: 16px; }
.tile p { margin: 0; font-size: 13px; color: #6b7280; }
.tile.coming-soon { opacity: 0.55; }
.tile.coming-soon::after { content: " — coming soon"; font-size: 12px; color: #9ca3af; }

/* Tile icon — coloured bubble at the top of each tile. Background +
   colour set inline by partners_icon_block() so each section gets its
   own Bootstrap-aligned colour (teal / green / yellow / pink / grey). */
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.tile:hover .tile-icon { filter: brightness(0.95); }

/* Section-page title (inside the first card). Back link is rendered
   separately ABOVE the card via partners_back_link() so the pattern is
   identical to drill-down pages. */
.section-title {
  display: flex;
  align-items: center;
  margin: 0 0 6px 0;
}
.section-title .section-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  margin-right: 14px;
  /* background + color set inline per icon via partners_icon_block() */
}
.section-title .section-title-text { font-weight: 700; }

/* Back link — used in section headers AND on drill-down pages
   (via partners_back_link()) so it's the same visual everywhere. */
.section-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  color: #374151 !important;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.1s;
}
.section-back-link:hover { background: #e5e7eb; }
