/*
	Adtrax Business Suite - Earth Tones Design System
	Copyright [2003 Jeffery Paris jpariscoder@gmail.com] - phpog.com
*/

:root {
	--font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	--radius-lg: 18px; --radius-md: 14px; --radius-sm: 10px;
	--shadow-1: 0 12px 32px rgba(61, 51, 40, 0.15);
	--shadow-2: 0 6px 18px rgba(61, 51, 40, 0.12);
	--shadow-3: 0 3px 8px rgba(61, 51, 40, 0.08);
	--bg0: #e9e4dc; --bg1: #e2ddd5; --card: #d9d0c4; --card-hover: #d2c9bd;
	--border: #bfb5a9; --border-2: #cfc5b9; --text0: #3d3328; --text1: #5a4e42; --text2: #7a6e62;
	--accent: #7a9b76; --accent-2: #8aab86; --good: #6b9a5b; --warn: #d4a05f; --bad: #c76565;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body { font-family: var(--font); background: linear-gradient(135deg, var(--bg1), var(--bg0)); color: var(--text0); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-2); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 16px 0; font-weight: 700; line-height: 1.3; color: var(--text0); }
h1 { font-size: 28px; } h2 { font-size: 24px; } h3 { font-size: 20px; } h4 { font-size: 18px; } h5 { font-size: 16px; } h6 { font-size: 14px; }
p { margin: 0 0 14px 0; }

.app-topbar { position: sticky; top: 0; z-index: 100; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(217, 208, 196, 0.85); border-bottom: 2px solid var(--border); box-shadow: var(--shadow-3); }
.app-topbar__inner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; max-width: 1400px; margin: 0 auto; }
.app-brand { display: flex; align-items: center; gap: 10px; min-width: 180px; text-decoration: none; }
.app-brand:hover { text-decoration: none; }
.app-brand__dot { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--accent); box-shadow: 0 0 0 6px rgba(122, 155, 118, 0.3); flex-shrink: 0; }
.app-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.app-brand__title { font-weight: 800; letter-spacing: 0.3px; color: var(--text0); font-size: 18px; }
.app-brand__sub { font-size: 11px; color: var(--text2); font-weight: 500; }
.app-search { position: relative; flex: 1; max-width: 480px; }
.app-search__label { position: absolute; left: -9999px; }
.app-search__input { width: 100%; border-radius: 999px; padding: 10px 16px; border: 2px solid var(--border-2); background: rgba(255, 255, 255, 0.25); color: var(--text0); outline: none; font-size: 14px; transition: all 0.2s; }
.app-search__input::placeholder { color: var(--text2); }
.app-search__input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(122, 155, 118, 0.2); background: rgba(255, 255, 255, 0.45); }
.app-topbar__actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.app-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 2px solid var(--border); background: var(--card); color: var(--text0); cursor: pointer; user-select: none; font-size: 14px; font-weight: 600; font-family: var(--font); transition: all 0.2s; }
.app-btn:hover { border-color: var(--accent); background: var(--card-hover); transform: translateY(-1px); box-shadow: var(--shadow-3); }
.app-btn--primary { background: var(--accent); color: white; border-color: var(--accent); }
.app-btn--primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.app-btn__icon { display: inline-block; width: 18px; text-align: center; font-size: 18px; }
.app-btn__text { font-weight: 600; font-size: 14px; }

@media (max-width: 680px) {
	.app-brand { min-width: 140px; }
	.app-brand__title { font-size: 16px; }
	.app-search { display: none; }
	.app-btn__text { display: none; }
}

.app-breadcrumbs { background: var(--card); border-bottom: 2px solid var(--border); padding: 10px 16px; position: sticky; top: 60px; z-index: 90; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.app-breadcrumbs__inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text1); overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
.app-breadcrumbs__inner::-webkit-scrollbar { height: 4px; }
.app-breadcrumbs__inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.app-breadcrumbs a { color: var(--accent); font-weight: 600; }
.app-breadcrumbs__sep { color: var(--text2); user-select: none; }

