/* =============================================================================
   Autoservis Alen — cjenici (price list) application
   -----------------------------------------------------------------------------
   Single stylesheet for the public CSV list, login and admin pages.

   Palette and header/footer mirror the main website:
     page / header : #ffffff
     content       : #f6f6f6
     accent        : #ffcc33 / #fdb529
     ink / footer  : #1f2533
   ============================================================================= */

:root {
	/* Surfaces */
	--bg:        #f6f6f6;
	--bg-deep:   #ffffff;
	--panel:     #ffffff;
	--row:       #f5f6f8;
	--border:    #dde1f3;
	--line:      #c9cfe0;

	/* Text */
	--text:      #3b4252;
	--bright:    #1f2533;
	--muted:     #83889c;
	--link:      #8a5a00;

	/* Brand / accent */
	--accent:    #ffcc33;
	--accent-2:  #fdb529;
	--on-accent: #1f2533;

	/* Status */
	--danger:    #d61f45;
	--ok:        #1e8e3e;
	--on-danger: #ffffff;

	/* Inline code */
	--code:      #000;

	/* Buttons that need a strong dark fill */
	--strong-bg:   #1f2533;
	--strong-text: #ffffff;

	/* Header */
	--header-bg:       #ffffff;
	--header-text:     #1f1f1f;
	--header-image:    url('../img/slant.svg');
	--header-position: 800px center;

	/* Footer */
	--footer-bg:     #1f2533;
	--footer-text:   #ccd1dd;
	--footer-link:   #ccd1dd;
	--footer-line:   #282e3a;
	--footer-accent: #ffcc33;

	/* Scrollbar */
	--scrollbar-thumb:       #b8c0cf;
	--scrollbar-thumb-hover: #93a0b5;

	/* Effects */
	--shadow-color: #c9d1dd;
	--radius:       10px;
	--font:         'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* -----------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0 auto;
	max-width: 1400px;
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 16px;
	font-weight: 400;
	line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .7em;
	color: var(--bright);
	font-family: var(--font);
	font-weight: 700;
	line-height: 1.25;
}

h1 { font-size: 2em; }
h2 { font-size: 1.4em; }
h3 { font-size: 1.15em; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

code, kbd, samp {
	padding: .1em .4em;
	border-radius: 4px;
	background: var(--row);
	color: var(--code);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
	font-size: .9em;
	word-break: break-word;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

/* -----------------------------------------------------------------------------
   Site header — mirrors the main Autoservis Alen navigation
   -------------------------------------------------------------------------- */
.site-header {
	position: relative;
	padding: 2em 4em;
	background-color: var(--header-bg);
	background-image: var(--header-image);
	background-repeat: no-repeat;
	background-position: var(--header-position);
	background-size: cover;
	box-shadow: 0 8px 10px -9px #26282f;
	font-family: var(--font);
}

.topnav {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	overflow: hidden;
}

#brand {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	margin-right: 50px;
	padding: 0;
	border: 0 !important;
}

#logo {
	display: block;
	width: auto;
	height: 50px;
}

.topnav a {
	display: block;
	height: 58px;
	margin: 0 8px;
	padding: 0 6px;
	border-bottom: 3px solid transparent;
	color: var(--header-text);
	font-size: 16px;
	font-weight: 600;
	line-height: 58px;
	text-transform: uppercase;
	white-space: nowrap;
}

.topnav a:not(#brand):hover,
.topnav a.active {
	border-bottom-color: var(--accent);
	color: var(--header-text);
	text-decoration: none;
}

#toggler {
	display: none;
	padding: 10px;
	border: 0;
	background: none;
	cursor: pointer;
}

.bar1, .bar2, .bar3 {
	display: block;
	width: 35px;
	height: 5px;
	margin: 6px 0;
	background-color: var(--header-text);
	transition: transform .3s, opacity .3s, background-color .3s;
}

#toggler.change .bar1 { transform: rotate(-45deg) translate(-9px, 6px); }
#toggler.change .bar2 { opacity: 0; }
#toggler.change .bar3 { transform: rotate(45deg) translate(-8px, -8px); }

/* -----------------------------------------------------------------------------
   Admin bar (only rendered on the admin page)
   -------------------------------------------------------------------------- */
.adminbar {
	border-bottom: 1px solid var(--border);
	background: var(--bg-deep);
}

.adminbar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .75em 1.5em;
	padding: .7em 4em;
	font-size: .9em;
}

.adminbar-title {
	color: var(--bright);
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.adminbar-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.25em;
}

.adminbar-nav a,
.adminbar .who { color: var(--muted); }

.adminbar-nav a:hover { color: var(--link); }

.adminbar .who { font-weight: 600; }

/* -----------------------------------------------------------------------------
   Main / page scaffolding
   -------------------------------------------------------------------------- */
main {
	min-height: 45vh;
	padding: 3em 4em 4em;
	background-color: var(--bg-deep);
}

