/**
 * Yuriva Certificate Manager - front-end styles.
 */

.ycm {
	--ycm-navy: #113d5c;
	--ycm-navy-dark: #0c2d45;
	--ycm-gold: #c4a052;
	--ycm-bg: #f6f7f9;
	--ycm-surface: #ffffff;
	--ycm-text: #1d2530;
	--ycm-muted: #6b7280;
	--ycm-border: #e4e7ec;
	--ycm-radius: 14px;
	box-sizing: border-box;
	color: var(--ycm-text);
	font-size: 15px;
	line-height: 1.5;
}

.ycm *,
.ycm *::before,
.ycm *::after {
	box-sizing: border-box;
}

/* Buttons */
.ycm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 16px;
	border: 1px solid transparent;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ycm-btn--primary {
	background: var(--ycm-navy);
	color: #fff;
}

.ycm-btn--primary:hover {
	background: var(--ycm-navy-dark);
	color: #fff;
}

.ycm-btn--ghost {
	background: transparent;
	border-color: var(--ycm-border);
	color: var(--ycm-text);
}

.ycm-btn--ghost:hover {
	background: var(--ycm-bg);
	color: var(--ycm-text);
}

.ycm-btn--danger {
	background: transparent;
	border-color: #f2c4c4;
	color: #b3261e;
}

.ycm-btn--danger:hover {
	background: #fdeceb;
}

.ycm-btn--block {
	width: 100%;
}

/* Forms */
.ycm-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 16px;
}

.ycm-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--ycm-muted);
}

.ycm-input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--ycm-border);
	border-radius: 10px;
	background: #fff;
	font-size: 15px;
	color: var(--ycm-text);
}

.ycm-input:focus {
	outline: none;
	border-color: var(--ycm-navy);
	box-shadow: 0 0 0 3px rgba(17, 61, 92, 0.12);
}

.ycm-check {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 18px;
	font-size: 14px;
	color: var(--ycm-muted);
}

.ycm-form--grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 20px;
}

.ycm-form__actions {
	grid-column: 1 / -1;
	margin-top: 8px;
}

.ycm-field--media {
	grid-column: 1 / -1;
}

.ycm-media {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.ycm-media__preview {
	max-width: 96px;
	max-height: 96px;
	border-radius: 10px;
	border: 1px solid var(--ycm-border);
	background: #fff;
	object-fit: contain;
}

/* Notices */
.ycm-notice {
	padding: 12px 14px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 14px;
}

.ycm-notice--success {
	background: #e8f5ee;
	color: #14663c;
}

.ycm-notice--error {
	background: #fdeceb;
	color: #a4231c;
}

/* Auth */
.ycm-auth {
	display: flex;
	justify-content: center;
	padding: 48px 16px;
	background: var(--ycm-bg);
	min-height: 60vh;
}

.ycm-auth__card {
	width: 100%;
	max-width: 400px;
	background: var(--ycm-surface);
	border: 1px solid var(--ycm-border);
	border-radius: var(--ycm-radius);
	padding: 32px;
	box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.ycm-auth__brand {
	text-align: center;
	margin-bottom: 24px;
}

.ycm-auth__logo {
	max-height: 64px;
	width: auto;
	margin: 0 auto 12px;
	display: block;
}

.ycm-auth__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	color: var(--ycm-navy);
}

.ycm-auth__subtitle {
	margin: 6px 0 0;
	font-size: 14px;
	color: var(--ycm-muted);
}

.ycm-auth__footer {
	margin: 18px 0 0;
	text-align: center;
	font-size: 13px;
}

/* App layout */
.ycm-app {
	display: flex;
	min-height: 70vh;
	background: var(--ycm-bg);
	border-radius: var(--ycm-radius);
	overflow: hidden;
	border: 1px solid var(--ycm-border);
}

.ycm-sidebar {
	width: 244px;
	flex: 0 0 244px;
	background: var(--ycm-navy);
	padding: 22px 16px;
	color: #fff;
}

.ycm-sidebar__brand {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 22px;
}

.ycm-sidebar__logo {
	width: 34px;
	height: 34px;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
	padding: 3px;
}

.ycm-sidebar__name {
	font-weight: 700;
	font-size: 15px;
	color: #fff;
}

.ycm-nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ycm-nav__item {
	display: block;
	padding: 10px 12px;
	border-radius: 9px;
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}

.ycm-nav__item:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.ycm-nav__item.is-active {
	background: var(--ycm-gold);
	color: #1d2530;
	font-weight: 600;
}

.ycm-nav__item--danger {
	margin-top: 12px;
	color: #ffd9d6;
}

.ycm-main {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--ycm-bg);
}

.ycm-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 22px;
	background: var(--ycm-surface);
	border-bottom: 1px solid var(--ycm-border);
}

.ycm-topbar__title {
	margin: 0;
	font-size: 18px;
	flex: 1 1 auto;
	color: var(--ycm-text);
}

.ycm-topbar__user {
	font-size: 13px;
	color: var(--ycm-muted);
}

