/*
 * BIMCAD frontend app stilovi - port originalnog wwwroot/css/site.css (paleta, sidebar+topbar
 * layout, komponente). Cijeli domen je sada ova aplikacija, pa se CSS primjenjuje globalno
 * (nema #bimcad-wrap scoping kao u wp-admin varijanti).
 */
:root {
	--navy: #14213d;
	--blue: #377cf6;
	--blue-soft: #ebf2ff;
	--ink: #172033;
	--muted: #778197;
	--line: #e8ebf1;
	--surface: #fff;
	--background: #f5f7fb;
	--green: #20a977;
	--orange: #ed9b3b;
	--red: #df5c66;
	--violet: #8369e8;
	--shadow: 0 1px 2px rgba( 20, 33, 61, 0.06 ), 0 8px 24px rgba( 20, 33, 61, 0.04 );
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	background: var( --background );
	color: var( --ink );
	font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

h1, h2, h3 { color: var( --navy ); font-weight: 800; margin: 0 0 0.5em; }

.bimcad-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	min-height: 100vh;
}

/* --- Sidebar --- */
.bimcad-sidebar {
	background: var( --navy );
	color: #fff;
	padding: 24px 16px;
	position: sticky;
	top: 0;
	height: 100vh;
	overflow-y: auto;
}
.bimcad-sidebar-brand {
	font-size: 1.3em;
	font-weight: 800;
	letter-spacing: 0.04em;
	margin-bottom: 24px;
	padding: 0 8px;
}
.bimcad-sidebar-group { margin-bottom: 20px; }
.bimcad-sidebar-group-label {
	display: block;
	font-size: 0.72em;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: rgba( 255, 255, 255, 0.45 );
	padding: 0 8px 6px;
}
.bimcad-nav-link {
	display: block;
	padding: 10px 12px;
	border-radius: 8px;
	color: rgba( 255, 255, 255, 0.82 );
	font-weight: 600;
	font-size: 0.94em;
}
.bimcad-nav-link:hover { background: rgba( 255, 255, 255, 0.08 ); text-decoration: none; }
.bimcad-nav-link.is-active { background: var( --blue ); color: #fff; }

.bimcad-sidebar-toggle {
	display: none;
	position: fixed;
	top: 14px;
	left: 14px;
	z-index: 50;
	background: var( --navy );
	color: #fff;
	border: none;
	border-radius: 8px;
	width: 40px;
	height: 40px;
	font-size: 1.2em;
	cursor: pointer;
}
.bimcad-scrim {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba( 20, 33, 61, 0.5 );
	z-index: 39;
}

/* --- Topbar --- */
.bimcad-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 28px;
	background: var( --surface );
	border-bottom: 1px solid var( --line );
	position: sticky;
	top: 0;
	z-index: 10;
}
.bimcad-topbar-title { font-size: 1.15em; font-weight: 800; color: var( --navy ); }
.bimcad-topbar-actions { display: flex; align-items: center; gap: 14px; position: relative; }

.bimcad-user-menu { position: relative; }
.bimcad-user-menu-trigger {
	background: var( --blue-soft );
	color: var( --blue );
	border: none;
	border-radius: 999px;
	padding: 8px 16px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}
.bimcad-dropdown {
	display: none;
	position: absolute;
	right: 0;
	top: calc( 100% + 8px );
	background: var( --surface );
	border: 1px solid var( --line );
	border-radius: 10px;
	box-shadow: var( --shadow );
	min-width: 180px;
	padding: 6px;
	z-index: 20;
}
.bimcad-dropdown.is-open { display: block; }
.bimcad-dropdown a {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	color: var( --ink );
	font-weight: 600;
	font-size: 0.92em;
}
.bimcad-dropdown a:hover { background: var( --blue-soft ); text-decoration: none; }

/* --- Content --- */
.bimcad-content { padding: 28px; max-width: 1200px; }