.page-head {
	margin-bottom: 2em;
	padding-bottom: 1.25em;
	border-bottom: 3px solid var(--accent);
}

.page-head h1 { margin-bottom: .25em; }
.page-head p { margin-bottom: 0; }

.card {
	margin: 0 0 1.5em;
	padding: 1.6em 1.8em;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--panel);
	box-shadow: 0 1px 4px rgba(17, 24, 39, .08);
}

.card > :last-child { margin-bottom: 0; }
.card h2 { margin-top: 0; }

.notice-card { border-left: 4px solid var(--accent); }

.muted { color: var(--muted); }
.footnote { margin-top: 1.1em; font-size: .85em; }

/* -----------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-scroll {
	overflow-x: auto;
	margin: 0 -.25em;
	padding: 0 .25em;
}

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

th, td {
	padding: .75em .8em;
	border-bottom: 1px solid var(--border);
	text-align: left;
	vertical-align: middle;
}

th {
	border-bottom: 2px solid var(--line);
	color: var(--muted);
	font-size: .78em;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	white-space: nowrap;
}

tbody tr:hover td { background: var(--row); }

th.actions,
td.actions {
	text-align: right;
	white-space: nowrap;
}

td.actions .btn { margin-left: .35em; }

/* -----------------------------------------------------------------------------
   Buttons, badges, notices
   -------------------------------------------------------------------------- */
.btn,
button,
input[type="submit"],
input[type="button"] {
	display: inline-block;
	padding: .6em 1.15em;
	border: 0;
	border-radius: 6px;
	background-color: var(--accent);
	color: var(--on-accent);
	font-family: var(--font);
	font-size: .85em;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .04em;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s, transform .15s;
}

.btn:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
	background-color: var(--accent-2);
	text-decoration: none;
}

.btn:active,
button:active,
input[type="submit"]:active { transform: translateY(1px); }

button.link {
	padding: 0;
	background: none;
	color: var(--link);
	font-size: inherit;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
}

button.link:hover { background: none; text-decoration: underline; }

.btn-download {
	background-color: var(--strong-bg);
	color: var(--strong-text);
}

.btn-download:hover { background-color: var(--strong-bg); filter: brightness(.92); }

.btn-delete {
	background-color: var(--danger);
	color: var(--on-danger);
}

.btn-delete:hover { background-color: var(--danger); filter: brightness(.9); }

.badge {
	display: inline-block;
	margin-left: .3em;
	padding: .14em .55em;
	border-radius: 999px;
	background: var(--accent);
	color: var(--on-accent);
	font-size: .7em;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	vertical-align: middle;
}

.notice,
.error,
.error-notice {
	margin: 0 0 1.2em;
	padding: .85em 1.15em;
	border: 1px solid transparent;
	border-radius: 8px;
}

.notice {
	border-color: color-mix(in srgb, var(--ok) 40%, transparent);
	background: color-mix(in srgb, var(--ok) 12%, transparent);
	color: var(--ok);
}

.error,
.error-notice {
	border-color: color-mix(in srgb, var(--danger) 40%, transparent);
	background: color-mix(in srgb, var(--danger) 12%, transparent);
	color: var(--danger);
}

.error strong,
.error-notice strong { color: inherit; }

/* -----------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
label {
	display: block;
	margin-bottom: .35em;
	color: var(--muted);
	font-size: .82em;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="file"],
select,
textarea {
	width: 100%;
	padding: .62em .8em;
	border: 1px solid var(--border);
	border-radius: 6px;
	background-color: var(--row);
	color: var(--text);
	font-family: var(--font);
	font-size: 1em;
	line-height: 1.4;
	transition: border-color .2s, box-shadow .2s;
}

input[type="file"] { padding: .35em; }

input:focus,
select:focus,
textarea:focus {
	border-color: var(--accent);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}

input[type="checkbox"] { width: auto; accent-color: var(--accent); }

.fields {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1em;
	margin-top: 1.1em;
}

.field { flex: 1 1 190px; }
.field input[type="submit"] { width: auto; }

form.inline { display: inline; }

/* -----------------------------------------------------------------------------
   Login page
   -------------------------------------------------------------------------- */
.login-main {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 4em;
}

.login-card {
	width: min(430px, 100%);
	padding: 2.2em 2.4em;
}

.login-card h1 {
	margin-bottom: .35em;
	font-size: 1.6em;
}

.login-card .lead { margin-bottom: 1.6em; }

.login-card label { margin-top: 1em; }
.login-card input[type="submit"] { width: 100%; margin-top: 1.5em; }

.login-card .remember {
	display: flex;
	align-items: center;
	gap: .5em;
	margin-top: 1em;
	text-transform: none;
	font-weight: 400;
	letter-spacing: 0;
}

.login-links {
	margin-top: 1.4em;
	font-size: .85em;
	text-align: center;
}

