/*!
 * Sovereign GRC Frontend Stylesheet
 * Branded to match infracom.com.sg
 *
 * Brand tokens:
 *   --sgrc-red:        #C8102E  (primary)
 *   --sgrc-red-dark:   #9B0C22  (hover)
 *   --sgrc-red-deep:   #C01120  (accent)
 *   --sgrc-coral:      #FF4D5E  (highlight)
 *   --sgrc-bg:         #F1F1F1  (page background)
 *   --sgrc-text:       #4A4A4A  (body text)
 *   --sgrc-text-dark:  #1A1A1A  (headings)
 *
 * Typography:
 *   Headings — Playfair Display (serif, 600)
 *   Body     — Barlow (sans, 400-700)
 */

:root {
	--sgrc-red: #C8102E;
	--sgrc-red-dark: #9B0C22;
	--sgrc-red-deep: #C01120;
	--sgrc-coral: #FF4D5E;
	--sgrc-bg: #F1F1F1;
	--sgrc-card-bg: #FFFFFF;
	--sgrc-text: #4A4A4A;
	--sgrc-text-dark: #1A1A1A;
	--sgrc-muted: #888;
	--sgrc-border: #E0E0E0;
	--sgrc-success: #00A32A;
	--sgrc-warning: #FFBA00;
	--sgrc-danger: #D63638;
	--sgrc-mono-bg: #F6F7F7;
	--sgrc-shadow: 0 1px 3px rgba(0,0,0,0.08);
	--sgrc-shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
	--sgrc-radius: 4px;
	--sgrc-radius-lg: 8px;
	--sgrc-topbar-height: 64px;
}

/* RESET & BASE */
body.sgrc-app {
	margin: 0;
	padding: 0;
	font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: var(--sgrc-text);
	background: var(--sgrc-bg);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

body.sgrc-app * {
	box-sizing: border-box;
}

body.sgrc-app h1, body.sgrc-app h2, body.sgrc-app h3, body.sgrc-app h4 {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 600;
	color: var(--sgrc-text-dark);
	margin-top: 0;
}

body.sgrc-app h1 {
	font-size: 32px;
	line-height: 1.15;
}

body.sgrc-app h2 {
	font-size: 24px;
	line-height: 1.2;
}

body.sgrc-app h3 {
	font-size: 18px;
	line-height: 1.3;
}

body.sgrc-app a {
	color: var(--sgrc-red);
	text-decoration: none;
}

body.sgrc-app a:hover {
	color: var(--sgrc-red-dark);
	text-decoration: underline;
}

.sgrc-mono {
	font-family: 'SF Mono', Menlo, Consolas, monospace;
	font-size: 12px;
	background: var(--sgrc-mono-bg);
	padding: 2px 6px;
	border-radius: 3px;
}

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

.sgrc-lead {
	font-size: 17px;
	color: var(--sgrc-text);
	line-height: 1.45;
}

/* TOP BAR */
.sgrc-topbar {
	background: var(--sgrc-text-dark);
	color: #fff;
	box-shadow: var(--sgrc-shadow);
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 3px solid var(--sgrc-red);
}

.sgrc-topbar-inner {
	display: flex;
	align-items: center;
	height: var(--sgrc-topbar-height);
	padding: 0 24px;
	max-width: 1440px;
	margin: 0 auto;
	gap: 32px;
}

.sgrc-brand-link {
	display: flex;
	align-items: center;
	gap: 12px;
	color: #fff;
	text-decoration: none;
	font-family: 'Playfair Display', Georgia, serif;
}

.sgrc-brand-link:hover {
	color: #fff;
	text-decoration: none;
}

.sgrc-brand-mark {
	color: var(--sgrc-red);
	font-size: 24px;
	line-height: 1;
}

.sgrc-brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.1;
}

