/**
 * BenAdvance Resource Portal - front-end styles.
 * Scoped under .bmc-portal so it does not fight the theme.
 */

.bmc-portal {
	--bmc-brand: #0B4A6F;
	--bmc-accent: #1B9AAA;
	--bmc-ink: #111827;
	--bmc-muted: #6b7280;
	--bmc-line: #e5e7eb;
	--bmc-bg: #f7f8fa;
	--bmc-radius: 10px;
	color: var(--bmc-ink);
	font-size: 15px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

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

/* ---------- Notices ---------- */

.bmc-notice {
	padding: 12px 16px;
	border-radius: 8px;
	margin: 0 0 20px;
	font-size: 14px;
	border: 1px solid transparent;
}
.bmc-notice--success { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.bmc-notice--error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ---------- Buttons ---------- */

.bmc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 11px 20px;
	border-radius: 8px;
	border: 1px solid transparent;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.bmc-button--primary { background: var(--bmc-accent); color: #fff; }
.bmc-button--primary:hover { background: var(--bmc-brand); color: #fff; }
.bmc-button--ghost {
	background: #fff;
	color: var(--bmc-brand);
	border-color: var(--bmc-line);
}
.bmc-button--ghost:hover { border-color: var(--bmc-accent); color: var(--bmc-accent); }
.bmc-button--sm { padding: 8px 14px; font-size: 13px; }

.bmc-linkbutton {
	background: none;
	border: 0;
	padding: 0;
	color: var(--bmc-accent);
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

/* ---------- Login ---------- */

.bmc-login {
	display: flex;
	justify-content: center;
	padding: 24px 12px 48px;
}
.bmc-login__card {
	width: 100%;
	max-width: 440px;
	background: #fff;
	border: 1px solid var(--bmc-line);
	border-radius: var(--bmc-radius);
	padding: 36px 32px;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
	text-align: left;
}
.bmc-login__logo { display: block; max-height: 52px; width: auto; margin: 0 auto 20px; }
.bmc-login__title { margin: 0 0 8px; font-size: 21px; line-height: 1.3; }
.bmc-login__help { margin: 0 0 24px; color: var(--bmc-muted); font-size: 14px; }
.bmc-login__footer { margin: 24px 0 0; font-size: 13px; color: var(--bmc-muted); text-align: center; }

.bmc-tabs {
	display: flex;
	gap: 4px;
	background: var(--bmc-bg);
	padding: 4px;
	border-radius: 8px;
	margin-bottom: 22px;
}
.bmc-tab {
	flex: 1;
	padding: 9px 12px;
	border: 0;
	background: transparent;
	border-radius: 6px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	color: var(--bmc-muted);
	cursor: pointer;
}
.bmc-tab.is-active { background: #fff; color: var(--bmc-brand); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.bmc-pane.is-hidden { display: none; }

.bmc-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 6px;
}
.bmc-input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid var(--bmc-line);
	border-radius: 8px;
	font-size: 15px;
	margin-bottom: 16px;
	background: #fff;
	color: var(--bmc-ink);
}
.bmc-input:focus {
	outline: none;
	border-color: var(--bmc-accent);
	box-shadow: 0 0 0 3px rgba(27,154,170,.15);
}
.bmc-form .bmc-button { width: 100%; margin-top: 4px; }
.bmc-form__aside { margin: 16px 0 0; font-size: 13px; color: var(--bmc-muted); text-align: center; }
.bmc-hint { font-size: 13px; color: var(--bmc-muted); margin: -6px 0 16px; }

/* ---------- App shell ---------- */

.bmc-app {
	background: #fff;
	border: 1px solid var(--bmc-line);
	border-radius: var(--bmc-radius);
	overflow: hidden;
}

.bmc-header {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	background: var(--bmc-brand);
	color: #fff;
}
.bmc-header__brand { display: flex; align-items: center; gap: 14px; }
.bmc-header__logo { max-height: 40px; width: auto; }
.bmc-header__title { margin: 0; font-size: 18px; color: #fff; line-height: 1.2; }
.bmc-header__sub { margin: 2px 0 0; font-size: 13px; opacity: .8; }
.bmc-header__user { display: flex; align-items: center; gap: 14px; }
.bmc-header__who { text-align: right; line-height: 1.3; }
.bmc-header__name { display: block; font-size: 14px; font-weight: 600; }
.bmc-header__company { display: block; font-size: 12px; opacity: .8; }

.bmc-layout { display: flex; align-items: stretch; }

/* ---------- Sidebar ---------- */

.bmc-sidebar {
	width: 250px;
	flex: 0 0 250px;
	border-right: 1px solid var(--bmc-line);
	background: var(--bmc-bg);
	padding: 20px 16px;
}

.bmc-search { position: relative; margin-bottom: 18px; }
.bmc-search__input {
	width: 100%;
	padding: 10px 38px 10px 12px;
	border: 1px solid var(--bmc-line);
	border-radius: 8px;
	font-size: 14px;
	background: #fff;
}
.bmc-search__input:focus { outline: none; border-color: var(--bmc-accent); }
.bmc-search__go {
	position: absolute;
	right: 4px; top: 50%;
	transform: translateY(-50%);
	background: none; border: 0;
	padding: 6px 8px;
	color: var(--bmc-muted);
	cursor: pointer;
}

.bmc-folders { display: flex; flex-direction: column; gap: 1px; }
.bmc-folder {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 9px 10px;
	border-radius: 7px;
	font-size: 14px;
	color: #374151;
	text-decoration: none;
	transition: background .12s ease;
}
.bmc-folder:hover { background: #eef1f4; color: var(--bmc-brand); }
.bmc-folder.is-active { background: #fff; color: var(--bmc-brand); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.bmc-folder--child { padding-left: 26px; font-size: 13px; }
.bmc-folder__icon { display: inline-flex; color: var(--bmc-accent); flex: 0 0 auto; }
.bmc-folder__name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bmc-folder__count { font-size: 12px; color: var(--bmc-muted); }

.bmc-sidebar__notice {
	margin: 22px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--bmc-line);
	font-size: 12px;
	line-height: 1.5;
	color: var(--bmc-muted);
}

/* ---------- Main ---------- */

.bmc-main { flex: 1 1 auto; padding: 22px 24px 32px; min-width: 0; }

.bmc-crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--bmc-muted);
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--bmc-line);
}
.bmc-crumbs a { color: var(--bmc-accent); text-decoration: none; }
.bmc-crumbs strong { color: var(--bmc-ink); }
.bmc-crumbs__sep { opacity: .5; }
.bmc-crumbs__count { margin-left: auto; font-size: 13px; }
.bmc-crumbs__clear { font-size: 13px; }

.bmc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
	gap: 18px;
}

.bmc-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--bmc-line);
	border-radius: var(--bmc-radius);
	overflow: hidden;
	background: #fff;
	transition: box-shadow .15s ease, transform .15s ease;
}
.bmc-card:hover { box-shadow: 0 6px 18px rgba(17,24,39,.09); transform: translateY(-2px); }
.bmc-card.is-featured { border-color: var(--bmc-accent); }

