/* =============================================================================
   /all-modules — demo catalogue
   Palette lifted from krayincrm.com's theme stylesheet so the page reads as
   part of the same product, not as a separate dark tool:
     #0e7ab9  primary button/brand      (52 uses in the site CSS)
     #263238  headings + body text
     #64687a  muted copy
     #dfe1e5  borders
     #f8fafc  section tint
     #f8fafc  footer + section tint
     Inter    typeface
   ========================================================================== */

:root {
	--bg:        #ffffff;
	--bg-tint:   #f8fafc;
	--bg-tint-2: #f1f5f9;
	--surface:   #ffffff;
	--line:      #dfe1e5;
	--line-2:    #cbd5e1;
	--text:      #263238;
	--muted:     #64687a;
	--faint:     #94a3b8;
	--brand:     #0e7ab9;
	--brand-2:   #0e90d9;
	--brand-soft:#e8f3fb;
	--grad:      linear-gradient(135deg, #40bdf4 20%, #1e88e5 70%);
	--ok:        #15803d;
	--ok-soft:   #e7f6ec;
	--warn:      #b45309;
	--warn-soft: #fdf3e3;
	--dark:      #292c36;
	--radius:    12px;
	--shadow:    0 1px 2px rgba(38, 50, 56, 0.05);
	--shadow-lg: 0 10px 28px rgba(38, 50, 56, 0.10);
}

* { box-sizing: border-box; }

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

html { scroll-behavior: smooth; }

body {
	margin: 0;
	/* Soft brand wash across the top only — echoes the site's illustrated
	   headers with no pseudo-element, so it cannot overflow horizontally. */
	background:
		radial-gradient(760px 340px at 22% 0, rgba(64, 189, 244, 0.16), transparent 70%) no-repeat,
		radial-gradient(620px 300px at 82% 40px, rgba(112, 123, 242, 0.10), transparent 70%) no-repeat,
		var(--bg);
	color: var(--text);
	font: 400 15px/1.6 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	-webkit-font-smoothing: antialiased;
	/* Long unbroken strings (a module name, an address) wrap instead of forcing
	   a horizontal scrollbar on narrow screens. */
	overflow-wrap: break-word;
}

.wrap {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	/* Fluid gutters: 16px on a phone, 30px on a desktop. */
	padding: 0 clamp(16px, 3vw, 30px);
}

.hidden { display: none !important; }

/* ---------- Header ---------- */

.hdr {
	position: sticky;
	top: 0;
	z-index: 20;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--line);
}

.hdr-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }

/* Logo is dark-on-transparent, so it sits on the light background unmodified —
   the landing page has to invert it, this one does not. */
.brand img { height: 30px; display: block; }

.hdr-nav { display: flex; align-items: center; gap: 22px; }
.hdr-nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: color .15s; }
.hdr-nav a:hover { color: var(--brand); }

.hdr-cta {
	padding: 9px 18px;
	border-radius: 35px;
	background: var(--brand);
	color: #fff !important;
	font-weight: 600;
	transition: background .18s;
}
.hdr-cta:hover { background: #0b6698; }

/* ---------- Hero ---------- */

.hero { padding: 58px 0 34px; }

.eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 6px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	box-shadow: var(--shadow);
	font-size: 12.5px; font-weight: 500; color: var(--muted);
}
.eyebrow-dot {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--brand-2);
	box-shadow: 0 0 0 4px rgba(14, 144, 217, 0.14);
}

.hero h1 {
	margin: 20px 0 12px;
	font-size: clamp(30px, 4.4vw, 50px);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.12;
	color: var(--text);
}

