:root {
	--bg: #f4faf9;
	--ink: #0f2d2f;
	--muted: #4b6b6e;
	--panel: rgba(255, 255, 255, 0.86);
	--line: #d5e8e6;
	--primary: #0d9488;
	--primary-dark: #0f766e;
	--accent: #f97316;
	--danger: #dc2626;
	--ok: #16a34a;
	--shadow: 0 14px 32px rgba(15, 45, 47, 0.12);
}

* {
	box-sizing: border-box;
}

.hidden {
	display: none !important;
}

body {
	margin: 0;
	color: var(--ink);
	font-family: "Plus Jakarta Sans", sans-serif;
	background:
		radial-gradient(circle at 12% 14%, rgba(13, 148, 136, 0.16), transparent 35%),
		radial-gradient(circle at 88% 10%, rgba(249, 115, 22, 0.13), transparent 35%),
		linear-gradient(145deg, #f6fbfa 0%, #eaf6f3 100%);
	min-height: 100vh;
}

.login-overlay {
	position: fixed;
	inset: 0;
	z-index: 50;
	display: grid;
	place-items: center;
	padding: 18px;
	background: rgba(4, 26, 28, 0.42);
	backdrop-filter: blur(7px);
}

.login-overlay.hidden {
	display: none;
}

.login-card {
	width: min(460px, 100%);
	background: #ffffff;
	border-radius: 18px;
	padding: 22px;
	box-shadow: 0 16px 36px rgba(6, 40, 43, 0.24);
	border: 1px solid #d8ece9;
}

.login-logo {
	width: 74px;
	height: 74px;
	object-fit: contain;
	margin-bottom: 4px;
}

.login-card h2 {
	margin: 0;
	font: 700 1.4rem/1.2 "Outfit", sans-serif;
}

.login-card p {
	margin: 8px 0 12px;
	color: var(--muted);
	font-size: 0.92rem;
}

.login-form {
	display: grid;
	gap: 10px;
}

.login-hint {
	margin-top: 12px;
	padding: 10px;
	background: #f0fdfa;
	border: 1px solid #cdebe6;
	border-radius: 10px;
	font-size: 0.82rem;
	color: #115e59;
}

.login-error {
	color: #b91c1c;
	min-height: 20px;
	margin-bottom: 0;
}

.app-shell {
	display: grid;
	grid-template-columns: 300px 1fr;
	min-height: 100vh;
}

.sidebar {
	padding: 22px;
	border-right: 1px solid rgba(13, 148, 136, 0.18);
	background: linear-gradient(170deg, rgba(12, 74, 110, 0.08), rgba(13, 148, 136, 0.14));
	backdrop-filter: blur(8px);
	display: flex;
	flex-direction: column;
	gap: 18px;
	z-index: 30;
}

.sidebar-overlay {
	position: fixed;
	inset: 0;
	background: rgba(5, 20, 24, 0.42);
	backdrop-filter: blur(2px);
	z-index: 25;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.sidebar-overlay.open {
	opacity: 1;
	pointer-events: auto;
}

.sidebar-header-mobile {
	display: none;
	justify-content: space-between;
	align-items: center;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 4px;
}

.sidebar-close,
.hamburger-btn {
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #ffffff;
	color: #0f172a;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	padding: 8px 11px;
}

.hamburger-btn {
	display: none;
	font-size: 1.15rem;
	align-self: flex-start;
}

.sidebar-footer {
	margin-top: auto;
	display: grid;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px dashed rgba(13, 148, 136, 0.22);
}

.sidebar-user {
	padding: 8px 10px;
	border-radius: 10px;
	font-size: 0.82rem;
	font-weight: 700;
	background: #ecfdf5;
	color: #166534;
	word-break: break-word;
}

.brand {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 28px;
}

.brand-logo {
	width: 64px;
	height: 64px;
	object-fit: contain;
	border-radius: 16px;
	background: #ffffff;
	padding: 6px;
	box-shadow: 0 8px 20px rgba(13, 148, 136, 0.18);
}

.brand-text h1 {
	font: 700 1rem/1.2 "Outfit", sans-serif;
	margin: 0;
}

.brand-text p {
	font-size: 0.8rem;
	color: var(--muted);
	margin: 4px 0 0;
}

.menu {
	display: grid;
	gap: 10px;
}

.menu-item {
	border: 1px solid transparent;
	background: rgba(255, 255, 255, 0.7);
	color: var(--ink);
	padding: 12px 14px;
	text-align: left;
	border-radius: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: 0.25s ease;
}

.menu-item:hover {
	transform: translateX(4px);
	border-color: rgba(13, 148, 136, 0.35);
}

.menu-item.active {
	color: #ffffff;
	background: linear-gradient(120deg, #0f766e, #0d9488);
	box-shadow: 0 10px 24px rgba(15, 118, 110, 0.34);
}

.main-content {
	padding: 24px;
}

.app-footer {
	margin-top: 18px;
	padding: 12px 14px;
	text-align: center;
	font-size: 0.84rem;
	font-weight: 600;
	color: #3f5e62;
	background: rgba(255, 255, 255, 0.78);
	border: 1px solid var(--line);
	border-radius: 12px;
}

.topbar {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
	align-items: center;
}

.topbar h2 {
	margin: 0;
	font: 700 1.6rem/1.2 "Outfit", sans-serif;
}

.topbar p {
	margin: 8px 0 0;
	color: var(--muted);
}

.topbar-meta {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 8px 14px;
	font-size: 0.9rem;
	font-weight: 600;
}


#activeUser {
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	background: #ecfdf5;
	color: #166534;
}

.btn-ghost {
	padding: 7px 12px;
	background: #e2e8f0;
	color: #0f172a;
	font-size: 0.86rem;
}

.section {
	display: none;
	animation: fadeIn 0.3s ease;
}

.section.active {
	display: block;
}

.cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 16px;
}

.metric-card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow);
	padding: 16px;
}