.bmc-card__thumb {
	aspect-ratio: 4 / 3;
	background: var(--bmc-bg);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.bmc-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bmc-card__thumb--icon { background: linear-gradient(140deg, #eef2f5, #dfe6ec); }
.bmc-filetype {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .06em;
	color: #fff;
	background: var(--bmc-brand);
	padding: 7px 12px;
	border-radius: 6px;
}
.bmc-card__thumb--icon[data-type="pdf"]    .bmc-filetype { background: #c0392b; }
.bmc-card__thumb--icon[data-type="doc"]    .bmc-filetype { background: #2b579a; }
.bmc-card__thumb--icon[data-type="sheet"]  .bmc-filetype { background: #1d6f42; }
.bmc-card__thumb--icon[data-type="slides"] .bmc-filetype { background: #c43e1c; }
.bmc-card__thumb--icon[data-type="image"]  .bmc-filetype { background: #7d3cb5; }
.bmc-card__thumb--icon[data-type="video"]  .bmc-filetype { background: #111827; }
.bmc-card__thumb--icon[data-type="zip"]    .bmc-filetype { background: #6b7280; }

.bmc-card__body { padding: 14px 15px 8px; flex: 1 1 auto; }
.bmc-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--bmc-accent);
	margin-bottom: 6px;
}
.bmc-card__title { margin: 0 0 6px; font-size: 15px; line-height: 1.35; }
.bmc-card__desc { margin: 0 0 8px; font-size: 13px; color: var(--bmc-muted); }
.bmc-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	font-size: 12px;
	color: var(--bmc-muted);
}
.bmc-card__actions {
	display: flex;
	gap: 8px;
	padding: 12px 15px 15px;
	border-top: 1px solid var(--bmc-line);
	margin-top: 10px;
}
.bmc-card__pending { font-size: 13px; color: var(--bmc-muted); font-style: italic; }

.bmc-empty {
	text-align: center;
	padding: 56px 20px;
	color: var(--bmc-muted);
}
.bmc-empty h3 { margin: 12px 0 6px; font-size: 17px; color: var(--bmc-ink); }
.bmc-empty p { margin: 0; font-size: 14px; max-width: 400px; margin-inline: auto; }

.bmc-pagination { display: flex; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.bmc-page {
	min-width: 34px;
	padding: 7px 10px;
	text-align: center;
	border: 1px solid var(--bmc-line);
	border-radius: 7px;
	font-size: 13px;
	text-decoration: none;
	color: var(--bmc-ink);
	background: #fff;
}
.bmc-page.is-active { background: var(--bmc-brand); border-color: var(--bmc-brand); color: #fff; }

/* ---------- Responsive ---------- */

@media (max-width: 782px) {
	.bmc-layout { flex-direction: column; }
	.bmc-sidebar {
		width: 100%;
		flex: 1 1 auto;
		border-right: 0;
		border-bottom: 1px solid var(--bmc-line);
	}
	.bmc-folders { flex-direction: row; flex-wrap: wrap; }
	.bmc-folder { background: #fff; border: 1px solid var(--bmc-line); }
	.bmc-folder--child { padding-left: 10px; }
	.bmc-header { justify-content: flex-start; }
	.bmc-header__user { width: 100%; justify-content: space-between; }
	.bmc-header__who { text-align: left; }
	.bmc-main { padding: 18px 16px 26px; }
	.bmc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
}