/* -----------------------------------------------------------------------------
   Admin table extras
   -------------------------------------------------------------------------- */
.edit-cell { padding-top: 0; }
.edit-cell details.edit summary {
	display: inline-block;
	color: var(--link);
	font-size: .82em;
	font-weight: 600;
	cursor: pointer;
}
.edit-cell details.edit summary:hover { text-decoration: underline; }
.edit-cell details.edit .fields { margin-top: .9em; }

/* -----------------------------------------------------------------------------
   Site footer — mirrors the main Autoservis Alen footer
   -------------------------------------------------------------------------- */
.site-footer {
	padding: 2em 4em;
	background-color: var(--footer-bg);
	color: var(--footer-text);
	font-family: var(--font);
	font-size: 14px;
}

.site-footer::after {
	content: "";
	display: table;
	clear: both;
}

.footer-nav {
	float: left;
	width: 70%;
}

.footer-nav a {
	display: inline-block;
	margin-right: 4px;
	padding: 0 10px 12px;
	border-bottom: 2px solid var(--footer-line);
	color: var(--footer-link);
	font-size: 14px;
	line-height: 44px;
}

.footer-nav a:hover,
.footer-nav a.active {
	border-bottom-color: var(--footer-accent);
	color: #fff;
	text-decoration: none;
}

.footer-about {
	float: right;
	width: 30%;
	text-align: right;
}

.footer-about p {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
}

.copyright {
	display: inline-block;
	margin-top: 40px;
	font-size: 13px;
	color: var(--footer-text);
}

/* Back to top */
.cd-top {
	position: fixed;
	bottom: 30px;
	left: 20px;
	z-index: 9999;
	width: 50px;
	height: 50px;
	background: url('../img/totop.svg') center / contain no-repeat;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s, visibility .3s;
}

.cd-top.cd-top--show { opacity: 1; visibility: visible; }

/* -----------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 900px) {
	main { padding: 2.5em 2em 3em; }
	.adminbar-inner { padding: .7em 2em; }
	.footer-nav a { margin-right: 0; }
}

@media only screen and (max-width: 768px) {
	.site-header {
		padding: 1.25em 1.5em;
		background-position: 120px center;
	}

	.topnav { min-height: 56px; }
	#brand { margin-right: 0; }
	#logo { height: 44px; }

	.topnav a {
		display: none;
		height: auto;
		margin: 0;
		padding: .55em 0;
		line-height: 1.4;
		border-bottom: 1px solid var(--border);
	}

	.topnav a#brand { display: inline-flex; border: 0; }

	#toggler {
		display: block;
		position: absolute;
		right: 0;
		top: 0;
	}

	.topnav.responsive a { display: block; text-align: left; }
	.topnav.responsive a#brand { display: inline-flex; }
	.topnav.responsive a:not(#brand) { padding: .65em 0; }

	main { padding: 2em 1.25em 2.5em; }
	.card { padding: 1.3em 1.25em; }

	.adminbar-inner {
		align-items: flex-start;
		padding: .8em 1.25em;
	}

	.adminbar-nav { gap: .35em 1em; }

	.footer-nav,
	.footer-about {
		float: none;
		width: 100%;
		text-align: left;
		margin-bottom: 1.5em;
	}

	.footer-nav a {
		display: block;
		padding: 6px;
		line-height: 30px;
		border-bottom: 1px solid var(--footer-line);
	}

	.copyright { margin-top: 1em; }

	.login-main { padding-top: 2em; }
	.login-card { padding: 1.6em 1.4em; }

	.fields { display: block; }
	.field { margin-bottom: .9em; }
	.field input[type="submit"] { width: 100%; }
}

/* The public price list also loads style.css. Keep its mobile navigation
   consistent with the other public pages instead of mixing the two layouts. */
@media only screen and (max-width: 768px) {
	.page-files .site-header { padding: 2em; }
	.page-files .topnav { display: block; }
	.page-files .topnav a {
		float: left;
		font-size: 25px;
		font-weight: 400;
		line-height: 1.5;
		text-transform: none;
	}
	.page-files .topnav a#brand { display: block; padding: 0; }
	.page-files #logo { height: 50px; }
	.page-files .topnav #toggler {
		position: static;
		float: right;
		display: block;
		margin-top: 5px;
		padding: 0;
	}
	.page-files .topnav.responsive #toggler {
		position: absolute;
		right: 0;
		top: 0;
	}
	.page-files .topnav.responsive a { float: none; display: block; }
	.page-files .topnav.responsive a:not(#brand) { padding: .5em 0; }
	.page-files #toggler .bar1,
	.page-files #toggler .bar2,
	.page-files #toggler .bar3 { background-color: #fff; }
	.page-files #toggler.change .bar1,
	.page-files #toggler.change .bar3 { background-color: #1f2533; }
}