.app-main { padding: 20px 16px 100px; min-height: calc(100vh - 60px); }
.app-shell { max-width: 1200px; margin: 0 auto; }
.app-shell--narrow { max-width: 600px; margin: 0 auto; }
.app-auth-shell { padding-top: 12px; }
.app-auth-card { max-width: 560px; margin-left: auto; margin-right: auto; margin-top: 16px; }
.app-card { border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--card); box-shadow: var(--shadow-2); margin-bottom: 20px; }
.app-card__header { padding: 18px 20px; border-bottom: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); }
.app-card__title { margin: 0; font-size: 20px; font-weight: 800; color: var(--text0); }
.app-card__body { padding: 20px; }
.app-card__footer { padding: 16px 20px; border-top: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); }

@media (min-width: 980px) {
	.app-card__body { padding: 24px; }
}

.app-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.app-stat-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 8px; transition: all 0.2s; }
.app-stat-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.app-stat-card:visited { color: inherit; }
a.app-stat-card { color: inherit; text-decoration: none; cursor: pointer; }
a.app-stat-card:hover { color: inherit; text-decoration: none; }
.app-stat-card__label { font-size: 13px; font-weight: 600; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; }
.app-stat-card__value { font-size: 32px; font-weight: 800; color: var(--text0); line-height: 1; }
.app-stat-card__meta { font-size: 12px; color: var(--text2); }
.app-stat-card--good { border-color: var(--good); background: linear-gradient(135deg, var(--card) 0%, rgba(107, 154, 91, 0.1) 100%); }
.app-stat-card--warn { border-color: var(--warn); background: linear-gradient(135deg, var(--card) 0%, rgba(212, 160, 95, 0.1) 100%); }
.app-stat-card--bad { border-color: var(--bad); background: linear-gradient(135deg, var(--card) 0%, rgba(199, 101, 101, 0.1) 100%); }

.app-activity-feed { display: grid; gap: 12px; }
.app-activity-item { background: rgba(255, 255, 255, 0.25); border: 2px solid var(--border-2); border-radius: var(--radius-md); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; transition: all 0.2s; }
.app-activity-item:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.35); }
.app-activity-item__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: rgba(122, 155, 118, 0.3); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); flex-shrink: 0; }
.app-activity-item__content { min-width: 0; }
.app-activity-item__title { font-weight: 600; color: var(--text0); margin: 0 0 4px 0; font-size: 14px; }
.app-activity-item__meta { font-size: 12px; color: var(--text2); }
.app-activity-item__time { font-size: 12px; color: var(--text2); text-align: right; white-space: nowrap; }

.app-backdrop { position: fixed; inset: 0; background: rgba(61, 51, 40, 0.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 200; opacity: 0; transition: opacity 0.25s; pointer-events: none; }
.app-backdrop.is-open { opacity: 1; pointer-events: auto; }
.app-drawer { position: fixed; right: 0; top: 0; height: 100%; width: min(380px, calc(100vw - 40px)); z-index: 250; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.app-drawer.is-open { transform: translateX(0); }
.app-drawer__inner { height: 100%; background: var(--card); border-left: 2px solid var(--border); box-shadow: -8px 0 32px rgba(61, 51, 40, 0.2); display: flex; flex-direction: column; overflow-y: auto; }
.app-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); position: sticky; top: 0; z-index: 10; }
.app-drawer__title { font-weight: 800; font-size: 18px; color: var(--text0); }
.app-drawer__close { width: 40px; height: 40px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: transparent; color: var(--text0); font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.app-drawer__close:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.25); }
.app-nav { flex: 1; padding: 12px; }
.app-nav ul { list-style: none; margin: 0; padding: 0; }
.app-nav li { margin: 0; padding: 0; }
.app-nav a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: var(--radius-md); color: var(--text0); text-decoration: none; font-weight: 600; font-size: 15px; transition: all 0.2s; }
.app-nav a:hover { background: rgba(255, 255, 255, 0.25); text-decoration: none; }
.app-nav a.active { background: var(--accent); color: white; }

