/* ================================================================
   EpTeam Web — app.css
   Sve boje direktno — bez Radzen varijabli, bez Bootstrap varijabli.
   ================================================================ */

/* ── Palette ── */
:root {
	--bg:          #111827;
	--surface:     #1e2640;
	--surface-2:   #252d4a;
	--border:      #2d3655;
	--text:        #f6f6f6;
	--text-muted:  #9ca8c8;
	--primary:     #5480c0;
	--primary-h:   #4670a8;
	--success:     #71b294;
	--danger:      #d16a5c;
	--warning:     #f4e949;
}

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: 'Open Sans', 'Segoe UI', system-ui, sans-serif;
	font-size: 15px;
}

/* ── Layout ── */
.app-layout {
	display: flex;
	flex-direction: column;
	height: 100vh;
	overflow: hidden;
}

.app-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	height: 56px;
	padding: 0 1rem;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
	z-index: 100;
}

.app-body {
	display: flex;
	flex: 1;
	overflow: hidden;
}

.app-sidebar {
	width: 220px;
	background: var(--surface);
	border-right: 1px solid var(--border);
	overflow-y: auto;
	flex-shrink: 0;
	transition: width 0.2s ease;
}

.app-sidebar.collapsed {
	width: 0;
	overflow: hidden;
}

.app-main {
	flex: 1;
	overflow-y: auto;
	background: var(--bg);
}

/* ── Header ── */
.sidebar-toggle {
	background: none;
	border: none;
	color: var(--text);
	font-size: 1.4rem;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	border-radius: 6px;
	line-height: 1;
}

.sidebar-toggle:hover {
	background: var(--border);
}

.app-logo-link {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.app-logo {
	height: 30px;
	width: auto;
}

.header-search-wrapper {
	flex: 1;
	max-width: 500px;
}

.header-search {
	position: relative;
}

.header-search-icon {
	position: absolute;
	left: 0.75rem;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	font-size: 0.875rem;
	pointer-events: none;
}

.header-search-input {
	width: 100%;
	padding: 0.375rem 0.75rem 0.375rem 2.25rem;
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	color: var(--text);
	font-size: 0.875rem;
	outline: none;
	box-sizing: border-box;
}

.header-search-input::placeholder {
	color: var(--text-muted);
}

.header-actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.header-icon-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	color: var(--text);
	text-decoration: none;
	font-size: 1.2rem;
}

.header-icon-btn:hover {
	background: var(--border);
}

.notification-badge {
	position: absolute;
	top: 2px;
	right: 2px;
	background: var(--danger);
	color: white;
	font-size: 0.6rem;
	font-weight: 700;
	min-width: 16px;
	height: 16px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 3px;
}

/* ── Nav menu ── */
.nav-menu {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
}

.nav-item {
	margin: 0;
}

.nav-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.6rem 1rem;
	color: var(--text-muted);
	text-decoration: none;
	font-size: 0.875rem;
	border-radius: 0;
	transition: background 0.15s, color 0.15s;
	width: 100%;
	background: none;
	border: none;
	cursor: pointer;
	text-align: left;
}

.nav-link:hover {
	background: var(--border);
	color: var(--text);
}

.nav-link.active {
	background: var(--primary);
	color: #fff;
}

.nav-link i {
	font-size: 1rem;
	flex-shrink: 0;
	width: 1rem;
	text-align: center;
}

.nav-submenu {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--bg);
}

.nav-link-sub {
	padding-left: 2.5rem;
	font-size: 0.8125rem;
}

/* ── Bootstrap card override ── */
.card {
	background-color: var(--surface) !important;
	border-color: var(--border) !important;
	color: var(--text) !important;
}

.card-header {
	border-bottom-color: var(--border) !important;
}

.card-footer {
	border-top-color: var(--border) !important;
	background-color: transparent !important;
}

/* ── Forms override ── */
.form-control, .form-select, input[type="text"], input[type="password"],
input[type="email"], input[type="date"], input[type="number"], select, textarea {
	background-color: var(--bg) !important;
	color: var(--text) !important;
	border-color: var(--border) !important;
}

.form-control::placeholder, input::placeholder, textarea::placeholder {
	color: var(--text-muted) !important;
	opacity: 1;
}

.form-control:focus, .form-select:focus {
	background-color: var(--bg) !important;
	color: var(--text) !important;
	border-color: var(--primary) !important;
	box-shadow: 0 0 0 3px rgba(84, 128, 192, 0.2) !important;
}

.form-select option {
	background-color: var(--surface);
	color: var(--text);
}

/* ── Table override ── */
.table {
	color: var(--text) !important;
	border-color: var(--border) !important;
}

.table > :not(caption) > * > * {
	background-color: transparent;
	color: var(--text);
	border-bottom-color: var(--border);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
	background-color: rgba(255,255,255,0.03);
}

.table-hover > tbody > tr:hover > * {
	background-color: rgba(255,255,255,0.06);
}

/* ── Modal override ── */
.modal-content {
	background-color: var(--surface) !important;
	border-color: var(--border) !important;
	color: var(--text) !important;
}

.modal-header, .modal-footer {
	border-color: var(--border) !important;
}

.modal-backdrop {
	background-color: rgba(0, 0, 0, 0.7) !important;
}

/* ── Alert override ── */
.alert-info {
	background-color: rgba(84, 128, 192, 0.15);
	border-color: rgba(84, 128, 192, 0.3);
	color: #a8c3f0;
}

/* ── Login page ── */
.login-page {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bg);
	padding: 1rem;
}

