/* POS Ledger — mobile-first app shell */

/* Deliberate heading scale - previously h1/h2/h3 across every page relied
   entirely on the browser's raw default sizing (h1 ~32px etc.), which
   looked oversized and inconsistent against this compact, card-based
   design. */
.posl-app-shell h1 {
	font-size: 22px;
	font-weight: 800;
	margin: 0 0 14px;
	color: var(--pos-ledger-text, #1f2937);
	letter-spacing: -0.01em;
}
.posl-app-shell h2 {
	font-size: 18px;
	font-weight: 700;
	margin: 22px 0 10px;
	color: var(--pos-ledger-text, #1f2937);
}
.posl-app-shell h3 {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--pos-ledger-text, #1f2937);
}
.posl-auth-card h2 {
	font-size: 19px;
	font-weight: 800;
	margin: 0 0 14px;
	color: var(--pos-ledger-text, #1f2937);
	text-align: center;
}

.posl-app-shell {
	--posl-gap: 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	color: var(--pos-ledger-text, #1f2937);
	background: var(--pos-ledger-bg, #f4f7fb);
	min-height: 100vh;
	border-radius: var(--pos-ledger-radius, 10px);
	overflow: visible;
}

.posl-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	padding: 12px 16px;
	background: var(--pos-ledger-primary, #1d4ed8);
	color: #fff;
	border-radius: var(--pos-ledger-radius, 10px) var(--pos-ledger-radius, 10px) 0 0;
	position: sticky;
	top: 0;
	z-index: 20;
}

.posl-nav-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(255,255,255,0.14);
	border: none;
	color: #fff;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}
.posl-nav-caret { transition: transform .15s ease; }
.posl-nav-toggle[aria-expanded="true"] .posl-nav-caret { transform: rotate(180deg); }

.posl-topbar-logo-link { display: flex; align-items: center; }
.posl-topbar-logo {
	max-height: 34px !important;
	height: auto !important;
	width: auto !important;
	max-width: 160px !important;
	display: block;
}
@media (max-width: 480px) {
	.posl-topbar-logo { max-height: 26px !important; max-width: 110px !important; }
}

.posl-topbar-right { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.posl-role-badge { background: rgba(255,255,255,0.2); padding: 3px 9px; border-radius: 999px; }
.posl-webmail-link { color: #fff !important; opacity: 1 !important; text-decoration: underline; }
.posl-logout { color: #fff; text-decoration: underline; }

/* Unified dropdown - same on every device, per explicit request */
.posl-nav-dropdown {
	background: var(--pos-ledger-surface, #fff);
	border-bottom: 1px solid rgba(0,0,0,0.08);
	box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.posl-nav-dropdown[hidden] { display: none; }
.posl-nav-dropdown ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; }
.posl-nav-dropdown a {
	display: block;
	padding: 12px 14px;
	text-decoration: none;
	color: var(--pos-ledger-text, #1f2937);
	border-radius: 8px;
	font-weight: 500;
}
.posl-nav-dropdown a.is-active,
.posl-nav-dropdown a:hover { background: var(--pos-ledger-bg, #f4f7fb); color: var(--pos-ledger-primary, #1d4ed8); }

@media (min-width: 820px) {
	.posl-nav-dropdown ul { flex-direction: row; flex-wrap: wrap; }
	.posl-nav-dropdown a { padding: 12px 16px; }
}

.posl-content { padding: 16px; max-width: 1100px; margin: 0 auto; }

.posl-card-grid { display: grid; grid-template-columns: 1fr; gap: var(--posl-gap); margin-top: 14px; }
@media (min-width: 640px) { .posl-card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .posl-card-grid { grid-template-columns: repeat(3, 1fr); } }

.posl-card, .posl-form-boxed {
	background: var(--pos-ledger-surface, #fff);
	border-radius: var(--pos-ledger-radius, 10px);
	padding: 16px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.posl-form { display: flex; flex-direction: column; gap: 10px; }
.posl-form label, .posl-inline-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; }
.posl-form input, .posl-form select, .posl-form textarea,
.posl-inline-form input, .posl-inline-form select, .posl-inline-form textarea {
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	width: 100%;
	box-sizing: border-box;
}
.posl-checkbox-label { flex-direction: row !important; align-items: center; }

.posl-inline-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.posl-btn {
	padding: 11px 18px;
	border-radius: 8px;
	border: none;
	font-weight: 600;
	font-size: 15px;
	cursor: pointer;
	align-self: flex-start;
}
.posl-btn-primary { background: var(--pos-ledger-primary, #1d4ed8); color: #fff; }
.posl-btn-secondary { background: #e5e7eb; color: #1f2937; }

.posl-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.posl-badge-success { background: #dcfce7; color: #166534; }
.posl-badge-danger { background: #fee2e2; color: #991b1b; }
.posl-badge-pending-invite { background: #fef3c7; color: #92400e; }

.posl-pos-integration-block { margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef0f2; }
.posl-pos-integration-block h4 { margin: 0 0 8px; font-size: 14px; }
.posl-pos-integration-block h5 { margin: 10px 0 6px; font-size: 13px; color: #4b5563; }

.posl-stat-cards { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.posl-stat-card { background: var(--pos-ledger-surface, #fff); border-radius: var(--pos-ledger-radius, 10px); padding: 16px 20px; min-width: 130px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.posl-stat-number { display: block; font-size: 24px; font-weight: 700; color: var(--pos-ledger-primary, #1d4ed8); }
.posl-stat-label { display: block; font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .03em; }

/* Scrollable tables so nothing is ever hidden/clipped on any device */
.posl-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--pos-ledger-radius, 10px); background: var(--pos-ledger-surface, #fff); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.posl-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.posl-table th, .posl-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #eef0f2; font-size: 14px; white-space: nowrap; }
.posl-table th { background: var(--pos-ledger-bg, #f4f7fb); position: sticky; top: 0; }

.posl-auth-page-bg {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: linear-gradient(160deg, var(--pos-ledger-bg, #f4f7fb) 0%, #e8eefc 100%);
}
.posl-auth-card {
	max-width: 420px;
	width: 100%;
	margin: 40px auto;
	background: #fff;
	border-radius: 16px;
	padding: 36px 32px;
	box-shadow: 0 12px 40px rgba(29,78,216,0.12), 0 2px 8px rgba(0,0,0,0.04);
}
.posl-brand-banner { text-align: center; margin-bottom: 20px; }
.posl-brand-banner a { display: block; text-align: center; }
.posl-brand-name { display: block; font-weight: 800; letter-spacing: .04em; color: var(--pos-ledger-primary, #1d4ed8); font-size: 20px; }
.posl-logo {
	max-height: 70px !important;
	width: auto !important;
	display: block !important;
	margin: 0 auto 8px !important;
	float: none !important;
}

.posl-auth-card #loginform,
.posl-auth-card .posl-form { display: flex; flex-direction: column; gap: 18px; }
.posl-auth-card .login-username,
.posl-auth-card .login-password,
.posl-auth-card p { margin: 0; }
.posl-auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: #374151; }
.posl-auth-card input[type="text"],
.posl-auth-card input[type="email"],
.posl-auth-card input[type="password"],
.posl-auth-card input[type="number"] {
	padding: 13px 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	font-size: 15px;
	background: #f9fafb;
	transition: border-color .15s ease, background .15s ease;
}
.posl-auth-card input:focus {
	outline: none;
	border-color: var(--pos-ledger-primary, #1d4ed8);
	background: #fff;
	box-shadow: 0 0 0 3px rgba(29,78,216,0.12);
}
.posl-auth-card .login-remember { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: #4b5563; }
.posl-auth-card .login-remember label { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.posl-auth-card .login-submit,
.posl-auth-card .posl-btn { margin-top: 4px; }
.posl-auth-card input[type="submit"],
.posl-auth-card .posl-btn-primary {
	width: 100%;
	padding: 14px;
	background: var(--pos-ledger-primary, #1d4ed8);
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease, transform .1s ease;
}
.posl-auth-card input[type="submit"]:hover,
.posl-auth-card .posl-btn-primary:hover { background: #1e40af; }
.posl-auth-card input[type="submit"]:active { transform: scale(0.98); }
.posl-auth-card #nav { margin-top: 18px; text-align: center; font-size: 14px; }
.posl-auth-card #nav a { color: var(--pos-ledger-primary, #1d4ed8); text-decoration: none; font-weight: 600; }
.posl-auth-card #nav a:hover { text-decoration: underline; }

.posl-alert { padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.posl-alert-error { background: #fee2e2; color: #991b1b; }
.posl-alert-success { background: #dcfce7; color: #166534; }

.posl-verify-fallback { margin-top: 18px; font-size: 14px; }
.posl-verify-fallback summary { cursor: pointer; color: var(--pos-ledger-primary, #1d4ed8); font-weight: 600; }
.posl-verify-fallback .posl-form,
.posl-verify-fallback .posl-inline-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef0f2; }

.posl-signup-link { text-align: center; margin-top: 14px; font-size: 14px; color: var(--pos-ledger-text, #1f2937); }
.posl-signup-link a { color: var(--pos-ledger-primary, #1d4ed8); font-weight: 700; text-decoration: none; }
.posl-signup-link a:hover { text-decoration: underline; }

.posl-password-wrapper { position: relative; display: flex; }
.posl-password-wrapper input[type="password"],
.posl-password-wrapper input[type="text"] { flex: 1; padding-right: 60px !important; }
.posl-password-toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--pos-ledger-primary, #1d4ed8);
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 8px;
}
.posl-password-toggle:hover { text-decoration: underline; }

.posl-empty-state, .posl-muted { color: #6b7280; font-size: 14px; }

.posl-conditional-fields[hidden] { display: none; }

.posl-phone-field { display: flex; gap: 8px; }
.posl-phone-field select { flex: 0 0 auto; width: auto; max-width: 45%; }
.posl-phone-field input { flex: 1 1 auto; }

.posl-section-spacer { height: 28px; }

.posl-pagination { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.posl-page-link { padding: 6px 12px; border-radius: 6px; background: var(--pos-ledger-surface, #fff); border: 1px solid #d1d5db; color: var(--pos-ledger-text, #1f2937); text-decoration: none; font-size: 14px; }
.posl-page-link.is-active { background: var(--pos-ledger-primary, #1d4ed8); color: #fff; border-color: var(--pos-ledger-primary, #1d4ed8); }

.posl-searchable-picker { position: relative; }
.posl-picker-results {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 100;
	max-height: 220px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.12);
	margin-top: 4px;
}
.posl-picker-result { padding: 9px 12px; cursor: pointer; font-size: 14px; }
.posl-picker-result:hover { background: #f4f7fb; color: var(--pos-ledger-primary, #1d4ed8); }

/* At-a-glance dashboard stat cards */
.posl-glance-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 14px;
	margin: 16px 0 26px;
}
.posl-glance-card {
	background: var(--pos-ledger-surface, #fff);
	border-radius: var(--pos-ledger-radius, 10px);
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.06);
	border-top: 3px solid transparent;
	transition: transform .15s ease, box-shadow .15s ease;
}
.posl-glance-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.09);
}
.posl-glance-icon { font-size: 22px; line-height: 1; }
.posl-glance-value { font-size: 24px; font-weight: 800; color: var(--pos-ledger-text, #1f2937); letter-spacing: -0.02em; }
.posl-glance-label { font-size: 12.5px; color: #6b7280; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.posl-glance-blue   { border-top-color: #1d4ed8; }
.posl-glance-green  { border-top-color: #16a34a; }
.posl-glance-amber  { border-top-color: #d97706; }
.posl-glance-purple { border-top-color: #7c3aed; }

.posl-glance-blue   .posl-glance-value { color: #1d4ed8; }
.posl-glance-green  .posl-glance-value { color: #15803d; }
.posl-glance-amber  .posl-glance-value { color: #b45309; }
.posl-glance-purple .posl-glance-value { color: #6d28d9; }

@media (max-width: 480px) {
	.posl-glance-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.posl-glance-card { padding: 14px 12px; }
	.posl-glance-value { font-size: 20px; }
}

@media print {
	.posl-topbar, .posl-nav-dropdown, .posl-no-print { display: none !important; }
	.posl-app-shell { background: none !important; }
	.posl-content { max-width: 100%; padding: 0; }
	.posl-card, .posl-table-scroll { box-shadow: none; border: 1px solid #ccc; }
}