.app-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 150; background: var(--card); border-top: 2px solid var(--border); box-shadow: 0 -4px 16px rgba(61, 51, 40, 0.1); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.app-bottom-nav__inner { display: flex; justify-content: space-around; align-items: stretch; max-width: 680px; margin: 0 auto; height: 64px; }
.app-bottom-nav__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--text1); transition: all 0.2s; border-top: 3px solid transparent; padding-top: 3px; }
.app-bottom-nav__item:hover { color: var(--accent); text-decoration: none; background: rgba(255, 255, 255, 0.25); }
.app-bottom-nav__item.active { color: var(--accent); border-top-color: var(--accent); }
.app-bottom-nav__icon { font-size: 22px; line-height: 1; }
.app-bottom-nav__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }

.app-fab { position: fixed; right: 20px; bottom: 84px; z-index: 160; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: white; border: none; box-shadow: var(--shadow-1); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 28px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.app-fab:hover { background: var(--accent-2); transform: scale(1.08); box-shadow: 0 16px 40px rgba(61, 51, 40, 0.25); }
.app-fab:active { transform: scale(0.95); }

.app-back-to-top { position: fixed; right: 20px; bottom: 150px; z-index: 160; width: 44px; height: 44px; border-radius: 50%; background: var(--card); color: var(--text0); border: 2px solid var(--border); box-shadow: var(--shadow-2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 20px; opacity: 0; pointer-events: none; transition: all 0.3s; }
.app-back-to-top.visible { opacity: 1; pointer-events: auto; }
.app-back-to-top:hover { background: var(--accent); color: white; border-color: var(--accent); transform: translateY(-3px); }

.app-form { display: grid; gap: 18px; max-width: 680px; }
.app-form__row { display: grid; gap: 8px; }
.app-form__row--cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }

.app-form__row > .app-btn,
.app-form__row > input.app-btn { justify-self: start; }

/* Invoice forms */
.app-invoice-form { max-width: 920px; }
.app-invoice-form .app-form__row { gap: 6px; }
.app-invoice-form .app-textarea { min-height: 120px; }
.app-label { font-weight: 700; color: var(--text0); font-size: 14px; display: block; margin-bottom: 6px; }
.app-label--required::after { content: ' *'; color: var(--bad); }
.app-input, .app-select, .app-textarea { width: 100%; border-radius: var(--radius-md); border: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); color: var(--text0); padding: 11px 14px; outline: none; font-size: 14px; font-family: var(--font); transition: all 0.2s; }
.app-input:focus, .app-select:focus, .app-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(122, 155, 118, 0.2); background: rgba(255, 255, 255, 0.45); }
.app-textarea { min-height: 120px; resize: vertical; }
.app-select { cursor: pointer; }

.app-upload-zone { border: 2px dashed var(--border); border-radius: var(--radius-lg); padding: 14px 12px; text-align: center; background: rgba(255, 255, 255, 0.25); cursor: pointer; transition: all 0.2s; min-height: 90px; width: 100%; max-width: 420px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; }
.app-upload-zone:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.35); }
.app-upload-zone.is-dragover { border-color: var(--accent); background: rgba(122, 155, 118, 0.18); }
.app-upload-zone__icon { width: 40px; height: 40px; margin: 0 auto; opacity: 0.75; }
.app-upload-zone__icon svg { width: 40px; height: 40px; fill: var(--text2); }
.app-upload-zone__title { font-size: 15px; font-weight: 700; color: var(--text0); margin-bottom: 0; }
.app-upload-zone__subtitle { font-size: 13px; color: var(--text2); }
.app-upload-zone__input { display: none; }
.app-upload-files { display: grid; gap: 12px; margin-top: 20px; }
.app-upload-file { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(255, 255, 255, 0.25); border: 2px solid var(--border); border-radius: var(--radius-md); transition: all 0.2s; }
.app-upload-file:hover { border-color: var(--accent); }
.app-upload-file__icon { width: 40px; height: 40px; border-radius: var(--radius-sm); background: rgba(122, 155, 118, 0.3); display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); flex-shrink: 0; }
.app-upload-file__info { flex: 1; min-width: 0; }
.app-upload-file__name { font-weight: 600; color: var(--text0); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-upload-file__size { font-size: 12px; color: var(--text2); }
.app-upload-file__remove { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 2px solid var(--border); background: transparent; color: var(--bad); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.app-upload-file__remove:hover { background: var(--bad); color: white; border-color: var(--bad); }

.app-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-md); border: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); }
.app-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.app-table thead { background: var(--card); border-bottom: 2px solid var(--border); position: sticky; top: 0; z-index: 10; }
.app-table th { padding: 12px 14px; text-align: left; font-weight: 700; color: var(--text0); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--border); }
.app-table td { padding: 14px 14px; border-bottom: 1px solid var(--border-2); color: var(--text1); }
.app-table tbody tr:hover { background: rgba(122, 155, 118, 0.08); }
.app-table tbody tr:last-child td { border-bottom: none; }