.sgrc-brand-text strong {
	font-size: 18px;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.sgrc-brand-sub {
	font-size: 11px;
	font-family: 'Barlow', sans-serif;
	font-weight: 400;
	color: #BBB;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	margin-top: 2px;
}

.sgrc-topbar-nav {
	display: flex;
	gap: 4px;
	margin-left: 32px;
	flex: 1;
}

.sgrc-nav-link {
	color: #DDD;
	font-family: 'Barlow', sans-serif;
	font-size: 14px;
	font-weight: 500;
	padding: 8px 14px;
	border-radius: var(--sgrc-radius);
	text-decoration: none;
	transition: background 0.15s;
}

.sgrc-nav-link:hover {
	color: #fff;
	background: rgba(255,255,255,0.08);
	text-decoration: none;
}

.sgrc-topbar-right {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-left: auto;
}

/* PERSONA INDICATOR */
.sgrc-persona-indicator {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #DDD;
	padding: 6px 12px;
	background: rgba(255,255,255,0.05);
	border-radius: var(--sgrc-radius);
}

.sgrc-persona-dot {
	width: 8px;
	height: 8px;
	background: var(--sgrc-success);
	border-radius: 50%;
	box-shadow: 0 0 6px var(--sgrc-success);
}

.sgrc-persona-label {
	color: #999;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 1px;
	font-weight: 600;
}

.sgrc-persona-name {
	color: #fff;
	font-family: 'Barlow', sans-serif;
	font-weight: 600;
}

.sgrc-persona-switch {
	color: var(--sgrc-coral);
	text-decoration: none;
	font-size: 11px;
	margin-left: 8px;
	padding: 2px 8px;
	border: 1px solid rgba(255,77,94,0.4);
	border-radius: 3px;
	transition: all 0.15s;
}

.sgrc-persona-switch:hover {
	background: var(--sgrc-coral);
	color: var(--sgrc-text-dark);
	text-decoration: none;
}

.sgrc-persona-none a {
	color: var(--sgrc-warning);
	text-decoration: none;
}

/* USER MENU */
.sgrc-user-menu {
	position: relative;
}

.sgrc-user-menu-btn {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(255,255,255,0.05);
	border: none;
	color: #fff;
	padding: 6px 12px 6px 6px;
	border-radius: var(--sgrc-radius);
	cursor: pointer;
	font-family: 'Barlow', sans-serif;
	font-size: 14px;
	transition: background 0.15s;
}

.sgrc-user-menu-btn:hover {
	background: rgba(255,255,255,0.10);
}

.sgrc-user-avatar {
	width: 28px;
	height: 28px;
	background: var(--sgrc-red);
	color: #fff;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 12px;
}

.sgrc-user-name {
	font-weight: 500;
}

.sgrc-user-caret {
	color: #999;
	font-size: 10px;
}

.sgrc-user-menu-dropdown {
	position: absolute;
	right: 0;
	top: calc(100% + 4px);
	background: #fff;
	min-width: 200px;
	border-radius: var(--sgrc-radius);
	box-shadow: var(--sgrc-shadow-lg);
	padding: 6px;
	display: none;
	z-index: 1000;
}

.sgrc-user-menu.is-open .sgrc-user-menu-dropdown {
	display: block;
}

.sgrc-user-menu-dropdown a {
	display: block;
	padding: 8px 12px;
	color: var(--sgrc-text-dark);
	font-size: 14px;
	text-decoration: none;
	border-radius: 3px;
}

.sgrc-user-menu-dropdown a:hover {
	background: var(--sgrc-bg);
	color: var(--sgrc-red);
	text-decoration: none;
}

/* MAIN CONTENT AREA */
.sgrc-main {
	flex: 1;
	padding: 32px 24px;
}

.sgrc-main-inner {
	max-width: 1280px;
	margin: 0 auto;
}

/* FOOTER */
.sgrc-footer {
	background: #fff;
	border-top: 1px solid var(--sgrc-border);
	padding: 16px 24px;
	margin-top: auto;
}

.sgrc-footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	font-size: 12px;
	color: var(--sgrc-muted);
	display: flex;
	gap: 8px;
	align-items: center;
}

.sgrc-footer-brand {
	font-weight: 600;
}

.sgrc-footer-sep {
	color: var(--sgrc-border);
}

/* PERSONA SELECTOR PAGE */
.sgrc-persona-page .sgrc-main { padding-top: 48px; }

.sgrc-persona-selector {
	max-width: 1100px;
	margin: 0 auto;
}

.sgrc-persona-header {
	text-align: center;
	margin-bottom: 40px;
}