.login-card {
	background: var(--surface);
	border-radius: 12px;
	box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
	padding: 2.5rem 2rem;
	width: 100%;
	max-width: 400px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.25rem;
}

.login-logo img {
	height: 64px;
	width: auto;
}

.login-title {
	font-size: 1.5rem;
	font-weight: 600;
	margin: 0;
	color: var(--text);
	align-self: flex-start;
}

.login-subtitle {
	font-size: 0.9rem;
	color: var(--text-muted);
	margin: 0;
	line-height: 1.6;
	align-self: flex-start;
}

.login-fields {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.login-field {
	display: flex;
	flex-direction: column;
	gap: 0.375rem;
}

.login-label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--text-muted);
}

.login-input-wrapper {
	position: relative;
	display: flex;
	align-items: center;
}

.login-input {
	width: 100%;
	padding: 0.625rem 0.875rem;
	border: 1px solid var(--border);
	border-radius: 6px;
	font-size: 0.9375rem;
	color: var(--text);
	background: var(--bg);
	outline: none;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.login-input::placeholder {
	color: #8a94b8;
}

.login-input:focus {
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(84, 128, 192, 0.2);
}

.login-input-wrapper .login-input {
	padding-right: 2.75rem;
}

.login-eye-btn {
	position: absolute;
	right: 0.75rem;
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 0;
	font-size: 1rem;
	display: flex;
	align-items: center;
}

.login-eye-btn:hover { color: var(--text); }

.login-error {
	width: 100%;
	padding: 0.625rem 0.875rem;
	background: rgba(209, 106, 92, 0.15);
	border: 1px solid rgba(209, 106, 92, 0.4);
	border-radius: 6px;
	color: #f0a090;
	font-size: 0.875rem;
}

.login-btn {
	width: 100%;
	padding: 0.675rem 1rem;
	background: var(--primary);
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, opacity 0.15s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.login-btn:hover:not(:disabled) { background: var(--primary-h); }
.login-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.login-btn-secondary {
	background: var(--surface-2);
	color: var(--text);
	border: 1px solid var(--border);
}

.login-btn-secondary:hover:not(:disabled) { background: var(--border); }

.login-forgot-link {
	background: none;
	border: none;
	color: #8aacdf;
	font-size: 0.875rem;
	cursor: pointer;
	padding: 0;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.login-forgot-link:hover { color: #a8c3f0; }

/* ── Blazor startup loader ── */
#blazor-loader {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	background: var(--bg);
}

#blazor-loader img {
	height: 64px;
	width: auto;
	opacity: 0.9;
}

.blazor-loader-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--border);
	border-top-color: var(--primary);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

/* ── JS toast ── */
#toast-container {
	position: fixed;
	bottom: 1rem;
	right: 1rem;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

/* ── Staff allocation ── */
.allocation-candidates {
	max-height: 70vh;
	overflow-y: auto;
}

.allocation-candidate {
	cursor: grab;
}

.allocation-candidate:active {
	cursor: grabbing;
}

.allocation-slot {
	transition: border-color 0.15s ease, background-color 0.15s ease;
}

.allocation-slot-over {
	border-color: var(--primary);
	background-color: rgba(13, 110, 253, 0.06);
}

/* ── Attendance / check-in ── */
.stat-tile {
	border-left: 3px solid var(--color-border);
}

.stat-tile-success { border-left-color: var(--color-success, #198754); }
.stat-tile-warning { border-left-color: var(--color-warning, #ffc107); }
.stat-tile-danger  { border-left-color: var(--color-danger, #dc3545); }
.stat-tile-info    { border-left-color: var(--color-info, #0dcaf0); }
.stat-tile-primary { border-left-color: var(--color-primary); }

.attendance-live {
	animation: attendance-pulse 2s ease-in-out infinite;
}

@keyframes attendance-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

/*
 * Desktop-only refinements. Scoped to >=992px so the MAUI/mobile layout that
 * shares these component styles is left untouched.
 */
@media (min-width: 992px) {
	/* Tabs: on mobile they stretch full-width with labels hidden until active.
	   On a wide screen that reads as a row of oversized empty buttons. */
	.profile-tabs {
		justify-content: flex-start;
		gap: var(--space-1);
		border-bottom: 1px solid var(--color-border);
		padding-bottom: 0;
	}

	.profile-tab-button {
		flex: 0 0 auto;
		width: auto;
		max-width: none;
		min-height: 0;
		flex-direction: row;
		gap: var(--space-2);
		padding: 0.5rem 0.9rem;
		font-size: var(--text-sm);
		font-weight: 500;
		border: 1px solid transparent;
		border-bottom: none;
		border-radius: var(--radius-md) var(--radius-md) 0 0;
		background: transparent;
		margin-bottom: -1px;
	}

	.profile-tab-button i {
		font-size: var(--text-md);
	}

	/* Labels always visible on desktop — there is room for them. */
	.profile-tab-label,
	.profile-tab-button:hover .profile-tab-label,
	.profile-tab-button.active .profile-tab-label {
		display: inline;
		font-size: var(--text-sm);
	}

	.profile-tab-button:hover {
		background: var(--color-bg-elevated);
		border-color: var(--color-border);
		border-bottom-color: transparent;
	}

	.profile-tab-button.active {
		background: var(--color-bg-elevated);
		color: var(--color-primary);
		border-color: var(--color-border);
		border-bottom-color: var(--color-bg-elevated);
	}

	/* Save/Back keep their own sizing but shouldn't inherit the tab shape. */
	.profile-tabs .btn-profile-save {
		align-self: center;
		margin-bottom: var(--space-2);
	}
}