.metric-card h3 {
	margin: 0;
	font-size: 0.95rem;
	color: var(--muted);
}

.metric {
	margin: 10px 0 0;
	font: 700 2rem/1 "Outfit", sans-serif;
}

.tone-blue {
	border-top: 5px solid #0284c7;
}

.tone-green {
	border-top: 5px solid var(--ok);
}

.tone-cyan {
	border-top: 5px solid #06b6d4;
}

.tone-orange {
	border-top: 5px solid var(--accent);
}

.tone-red {
	border-top: 5px solid var(--danger);
}

.dashboard-grid {
	display: grid;
	grid-template-columns: 1.1fr 1.9fr;
	gap: 16px;
	margin-bottom: 16px;
}

.dashboard-grid.two-charts {
	grid-template-columns: 1fr 1fr;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 16px;
	box-shadow: var(--shadow);
}

.panel h3 {
	margin: 0 0 12px;
	font: 700 1.06rem/1.2 "Outfit", sans-serif;
}

.panel-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

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

.table-header-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.sort-control {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.84rem;
	color: var(--muted);
}

.sort-control select {
	min-width: 180px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--text);
}

.badge {
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.75rem;
	color: #7c2d12;
	background: #ffedd5;
}

.alerts-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.alerts-list li {
	border-left: 4px solid var(--accent);
	border-radius: 10px;
	background: #fff7ed;
	padding: 10px 12px;
	font-size: 0.92rem;
}

.alerts-list li.expired {
	border-left-color: var(--danger);
	background: #fef2f2;
}

.notification-result {
	margin: 10px 0 0;
	font-size: 0.85rem;
	color: #0f766e;
}

.mini-metrics-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.mini-metric-card {
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 12px;
	background: #ffffff;
	display: grid;
	gap: 6px;
}

.mini-metric-card span {
	font-size: 0.82rem;
	color: var(--muted);
	font-weight: 600;
}

.mini-metric-card strong {
	font: 700 1.35rem/1 "Outfit", sans-serif;
	color: #0f766e;
}


.readonly-note {
	display: inline-block;
	margin-bottom: 10px;
	font-size: 0.82rem;
	padding: 5px 10px;
	border-radius: 999px;
	background: #fef3c7;
	color: #92400e;
}

.table-wrap {
	overflow-x: auto;
}

.stock-chart-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	margin-top: 4px;
}

.stock-chart-grid canvas {
	width: 100% !important;
}