.sgrc-persona-header h1 {
	font-size: 36px;
	margin-bottom: 12px;
}

.sgrc-persona-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
	margin-bottom: 32px;
}

.sgrc-persona-form {
	margin: 0;
}

.sgrc-persona-tile {
	width: 100%;
	background: #fff;
	border: 2px solid var(--sgrc-border);
	border-radius: var(--sgrc-radius-lg);
	padding: 24px;
	text-align: left;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 8px;
	transition: all 0.15s;
	font-family: 'Barlow', sans-serif;
	min-height: 180px;
}

.sgrc-persona-tile:hover {
	border-color: var(--sgrc-red);
	box-shadow: var(--sgrc-shadow-lg);
	transform: translateY(-2px);
}

.sgrc-persona-tile .sgrc-tile-name {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 20px;
	font-weight: 600;
	color: var(--sgrc-text-dark);
}

.sgrc-persona-tile .sgrc-tile-desc {
	font-size: 13px;
	color: var(--sgrc-text);
	line-height: 1.45;
	flex: 1;
}

.sgrc-persona-tile .sgrc-tile-action {
	color: var(--sgrc-red);
	font-weight: 600;
	font-size: 13px;
	margin-top: 8px;
}

.sgrc-persona-footer {
	text-align: center;
}

/* DASHBOARD */
.sgrc-dashboard-header {
	margin-bottom: 32px;
}

.sgrc-dashboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px;
	margin-bottom: 32px;
}

.sgrc-card {
	background: var(--sgrc-card-bg);
	border: 1px solid var(--sgrc-border);
	border-radius: var(--sgrc-radius-lg);
	padding: 20px;
	box-shadow: var(--sgrc-shadow);
	transition: box-shadow 0.15s;
}

.sgrc-card:hover {
	box-shadow: var(--sgrc-shadow-lg);
}

.sgrc-card-icon {
	font-size: 28px;
	margin-bottom: 8px;
}

.sgrc-card-title {
	margin: 0 0 6px 0;
	font-size: 17px;
}

.sgrc-card-desc {
	margin: 0 0 12px 0;
	color: var(--sgrc-text);
	font-size: 14px;
	line-height: 1.45;
}

.sgrc-card-status {
	display: inline-block;
	font-size: 11px;
	background: #FFF8DC;
	color: #856404;
	padding: 3px 8px;
	border-radius: 3px;
	font-weight: 500;
}

/* SECTIONS & TABLES */
.sgrc-section {
	margin-top: 32px;
	background: #fff;
	border: 1px solid var(--sgrc-border);
	border-radius: var(--sgrc-radius-lg);
	padding: 24px;
}

.sgrc-section-title {
	margin-top: 0;
	border-bottom: 2px solid var(--sgrc-red);
	padding-bottom: 8px;
	display: inline-block;
}

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

.sgrc-table thead th {
	text-align: left;
	background: var(--sgrc-bg);
	padding: 10px 12px;
	font-weight: 600;
	color: var(--sgrc-text-dark);
	border-bottom: 2px solid var(--sgrc-border);
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.sgrc-table tbody td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--sgrc-border);
}

.sgrc-table tbody tr:hover {
	background: var(--sgrc-bg);
}

/* BUTTONS */
.sgrc-button {
	display: inline-block;
	background: var(--sgrc-red);
	color: #fff;
	padding: 10px 20px;
	border-radius: var(--sgrc-radius);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	border: none;
	cursor: pointer;
	transition: background 0.15s;
}

.sgrc-button:hover {
	background: var(--sgrc-red-dark);
	color: #fff;
	text-decoration: none;
}

.sgrc-button-secondary {
	background: transparent;
	border: 2px solid var(--sgrc-red);
	color: var(--sgrc-red);
}

.sgrc-button-secondary:hover {
	background: var(--sgrc-red);
	color: #fff;
}

/* EMPTY / ERROR STATES */
.sgrc-empty-state {
	text-align: center;
	padding: 64px 24px;
	background: #fff;
	border-radius: var(--sgrc-radius-lg);
	box-shadow: var(--sgrc-shadow);
}

.sgrc-empty-state h1 {
	color: var(--sgrc-text-dark);
}

