/* GCC Staff Portal – front end */
:root { --gcc-sp-primary: #1f8a4c; }

.gcc-sp, .gcc-sp-viewer, .gcc-sp-modal-wrap {
	--p: var(--gcc-sp-primary);
	--p-soft: color-mix(in srgb, var(--p) 10%, #fff);
	--p-mid: color-mix(in srgb, var(--p) 22%, #fff);
	--ink: #1b2430;
	--ink-2: #5b6573;
	--line: #e4e7eb;
	--bg: #f6f7f9;
	--radius: 12px;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--ink);
	box-sizing: border-box;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}
.gcc-sp *, .gcc-sp *::before, .gcc-sp *::after,
.gcc-sp-viewer *, .gcc-sp-viewer *::before, .gcc-sp-viewer *::after,
.gcc-sp-modal-wrap *, .gcc-sp-modal-wrap *::before, .gcc-sp-modal-wrap *::after { box-sizing: border-box; }

/* Neutralise theme button/input styling inside the portal */
.gcc-sp button, .gcc-sp-viewer button, .gcc-sp-modal-wrap button {
	font: inherit; color: inherit; background: none; border: 0; margin: 0; padding: 0;
	box-shadow: none; text-transform: none; letter-spacing: normal; line-height: inherit;
	cursor: pointer; min-height: 0; width: auto; height: auto; border-radius: 0; text-decoration: none;
}
.gcc-sp button:focus-visible, .gcc-sp-viewer button:focus-visible, .gcc-sp-modal-wrap button:focus-visible,
.gcc-sp tr:focus-visible { outline: 2px solid var(--p); outline-offset: 2px; }
.gcc-sp input, .gcc-sp select { font: inherit; margin: 0; }
.gcc-sp img { max-width: 100%; }
.gcc-sp h2, .gcc-sp h3, .gcc-sp p { margin: 0; }
.gcc-sp ul { margin: 0; padding: 0; list-style: none; }

.gcc-sp-ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.gcc-sp-ico svg { width: 100%; height: 100%; display: block; }
.gcc-sp-ico.is-folder { color: #f2b33d; }
.gcc-sp-ico.is-root { color: var(--p); }

.gcc-sp-boot { display: flex; align-items: center; justify-content: center; min-height: 240px; }
.gcc-sp-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--p-mid); border-top-color: var(--p); animation: gcc-sp-spin .8s linear infinite; display: inline-block; }
@keyframes gcc-sp-spin { to { transform: rotate(360deg); } }

/* Buttons */
.gcc-sp .gcc-sp-btn, .gcc-sp-modal-wrap .gcc-sp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; transition: .15s;
}
.gcc-sp .gcc-sp-btn-primary, .gcc-sp-modal-wrap .gcc-sp-btn-primary { background: var(--p); color: #fff; }
.gcc-sp .gcc-sp-btn-primary:hover, .gcc-sp-modal-wrap .gcc-sp-btn-primary:hover { filter: brightness(.92); }
.gcc-sp .gcc-sp-btn-ghost, .gcc-sp-modal-wrap .gcc-sp-btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.gcc-sp .gcc-sp-btn-ghost:hover, .gcc-sp-modal-wrap .gcc-sp-btn-ghost:hover { background: var(--bg); }
.gcc-sp .gcc-sp-btn.is-busy, .gcc-sp-modal-wrap .gcc-sp-btn.is-busy { opacity: .6; cursor: progress; }
.gcc-sp .gcc-sp-iconbtn, .gcc-sp-viewer .gcc-sp-iconbtn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 36px; height: 36px; border-radius: 8px; color: var(--ink-2); transition: .15s;
}
.gcc-sp .gcc-sp-iconbtn svg, .gcc-sp-viewer .gcc-sp-iconbtn svg { width: 20px; height: 20px; }
.gcc-sp .gcc-sp-iconbtn:hover, .gcc-sp-viewer .gcc-sp-iconbtn:hover { background: var(--bg); color: var(--ink); }
.gcc-sp .gcc-sp-iconbtn.is-active { background: var(--p-soft); color: var(--p); }

/* ---------------- Full-bleed, full-height layout */
html.gcc-sp-fullbleed, html.gcc-sp-fullbleed body { overflow-x: clip; }
.gcc-sp {
	--gcc-sp-h: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	text-align: left;
}
@supports (height: 100dvh) {
	.gcc-sp { --gcc-sp-h: calc(100dvh - var(--wp-admin--admin-bar--height, 0px)); }
}