.ycm-burger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 38px;
	height: 38px;
	border: 1px solid var(--ycm-border);
	border-radius: 9px;
	background: #fff;
	cursor: pointer;
	padding: 0 9px;
}

.ycm-burger span {
	display: block;
	height: 2px;
	background: var(--ycm-text);
	border-radius: 2px;
}

.ycm-content {
	padding: 22px;
}

/* Cards & stats */
.ycm-card {
	background: var(--ycm-surface);
	border: 1px solid var(--ycm-border);
	border-radius: var(--ycm-radius);
	padding: 22px;
	margin-bottom: 20px;
}

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

.ycm-card__title {
	margin: 0;
	font-size: 16px;
	color: var(--ycm-text);
}

.ycm-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin-bottom: 20px;
}

.ycm-stat {
	background: var(--ycm-surface);
	border: 1px solid var(--ycm-border);
	border-radius: var(--ycm-radius);
	padding: 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ycm-stat__label {
	font-size: 13px;
	color: var(--ycm-muted);
}

.ycm-stat__value {
	font-size: 28px;
	font-weight: 700;
	color: var(--ycm-navy);
	line-height: 1.1;
}

/* Tables */
.ycm-table-wrap {
	overflow-x: auto;
}

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

.ycm-table th,
.ycm-table td {
	padding: 12px 10px;
	text-align: left;
	border-bottom: 1px solid var(--ycm-border);
	vertical-align: middle;
}

.ycm-table th {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ycm-muted);
}

.ycm-table code {
	font-size: 13px;
	background: var(--ycm-bg);
	padding: 2px 6px;
	border-radius: 6px;
}

.ycm-table__actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	align-items: center;
}

.ycm-inline-form {
	display: inline;
	margin: 0;
}

.ycm-empty {
	color: var(--ycm-muted);
	font-size: 14px;
	margin: 0;
}

/* Search */
.ycm-search {
	display: flex;
	gap: 8px;
	align-items: center;
}

.ycm-search .ycm-input {
	min-width: 220px;
}

.ycm-search--wide {
	margin-bottom: 18px;
}

.ycm-pagination {
	display: flex;
	gap: 6px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.ycm-pagination__link {
	padding: 7px 12px;
	border: 1px solid var(--ycm-border);
	border-radius: 8px;
	text-decoration: none;
	color: var(--ycm-text);
	font-size: 13px;
}

.ycm-pagination__link.is-active {
	background: var(--ycm-navy);
	border-color: var(--ycm-navy);
	color: #fff;
}

/* Results */
.ycm-result {
	border-radius: var(--ycm-radius);
	padding: 20px;
	border: 1px solid var(--ycm-border);
}

.ycm-result--valid {
	background: #f2fbf6;
	border-color: #bfe6d0;
}

.ycm-result--invalid {
	background: #fdf2f1;
	border-color: #f2c4c4;
}

.ycm-result__photo {
	display: block;
	margin: 14px 0;
	max-width: 110px;
	height: auto;
	border-radius: 10px;
	border: 1px solid var(--ycm-border);
}

.ycm-badge {
	display: inline-block;
	padding: 5px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.ycm-badge--valid {
	background: #14663c;
	color: #fff;
}

.ycm-badge--invalid {
	background: #b3261e;
	color: #fff;
}

.ycm-details {
	margin: 16px 0 12px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 20px;
}

.ycm-details dt {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--ycm-muted);
	margin: 0 0 2px;
}

.ycm-details dd {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
}

.ycm-hint {
	margin-top: 22px;
	padding-top: 16px;
	border-top: 1px solid var(--ycm-border);
	font-size: 13px;
	color: var(--ycm-muted);
}

/* Public verify page */
.ycm-verify {
	display: flex;
	justify-content: center;
	padding: 40px 16px;
	background: var(--ycm-bg);
}

.ycm-verify__card {
	width: 100%;
	max-width: 620px;
	background: var(--ycm-surface);
	border: 1px solid var(--ycm-border);
	border-radius: var(--ycm-radius);
	padding: 32px;
	box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.ycm-verify__head {
	text-align: center;
	margin-bottom: 22px;
}

.ycm-verify__logo {
	max-height: 62px;
	width: auto;
	display: block;
	margin: 0 auto 12px;
}

.ycm-verify__title {
	margin: 0;
	font-size: 22px;
	color: var(--ycm-navy);
}

.ycm-verify__subtitle {
	margin: 6px 0 0;
	color: var(--ycm-muted);
	font-size: 14px;
}

.ycm-verify__foot {
	margin: 20px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--ycm-muted);
}

/* Responsive */
@media (max-width: 900px) {
	.ycm-form--grid,
	.ycm-stats,
	.ycm-details {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 782px) {
	.ycm-app {
		display: block;
	}

	.ycm-sidebar {
		width: 100%;
		flex: none;
		display: none;
	}

	.ycm-sidebar.is-open {
		display: block;
	}

	.ycm-burger {
		display: flex;
	}

	.ycm-content {
		padding: 16px;
	}

	.ycm-search {
		width: 100%;
		flex-wrap: wrap;
	}

	.ycm-search .ycm-input {
		flex: 1 1 100%;
		min-width: 0;
	}

	.ycm-table thead {
		display: none;
	}

	.ycm-table,
	.ycm-table tbody,
	.ycm-table tr,
	.ycm-table td {
		display: block;
		width: 100%;
	}

	.ycm-table tr {
		border: 1px solid var(--ycm-border);
		border-radius: 12px;
		margin-bottom: 12px;
		padding: 6px 10px;
	}

	.ycm-table td {
		border-bottom: none;
		padding: 7px 0;
		display: flex;
		justify-content: space-between;
		gap: 12px;
	}

	.ycm-table td::before {
		content: attr(data-label);
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--ycm-muted);
	}

	.ycm-table__actions {
		justify-content: flex-start;
		padding-top: 10px;
	}
}

/* Bulk actions, table refinements and edit view */
.ycm-bulkbar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 14px;
	padding: 10px 12px;
	background: #f6f7fb;
	border: 1px solid #e6e8f0;
	border-radius: 10px;
}

