@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

/* -- Variables ---------------------------------------------------------- */
:root {
	/* Palette */
	--bg:         #f0f2f5;
	--surface:    #ffffff;
	--card:       #ffffff;
	--text:       #1a1a2e;
	--muted:      #7a7a9a;
	--border:     #e0e0ec;
	--error:      #EE4B2B;

	/* Shape */
	--radius:     12px;
	--shadow:     0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.05);
	--input-h:    48px;

	/* Brand colours */
	--green:      #01433B;
	--blue:       #1a56db;
	--amber:      #92400e;
	--red:        #dc2626;

	/* Button aliases */
	--btn-green:  #01433B;
	--btn-blue:   #2563eb;
	--btn-red:    #dc2626;
	--btn-amber:  #d97706;
	--btn-gray:   #4b5563;
	--btn-purple: #7c3aed;
}

/* -- Base --------------------------------------------------------------- */
body {
	font-family: 'DM Sans', 'IBM Plex Sans', system-ui, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	padding: 20px 16px 40px;
}

/* Mobile page wrapper */
.page { width: 100%; max-width: 480px; }

/* Desktop page wrapper */
.wrap {
	max-width: 100%;
	margin: 0 auto;
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	padding: 2px;
	height: 100vh;
	display: flex;
	flex-direction: column;
}

h1 {
	font-size: 1.4rem;
	font-weight: 600;
	text-align: center;
	margin-bottom: 24px;
	color: var(--text);
	letter-spacing: -.3px;
}

/* -- Page header (desktop) ---------------------------------------------- */
.page-header {
	background: var(--green);
	color: #fff;
	border-radius: var(--radius);
	padding: 10px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	box-shadow: var(--shadow);
}
.page-header strong { font-size: 15px; font-weight: 600; }
.page-header span   { font-size: 13px; color: rgba(255,255,255,.75); }
.page-header a      { font-size: 12px; color: rgba(255,255,255,.7); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.page-header a:hover { color: #fff; }

/* -- Three-column layout (desktop) ------------------------------------- */
.cols { display: flex; gap: 16px; align-items: stretch; flex: 1; min-height: 0; }
.col  { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
@media (max-width: 960px) { .cols { flex-direction: column; } }

/* -- Cards -------------------------------------------------------------- */

/* Mobile card ? padded */
.card {
	background: var(--card);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 16px;
	box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.card-title {
	font-size: 1.25rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var(--muted);
	text-align: center;
	margin-bottom: 14px;
}

/* Mobile card ? no padding (m- variant) */
.m-card { background: var(--card); border-radius: var(--radius); margin-bottom: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden; }
.m-card-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 14px 16px 6px; }
.m-card-body  { padding: 0 16px 16px; }

/* Desktop card (header + body) */
.card-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	border-radius: var(--radius) var(--radius) 0 0;
	gap: 8px;
	min-height: 44px;
	flex-shrink: 0;
}
.card-header h5  { font-size: 13px; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 6px; color: #fff; }
.card-header a   { font-size: 11px; font-weight: 500; text-decoration: none; color: #000; display: flex; align-items: center; gap: 4px; }
.card-header a:hover { color: var(--green); }
.card-header.blue  { background: var(--blue); }
.card-header.green { background: var(--green); }
.card-header.amber { background: var(--amber); }

.card-body { padding: 0; border-radius: 0 0 var(--radius) var(--radius); flex: 1; min-height: 0; overflow-y: auto; }

/* -- Form elements ------------------------------------------------------ */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; font-weight: 500; color: var(--muted); margin-bottom: 5px; }

input[type="text"],
input[type="date"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="password"],
select,
textarea {
	width: 100%;
	height: var(--input-h);
	padding: 0 14px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius);
	font-family: inherit;
	font-size: .95rem;
	color: var(--text);
	background: #fff;
	appearance: none;
	-webkit-appearance: none;
	outline: none;
	transition: border-color .2s;
	text-align: center;
}
textarea { height: auto; padding: 12px 14px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--btn-blue); }

.select-wrap { position: relative; }
.select-wrap::after { content: '?'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; font-size: .85rem; }

/* -- Buttons ------------------------------------------------------------ */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }

