body {
	margin: 0;
	font-family: Arial, Helvetica, sans-serif;
	background: #f5f6f8;
	color: #1f2933;
}

a {
	color: #0b5cad;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	background: #263645;
	color: white;
	padding: 10px 16px;
}

.brand {
	color: white;
	text-decoration: none;
	font-weight: bold;
	font-size: 20px;
}

nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-end;
}

nav a {
	color: white;
	text-decoration: none;
	padding: 6px 8px;
	border-radius: 4px;
	font-size: 13px;
}

nav a:hover {
	background: rgba(255,255,255,0.14);
}

.nav-user {
	color: #dce8f2;
	font-size: 13px;
	padding: 6px 8px;
}

.nav-admin-badge {
	background: #f6c453;
	color: #263645;
	border-radius: 4px;
	font-size: 11px;
	padding: 1px 4px;
}

main {
	padding: 18px;
}

.hero {
	background: white;
	border: solid #d6dbe1 1px;
	border-radius: 6px;
	padding: 18px;
	margin-bottom: 18px;
}

.hero h1 {
	margin: 0 0 6px 0;
	font-size: 30px;
}

.panel {
	background: white;
	border: solid #d6dbe1 1px;
	border-radius: 6px;
	padding: 14px;
	margin-bottom: 14px;
}

.panel h2,
.panel h3 {
	margin-top: 0;
}

.panel h4 {
	margin-bottom: 6px;
}

.desktop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
	align-items: start;
}

.full-width {
	grid-column: 1 / -1;
}

.button-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0;
}

.button,
button.button {
	display: inline-block;
	background: #1f6fb8;
	color: white;
	border: 0;
	border-radius: 4px;
	padding: 8px 10px;
	text-decoration: none;
	cursor: pointer;
	font-size: 14px;
}

.button:hover {
	background: #185a96;
}

.button:disabled {
	background: #8b99a8;
	cursor: not-allowed;
}

.secondary-button {
	background: #596b7a;
}

.danger-button {
	background: #a33a34;
}

.danger-button:hover {
	background: #842b27;
}

.data-table {
	width: 100%;
	border-collapse: collapse;
}

.data-table th,
.data-table td {
	border: solid #d6dbe1 1px;
	padding: 6px;
	text-align: left;
	vertical-align: top;
}

.data-table th {
	background: #eef2f6;
}

.form-table input[type="text"],
.form-table input[type="date"],
.form-table input[type="number"],
.form-table input[type="password"],
.form-table select,
.form-table textarea {
	width: 100%;
	box-sizing: border-box;
	border: solid #b9c2cc 1px;
	border-radius: 4px;
	padding: 7px;
	font-family: Arial, Helvetica, sans-serif;
}

.compact-table {
	font-size: 12px;
}

.compact-table input,
.compact-table select {
	min-width: 72px;
}

.table-scroll {
	overflow: auto;
	max-width: 100%;
}

.sheet-grid {
	border-collapse: collapse;
	font-size: 12px;
	background: white;
}

.sheet-grid th,
.sheet-grid td {
	border: solid #d6dbe1 1px;
	padding: 4px 6px;
	min-width: 80px;
	max-width: 260px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sheet-grid th {
	position: sticky;
	top: 0;
	background: #eef2f6;
	z-index: 1;
}

.static-data-grid th:first-child {
	position: sticky;
	left: 0;
	z-index: 2;
}

.static-data-grid td {
	max-width: 320px;
}

.static-grid-input {
	width: 100%;
	min-width: 80px;
	max-width: 260px;
	box-sizing: border-box;
	border: solid transparent 1px;
	background: transparent;
	font: inherit;
	resize: vertical;
	min-height: 24px;
	padding: 2px 3px;
}

.static-grid-input:focus {
	border-color: #477cb3;
	background: #fff;
	outline: none;
}

.static-grid-formula {
	color: #806000;
	font-size: 11px;
	margin-top: 2px;
	max-width: 260px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.static-data-actions {
	white-space: nowrap;
}

.static-data-actions a {
	display: inline-block;
	margin-right: 8px;
}

.static-row-edit-table textarea {
	min-width: 260px;
}

.usage-log-table th {
	white-space: nowrap;
}

.usage-log-uri,
.usage-log-agent {
	display: inline-block;
	max-width: 320px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: top;
}

.formula-cell {
	background: #fff8d8;
}

.input-cell {
	background: #e7f7e7;
}

.metric-card .metric-label {
	font-size: 12px;
	text-transform: uppercase;
	color: #596b7a;
}

.metric-card .metric-number {
	font-size: 26px;
	font-weight: bold;
	margin: 6px 0;
}

.metric-card .metric-note,
.muted {
	color: #596b7a;
	font-size: 13px;
}

.badge {
	display: inline-block;
	background: #eef2f6;
	border: solid #ccd4dd 1px;
	border-radius: 4px;
	padding: 2px 5px;
	font-size: 12px;
}

.status-warn {
	background: #fff4c2;
	border: solid #d9b43b 1px;
	padding: 8px;
	margin: 10px 0;
}

.login-page {
	min-height: 90vh;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.login-card {
	background: white;
	border: solid #d6dbe1 1px;
	border-top: solid #263645 5px;
	border-radius: 6px;
	padding: 18px;
	width: 360px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

.login-card h1 {
	margin-top: 0;
}

.login-card label {
	display: block;
	font-weight: bold;
	margin-top: 10px;
}

.login-card input {
	width: 100%;
	box-sizing: border-box;
	border: solid #b9c2cc 1px;
	border-radius: 4px;
	padding: 8px;
	margin-top: 4px;
}

.login-card button {
	width: 100%;
	background: #1f6fb8;
	color: white;
	border: 0;
	border-radius: 4px;
	padding: 9px;
	margin-top: 14px;
	font-weight: bold;
	cursor: pointer;
}

.login-message {
	background: #fff4c2;
	border: solid #d9b43b 1px;
	padding: 8px;
	margin: 10px 0;
}

code {
	background: #eef2f6;
	padding: 1px 4px;
	border-radius: 3px;
}
