/* public/styles.css */

/* ---------- Base ---------- */
:root {
	--bg: #ffffff;
	--text: #111827;
	--muted: #6b7280;
	--border: #e5e7eb;

	--orange: #f97316;
	--orange-weak: #fff7ed;

	--card: #ffffff;
	--shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------- Layout ---------- */
.page {
	min-height: 100vh;
}

.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 18px;
}

.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 16px;
	padding: 16px;
	box-shadow: var(--shadow);
	margin-top: 30px;
}

/* ---------- Topbar ---------- */
.topbar {
	background: #fff;
	border-bottom: 1px solid var(--border);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 18px;
	height: 70px;
}

.topbar .brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	height: auto;
}

.topbar .logo {
	height: 50px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
	display: block;
}

.topbarRight {
	display: flex;
	gap: 8px;
	align-items: center;
}

.topbarRight .btn {
	padding: 8px 12px;
	font-size: 13px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
	margin: 0;
}

h1 {
	font-size: 22px;
	font-weight: 900;
}

h2 {
	font-size: 18px;
	font-weight: 900;
}

.meta {
	color: var(--muted);
	font-size: 13px;
	line-height: 1.4;
}

.hint {
	color: var(--muted);
	font-size: 14px;
}

/* ---------- Rows & Grids ---------- */
.row {
	display: flex;
	gap: 12px;
	align-items: center;
}

.grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

/* Job name input - wide on desktop */
.jobNameInput {
	min-width: 320px;
	font-weight: bold;
}

/* Mobile stacking */
@media (max-width: 760px) {
	.container {
		padding: 14px;
	}

	.grid2 {
		grid-template-columns: 1fr;
	}

	.topbarRight {
		gap: 8px;
	}

	/* Job name input - shrink on mobile to fit button */
	.jobNameInput {
		min-width: 0;
		flex: 1;
	}

	/* Hide elements on mobile */
	.hide-mobile {
		display: none !important;
	}

	/* Show elements on mobile */
	.show-mobile {
		display: flex !important;
	}
}

/* ---------- Inputs ---------- */
.input,
input[type="text"],
input[type="number"],
input[type="file"],
textarea.input {
	width: 100%;
	border: 1px solid var(--border);
	background: #fff;
	border-radius: 12px;
	padding: 11px 12px;
	font-size: 14px;
	font-family: inherit;
	outline: none;
}

.input:focus,
input:focus {
	border-color: #fdba74;
	box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

/* ---------- Buttons ---------- */
.btn {
	border: 1px solid var(--orange);
	background: var(--orange);
	color: #fff;
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 14px;
	font-weight: 900;
	cursor: pointer;
	white-space: nowrap;
}

.btn:hover {
	filter: brightness(0.98);
}

.btn:active {
	transform: translateY(1px);
}

.btnOutline {
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.btnOutline:hover {
	border-color: #d1d5db;
}

.btnIcon {
	width: 44px;
	height: 44px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
	border-radius: 14px;
}

.btnDanger {
	background: #dc2626;
	border-color: #dc2626;
	color: #fff;
}

.btnDanger:hover {
	background: #b91c1c;
	border-color: #b91c1c;
}

/* ---------- Status ---------- */
.status {
	font-size: 14px;
	font-weight: 700;
	color: var(--muted);
}

/* ---------- Building Badge ---------- */
.buildingBadge {
	display: inline-block;
	background: var(--orange);
	color: #ffffff;
	font-weight: 900;
	font-size: 14px;
	padding: 7px 12px;
	border-radius: 999px;
}

/* ---------- Accordion (Buildings) ---------- */
.accordion {
	border: 1px solid var(--border);
	border-radius: 14px;
	overflow: hidden;
	margin-bottom: 12px;
	background: #fff;
}

.accordionHeader {
	width: 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: var(--orange-weak);
	border: none;
	cursor: pointer;
}

.accordionHeader .accordionBuildingName {
	flex: 1;
	min-width: 0;
	text-align: left;
}

.accordionActions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.accordionHeader .accordionArrow {
	flex-shrink: 0;
	margin-left: 8px;
}

.accordionMeta {
	color: var(--muted);
	font-size: 13px;
	margin-left: auto;
}

.accordionChevron {
	font-weight: 900;
	margin-left: 10px;
}

.accordionBody {
	display: none;
	padding: 12px 14px;
}

.accordion.open .accordionBody {
	display: block;
}

/* ---------- Entry Rows inside Accordion ---------- */
.entryRow {
	display: flex;
	gap: 12px;
	padding: 10px 0;
	border-bottom: 1px solid #f3f4f6;
}

.entryRow:last-child {
	border-bottom: none;
}

.entryLeft {
	width: 72px;
}

.entryRight {
	flex: 1;
}

.savedThumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--border);
	display: block;
}

.savedThumb.placeholder {
	width: 64px;
	height: 64px;
	border-radius: 10px;
	border: 1px dashed #d1d5db;
	background: #f9fafb;
}