/* BUILD NOTE (visible during build phase only) */
.sgrc-buildnote {
	background: #FFF8DC;
	border: 1px solid #FFE69C;
	border-radius: var(--sgrc-radius);
	padding: 12px 16px;
	margin-top: 24px;
	font-size: 13px;
	color: #856404;
}

/* RESPONSIVE */
@media (max-width: 768px) {
	.sgrc-topbar-inner {
		padding: 0 12px;
		gap: 12px;
	}
	.sgrc-topbar-nav {
		display: none;
	}
	.sgrc-user-name {
		display: none;
	}
	.sgrc-main {
		padding: 20px 12px;
	}
	body.sgrc-app h1 {
		font-size: 26px;
	}
	.sgrc-persona-grid,
	.sgrc-dashboard-grid {
		grid-template-columns: 1fr;
	}
}

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

body.sgrc-login-body {
	margin: 0;
	padding: 0;
	font-family: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: linear-gradient(135deg, #1A1A1A 0%, #2D0A11 100%);
	min-height: 100vh;
	color: var(--sgrc-text);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

body.sgrc-login-body * {
	box-sizing: border-box;
}

.sgrc-login-wrap {
	width: 100%;
	max-width: 440px;
	padding: 24px;
}

.sgrc-login-card {
	background: #fff;
	border-radius: 12px;
	padding: 40px 36px;
	box-shadow: 0 20px 60px rgba(0,0,0,0.3);
	border-top: 4px solid var(--sgrc-red);
}

.sgrc-login-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 24px;
	font-family: 'Playfair Display', Georgia, serif;
}

.sgrc-login-brand-mark {
	color: var(--sgrc-red);
	font-size: 32px;
	line-height: 1;
}

.sgrc-login-brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.1;
}

.sgrc-login-brand-text strong {
	font-size: 22px;
	font-weight: 600;
	color: var(--sgrc-text-dark);
	letter-spacing: 0.5px;
}

.sgrc-login-brand-sub {
	font-size: 11px;
	font-family: 'Barlow', sans-serif;
	font-weight: 500;
	color: var(--sgrc-muted);
	letter-spacing: 1.5px;
	text-transform: uppercase;
	margin-top: 3px;
}

.sgrc-cma-banner {
	background: #FFF4F4;
	border: 2px solid var(--sgrc-red);
	border-left-width: 6px;
	border-radius: 4px;
	padding: 14px 16px;
	margin-bottom: 24px;
}

.sgrc-cma-banner__title {
	color: var(--sgrc-red-dark);
	font-weight: 700;
	font-size: 12px;
	letter-spacing: 0.5px;
	margin-bottom: 8px;
	text-transform: uppercase;
}

.sgrc-cma-banner__text {
	color: var(--sgrc-text);
	font-size: 12px;
	line-height: 1.5;
}

.sgrc-login-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 28px;
	font-weight: 600;
	color: var(--sgrc-text-dark);
	margin: 0 0 24px 0;
}

.sgrc-login-error {
	background: #FFF4F4;
	border: 1px solid var(--sgrc-red);
	color: var(--sgrc-red-dark);
	padding: 12px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 14px;
}

.sgrc-login-notice {
	background: #E8F4FD;
	border: 1px solid #5C9BD5;
	color: #1B5E8C;
	padding: 12px 14px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 14px;
}

.sgrc-login-form {
	margin: 0;
}

.sgrc-form-field {
	margin-bottom: 16px;
}

.sgrc-form-field label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--sgrc-text-dark);
	margin-bottom: 6px;
}

.sgrc-form-field input[type="text"],
.sgrc-form-field input[type="password"],
.sgrc-form-field input[type="email"] {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--sgrc-border);
	border-radius: 4px;
	font-family: 'Barlow', sans-serif;
	font-size: 15px;
	background: #fff;
	color: var(--sgrc-text-dark);
	transition: border-color 0.15s, box-shadow 0.15s;
}

.sgrc-form-field input:focus {
	outline: none;
	border-color: var(--sgrc-red);
	box-shadow: 0 0 0 3px rgba(200,16,46,0.12);
}

.sgrc-form-field-inline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
}

.sgrc-checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--sgrc-text);
	cursor: pointer;
	margin-bottom: 0 !important;
}