.ycm-table__check {
	width: 34px;
	text-align: center;
}

.ycm-table td,
.ycm-table th {
	vertical-align: middle;
}

.ycm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.ycm-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}

.ycm-pill--ok,
.ycm-pill--valid {
	background: #e7f7ee;
	color: #12703f;
}

.ycm-pill--off,
.ycm-pill--revoked {
	background: #fdeaea;
	color: #a11d1d;
}

.ycm-card--danger {
	border-color: #f3c7c7;
}

.ycm-btn--danger {
	background: #c62828;
	border-color: #c62828;
	color: #fff;
}

.ycm-btn--danger:hover {
	background: #a51f1f;
}

.ycm-form--grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.ycm-form--grid .ycm-form__actions,
.ycm-form--grid .ycm-field--media {
	grid-column: 1 / -1;
}

@media (max-width: 782px) {
	.ycm-form--grid {
		grid-template-columns: 1fr;
	}

	.ycm-table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}

	.ycm-bulkbar {
		flex-direction: column;
		align-items: stretch;
	}
}

/* --- 2.0.0: custom template, field editor, about box, pagination --- */
.ycm-notice--info {
	background: #eef4fb;
	border: 1px solid #cddff2;
	color: #17456f;
}

.ycm-field--wide {
	grid-column: 1 / -1;
}

.ycm-field.is-disabled {
	opacity: .5;
}

.ycm-help {
	margin: 6px 0 0;
	font-size: 12px;
	color: #6b7280;
	line-height: 1.5;
}

.ycm-media__preview--wide {
	width: 100%;
	max-width: 420px;
	height: auto;
	border-radius: 8px;
}

.ycm-form--narrow {
	max-width: 420px;
}

.ycm-editor {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

.ycm-editor__stage {
	position: relative;
	overflow: hidden;
	border: 1px solid #e2e5ea;
	border-radius: 10px;
	background: #f7f8fa;
	touch-action: none;
}

.ycm-editor__bg {
	display: block;
	width: 100%;
	height: auto;
}

.ycm-editor__pin {
	position: absolute;
	transform: translate(-50%, -50%);
	padding: 3px 8px;
	border-radius: 5px;
	background: rgba(255, 255, 255, .88);
	border: 1px dashed #2f6fb0;
	font-size: 11px;
	font-weight: 500;
	line-height: 1.2;
	white-space: nowrap;
	cursor: move;
	user-select: none;
}

.ycm-editor__pin--image {
	border-style: solid;
	border-color: #b38a3a;
}

.ycm-editor__panel {
	display: grid;
	gap: 10px;
	max-height: 520px;
	overflow-y: auto;
}

.ycm-editor__row {
	padding: 10px 12px;
	border: 1px solid #e6e8ec;
	border-radius: 8px;
	background: #fcfcfd;
}

.ycm-editor__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 13px;
}

.ycm-editor__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 8px;
}

.ycm-editor__controls label {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 11px;
	color: #6b7280;
}

.ycm-editor__controls input[type="number"],
.ycm-editor__controls select {
	width: 78px;
	padding: 4px 6px;
	border: 1px solid #d7dae0;
	border-radius: 5px;
	font-size: 12px;
}

.ycm-editor__controls input[type="color"] {
	width: 44px;
	height: 28px;
	padding: 0;
	border: 1px solid #d7dae0;
	border-radius: 5px;
	background: none;
}

.ycm-editor__bold {
	flex-direction: row !important;
	align-items: center;
	gap: 6px !important;
}

.ycm-about__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 12px;
	margin: 0;
}

.ycm-about__list dt {
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: #6b7280;
}

.ycm-about__list dd {
	margin: 3px 0 0;
	font-weight: 600;
}

.ycm-about__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.ycm-about__status {
	font-size: 13px;
	color: #1a7f4b;
	font-weight: 600;
}

.ycm-pagination {
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.ycm-pagination__info {
	margin-right: auto;
	font-size: 12px;
	color: #6b7280;
}

.ycm-pagination__link.is-disabled {
	pointer-events: none;
	opacity: .45;
}

@media (max-width: 900px) {
	.ycm-editor {
		grid-template-columns: 1fr;
	}
}
