/* BabbleBlue customer control panel — shares the marketing site's palette */

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

:root {
	--blue-600: #2563EB;
	--blue-700: #1E40AF;
	--blue-800: #1E3A8A;
	--blue-900: #1E2D5B;
	--blue-950: #0F172A;
	--blue-100: #DBEAFE;
	--blue-50: #EFF6FF;
	--orange-500: #F97316;
	--orange-600: #EA580C;
	--orange-400: #FB923C;
	--green-600: #16A34A;
	--green-50: #F0FDF4;
	--red-600: #DC2626;
	--red-50: #FEF2F2;
	--slate-900: #0F172A;
	--slate-800: #1E293B;
	--slate-700: #334155;
	--slate-500: #64748B;
	--slate-400: #94A3B8;
	--slate-300: #CBD5E1;
	--slate-200: #E2E8F0;
	--slate-100: #F1F5F9;
	--slate-50: #F8FAFC;
	--white: #FFFFFF;
	--radius: 12px;
	--shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
	--shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

body {
	font-family: 'DM Sans', sans-serif;
	color: var(--slate-800);
	background: var(--slate-100);
	line-height: 1.6;
	font-size: 15px;
}

h1, h2, h3, .logo, .stat-val {
	font-family: 'Exo 2', sans-serif;
}

a { color: var(--blue-600); }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
	width: 232px;
	flex-shrink: 0;
	background: linear-gradient(180deg, var(--blue-950) 0%, var(--blue-900) 60%, var(--blue-800) 100%);
	color: var(--white);
	display: flex;
	flex-direction: column;
	position: fixed;
	top: 0; bottom: 0; left: 0;
}

.logo {
	display: block;
	text-decoration: none;
	padding: 24px 24px 20px;
}
.logo-img {
	display: block;
	width: 100%;
	height: auto;
}
.logo-sub {
	display: block;
	font-family: 'DM Sans', sans-serif;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.45);
	margin-top: 2px;
}

.sidebar nav {
	flex: 1;
	min-height: 0; /* lets the nav shrink so it scrolls instead of pushing the foot off-screen */
	overflow-y: auto;
	padding: 8px 12px;
	scrollbar-width: thin;
	scrollbar-color: rgba(255,255,255,0.25) transparent;
}
.sidebar nav a {
	display: block;
	color: rgba(255,255,255,0.75);
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	padding: 7px 14px;
	border-radius: 8px;
	margin-bottom: 1px;
	transition: all 0.15s;
}
.nav-sec {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.35);
	padding: 14px 14px 4px;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.sidebar nav a.active {
	background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
	color: var(--white);
	box-shadow: 0 2px 10px rgba(37,99,235,0.4);
}

.sidebar-foot {
	padding: 16px 24px 20px;
	border-top: 1px solid rgba(255,255,255,0.1);
	font-size: 13px;
}
.sidebar-foot .who { color: var(--white); word-break: break-all; margin-bottom: 8px; }
.sidebar-foot a { color: var(--orange-400); text-decoration: none; font-weight: 600; }

.content {
	flex: 1;
	margin-left: 232px;
	padding: 36px 40px 60px;
	max-width: 1140px;
}
.content > h1 {
	font-weight: 800;
	font-size: 28px;
	color: var(--slate-900);
	margin-bottom: 24px;
}

/* ---- Cards ---- */
.card {
	background: var(--white);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 24px;
	margin-bottom: 24px;
	box-shadow: var(--shadow-sm);
}
.card > h2 {
	font-weight: 700;
	font-size: 17px;
	color: var(--slate-900);
	margin-bottom: 4px;
}
.card > .card-sub {
	color: var(--slate-500);
	font-size: 13px;
	margin-bottom: 16px;
}

/* ---- Stat tiles ---- */
.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 16px;
	margin-bottom: 24px;
}
.stat {
	background: var(--white);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 18px 20px;
	box-shadow: var(--shadow-sm);
}
.stat-val { font-weight: 800; font-size: 30px; color: var(--slate-900); line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--slate-500); font-weight: 500; }

/* ---- Tables ---- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
	text-align: left;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: var(--slate-500);
	padding: 8px 12px;
	border-bottom: 2px solid var(--slate-200);
}
.table td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--slate-100);
	color: var(--slate-700);
	vertical-align: middle;
	overflow-wrap: anywhere; /* long unbreakable values must never push the table past its card */
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--blue-50); }