table {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

th,
td {
	border-bottom: 1px solid #dce9e7;
	padding: 10px;
	text-align: left;
	font-size: 0.92rem;
}

th {
	font-weight: 700;
	color: #1f4b4e;
	background: #f0f8f7;
}

tr:hover td {
	background: #f9fffe;
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.form-grid.compact {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
	display: grid;
	gap: 6px;
	font-size: 0.9rem;
	color: var(--muted);
}

input,
select,
textarea,
button {
	font: inherit;
}

input,
select,
textarea {
	width: 100%;
	border-radius: 10px;
	border: 1px solid #cce2e0;
	padding: 10px;
	background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid rgba(13, 148, 136, 0.2);
	border-color: #0d9488;
}

textarea {
	resize: vertical;
	min-height: 92px;
}

button {
	border: none;
	border-radius: 10px;
	padding: 10px 16px;
	cursor: pointer;
	font-weight: 700;
}

.btn-primary {
	color: #ffffff;
	background: linear-gradient(135deg, #0f766e, #0d9488);
}

.btn-secondary {
	color: #7c2d12;
	background: #ffedd5;
}

.btn-danger {
	color: #ffffff;
	background: #dc2626;
}

.btn-xs {
	padding: 6px 10px;
	font-size: 0.78rem;
	border-radius: 8px;
}

.table-actions {
	display: flex;
	gap: 6px;
}

.follow-up-dialog {
	width: min(620px, calc(100% - 24px));
	max-height: min(86vh, 760px);
	padding: 20px;
	border: 1px solid var(--line);
	border-radius: 8px;
	color: var(--ink);
	background: #ffffff;
	box-shadow: var(--shadow);
}

.follow-up-dialog::backdrop {
	background: rgba(15, 45, 47, 0.48);
	backdrop-filter: blur(3px);
}

.follow-up-dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
}

.follow-up-dialog-header h2 {
	margin: 0;
	font: 700 1.15rem/1.3 "Outfit", sans-serif;
}

.follow-up-dialog-header .eyebrow {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: 0.76rem;
	text-transform: uppercase;
}

.follow-up-history {
	display: grid;
	gap: 10px;
	max-height: 42vh;
	overflow-y: auto;
	margin-bottom: 18px;
}

.follow-up-entry {
	padding: 12px;
	border: 1px solid var(--line);
	border-left: 3px solid var(--primary);
	border-radius: 5px;
	background: #f7fbfa;
}

.follow-up-entry p {
	margin: 0 0 8px;
	white-space: pre-wrap;
	color: var(--ink);
}

.follow-up-entry small,
.follow-up-empty {
	color: var(--muted);
	font-size: 0.82rem;
}

.follow-up-empty {
	margin: 0;
	padding: 16px 12px;
	border: 1px dashed var(--line);
	text-align: center;
}

.follow-up-form {
	display: grid;
	gap: 10px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

.follow-up-form label {
	font-weight: 700;
}

.follow-up-form textarea {
	width: 100%;
}

.follow-up-datetime {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 12px;
}

.form-error {
	margin: 0;
	color: var(--danger);
	font-size: 0.86rem;
}

.status-pill {
	display: inline-block;
	border-radius: 999px;
	padding: 4px 10px;
	font-size: 0.76rem;
	font-weight: 700;
}

.status-safe {
	background: #ecfdf5;
	color: #166534;
}

.status-low {
	background: #fff7ed;
	color: #9a3412;
}

.status-empty {
	background: #fef2f2;
	color: #991b1b;
}

.status-pending {
	background: #eff6ff;
	color: #1d4ed8;
}

.status-done {
	background: #ecfdf5;
	color: #166534;
}

.status-cancelled {
	background: #fef2f2;
	color: #991b1b;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(4px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 1180px) {
	.cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.dashboard-grid,
	.dashboard-grid.two-charts,
	.form-grid,
	.form-grid.compact,
	.mini-metrics-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 860px) {
	.app-shell {
		grid-template-columns: 1fr;
	}

	.sidebar {
		position: fixed;
		left: 0;
		top: 0;
		height: 100vh;
		width: min(84vw, 320px);
		max-width: 320px;
		border-right: 1px solid rgba(13, 148, 136, 0.18);
		border-bottom: none;
		transform: translateX(-100%);
		transition: transform 0.28s ease;
		overflow-y: auto;
		padding-top: 16px;
	}

	.sidebar.open {
		transform: translateX(0);
	}

	.sidebar-header-mobile {
		display: flex;
	}

	.hamburger-btn {
		display: inline-flex;
	}

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

	.topbar {
		align-items: center;
		justify-content: flex-start;
		gap: 12px;
	}

	.topbar-meta {
		padding: 7px 10px;
		font-size: 0.82rem;
	}

	body.sidebar-open {
		overflow: hidden;
	}
}

@media (max-width: 560px) {
	.cards-grid {
		grid-template-columns: 1fr;
	}

	.main-content {
		padding: 14px;
	}

	.topbar h2 {
		font-size: 1.25rem;
	}

	.topbar p {
		font-size: 0.9rem;
	}

	.sidebar {
		padding: 14px;
	}

	.app-footer {
		font-size: 0.78rem;
		padding: 10px;
	}
}
