/* ==========================================================
   Park Hub HR Panel — dizayn sistemi
   Brend rəngi: #1B4DFF (loqodan — canlı royal blue)
   ========================================================== */

:root {
	--brand: #1B4DFF;
	--brand-dark: #123ad1;
	--brand-light: #e8edff;
	--brand-lighter: #f3f6ff;
	--brand-rgb: 27, 77, 255;

	--bg: #f4f5f9;
	--surface: #ffffff;
	--border: #e6e8f0;

	--text: #171a26;
	--text-secondary: #5a5f73;
	--text-muted: #9aa0b5;

	--success: #14884a;
	--success-bg: #e4f6ec;
	--warning: #9a6700;
	--warning-bg: #fff3d6;
	--danger: #c92a3c;
	--danger-bg: #fde9ec;
	--info: #123ad1;
	--info-bg: #e8edff;

	--radius: 12px;
	--radius-sm: 8px;
	--shadow: 0 1px 3px rgba(23, 26, 38, 0.06), 0 4px 16px rgba(23, 26, 38, 0.05);
	--shadow-lg: 0 8px 40px rgba(23, 26, 38, 0.16);

	--sidebar-w: 260px;
	--font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
	font-family: var(--font);
	background: var(--bg);
	color: var(--text);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* ==================== DÜYMƏLƏR ==================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	font-family: var(--font);
	font-size: 14px;
	font-weight: 600;
	border: none;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background 0.15s, box-shadow 0.15s, transform 0.05s;
	white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary {
	background: var(--brand);
	color: #fff;
	box-shadow: 0 2px 8px rgba(var(--brand-rgb), 0.28);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }

.btn-ghost {
	background: transparent;
	color: var(--text-secondary);
	border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--brand-lighter); color: var(--brand); border-color: var(--brand-light); }

.btn-block { width: 100%; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; gap: 6px; }
.btn-sm .icon { width: 13px; height: 13px; }

/* Resend düyməsi: countdown zamanı en dəyişməsin */
.btn-resend { min-width: 150px; }

/* ==================== FORMALAR ==================== */

.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field label {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--text-secondary);
	margin-bottom: 6px;
	letter-spacing: 0.01em;
}
.field input, .field select {
	font-family: var(--font);
	font-size: 14px;
	color: var(--text);
	padding: 10px 12px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	width: 100%;
}
.field input:focus, .field select:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
.field input::placeholder { color: var(--text-muted); }

.field-row { display: flex; gap: 12px; }
.field-grow { flex: 1; }
.field-prefix { width: 110px; flex-shrink: 0; }

.field-hint {
	font-size: 12px;
	color: var(--text-muted);
	margin-top: 4px;
}

.form-hint {
	font-size: 12.5px;
	color: var(--text-muted);
	background: var(--brand-lighter);
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	margin-bottom: 16px;
}

.form-error {
	background: var(--danger-bg);
	color: var(--danger);
	font-size: 13px;
	font-weight: 500;
	border-radius: var(--radius-sm);
	padding: 10px 12px;
	margin-bottom: 16px;
}

.password-wrap { position: relative; display: flex; }
.password-wrap input { padding-right: 42px; }
.pw-toggle {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 6px 8px;
	display: flex;
	align-items: center;
}
.pw-toggle .icon { width: 18px; height: 18px; }
.pw-toggle:hover { color: var(--text-secondary); }

/* ==================== LOGIN ==================== */

.login-view {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background:
		radial-gradient(1200px 600px at 85% -10%, rgba(var(--brand-rgb), 0.12), transparent 60%),
		radial-gradient(900px 500px at -10% 110%, rgba(var(--brand-rgb), 0.09), transparent 60%),
		var(--bg);
	padding: 24px;
}

.login-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 20px;
	box-shadow: var(--shadow-lg);
	padding: 44px 40px 36px;
	width: 100%;
	max-width: 420px;
	text-align: center;
}

.login-logo {
	height: 34px;
	margin-bottom: 26px;
}

.login-card h1 {
	font-size: 20px;
	font-weight: 700;
	margin-bottom: 8px;
}

.login-sub {
	font-size: 13.5px;
	color: var(--text-secondary);
	margin-bottom: 28px;
}

.login-card form { text-align: left; }

.login-footer {
	margin-top: 28px;
	font-size: 12.5px;
	color: var(--text-muted);
}

/* ==================== APP SHELL ==================== */