/* ---- Badges ---- */
.badge {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	padding: 2px 10px;
	border-radius: 50px;
	white-space: nowrap;
}
.badge-green { background: var(--green-50); color: var(--green-600); }
.badge-red { background: var(--red-50); color: var(--red-600); }
.badge-orange { background: #FFF7ED; color: var(--orange-600); }
.badge-blue { background: var(--blue-50); color: var(--blue-600); }
.badge-gray { background: var(--slate-100); color: var(--slate-500); }
.badge-purple { background: #F5F3FF; color: #7C3AED; }

/* ---- Buttons ---- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px 20px;
	border-radius: 50px;
	font-family: 'DM Sans', sans-serif;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: all 0.2s;
}
.btn-primary {
	background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
	color: var(--white);
	box-shadow: 0 2px 10px rgba(37,99,235,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(37,99,235,0.4); }
.btn-orange {
	background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
	color: var(--white);
	box-shadow: 0 2px 10px rgba(249,115,22,0.3);
}
.btn-orange:hover { transform: translateY(-1px); }
.btn-outline {
	background: transparent;
	color: var(--blue-600);
	border: 2px solid var(--blue-600);
	padding: 7px 18px;
}
.btn-outline:hover { background: var(--blue-600); color: var(--white); }
.btn-danger {
	background: transparent;
	color: var(--red-600);
	border: 1px solid var(--red-600);
	padding: 4px 12px;
	font-size: 13px;
}
.btn-danger:hover { background: var(--red-600); color: var(--white); }
.btn-sm { padding: 5px 14px; font-size: 13px; }

/* ---- Forms ---- */
label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--slate-700);
	margin-bottom: 4px;
}
input[type=text], input[type=email], input[type=password], input[type=tel], select {
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
	color: var(--slate-800);
	background: var(--white);
	border: 1px solid var(--slate-300);
	border-radius: 8px;
	padding: 9px 12px;
	width: 100%;
	max-width: 340px;
}
input:focus, select:focus {
	outline: none;
	border-color: var(--blue-600);
	box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.field { margin-bottom: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; }
.check-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.check-row label { margin: 0; font-weight: 500; }

/* ---- Flash / notices ---- */
.flash {
	border-radius: var(--radius);
	padding: 12px 18px;
	margin-bottom: 20px;
	font-weight: 500;
	font-size: 14px;
}
.flash-success { background: var(--green-50); color: var(--green-600); border: 1px solid #BBF7D0; }
.flash-error { background: var(--red-50); color: var(--red-600); border: 1px solid #FECACA; }
.notice {
	background: var(--blue-50);
	border: 1px solid var(--blue-100);
	color: var(--blue-800);
	border-radius: var(--radius);
	padding: 12px 18px;
	font-size: 14px;
	margin-bottom: 20px;
}
.muted { color: var(--slate-500); font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }

/* ---- Section rows (forwarding etc.) ---- */
.setting-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	padding: 14px 0;
	border-bottom: 1px solid var(--slate-100);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .setting-name { flex: 0 0 320px; font-weight: 600; font-size: 14px; }
.setting-row .setting-name .muted { display: block; font-weight: 400; }

/* ---- Voicemail ---- */
audio { height: 34px; vertical-align: middle; max-width: 280px; }
details.vm-settings { margin-top: 14px; }
details.vm-settings summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	color: var(--blue-600);
}
details.vm-settings > div { margin-top: 12px; }

/* ---- Analytics ---- */
.range-tabs {
	display: flex;
	gap: 8px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}
.range-tab {
	padding: 7px 16px;
	border-radius: 50px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	color: var(--slate-700);
	background: var(--white);
	border: 1px solid var(--slate-200);
	transition: all 0.15s;
}
.range-tab:hover { border-color: var(--blue-600); color: var(--blue-600); }
.range-tab.active {
	background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
	color: var(--white);
	border-color: transparent;
}
.range-tab.range-export { margin-left: auto; color: var(--slate-500); }
.range-tab.range-export:hover { color: var(--blue-600); }

.legend { font-size: 13px; color: var(--slate-500); margin-left: 8px; white-space: nowrap; }
.legend-swatch {
	display: inline-block;
	width: 11px; height: 11px;
	border-radius: 3px;
	vertical-align: -1px;
	margin: 0 4px 0 12px;
}
.sw-answered { background: var(--blue-600); }
.sw-missed { background: var(--orange-500); }

.chart { margin-top: 8px; }
.chart-bars {
	display: flex;
	align-items: flex-end;
	gap: 3px;
	height: 160px;
	border-bottom: 2px solid var(--slate-200);
	padding-bottom: 0;
}
.bar-col {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	flex: 1 1 0;
	min-width: 3px;
}
.bar-col:hover .bar-seg { filter: brightness(1.08); }
.bar-seg { width: 100%; }
.bar-top { border-radius: 4px 4px 0 0; }
.bar-answered { background: var(--blue-600); }
.bar-missed { background: var(--orange-500); }
.bar-empty { background: var(--slate-200); }
.chart-axis {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: var(--slate-400);
	margin-top: 6px;
	font-variant-numeric: tabular-nums;
}

.hbar-track {
	background: var(--slate-100);
	border-radius: 50px;
	height: 10px;
	width: 100%;
	overflow: hidden;
}
.hbar {
	background: linear-gradient(90deg, var(--blue-600), var(--blue-700));
	height: 100%;
	border-radius: 50px;
}

/* ---- Pager ---- */
.pager { display: flex; gap: 10px; margin-top: 16px; }

/* ---- Login ---- */
.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(160deg, var(--blue-950) 0%, var(--blue-800) 40%, var(--blue-700) 70%, var(--blue-600) 100%);
	padding: 24px;
}
.login-card {
	background: var(--white);
	border-radius: 20px;
	padding: 40px 36px;
	width: 100%;
	max-width: 400px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card .logo { padding: 0 0 4px; }
.login-card .logo-img { width: 218px; max-width: 100%; }
.login-card .login-sub { color: var(--slate-500); font-size: 14px; margin-bottom: 24px; }
.login-card input { max-width: none; }
.login-card .btn { width: 100%; margin-top: 6px; }

/* ---- Signup wizard ---- */
.signup-page {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: linear-gradient(160deg, var(--blue-950) 0%, var(--blue-800) 40%, var(--blue-700) 70%, var(--blue-600) 100%);
	padding: 40px 16px 60px;
}
.signup-card {
	background: var(--white);
	border-radius: 20px;
	padding: 36px 34px;
	width: 100%;
	max-width: 660px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.signup-card .logo { padding: 0 0 6px; }
.signup-card .logo-img { width: 218px; max-width: 100%; }
.signup-card h1 { font-size: 24px; font-weight: 800; color: var(--slate-900); margin-bottom: 4px; }
.signup-card .signup-sub { color: var(--slate-500); font-size: 14px; margin-bottom: 20px; }
.signup-card input, .signup-card select { max-width: none; }
.signup-steps { display: flex; gap: 6px; margin: 8px 0 22px; flex-wrap: wrap; }
.signup-step {
	font-size: 12px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 50px;
	background: var(--slate-100);
	color: var(--slate-400);
	white-space: nowrap;
}
.signup-step.active {
	background: linear-gradient(135deg, var(--blue-600), var(--blue-700));
	color: var(--white);
}
.signup-step.done { background: var(--green-50); color: var(--green-600); }
.plan-pick {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 14px;
}
.plan-option {
	position: relative;
	display: block;
	border: 2px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 16px 18px;
	cursor: pointer;
	transition: all 0.15s;
	font-weight: 400;
}
.plan-option:hover { border-color: var(--slate-300); }
.plan-option.selected { border-color: var(--blue-600); background: var(--blue-50); }
.plan-option input { position: absolute; opacity: 0; pointer-events: none; }
.plan-option h3 { font-size: 17px; font-weight: 700; color: var(--slate-900); }
.plan-option .plan-price {
	font-family: 'Exo 2', sans-serif;
	font-size: 24px;
	font-weight: 800;
	color: var(--blue-600);
	margin: 2px 0 6px;
}
.plan-option .plan-price span { font-size: 13px; font-weight: 600; color: var(--slate-400); }
.plan-option p { font-size: 13px; color: var(--slate-500); line-height: 1.5; }
.price-preview {
	background: var(--slate-50);
	border: 1px solid var(--slate-200);
	border-radius: var(--radius);
	padding: 12px 16px;
	margin: 14px 0 18px;
	font-size: 14px;
}
.signup-foot { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 18px; }
.signup-foot a { color: rgba(255,255,255,0.85); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.layout { flex-direction: column; }
	.sidebar { position: static; width: 100%; }
	.sidebar nav { display: flex; flex-wrap: wrap; }
	.sidebar nav a { margin: 2px; }
	.nav-sec { display: none; } /* wrapped chips don't group; headings just break the flow */
	.content { margin-left: 0; padding: 24px 16px 48px; }
	.setting-row .setting-name { flex-basis: 100%; }
}
@media (max-width: 640px) {
	.plan-pick { grid-template-columns: 1fr; }
	.signup-card { padding: 28px 20px; }
}

/* ---- Admin mirror banner ---- */
.mirror-banner {
	background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
	color: var(--white);
	border-radius: var(--radius);
	padding: 12px 18px;
	margin-bottom: 20px;
	font-weight: 600;
	font-size: 14px;
	box-shadow: 0 2px 10px rgba(249,115,22,0.35);
}
.mirror-banner a { color: var(--white); font-weight: 700; margin-left: 8px; }
.mirror-banner-write {
	background: linear-gradient(135deg, var(--red-600), #B91C1C);
	box-shadow: 0 2px 10px rgba(220,38,38,0.35);
}