.sgrc-checkbox-label input {
	margin: 0;
}

.sgrc-button-full {
	width: 100%;
	padding: 12px 20px;
	font-size: 15px;
	font-family: 'Barlow', sans-serif;
}

.sgrc-button-sso {
	display: inline-block;
	width: 100%;
	background: #2F2F2F;
	color: #fff;
	padding: 12px 20px;
	border-radius: 4px;
	font-weight: 600;
	font-size: 15px;
	border: none;
	cursor: pointer;
	font-family: 'Barlow', sans-serif;
}

.sgrc-button-sso:hover:not(:disabled) {
	background: #1A1A1A;
}

.sgrc-button-sso:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.sgrc-login-helper {
	font-size: 11px;
	color: var(--sgrc-muted);
	text-align: center;
	margin: 8px 0 0 0;
	font-style: italic;
}

.sgrc-login-divider {
	text-align: center;
	color: var(--sgrc-muted);
	font-size: 11px;
	letter-spacing: 1px;
	margin: 20px 0 16px 0;
	position: relative;
}

.sgrc-login-divider::before,
.sgrc-login-divider::after {
	content: '';
	position: absolute;
	top: 50%;
	width: 40%;
	height: 1px;
	background: var(--sgrc-border);
}

.sgrc-login-divider::before { left: 0; }
.sgrc-login-divider::after { right: 0; }

.sgrc-login-divider span {
	background: #fff;
	padding: 0 12px;
	position: relative;
}

.sgrc-login-footer {
	text-align: center;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--sgrc-border);
	font-size: 13px;
}

.sgrc-login-page-footer {
	text-align: center;
	margin-top: 32px;
	font-size: 11px;
	color: rgba(255,255,255,0.6);
}

.sgrc-login-private {
	margin-left: 4px;
}

@media (max-width: 480px) {
	.sgrc-login-card {
		padding: 28px 22px;
	}
	.sgrc-login-title {
		font-size: 24px;
	}
}

/* ===================================================================
 * SSO DENIED PAGE
 * =================================================================== */

.sgrc-denied-card {
	border-top-color: #D63638 !important;
}

.sgrc-denied-icon {
	font-size: 56px;
	text-align: center;
	margin: 12px 0 16px 0;
	line-height: 1;
}

.sgrc-denied-title {
	color: #9B0C22;
	text-align: center;
	margin-bottom: 16px;
}

.sgrc-denied-message {
	background: #FFF8DC;
	border: 1px solid #FFE69C;
	border-radius: 4px;
	padding: 14px 16px;
	margin-bottom: 24px;
}

.sgrc-denied-message p {
	margin: 0 0 8px 0;
	color: #4A4A4A;
	font-size: 14px;
	line-height: 1.5;
}

.sgrc-denied-message p:last-child {
	margin-bottom: 0;
}

.sgrc-denied-contact {
	border: 1px solid var(--sgrc-border);
	border-radius: 4px;
	padding: 16px;
	margin-bottom: 20px;
	background: #F8F9FA;
	text-align: center;
}

.sgrc-denied-contact-label {
	font-size: 12px;
	color: var(--sgrc-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin: 0 0 6px 0;
}

.sgrc-denied-contact-email {
	display: inline-block;
	font-family: 'Barlow', sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: var(--sgrc-red);
	text-decoration: none;
}

.sgrc-denied-contact-email:hover {
	color: var(--sgrc-red-dark);
	text-decoration: underline;
}

.sgrc-denied-actions {
	text-align: center;
}

.sgrc-denied-actions .sgrc-button {
	margin-bottom: 12px;
}

.sgrc-denied-back-link {
	display: inline-block;
	color: var(--sgrc-muted);
	font-size: 13px;
	text-decoration: none;
	margin-top: 8px;
}

.sgrc-denied-back-link:hover {
	color: var(--sgrc-red);
	text-decoration: underline;
}

.sgrc-button-secondary {
	background: transparent !important;
	color: var(--sgrc-text-dark) !important;
	border: 1px solid var(--sgrc-border) !important;
}

.sgrc-button-secondary:hover {
	background: var(--sgrc-bg) !important;
	border-color: var(--sgrc-text-dark) !important;
}