/* --- Cards / stats --- */
.bimcad-stat-cards {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
	gap: 16px;
	margin-bottom: 24px;
}
.bimcad-stat-card {
	background: var( --surface );
	border: 1px solid var( --line );
	border-radius: 14px;
	padding: 20px;
	box-shadow: var( --shadow );
}
.bimcad-stat-card--dark { background: var( --navy ); color: #fff; border-color: var( --navy ); }
.bimcad-stat-label { font-size: 0.85em; color: var( --muted ); font-weight: 600; margin-bottom: 6px; }
.bimcad-stat-card--dark .bimcad-stat-label { color: rgba( 255, 255, 255, 0.65 ); }
.bimcad-stat-value { font-size: 1.7em; font-weight: 800; color: var( --navy ); }
.bimcad-stat-card--dark .bimcad-stat-value { color: #fff; }

/* --- Panels / tables --- */
.bimcad-panel {
	background: var( --surface );
	border: 1px solid var( --line );
	border-radius: 14px;
	padding: 22px;
	box-shadow: var( --shadow );
	margin-bottom: 22px;
}

.bimcad-table { width: 100%; border-collapse: collapse; }
.bimcad-table th {
	text-align: left;
	font-size: 0.8em;
	color: var( --muted );
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 10px 12px;
	border-bottom: 1px solid var( --line );
}
.bimcad-table td { padding: 12px; border-bottom: 1px solid var( --line ); vertical-align: middle; }
.bimcad-table tr:last-child td { border-bottom: none; }
.bimcad-table .bimcad-row-actions a { margin-right: 10px; font-size: 0.9em; font-weight: 600; }
.bimcad-table .bimcad-row-actions .bimcad-link-danger { color: var( --red ); }

.bimcad-empty { padding: 32px; text-align: center; color: var( --muted ); }

/* --- Badges --- */
.bimcad-badge { display: inline-block; padding: 0.2em 0.8em; border-radius: 999px; font-size: 0.85em; font-weight: 700; }
.bimcad-badge--neutral { background: var( --blue-soft ); color: var( --blue ); }
.bimcad-badge--paid { background: #e6f7f0; color: var( --green ); }
.bimcad-badge--unpaid { background: #fdeced; color: var( --red ); }
.bimcad-badge--pending { background: #fef3e6; color: var( --orange ); }

/* --- Forms --- */
.bimcad-form { max-width: 720px; }
.bimcad-form-section { margin-bottom: 26px; }
.bimcad-form-section-title { display: flex; align-items: center; font-weight: 700; color: var( --ink ); margin-bottom: 14px; }
.bimcad-section-number {
	display: inline-flex; align-items: center; justify-content: center;
	width: 1.9em; height: 1.9em; border-radius: 50%;
	background: var( --blue-soft ); color: var( --blue );
	font-size: 0.7em; font-weight: 700; margin-right: 0.6em; flex-shrink: 0;
}
.bimcad-field { margin-bottom: 16px; }
.bimcad-field label { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 6px; color: var( --ink ); }
.bimcad-field input[type="text"],
.bimcad-field input[type="email"],
.bimcad-field input[type="url"],
.bimcad-field input[type="tel"],
.bimcad-field input[type="number"],
.bimcad-field input[type="password"],
.bimcad-field input[type="date"],
.bimcad-field input[type="search"],
.bimcad-field select,
.bimcad-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var( --line );
	border-radius: 8px;
	font-family: inherit;
	font-size: 0.95em;
	background: var( --surface );
	color: var( --ink );
}
.bimcad-field input:focus, .bimcad-field select:focus, .bimcad-field textarea:focus {
	outline: none; border-color: var( --blue ); box-shadow: 0 0 0 3px var( --blue-soft );
}
.bimcad-checkbox-label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.92em; }
.bimcad-description { color: var( --muted ); font-size: 0.88em; }

.bimcad-btn {
	display: inline-flex; align-items: center; justify-content: center;
	border: none; border-radius: 8px; padding: 11px 20px;
	font-family: inherit; font-weight: 700; font-size: 0.94em; cursor: pointer;
	text-decoration: none;
}
.bimcad-btn--primary { background: var( --blue ); color: #fff; }
.bimcad-btn--primary:hover { background: #2a67d9; text-decoration: none; color: #fff; }
.bimcad-btn--secondary { background: var( --blue-soft ); color: var( --blue ); }
.bimcad-btn--secondary:hover { text-decoration: none; }
.bimcad-btn--block { width: 100%; }
.bimcad-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.bimcad-actions-row { display: flex; gap: 10px; align-items: center; margin-top: 20px; }

.bimcad-alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-weight: 600; font-size: 0.92em; }
.bimcad-alert--success { background: #e6f7f0; color: var( --green ); }
.bimcad-alert--error { background: #fdeced; color: var( --red ); }

.bimcad-search-bar { display: flex; gap: 8px; margin-bottom: 18px; max-width: 420px; }
.bimcad-search-bar input { flex: 1; }

.bimcad-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; flex-wrap: wrap; gap: 12px; }

/* --- Login page --- */
.bimcad-login-page {
	display: flex; align-items: center; justify-content: center; min-height: 100vh;
	background: linear-gradient( 160deg, var( --navy ), #1c2b52 );
}
.bimcad-login-card {
	background: var( --surface );
	border-radius: 18px;
	padding: 40px 36px;
	width: 100%;
	max-width: 380px;
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.25 );
}
.bimcad-login-brand { font-weight: 800; color: var( --blue ); letter-spacing: 0.06em; margin-bottom: 6px; }
.bimcad-login-card h1 { font-size: 1.4em; margin-bottom: 20px; }
.bimcad-login-card label { display: block; font-weight: 600; font-size: 0.88em; margin: 14px 0 6px; }
.bimcad-login-card input[type="text"], .bimcad-login-card input[type="password"] {
	width: 100%; padding: 11px 12px; border: 1px solid var( --line ); border-radius: 8px; font-family: inherit; font-size: 0.95em;
}
.bimcad-login-card .bimcad-checkbox-label { margin-top: 14px; }
.bimcad-login-card button { margin-top: 22px; }

/* --- Responsive (identično originalnim breakpoint-ima) --- */
@media ( max-width: 1180px ) {
	.bimcad-content { padding: 22px; }
}
@media ( max-width: 820px ) {
	.bimcad-layout { grid-template-columns: 1fr; }
	.bimcad-sidebar {
		position: fixed; left: 0; top: 0; width: 260px; z-index: 40;
		transform: translateX( -100% ); transition: transform 0.2s ease;
	}
	.bimcad-sidebar.is-open { transform: translateX( 0 ); }
	.bimcad-sidebar-toggle { display: block; }
	.bimcad-scrim.is-open { display: block; }
	.bimcad-topbar { padding-left: 64px; }
}
@media ( max-width: 620px ) {
	.bimcad-content { padding: 16px; }
	.bimcad-topbar { padding: 14px 14px 14px 64px; }
	.bimcad-login-card { padding: 28px 22px; }
}

/* --- Print (dokumenti fakture/ponude, Faza 4) --- */
@media print {
	.no-print { display: none !important; }
}