/* ---------------- Auth screens */
.gcc-sp-auth { display: flex; align-items: center; justify-content: center; min-height: var(--gcc-sp-h); padding: 40px 16px; background: linear-gradient(160deg, var(--p-soft), #fff 60%); }
.gcc-sp-auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 32px 30px; box-shadow: 0 10px 30px rgba(20, 30, 50, .07); }
.gcc-sp-auth-head { text-align: center; margin-bottom: 22px; }
.gcc-sp-auth-head .gcc-sp-logo { max-height: 64px; width: auto; margin: 0 auto 14px; display: block; }
.gcc-sp-auth-badge { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--p-soft); color: var(--p); display: flex; align-items: center; justify-content: center; }
.gcc-sp-auth-badge .gcc-sp-ico { width: 26px; height: 26px; }
.gcc-sp .gcc-sp-auth-title { font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.gcc-sp-form { display: flex; flex-direction: column; }
.gcc-sp-intro { color: var(--ink-2); margin-bottom: 18px !important; text-align: center; }
.gcc-sp-form label { font-weight: 600; font-size: 14px; margin: 0 0 6px; color: var(--ink); }
.gcc-sp .gcc-sp-form input, .gcc-sp .gcc-sp-form select {
	width: 100%; height: 46px; padding: 0 14px; margin-bottom: 16px; border: 1px solid #cfd5dc; border-radius: 10px;
	background: #fff; color: var(--ink); font-size: 16px; box-shadow: none; -webkit-user-select: text; user-select: text;
}
.gcc-sp .gcc-sp-form select { appearance: none; -webkit-appearance: none; padding-right: 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%235b6573' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 10px center; background-size: 22px; }
.gcc-sp .gcc-sp-form input:focus, .gcc-sp .gcc-sp-form select:focus { outline: none; border-color: var(--p); box-shadow: 0 0 0 3px var(--p-mid); }
.gcc-sp-form .gcc-sp-btn { width: 100%; height: 48px; margin-top: 4px; }
.gcc-sp-error { color: #c62828; font-size: 14px; min-height: 0; margin-bottom: 8px; }
.gcc-sp-error:empty { display: none; }
.gcc-sp-notice { background: #fff8e1; border: 1px solid #f3d27a; color: #6b4e00; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 16px; text-align: center; }
.gcc-sp-home-pill { align-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--p-soft); color: var(--p); font-weight: 600; margin-bottom: 14px; }
.gcc-sp-home-pill .gcc-sp-ico { width: 18px; height: 18px; }
.gcc-sp .gcc-sp-link { margin-top: 14px; color: var(--ink-2); font-size: 14px; text-align: center; text-decoration: underline; }

/* ---------------- Portal */
.gcc-sp-portal {
	display: flex; flex-direction: column; height: var(--gcc-sp-h); min-height: 480px;
	background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden;
}
.gcc-sp-topbar { display: flex; align-items: center; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fff; }
.gcc-sp-brand { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.gcc-sp-brand .gcc-sp-logo { height: 34px; width: auto; }
.gcc-sp-brand-title { font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-sp-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gcc-sp-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--p); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.gcc-sp-user-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.gcc-sp-user-text strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-sp-user-text small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-sp-topbar .gcc-sp-btn { padding: 8px 12px; font-size: 14px; }
.gcc-sp-topbar .gcc-sp-btn .gcc-sp-ico { width: 18px; height: 18px; }

.gcc-sp-body { flex: 1; display: flex; min-height: 0; }
.gcc-sp-sidebar { width: 260px; flex: none; border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; padding: 14px 10px; }
.gcc-sp-tree li ul { margin: 0; }
.gcc-sp-tree > li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.gcc-sp-tree-row { display: flex; align-items: center; border-radius: 8px; padding-right: 6px; }
.gcc-sp-tree-row:hover { background: #eceef2; }
.gcc-sp-tree-row.is-active { background: var(--p-mid); }
.gcc-sp-tree-row.is-active .gcc-sp-tree-name { color: var(--ink); font-weight: 600; }
.gcc-sp-tree-row.is-root .gcc-sp-tree-name { font-weight: 700; }
.gcc-sp .gcc-sp-caret { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); flex: none; transition: transform .15s; border-radius: 4px; }
.gcc-sp .gcc-sp-caret svg { width: 16px; height: 16px; }
.gcc-sp .gcc-sp-caret.is-open { transform: rotate(90deg); }
.gcc-sp-caret.is-empty { visibility: hidden; }
.gcc-sp .gcc-sp-tree-link { flex: 1; display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 7px 4px; min-width: 0; text-align: left; }
.gcc-sp-tree-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }

.gcc-sp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gcc-sp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.gcc-sp-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 16px; min-width: 0; }
.gcc-sp .gcc-sp-crumb { padding: 4px 8px; border-radius: 6px; color: var(--ink-2); font-weight: 500; }
.gcc-sp .gcc-sp-crumb:hover { background: var(--bg); color: var(--ink); }
.gcc-sp-crumb.is-current { color: var(--ink); font-weight: 700; padding: 4px 8px; }
.gcc-sp-sep { display: inline-flex; width: 16px; height: 16px; color: #a0a8b3; }
.gcc-sp-sep svg { width: 100%; height: 100%; }
.gcc-sp-viewtoggle { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; flex: none; }
.gcc-sp-viewtoggle .gcc-sp-iconbtn { width: 32px; height: 30px; }

.gcc-sp-content { flex: 1; overflow-y: auto; padding: 20px; }
.gcc-sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.gcc-sp .gcc-sp-card {
	display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
	padding: 18px 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: .15s; min-width: 0;
}
.gcc-sp .gcc-sp-card:hover { border-color: var(--p); box-shadow: 0 6px 18px rgba(20, 30, 50, .08); transform: translateY(-1px); }
.gcc-sp-card-thumb { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; border-radius: 10px; }
.gcc-sp-card.is-folder .gcc-sp-card-thumb { background: #fff7e6; }
.gcc-sp-card.is-file .gcc-sp-card-thumb { background: #fdeeee; }
.gcc-sp-card-thumb .gcc-sp-ico { width: 46px; height: 46px; }
.gcc-sp-card-name { font-weight: 600; font-size: 14px; width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.gcc-sp-card-meta { font-size: 12px; color: var(--ink-2); }

.gcc-sp-list { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0; border: 0; }
.gcc-sp-list th { text-align: left; font-weight: 600; color: var(--ink-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); background: none; }
.gcc-sp-list td { padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; background: none; }
.gcc-sp-list tr { cursor: pointer; }
.gcc-sp-list tbody tr:hover td { background: var(--p-soft); }
.gcc-sp-list td.gcc-sp-col-name { color: var(--ink); font-weight: 500; white-space: normal; width: 70%; }
.gcc-sp-col-name { display: flex; align-items: center; gap: 10px; }
.gcc-sp-list th:nth-child(n+2), .gcc-sp-list td:nth-child(n+2) { width: 15%; }

.gcc-sp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 260px; color: var(--ink-2); text-align: center; }
.gcc-sp-empty-ico { width: 56px; height: 56px; opacity: .55; }

/* ---------------- Viewer */
html.gcc-sp-noscroll, html.gcc-sp-noscroll body { overflow: hidden !important; }
.gcc-sp-viewer { position: fixed; inset: 0; z-index: 999990; display: flex; flex-direction: column; background: #2b3036; }
.gcc-sp-v-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.gcc-sp-v-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.gcc-sp-v-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcc-sp-v-ro { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; background: var(--p-soft); color: var(--p); font-size: 12px; font-weight: 600; flex: none; }
.gcc-sp-v-ro .gcc-sp-ico { width: 15px; height: 15px; }
.gcc-sp-v-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.gcc-sp-v-pageinfo { font-size: 13px; color: var(--ink-2); white-space: nowrap; padding: 0 6px; }
.gcc-sp-v-zoomlbl { font-size: 13px; color: var(--ink); min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; }
.gcc-sp-v-div { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.gcc-sp-viewer .gcc-sp-v-close { margin-left: 4px; }
.gcc-sp-v-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
.gcc-sp-v-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 16px 48px; min-width: min-content; }
.gcc-sp-v-page { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); flex: none; position: relative; }
.gcc-sp-v-page canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.gcc-sp-v-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100%; color: #e6e9ed; font-size: 15px; text-align: center; padding: 20px; }

/* ---------------- Inactivity modal */
.gcc-sp-modal-wrap { position: fixed; inset: 0; z-index: 999999; background: rgba(15, 20, 28, .55); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(2px); }
.gcc-sp-modal { background: #fff; border-radius: 16px; padding: 28px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.gcc-sp-modal-ico { width: 56px; height: 56px; border-radius: 50%; background: #fff4e0; color: #d98a00; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.gcc-sp-modal-ico .gcc-sp-ico { width: 30px; height: 30px; }
.gcc-sp-modal h3 { margin: 0 0 8px; font-size: 20px; color: var(--ink); }
.gcc-sp-modal p { margin: 0 0 20px; color: var(--ink-2); }
.gcc-sp-countdown { color: var(--ink); font-variant-numeric: tabular-nums; }
.gcc-sp-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------- Responsive */
@media (max-width: 760px) {
	.gcc-sp-portal { height: auto; min-height: var(--gcc-sp-h); }
	.gcc-sp-body { flex-direction: column; }
	.gcc-sp-sidebar { width: 100%; border-right: 0; border-bottom: 1px solid var(--line); max-height: 220px; padding: 10px; }
	.gcc-sp-user-text { display: none; }
	.gcc-sp-hide-sm { display: none !important; }
	.gcc-sp-toolbar { padding: 10px 12px; }
	.gcc-sp-content { padding: 12px; overflow: visible; }
	.gcc-sp-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
	.gcc-sp-list th:nth-child(2), .gcc-sp-list td:nth-child(2) { display: none; }
	.gcc-sp-v-bar { padding: 6px 8px; gap: 6px; }
	.gcc-sp-v-div { display: none; }
	.gcc-sp-v-pages { padding: 12px 8px 32px; gap: 10px; }
	.gcc-sp-auth-card { padding: 26px 20px; }
}

/* ---------------- Never print portal content */
@media print {
	.gcc-sp, .gcc-sp-viewer, .gcc-sp-modal-wrap { display: none !important; }
}
html.gcc-sp-printing .gcc-sp-viewer, html.gcc-sp-printing .gcc-sp { visibility: hidden !important; }