.app-user-grid { display: grid; gap: 16px; }
.app-user-card { background: rgba(255, 255, 255, 0.25); border: 2px solid var(--border); border-radius: var(--radius-md); padding: 18px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; transition: all 0.2s; }
.app-user-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.app-user-card--retired { opacity: 0.5; }
.app-user-card__avatar { width: 48px; height: 48px; border-radius: 50%; background: rgba(122, 155, 118, 0.3); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: var(--accent); flex-shrink: 0; }
.app-user-card__info { min-width: 0; }
.app-user-card__name { font-weight: 700; font-size: 16px; color: var(--text0); margin: 0 0 4px 0; }
.app-user-card__role { font-size: 13px; color: var(--text2); margin-bottom: 8px; }
.app-user-card__actions { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.app-user-card__actions a { color: var(--accent); font-weight: 600; }
.app-user-card__actions-sep { color: var(--text2); }

.app-alert { border-radius: var(--radius-md); padding: 14px 16px; border: 2px solid var(--border); background: rgba(255, 255, 255, 0.25); margin-bottom: 16px; font-size: 14px; }
.app-alert--good { border-color: var(--good); background: rgba(107, 154, 91, 0.15); color: var(--good); }
.app-alert--warn { border-color: var(--warn); background: rgba(212, 160, 95, 0.15); color: var(--warn); }
.app-alert--bad { border-color: var(--bad); background: rgba(199, 101, 101, 0.15); color: var(--bad); }

.app-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-linkrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.app-linkrow a { font-weight: 600; font-size: 14px; }
.app-muted { color: var(--text2); }
.app-text-center { text-align: center; }

@media (max-width: 768px) {
	.app-stats-grid { grid-template-columns: 1fr; }
	.app-user-card { grid-template-columns: 1fr; }
	.app-fab { right: 16px; bottom: 76px; width: 52px; height: 52px; }
	.app-back-to-top { right: 16px; bottom: 140px; }
}

/* AUTH PAGE STYLES */
body.auth { 
	display: flex; 
	align-items: center; 
	justify-content: center; 
	min-height: 100vh; 
	padding: 40px 20px;
}
.auth-wrap { 
	width: 100%; 
	max-width: 480px; 
	margin: 0 auto;
}
.auth-top { 
	display: flex; 
	align-items: center; 
	justify-content: space-between; 
	margin-bottom: 24px;
}
.auth-brand { 
	display: flex; 
	align-items: center; 
	gap: 12px;
}
.auth-brand__dot { 
	width: 40px; 
	height: 40px; 
	border-radius: var(--radius-sm); 
	background: var(--accent); 
	box-shadow: 0 0 0 8px rgba(122, 155, 118, 0.2);
}
.auth-brand__text { 
	display: flex; 
	flex-direction: column; 
	line-height: 1.2;
}
.auth-brand__title { 
	font-weight: 800; 
	font-size: 18px; 
	color: var(--text0);
}
.auth-brand__sub { 
	font-size: 12px; 
	color: var(--text2);
}
.auth-card { 
	box-shadow: var(--shadow-1);
}
.auth-title { 
	font-size: 24px; 
	font-weight: 800; 
	margin: 0 0 8px 0; 
	color: var(--text0);
}
.auth-sub { 
	color: var(--text2); 
	margin: 0 0 24px 0;
}
.auth-messages { 
	margin-bottom: 20px;
}
.auth-footnote { 
	margin-top: 24px; 
	padding-top: 24px; 
	border-top: 2px solid var(--border);
}
.auth-footnote p { 
	font-size: 13px; 
	color: var(--text2); 
	line-height: 1.6; 
	margin: 0;
}
.auth-links { 
	margin-bottom: 24px;
}
.app-link {
	font-weight: 600; 
	font-size: 14px;
}

.app-link--danger {
	color: var(--bad);
}
.app-link--danger:hover {
	color: var(--bad);
}

.app-linkrow__sep { 
	color: var(--text2);
}

/* INVOICE CARD STYLES */
.app-invoice-card {
	background: var(--card);
	border: 2px solid var(--border);
	border-radius: var(--radius-md);
	padding: 18px;
	margin-bottom: 16px;
	transition: all 0.2s ease;
}
.app-invoice-card:hover {
	border-color: var(--accent);
	box-shadow: var(--shadow-2);
}
.app-invoice-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--border-2);
}
.app-invoice-card__id {
	font-size: 18px;
	font-weight: 800;
	color: var(--text0);
}
.app-invoice-card__status {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 600;
	background: var(--bg1);
}
.app-invoice-card__status--unread {
	background: var(--warn);
	color: #fff;
}
.app-invoice-card__status--read {
	background: var(--good);
	color: #fff;
}
.app-invoice-card__body {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin-bottom: 12px;
}
.app-invoice-card__field {
	display: flex;
	flex-direction: column;
}
.app-invoice-card__label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	color: var(--text2);
	margin-bottom: 4px;
	letter-spacing: 0.5px;
}
.app-invoice-card__value {
	font-size: 14px;
	color: var(--text0);
	font-weight: 500;
}
.app-invoice-card__actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	padding-top: 12px;
	border-top: 2px solid var(--border-2);
}
.app-invoice-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* FORM GRID LAYOUT (replacing tables) */
.app-form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}
.app-form-grid--2col {
	grid-template-columns: repeat(2, 1fr);
}
.app-form-grid--3col {
	grid-template-columns: repeat(3, 1fr);
}
.app-form-grid--full {
	grid-template-columns: 1fr;
}
@media (max-width: 768px) {
	.app-form-grid,
	.app-form-grid--2col,
	.app-form-grid--3col {
		grid-template-columns: 1fr;
	}
}

