/* CGO common theme - loaded on every screen (includes/header.inc, menu, login, location, password).
   Colour themes are picked from the main menu and stored in the cgo_theme cookie; header.inc puts the
   value on <html data-theme="...">. Add a theme = add one html[data-theme] block below. */

/* Light palettes: soft tinted bars with dark text, medium tone for buttons/links.
   --brand = buttons/links, --brand-dark = text/headings, --brand-soft = light fills,
   --bar-bg / --bar-ink = header bars (menu, page top, login card head), --accent = location chip / menu button */
:root, html[data-theme="blue"]   { --brand: #3b82f6; --brand-dark: #1e3a8a; --brand-soft: #e8f0fe; --accent: #34d399; --bg: #f5f8fd; --bar-bg: linear-gradient(90deg, #dbe8ff, #eef4ff); --bar-ink: #1e3a8a; --bar-line: rgba(30,58,138,.25); }
html[data-theme="green"]         { --brand: #22c55e; --brand-dark: #14532d; --brand-soft: #e7f8ee; --accent: #f59e0b; --bg: #f4faf6; --bar-bg: linear-gradient(90deg, #d5f5e0, #ecfaf1); --bar-ink: #14532d; --bar-line: rgba(20,83,45,.25); }
html[data-theme="teal"]          { --brand: #14b8a6; --brand-dark: #134e4a; --brand-soft: #e0f7f4; --accent: #fb923c; --bg: #f3fafa; --bar-bg: linear-gradient(90deg, #cdf1ec, #e9f9f7); --bar-ink: #134e4a; --bar-line: rgba(19,78,74,.25); }
html[data-theme="purple"]        { --brand: #8b5cf6; --brand-dark: #4c1d95; --brand-soft: #efe9fe; --accent: #34d399; --bg: #f8f6fd; --bar-bg: linear-gradient(90deg, #e6dcff, #f3eeff); --bar-ink: #4c1d95; --bar-line: rgba(76,29,149,.25); }
html[data-theme="rose"]          { --brand: #f43f5e; --brand-dark: #881337; --brand-soft: #ffe9ee; --accent: #38bdf8; --bg: #fdf6f8; --bar-bg: linear-gradient(90deg, #ffdbe3, #fff0f3); --bar-ink: #881337; --bar-line: rgba(136,19,55,.25); }
html[data-theme="orange"]        { --brand: #f97316; --brand-dark: #7c2d12; --brand-soft: #ffeede; --accent: #06b6d4; --bg: #fdf8f3; --bar-bg: linear-gradient(90deg, #ffe1c7, #fff3e8); --bar-ink: #7c2d12; --bar-line: rgba(124,45,18,.25); }
html[data-theme="grey"]          { --brand: #64748b; --brand-dark: #1e293b; --brand-soft: #eceff3; --accent: #22c55e; --bg: #f5f7fa; --bar-bg: linear-gradient(90deg, #e2e8f0, #f1f5f9); --bar-ink: #1e293b; --bar-line: rgba(30,41,59,.25); }
/* old names keep working */
html[data-theme="maroon"]        { --brand: #f43f5e; --brand-dark: #881337; --brand-soft: #ffe9ee; --accent: #38bdf8; --bg: #fdf6f8; --bar-bg: linear-gradient(90deg, #ffdbe3, #fff0f3); --bar-ink: #881337; --bar-line: rgba(136,19,55,.25); }
html[data-theme="slate"]         { --brand: #64748b; --brand-dark: #1e293b; --brand-soft: #eceff3; --accent: #22c55e; --bg: #f5f7fa; --bar-bg: linear-gradient(90deg, #e2e8f0, #f1f5f9); --bar-ink: #1e293b; --bar-line: rgba(30,41,59,.25); }

:root {
	--card: #ffffff; --ink: #1c2a3a; --muted: #6b7a90; --line: #d9e0ea; --danger: #e5484d;
	--radius: 10px; --shadow: 0 6px 20px rgba(16, 38, 73, .08);
	--font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

/* ---------- base look for the legacy screens ---------- */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.4; color: var(--ink); background: var(--bg) !important; }
a { color: var(--brand-dark); }
a:hover { color: var(--brand); }
h1, h2, h3, h4 { color: var(--brand-dark); font-weight: 600; margin: .6em 0 .4em; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
hr { border: 0; border-top: 1px solid var(--line); }
img { max-width: 100%; }

/* tables: light grid, brand-tinted header cells */
table { border-collapse: collapse; font-family: var(--font); }
th { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; padding: 6px 8px; text-align: left; border-bottom: 2px solid var(--brand); }
td { padding: 4px 6px; vertical-align: middle; }
table[border="1"] td, table[border="1"] th { border: 1px solid var(--line); }
tr:hover > td[bgcolor] { filter: brightness(.98); }

/* form controls */
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="email"], input[type="search"], input[type="tel"], input[type="file"], select, textarea {
	font-family: var(--font); font-size: 13px; color: var(--ink); background: #fff;
	border: 1px solid #c7d0dc; border-radius: 6px; padding: 5px 8px; box-sizing: border-box; max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[readonly], input[disabled], select[disabled] { background: #f1f4f8; color: var(--muted); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); width: 16px; height: 16px; vertical-align: middle; }
label { color: var(--ink); }

input[type="submit"], input[type="button"], input[type="reset"], button {
	font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer;
	background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 8px; padding: 7px 14px;
}
input[type="submit"]:hover, input[type="button"]:hover, button:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
input[type="reset"], input[type="button"][value*="Back" i], input[type="button"][value*="Cancel" i], button.secondary { background: #fff; color: var(--brand-dark); border-color: #c7d0dc; }
input[type="reset"]:hover, input[type="button"][value*="Back" i]:hover, input[type="button"][value*="Cancel" i]:hover { background: var(--brand-soft); }

/* w3.css theme classes used across the old pages follow the chosen colour */
.w3-theme, .w3-theme-d1, .w3-theme-d2, .w3-theme-d3 { background-color: var(--brand) !important; color: #fff !important; }
.w3-theme-l1, .w3-theme-l2, .w3-theme-l3, .w3-theme-l4, .w3-theme-l5, .w3-theme-light { background-color: var(--brand-soft) !important; color: var(--brand-dark) !important; }
.w3-button.w3-blue, .w3-button.w3-light-blue, .w3-button.w3-indigo { background-color: var(--brand) !important; color: #fff !important; }

/* scrollbars (WebKit) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #c7d0dc; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }

/* print: no header bar, plain white */
@media print {
	body { background: #fff !important; font-size: 12px; }
	.cgo-top { display: none !important; }
}

/* small screens: let wide legacy tables scroll instead of breaking the page */
@media (max-width: 700px) {
	body { font-size: 14px; }
	input[type="submit"], input[type="button"], button { padding: 9px 14px; }
}