.btn {
	flex: 1 1 calc(50% - 5px);
	height: var(--input-h);
	border: none;
	border-radius: var(--radius);
	font-family: inherit;
	font-size: .9rem;
	font-weight: 600;
	color: #fff;
	cursor: pointer;
	transition: opacity .15s, transform .1s;
	letter-spacing: .01em;
	white-space: nowrap !important;
}
.btn:active  { opacity: .85; transform: scale(.97); }
.btn-full    { flex: 1 1 100%; }
.btn-green   { background: var(--btn-green); }
.btn-blue    { background: var(--btn-blue); }
.btn-red     { background: var(--btn-red); }
.btn-amber   { background: var(--btn-amber); }
.btn-gray    { background: var(--btn-gray); }
.btn-purple  { background: var(--btn-purple); }

/* Full-width (m- variant) */
.m-btn { width: 100%; height: var(--input-h); border: none; border-radius: var(--radius); font-family: inherit; font-size: .95rem; font-weight: 600; color: #fff; cursor: pointer; transition: opacity .15s, transform .1s; }
.m-btn:active  { opacity: .85; transform: scale(.98); }
.m-btn-green   { background: var(--btn-green); }
.m-btn-red     { background: var(--btn-red); }

/* Small inline */
.m-btn-sm { height: 32px; padding: 0 12px; border: none; border-radius: 8px; font-family: inherit; font-size: .8rem; font-weight: 600; color: #fff; cursor: pointer; }

/* Login submit */
.btn-submit { width: 100%; height: var(--input-h); background: var(--btn-red); color: #fff; border: none; border-radius: var(--radius); font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 6px; transition: opacity .15s, transform .1s; }
.btn-submit:active { opacity: .85; transform: scale(.97); }

/* -- Dropdown ----------------------------------------------------------- */
.dropdown { position: relative; }
.dropdown-btn { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 5px; padding: 4px 10px; font-size: 11px; font-weight: 500; font-family: inherit; cursor: pointer; display: flex; align-items: center; gap: 5px; }
.dropdown-btn:hover { background: rgba(255,255,255,.28); }
.dropdown-btn::after { content: '?'; font-size: 9px; }

.dropdown-menu { display: none; position: absolute; right: 0; top: calc(100% + 1px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.14); min-width: 210px; z-index: 200; overflow: hidden; }
.dropdown:hover .dropdown-menu { display: block; }

.dropdown-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 13px; color: var(--text); text-decoration: none; cursor: pointer; transition: background .1s; border: none; background: none; width: 100%; text-align: left; font-family: inherit; }
.dropdown-item:hover { background: var(--bg); }
.dropdown-item.active { background: var(--bg); font-weight: 600; color: var(--green); border-left: 3px solid var(--green); padding-left: 11px; }
.dropdown-item i { width: 16px; text-align: center; flex-shrink: 0; }
.dropdown-divider { border: none; border-top: 1px solid var(--border); margin: 3px 0; }

/* -- Icon colour helpers ------------------------------------------------ */
.text-info      { color: #0891b2; }
.text-primary   { color: var(--blue); }
.text-warning   { color: #d97706; }
.text-secondary { color: var(--muted); }
.text-success   { color: #16a34a; }
.text-danger    { color: var(--red); }
.disabled       { color: var(--muted); }

/* -- Nav list ----------------------------------------------------------- */
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list li { border-bottom: 1.5px solid var(--border); }
.nav-list li:last-child { border-bottom: none; }
.nav-list li a { display: block; padding: 12px 14px; font-size: .95rem; font-weight: 500; color: var(--text); text-decoration: none; border-radius: var(--radius); transition: background .15s, color .15s; }
.nav-list li a:hover,
.nav-list li a:active { background: var(--bg); color: var(--btn-blue); }
.nav-list li a.active  { background: var(--btn-amber); color: #fff; }

/* -- Misc UI ------------------------------------------------------------ */
.divider { border: none; border-top: 1.5px solid var(--border); margin: 16px 0; }

#result { background: var(--card); border-radius: var(--radius); padding: 16px; min-height: 60px; font-size: .9rem; color: var(--muted); text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.07); margin-bottom: 15px; }

iframe { background: #fafafa; display: block; }

/* -- Login / auth page -------------------------------------------------- */
.logo-wrap { text-align: center; margin-bottom: 24px; }
.logo-wrap img { width: 220px; max-width: 100%; }
.subtext { font-size: .82rem; color: var(--muted); text-align: center; margin-bottom: 22px; line-height: 1.5; }
.forgot { text-align: center; margin-top: 5px; }
.forgot a { color: var(--muted); text-decoration: none; cursor: pointer; }
.error { color: var(--error); font-weight: bold; }
.rules { font-size: .75rem; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.rules span { display: block; }
.rules span.met { color: #16a34a; }
.notice { font-size: .78rem; color: var(--muted); text-align: center; line-height: 1.5; margin-top: 16px; }
.notice a { color: var(--btn-red); text-decoration: none; }
.browser-warn { background: #fff3cd; border: 1.5px solid #ffc107; border-radius: var(--radius); padding: 12px 16px; font-size: .85rem; text-align: center; color: #7a5800; margin-top: 12px; }
.ua-info { text-align: center; font-size: .7rem; color: var(--muted); margin-top: 10px; }

/* -- PO table ----------------------------------------------------------- */
.po-vendor { font-weight: 600; font-size: .95rem; padding: 12px 16px 4px; border-top: 1px solid var(--border); color: var(--text); }
.po-vendor:first-child { border-top: none; }
.po-meta { font-size: .78rem; color: var(--muted); padding: 0 16px 8px; }
.po-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.po-table th { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 16px; text-align: left; }
.po-table th:last-child { text-align: right; }
.po-table td { padding: 6px 16px; border-top: 1px solid var(--border); }
.po-table td:nth-child(1) { width: 50px; color: var(--muted); }
.po-table td:nth-child(3),
.po-table td:nth-child(4) { text-align: right; white-space: nowrap; }
.po-footer { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; border-top: 2px solid var(--border); background: #f8f8fc; }
.po-footer-total { font-weight: 600; font-size: .95rem; }
.po-footer-actions { display: flex; gap: 8px; }
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); font-size: .9rem; }

/* -- Market badges ------------------------------------------------------ */
.MI  { background-color: #ffffff; }
.OH  { background-color: orange; }
.TX  { background-color: darkblue;  color: white; padding: 4px; }
.AV  { background-color: #99ff99;   padding: 4px; }
.GA  { background-color: blue;      color: white; padding: 4px; }
.IL  { background-color: green;     color: white; padding: 4px; }
.NC  { background-color: gold;      color: black; padding: 4px; }
.NJ  { background-color: red;       color: white; padding: 4px; }
.NC2 { background-color: red;       color: white; padding: 4px; }
.HST { background-color: orange;    padding: 4px; }
.TN  { background-color: orange;    padding: 4px; }
.RI  { background-color: gold;      color: black; padding: 4px; }
.MA  { background-color: green;     color: white; padding: 4px; }
.PA  { background-color: darkblue;  color: white; padding: 4px; }
.FL  { background-color: green;     color: white; padding: 4px; }

/* -- Scan / status badges ----------------------------------------------- */
.scan     { width: 300px; height: 50px; padding: 3px; }
.received { background-color: green; color: white; padding: 4px; width: 90%; }
.shipped  { background-color: gold;  color: black; padding: 4px; width: 90%; }
.pick     { background-color: black; color: white; padding: 4px; text-align: center; }