/* SMALL BUTTON VARIANT */
.app-btn--sm {
	padding: 6px 12px;
	font-size: 13px;
	min-height: 32px;
}
.app-btn--sm .app-btn__icon {
	font-size: 14px;
}

/* CAPTCHA STYLES */
.app-captcha-question {
	font-size: 18px;
	font-weight: 700;
	color: var(--text0);
	background: var(--bg1);
	padding: 16px;
	border-radius: var(--radius-sm);
	border: 2px solid var(--accent);
	text-align: center;
	margin: 12px 0;
	font-family: 'Courier New', monospace;
	letter-spacing: 2px;
}
.app-form__help {
	display: block;
	font-size: 12px;
	color: var(--text2);
	margin-top: 4px;
}

/* HIDE BOTTOM NAV WHEN NOT LOGGED IN */
.app-bottom-nav[data-user-logged-in="false"] {
	display: none;
}
.app-bottom-nav[data-user-logged-in="false"] + .app-fab {
	display: none;
}
.app-fab {
	display: none;
}
body[data-app] .app-fab {
	display: flex;
}
body.auth .app-fab {
	display: none;
}

/* TABS INTERFACE */
.app-tabs {
	width: 100%;
}
.app-tabs__nav {
	display: flex;
	gap: 8px;
	border-bottom: 2px solid var(--bg2);
	margin-bottom: 24px;
}
.app-tabs__btn {
	padding: 12px 24px;
	background: transparent;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: var(--text1);
	transition: all 0.2s ease;
	margin-bottom: -2px;
}
.app-tabs__btn:hover {
	color: var(--text0);
	background: var(--bg1);
}
.app-tabs__btn--active {
	color: var(--accent);
	border-bottom-color: var(--accent);
}
.app-tabs__content {
	padding: 0;
}


/* === STAGE 4 COMPLIANCE UTILITIES === */

.app-mb-24 { margin-bottom:24px; }
.app-mb-16 { margin-bottom:16px; }
.app-mb-12 { margin-bottom:12px; }
.app-mt-24 { margin-top:24px; }