.hero > p { margin: 0; max-width: 64ch; font-size: 16.5px; color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.stat {
	flex: 1 1 160px;
	padding: 16px 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.stat-val { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.stat-live { color: var(--ok); }
.stat-label { display: block; margin-top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- Controls ---------- */

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 34px 0 20px; }

.search {
	flex: 1 1 min(340px, 100%);
	min-width: 0;
	display: flex; align-items: center; gap: 10px;
	padding: 11px 15px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	color: var(--faint);
	transition: border-color .15s, box-shadow .15s;
}
.search:focus-within {
	border-color: var(--brand-2);
	box-shadow: 0 0 0 3px rgba(14, 144, 217, 0.12);
}
.search input {
	flex: 1; min-width: 0;
	border: 0; outline: 0; background: transparent;
	color: var(--text); font: inherit; font-size: 14.5px;
}
.search input::placeholder { color: var(--faint); }
.search-clear {
	border: 0; background: transparent; cursor: pointer;
	color: var(--faint); font-size: 20px; line-height: 1; padding: 0 2px;
}
.search-clear:hover { color: var(--text); }

.selects { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.select {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 13px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--surface);
	font-size: 13px; color: var(--muted);
}
.select select {
	border: 0; outline: 0; background: transparent;
	color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
}

.server-note {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 10px 13px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--bg-tint);
	font-size: 13px; color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.server-note svg { color: var(--brand); }

/* ---------- Category chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }

.chip {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 8px 15px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { color: var(--brand); border-color: var(--brand-2); }
.chip.is-active {
	color: #fff;
	background: var(--brand);
	border-color: var(--brand);
	font-weight: 600;
}
.chip-n {
	padding: 1px 7px; border-radius: 999px;
	background: var(--bg-tint-2);
	color: var(--muted);
	font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.chip.is-active .chip-n { background: rgba(255, 255, 255, 0.22); color: #fff; }

.result-line { margin-bottom: 16px; font-size: 13.5px; color: var(--muted); }
.result-line span { font-weight: 600; color: var(--text); }

/* ---------- Cards ---------- */

.grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	padding-bottom: 64px;
}

.card {
	display: flex; flex-direction: column;
	padding: 22px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	box-shadow: var(--shadow);
	transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:hover {
	border-color: var(--brand-2);
	box-shadow: var(--shadow-lg);
	transform: translateY(-3px);
}
.card.is-off { background: var(--bg-tint); }
.card.is-off:hover { transform: none; border-color: var(--line-2); box-shadow: var(--shadow); }

.card-top { display: flex; align-items: flex-start; gap: 14px; }

.badge-init {
	flex: 0 0 auto;
	width: 44px; height: 44px;
	display: grid; place-items: center;
	border-radius: 11px;
	background: var(--grad);
	color: #fff;
	font-size: 14.5px; font-weight: 700; letter-spacing: 0.02em;
}
.card.is-off .badge-init { background: #cbd5e1; }

.card-head { min-width: 0; }
.card-head h2 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; color: var(--text); }
.cat { font-size: 12.5px; color: var(--faint); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.tag {
	display: inline-flex; align-items: center; gap: 5px;
	padding: 3px 10px; border-radius: 999px;
	font-size: 11.5px; font-weight: 600;
}
.tag-pop  { background: var(--warn-soft); color: var(--warn); }
.tag-live { background: var(--ok-soft);   color: var(--ok); }
.tag-off  { background: var(--bg-tint-2); color: var(--muted); }
.tag-live .dot {
	width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
	animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.desc { margin: 13px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); flex: 1; }

.card-foot { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

.btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 10px 17px;
	border-radius: 8px;
	font-size: 14px; font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background .16s, border-color .16s, color .16s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0b6698; }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: #fff; }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-disabled { background: var(--bg-tint-2); color: var(--faint); cursor: not-allowed; font-weight: 500; }

/* ---------- Empty state ---------- */

.empty { padding: 64px 20px; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 16px; font-size: 15.5px; }

/* ---------- Footer ---------- */

.ftr {
	background: var(--bg-tint);
	border-top: 1px solid var(--line);
	padding: 52px 0 0;
	color: var(--muted);
	font-size: 14px;
}

.ftr-grid {
	display: grid;
	grid-template-columns: 1.6fr repeat(3, 1fr);
	gap: 40px;
	padding-bottom: 42px;
}

.ftr-brand { max-width: 34ch; }
.ftr-logo { height: 30px; width: auto; display: block; margin-bottom: 14px; }
.ftr-brand p { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--muted); }

.ftr-social { display: flex; gap: 10px; }
.ftr-social a {
	display: grid; place-items: center;
	width: 34px; height: 34px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: #fff;
	color: var(--muted);
	transition: color .16s, border-color .16s, transform .16s;
}
.ftr-social a:hover { color: var(--brand); border-color: var(--brand-2); transform: translateY(-2px); }

.ftr-col h3 {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--text);
}
.ftr-col ul { margin: 0; padding: 0; list-style: none; }
.ftr-col li { margin-bottom: 9px; }
.ftr-col a { color: var(--muted); text-decoration: none; transition: color .15s; }
.ftr-col a:hover { color: var(--brand); }

.ftr-bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
	padding: 18px 0 26px;
	border-top: 1px solid var(--line);
	font-size: 13px;
	color: var(--faint);
}
.ftr-bar-right { display: flex; gap: 18px; }
.ftr-bar a { color: var(--faint); text-decoration: none; }
.ftr-bar a:hover { color: var(--brand); }

/* =============================================================================
   Responsive
   Four bands, sized to real devices rather than round numbers:
     >1080   desktop        4-col footer, auto-fill card grid
     900-1080 small laptop  tighter gaps, narrower card minimum
     620-900  tablet        2-col cards, 2-col footer, brand full width
     <620     phone         single column, stacked controls, scrolling chips
   ========================================================================== */

/* ---- Small laptop ---- */
@media (max-width: 1080px) {
	.grid      { gap: 16px; }
	.ftr-grid  { gap: 30px; }
	.hero      { padding: 48px 0 30px; }
}

/* ---- Tablet ---- */
@media (max-width: 900px) {
	.hero h1 { font-size: clamp(28px, 5vw, 38px); }
	.hero > p { font-size: 15.5px; }

	/* 3 -> 2 -> 1. Fixed counts rather than auto-fill so a tablet never ends up
	   with a lone stretched card on the last row. */
	.grid { grid-template-columns: repeat(2, 1fr); }

	.controls { gap: 10px; }
	.search   { flex: 1 1 100%; order: -1; }

	.ftr-grid  { grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
	.ftr-brand { grid-column: 1 / -1; max-width: 52ch; }
}

/* ---- Phone ---- */
@media (max-width: 620px) {
	.hdr-inner { padding: 12px 0; }
	.brand img { height: 26px; }
	.hdr-nav   { gap: 14px; }
	/* Keep the primary action and the route back to the sandbox; the rest of
	   the nav is repeated in the footer. */
	.hdr-nav a[href^="https://krayincrm.com"] { display: none; }
	.hdr-cta   { padding: 9px 15px; font-size: 13.5px; }

	.hero    { padding: 32px 0 22px; }
	.hero h1 { font-size: clamp(26px, 7.5vw, 32px); margin: 16px 0 10px; }
	.hero > p { font-size: 15px; }

	/* Three tight columns keeps the numbers scannable without a tall stack. */
	.stats      { gap: 8px; margin-top: 22px; }
	.stat       { flex: 1 1 0; min-width: 0; padding: 12px 10px; text-align: center; }
	.stat-val   { font-size: 21px; }
	.stat-label { font-size: 11px; line-height: 1.3; }

	.controls { flex-direction: column; align-items: stretch; margin: 24px 0 16px; }
	.selects  { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
	.select, .server-note { justify-content: center; min-height: 44px; }
	.search { min-height: 44px; }

	/* Chips scroll sideways instead of stacking into four cramped rows. */
	.chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 0 calc(clamp(16px, 3vw, 30px) * -1) 16px;
		padding: 2px clamp(16px, 3vw, 30px);
	}
	.chips::-webkit-scrollbar { display: none; }
	.chip { flex: 0 0 auto; scroll-snap-align: start; min-height: 38px; }

	.grid { grid-template-columns: 1fr; gap: 14px; padding-bottom: 44px; }

	.card       { padding: 18px; }
	.card:hover { transform: none; }
	.badge-init { width: 40px; height: 40px; }
	.card-head h2 { font-size: 16px; }

	/* Full-width tap targets — comfortably over the 44px minimum. */
	.card-foot { gap: 8px; }
	.btn { flex: 1 1 100%; justify-content: center; min-height: 44px; }

	.ftr       { padding: 38px 0 0; }
	.ftr-grid  { grid-template-columns: 1fr 1fr; gap: 26px 20px; padding-bottom: 30px; }
	.ftr-brand { grid-column: 1 / -1; }
	.ftr-brand p { font-size: 13.5px; }
	.ftr-social a { width: 40px; height: 40px; }
	.ftr-bar   { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px 0 24px; }
}

/* ---- Small phone ---- */
@media (max-width: 380px) {
	.stats { flex-direction: column; }
	.stat  { flex-basis: auto; text-align: left; padding: 12px 14px; }
	.selects { grid-template-columns: 1fr; }
	.ftr-grid { grid-template-columns: 1fr; }
}

/* ---- Motion ---- */
@media (prefers-reduced-motion: reduce) {
	.card, .btn, .chip, .ftr-social a { transition: none; }
	.card:hover, .ftr-social a:hover  { transform: none; }
	.tag-live .dot { animation: none; }
	html { scroll-behavior: auto; }
}