/* ---------- Saved list container ---------- */
#savedList {
	max-height: 60vh;
	overflow: auto;
	padding-right: 6px;
}

/* ---------- File input (nice spacing) ---------- */
input[type="file"] {
	padding: 10px 12px;
}

/* ===============================
   LANDING PAGE STYLES
   =============================== */

/* Remove DEMO MODE badge */
.demo,
.demoBadge,
#demoBadge,
[data-demo],
.badge {
	display: none !important;
}

/* Center landing page layout */
.wrap {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.top {
	width: 100%;
	display: flex;
	justify-content: center;
	margin-bottom: 24px;
}

/* Landing page brand/logo container */
.top .brand {
	display: flex;
	justify-content: center;
	align-items: center;
}

/* Landing page logo - larger size */
.brandLogo {
	width: 320px;
	max-width: 90vw;
	height: auto;
	object-fit: contain;
	margin-left: 40px;
}

/* Company name display */
.companyName {
	font-size: 24px;
	font-weight: 700;
	color: var(--text);
	text-align: center;
	margin-bottom: 16px;
}

/* Center landing buttons */
.stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}

/* Entry Shield orange buttons */
.bigBtn {
	width: 260px;
	padding: 14px 18px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 8px;
	border: none;
	cursor: pointer;

	background: #f26522; /* Entry Shield orange */
	color: #fff;

	transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.bigBtn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.bigBtn.secondary {
	background: #f26522;
	color: #fff;
}

/* Existing Jobs rows */
#jobsList {
	column-gap: 16px;
}

@media (min-width: 768px) {
	#jobsList {
		column-count: 2;
	}
}

@media (min-width: 1200px) {
	#jobsList {
		column-count: 3;
	}
}

.jobCard {
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-left: 6px solid #f97316; /* Entry Shield orange */
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 10px;
	cursor: pointer;
	transition: background 0.15s ease, box-shadow 0.15s ease;
	break-inside: avoid;
	display: inline-block;
	width: 100%;
}

.jobCard:hover {
	background: #fff7ed;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

/* ---------- Mode Badge ---------- */
.modeBadge {
	display: inline-block;
	font-weight: 700;
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.modeBadgeAdmin {
	background: transparent;
	color: #111827;
	border: 1px solid #111827;
}

.modeBadgeUser {
	background: #2563eb;
	color: #fff;
}

.modeBadgeSuperAdmin {
	background: transparent;
	color: #111827;
	border: 1px solid #111827;
}

/* ---------- Admin Only Elements ---------- */
.admin-only {
	/* Default visible, hidden via JS for non-admin */
}

.super-admin-only {
	/* Default visible, hidden via JS for non-super-admin */
}

.jobCard b {
	color: #000;
	font-size: 16px;
}

.jobCard .meta {
	color: #374151;
	font-size: 13px;
	margin-top: 4px;
}

/* ---------- Modal ---------- */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.modalBackdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
}

.modalContent {
	position: relative;
	background: #fff;
	border-radius: 16px;
	padding: 24px;
	max-width: 420px;
	width: 90%;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* ---------- User List ---------- */
.userRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}

.userRow:last-child {
	border-bottom: none;
}

.userInfo {
	flex: 1;
	min-width: 0;
}

.userName {
	font-weight: 600;
	font-size: 15px;
	color: var(--text);
}

.userMeta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.userActions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ---------- Role Badges ---------- */
.roleBadge {
	display: inline-block;
	font-weight: 700;
	font-size: 11px;
	padding: 4px 8px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.roleBadgeAdmin {
	background: #dc2626;
	color: #fff;
}

.roleBadgeUser {
	background: #e5e7eb;
	color: #374151;
}

/* ---------- Button Sizes ---------- */
.btnSmall {
	padding: 6px 12px;
	font-size: 13px;
}

/* ---------- Mobile adjustments for user list ---------- */
@media (max-width: 500px) {
	.userRow {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.userActions {
		width: 100%;
	}

	.userActions .btn {
		flex: 1;
	}
}

/* ---------- Client List (Super Admin) ---------- */
.clientRow {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 0;
	border-bottom: 1px solid var(--border);
}

.clientRow:last-child {
	border-bottom: none;
}

.clientInfo {
	flex: 1;
	min-width: 0;
}

.clientName {
	font-weight: 600;
	font-size: 15px;
	color: var(--text);
}

.clientMeta {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
	flex-wrap: wrap;
}

.clientActions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ---------- Status Badges ---------- */
.statusBadge {
	display: inline-block;
	font-weight: 700;
	font-size: 11px;
	padding: 4px 8px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.statusBadgeActive {
	background: #22c55e;
	color: #fff;
}

.statusBadgeInactive {
	background: #e5e7eb;
	color: #6b7280;
}

/* ---------- Mobile adjustments for client list ---------- */
@media (max-width: 500px) {
	.clientRow {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}

	.clientActions {
		width: 100%;
	}

	.clientActions .btn {
		flex: 1;
	}
}