.app-maxw-780 { max-width:780px; }

.app-text-right { text-align:right; }
.app-text-xs { font-size:0.75em; }

.app-bg-light { background:#f9f9f9; }

.app-box-light-12 { padding:12px; background:#f9f9f9; border-radius:var(--radius-sm); }
.app-box-light-16 { padding:16px; background:#f9f9f9; border-radius:var(--radius-sm); }

.app-section-title { margin:20px 0 10px 0; }
.app-section-title--tight { margin:0 0 10px 0; }

.app-lineitems-grid-head {
	display:grid;
	grid-template-columns:2fr 1fr 1fr 1fr;
	gap:12px;
	font-weight:600;
	padding-bottom:12px;
	border-bottom:2px solid #ddd;
}

.app-lineitems-grid-row {
	display:grid;
	grid-template-columns:2fr 1fr 1fr 1fr;
	gap:12px;
	padding:12px 0;
	border-bottom:1px solid #eee;
}

.app-total-box {
	padding:20px;
	background:var(--accent);
	color:#fff;
	border-radius:var(--radius-sm);
	text-align:right;
}

.app-total-box__label { font-size:14px; opacity:0.9; }
.app-total-box__amount { font-size:32px; font-weight:800; }

.app-textarea-emailer { width:500px; height:400px; }
.app-textarea-wide { max-width:1024px; min-width:200px; width:100%; }

.app-ticket-actions { font-size:0.9em; line-height:32px; padding:0 6px 20px 0; }

.app-whoisonline-row {
	clear:both;
	width:98%;
	border-bottom:1px solid #DDDDDD;
	padding:10px 10px 20px 0;
	margin:0 0 10px 0;
	height:64px;
}

.app-link--admin { color:red; }
.app-link--affiliate { color:darkgreen; }
.app-link--user { color:black; }


/* Itemized invoices */
.app-itemized {
	width:100%;
	border:1px solid #DDDDDD;
	border-radius:6px;
	overflow:hidden;
}

.app-itemized__header,
.app-itemized__row {
	display:grid;
	grid-template-columns:70px 1fr 90px 110px 110px;
	align-items:center;
}

.app-itemized__header {
	background:#F7F7F7;
	font-weight:bold;
	border-bottom:1px solid #DDDDDD;
}

.app-itemized__h,
.app-itemized__hnum,
.app-itemized__cell,
.app-itemized__num {
	padding:10px 10px;
}

.app-itemized__row {
	border-bottom:1px solid #EEEEEE;
}

.app-itemized__row:last-child { border-bottom:0; }

.app-itemized__hnum,
.app-itemized__num { font-weight:bold; }

.app-itemized__rows { width:100%; }

.app-itemized--collapsed .app-itemized__row:nth-child(n+2) { display:none; }

@media (max-width: 760px) {
	.app-itemized__header,
	.app-itemized__row {
		grid-template-columns:54px 1fr 70px 80px 90px;
	}
	.app-itemized__h,
	.app-itemized__hnum,
	.app-itemized__cell,
	.app-itemized__num {
		padding:8px 8px;
		font-size:0.95em;
	}
}


/* Line Items - Dynamic Add/Remove */
.app-line-items__header {
	display:flex;
	align-items:flex-end;
	justify-content:space-between;
	gap:12px;
}
.app-line-items__header-left {
	flex:1;
}
.app-line-items__header-right {
	flex:0 0 auto;
}
.app-form-grid--4col {
	display:grid;
	grid-template-columns:2fr 1fr 1fr auto;
	gap:12px;
	align-items:end;
}
.app-line-item-actions {
	display:flex;
	justify-content:flex-end;
}
.app-line-item-remove {
	white-space:nowrap;
}
.app-line-item-row.is-hidden {
	display:none;
}
.app-line-item-row[data-index="1"] .app-line-item-remove {
	visibility:hidden;
	pointer-events:none;
}
@media (max-width: 720px) {
	.app-form-grid--4col {
		grid-template-columns:1fr;
	}
	.app-line-item-actions {
		justify-content:flex-start;
	}
}