.app {
	display: flex;
	min-height: 100vh;
}

.sidebar {
	width: var(--sidebar-w);
	flex-shrink: 0;
	background: var(--surface);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100vh;
}

.sidebar-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 22px 20px;
	border-bottom: 1px solid var(--border);
}

.sidebar-logo { width: 36px; height: 36px; }

.sidebar-brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.brand-sub { font-size: 11.5px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-nav {
	flex: 1;
	padding: 16px 12px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.nav-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 11px 14px;
	border-radius: var(--radius-sm);
	color: var(--text-secondary);
	text-decoration: none;
	font-weight: 500;
	font-size: 14px;
	transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--brand-lighter); color: var(--text); }
.nav-item.active {
	background: var(--brand-light);
	color: var(--brand);
	font-weight: 600;
}
.nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }

/* Sətir-üslublu (monoxrom) ikonlar — hamısı currentColor miras alır */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }
.nav-icon .icon { width: 19px; height: 19px; }

.sidebar-footer {
	padding: 16px;
	border-top: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.user-chip {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.user-avatar {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--brand);
	color: #fff;
	font-weight: 700;
	font-size: 15px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-name {
	font-weight: 600;
	font-size: 13.5px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.user-role { font-size: 11.5px; color: var(--text-muted); }

/* ==================== MAIN ==================== */

.main {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 20px 32px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 5;
}

.page-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }

.page-content {
	padding: 28px 32px;
	flex: 1;
}

/* ==================== FİLTR PANELİ ==================== */

.filter-bar {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.filter-main {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
	flex: 1;
	min-width: 0;
}

.filter-actions { display: flex; align-items: flex-end; gap: 8px; margin-left: auto; }

.filter-field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
.filter-field.filter-grow { flex: 1; min-width: 220px; }
.filter-field.filter-narrow { min-width: 120px; width: 130px; }

.filter-field > label {
	font-size: 11px;
	font-weight: 600;
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.filter-field input,
.filter-field select {
	font-family: var(--font);
	font-size: 13.5px;
	color: var(--text);
	height: 38px;
	padding: 8px 11px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	outline: none;
	width: 100%;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.filter-field input:focus,
.filter-field select:focus {
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
.filter-field input::placeholder { color: var(--text-muted); }

/* Axtarış inputu — içində ikon */
.filter-search { position: relative; }
.filter-search .icon {
	position: absolute;
	left: 11px;
	bottom: 11px;
	width: 16px;
	height: 16px;
	color: var(--text-muted);
	pointer-events: none;
}
.filter-search input { padding-left: 34px; }

.filter-bar .btn { height: 38px; }

@media (max-width: 700px) {
	.filter-field, .filter-field.filter-grow, .filter-field.filter-narrow { width: 100%; flex: 1 1 100%; min-width: 0; }
	.filter-actions { width: 100%; }
	.filter-actions .btn { width: 100%; }
}

/* ==================== KART / CƏDVƏL ==================== */

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.table-wrap { overflow-x: auto; }

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
}

.table thead th {
	text-align: left;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--text-muted);
	background: #fafbfd;
	padding: 12px 16px;
	border-bottom: 1px solid var(--border);
	white-space: nowrap;
}

.table tbody td {
	padding: 13px 16px;
	border-bottom: 1px solid var(--border);
	vertical-align: middle;
	white-space: nowrap;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--brand-lighter); }

.cell-person { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.cell-avatar {
	width: 30px;
	height: 30px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--brand-light);
	color: var(--brand);
	font-weight: 700;
	font-size: 12.5px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.plate {
	font-family: 'Consolas', 'SF Mono', monospace;
	font-weight: 700;
	font-size: 12.5px;
	background: #f1f3f9;
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 3px 8px;
	letter-spacing: 0.05em;
}

.amount { font-weight: 600; }

/* ---- Promo kod hücrəsi ---- */
.code-cell { display: flex; align-items: center; gap: 8px; }
.promo-code {
	font-family: 'Consolas', 'SF Mono', monospace;
	font-size: 13px;
	font-weight: 700;
	color: var(--brand);
	background: var(--brand-light);
	border-radius: 6px;
	padding: 4px 10px;
	letter-spacing: 0.04em;
}
.btn-copy {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--text-muted);
	padding: 5px 6px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
	transition: background 0.15s, color 0.15s;
}
.btn-copy .icon { width: 15px; height: 15px; }
.btn-copy:hover { background: var(--brand-light); color: var(--brand); }

/* ==================== BADGE ==================== */

.badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 999px;
	padding: 4px 11px;
	line-height: 1.4;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-neutral { background: #eef0f5; color: var(--text-secondary); }

.badge-live { background: var(--success-bg); color: var(--success); }
.live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--success);
	animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.4; transform: scale(0.8); }
}

.live-duration {
	font-family: 'Consolas', 'SF Mono', monospace;
	font-weight: 600;
	color: var(--success);
}

/* ==================== PAGINATION ==================== */

.pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-top: 1px solid var(--border);
	flex-wrap: wrap;
}

.pg-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pg-info { font-size: 12.5px; color: var(--text-muted); }
.pg-size { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.pg-size-select {
	font-family: var(--font);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--text);
	padding: 5px 8px;
	border: 1.5px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	cursor: pointer;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.pg-size-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15); }
.pg-controls { display: flex; align-items: center; gap: 4px; }
.pg-dots { color: var(--text-muted); padding: 0 4px; }

.pg-btn {
	min-width: 32px;
	height: 32px;
	padding: 0 8px;
	font-family: var(--font);
	font-size: 13px;
	font-weight: 600;
	color: var(--text-secondary);
	background: transparent;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.pg-btn:hover:not(:disabled):not(.active) { background: var(--brand-lighter); color: var(--brand); }
.pg-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; cursor: default; }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== MODAL ==================== */

.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(23, 26, 38, 0.45);
	backdrop-filter: blur(2px);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 60px 20px 20px;
	z-index: 100;
	opacity: 0;
	transition: opacity 0.2s;
	overflow-y: auto;
}
.modal-overlay.open { opacity: 1; }

.modal {
	background: var(--surface);
	border-radius: 16px;
	box-shadow: var(--shadow-lg);
	width: 100%;
	max-width: 480px;
	transform: translateY(-12px);
	transition: transform 0.2s;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px 0;
}
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close {
	background: none;
	border: none;
	color: var(--text-muted);
	cursor: pointer;
	padding: 6px;
	border-radius: 6px;
	display: inline-flex;
	align-items: center;
}
.modal-close .icon { width: 18px; height: 18px; }
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 20px 24px 24px; }

.modal-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 8px;
}

/* ==================== TOAST ==================== */

.toast-root {
	position: fixed;
	bottom: 24px;
	right: 24px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	z-index: 200;
	max-width: 380px;
}

.toast {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	padding: 13px 16px;
	font-size: 13.5px;
	font-weight: 500;
	opacity: 0;
	transform: translateX(16px);
	transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translateX(0); }

.toast-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
}
.toast-error   .toast-icon { background: var(--danger); }
.toast-success .toast-icon { background: var(--success); }
.toast-info    .toast-icon { background: var(--brand); }

.toast-msg { padding-top: 1px; }

/* ==================== VƏZİYYƏT BLOKLARI ==================== */

.state-block {
	padding: 64px 24px;
	text-align: center;
	color: var(--text-muted);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}
.state-block p { margin-top: 12px; font-size: 14px; }
.state-error p { color: var(--danger); }
.state-icon { width: 40px; height: 40px; color: var(--text-muted); }
.state-error .state-icon { color: var(--danger); }

.spinner {
	width: 34px;
	height: 34px;
	margin: 0 auto;
	border: 3px solid var(--brand-light);
	border-top-color: var(--brand);
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Modal daxilindəki state blokun çərçivəsini götür */
.modal-body .state-block { border: none; padding: 32px 12px; }

/* ==================== RESPONSIVE ==================== */

@media (max-width: 900px) {
	.app { flex-direction: column; }

	.sidebar {
		width: 100%;
		height: auto;
		position: static;
		flex-direction: row;
		align-items: center;
		flex-wrap: wrap;
		gap: 8px;
		padding: 8px 12px;
	}
	.sidebar-brand { border-bottom: none; padding: 8px 10px; }
	.sidebar-nav { flex-direction: row; padding: 0; flex: 1; }
	.nav-item { padding: 9px 12px; }
	.sidebar-footer { border-top: none; flex-direction: row; align-items: center; padding: 8px 10px; }
	.user-chip .user-meta { display: none; }

	.topbar { padding: 14px 16px; }
	.page-content { padding: 16px; }
	.field-row { flex-direction: column; gap: 0; }
	.field-prefix { width: 100%; }
}
