/* Safic Portal — neutral base styles; the theme can override everything under .safic-portal */
.safic-portal-page { width: 100%; padding: 40px 0 60px; }
.sp-repo__files { min-width: 0; overflow-x: auto; }
/* Neutralise common theme styles inside the portal */
.safic-portal table, .safic-portal th, .safic-portal td { border-left: 0; border-right: 0; border-top: 0; }
.safic-portal table { border: 0; table-layout: auto; margin: 0; }
.safic-portal button, .safic-portal input[type=submit], .safic-portal .sp-btn, .safic-portal .sp-link { text-transform: none; letter-spacing: normal; box-shadow: none; text-shadow: none; }
.safic-portal button.sp-link { background: none; border: 0; padding: 0; min-height: 0; }
.safic-portal ul { margin-left: 0; }
.safic-portal {
	--sp-blue: #0a47c2;
	--sp-blue-dark: #07358f;
	--sp-ink: #2b2f36;
	--sp-muted: #6b717c;
	--sp-line: #e3e6ec;
	--sp-bg: #f6f7f9;
	--sp-red: #c62f2f;
	--sp-amber: #b86e00;
	--sp-green: #1f7a4a;
	--sp-radius: 10px;
	font-family: "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--sp-ink);
	font-size: 15px;
	line-height: 1.45;
	max-width: 1240px;
	margin: 0 auto;
	padding: 20px 20px 40px;
}
.safic-portal *, .safic-portal *::before, .safic-portal *::after { box-sizing: border-box; }
.safic-portal h2 { font-size: 28px; margin: 0 0 4px; color: #55595f; }
.safic-portal h3 { font-size: 19px; margin: 0 0 14px; }
.safic-portal h4 { font-size: 16px; margin: 0 0 10px; }
.safic-portal a { color: var(--sp-blue); }

.sp-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--sp-line); padding-bottom: 10px; margin-bottom: 20px; }
.sp-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.sp-nav a, .sp-tabs a, .sp-filter a { text-decoration: none; padding: 7px 14px; border-radius: 999px; color: var(--sp-ink); font-weight: 600; }
.sp-nav a.is-active, .sp-filter a.is-active { background: var(--sp-blue); color: #fff; }
.sp-user { display: flex; gap: 14px; align-items: center; color: var(--sp-muted); font-size: 14px; }

.sp-card { background: #fff; border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 22px; margin-bottom: 20px; }
.sp-narrow { max-width: 760px; }
.sp-muted { color: var(--sp-muted); font-size: 13px; }
.sp-strong { font-weight: 700; text-decoration: none; }
.sp-empty { color: var(--sp-muted); font-style: italic; padding: 10px 0; }
.sp-mt { margin-top: 16px; }
.sp-nowrap { white-space: nowrap; }

.sp-notice { padding: 11px 16px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.sp-notice--success { background: #e7f5ed; color: var(--sp-green); }
.sp-notice--error { background: #fdecec; color: var(--sp-red); }

.sp-btn { display: inline-block; background: var(--sp-blue); color: #fff !important; border: 1px solid var(--sp-blue); border-radius: 7px; padding: 9px 18px; font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; font-family: inherit; }
.sp-btn:hover { background: var(--sp-blue-dark); }
.sp-btn--ghost { background: #fff; color: var(--sp-blue) !important; }
.sp-btn--ghost:hover { background: #eef3fd; }
.sp-btn--danger { background: var(--sp-red); border-color: var(--sp-red); }
.sp-btn--small { padding: 6px 12px; font-size: 13px; }
.sp-link { background: none; border: 0; padding: 0; color: var(--sp-blue); cursor: pointer; font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
.sp-link--danger { color: var(--sp-red); }
.sp-inline { display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.sp-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
summary.sp-btn { list-style: none; }
summary.sp-btn::-webkit-details-marker { display: none; }

.sp-form { display: grid; gap: 14px; }
.sp-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sp-grid3 { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 14px; }
.sp-field { display: grid; gap: 5px; }
.sp-field > span { font-size: 13px; font-weight: 700; color: #55595f; }
.safic-portal input[type=text], .safic-portal input[type=email], .safic-portal input[type=tel], .safic-portal input[type=date], .safic-portal input[type=search], .safic-portal input[type=password], .safic-portal input[type=number], .safic-portal select, .safic-portal textarea {
	width: 100%; padding: 9px 11px; border: 1px solid #c9ced8; border-radius: 6px; font: inherit; background: #fff; color: var(--sp-ink);
}
.safic-portal input:disabled { background: var(--sp-bg); color: var(--sp-muted); }
.sp-check { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; margin-right: 14px; }

.sp-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-toolbar select { width: auto; }
.sp-search { flex: 1; max-width: 420px; }

.sp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.sp-stats > div { background: #fff; border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 16px 18px; }
.sp-stats strong { display: block; font-size: 30px; line-height: 1; margin-bottom: 4px; color: var(--sp-blue); }
.sp-stats span { color: var(--sp-muted); font-size: 13px; }
.sp-stats .is-bad strong { color: var(--sp-red); }
.sp-stats .is-warn strong { color: var(--sp-amber); }

.sp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sp-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); font-weight: 700; padding: 8px 10px; border-bottom: 2px solid var(--sp-line); }
.sp-table td { padding: 10px; border-bottom: 1px solid var(--sp-line); vertical-align: middle; }
.sp-table tr:hover td { background: #fafbfc; }
.sp-num { text-align: right; }
.sp-actions { text-align: right; white-space: nowrap; }
.sp-actions > * + * { margin-left: 12px; }
.sp-fname { display: flex; align-items: center; gap: 4px; min-width: 200px; }
.sp-fname .sp-ext { flex: none; }
.sp-files td:first-child { width: 42%; min-width: 200px; }
.sp-fname a { text-decoration: none; overflow-wrap: break-word; word-break: normal; min-width: 0; color: var(--sp-ink); font-weight: 600; }
.sp-fname a:hover { color: var(--sp-blue); }
.sp-scroll { overflow-x: auto; }
.sp-matrix th:not(:first-child), .sp-matrix td:not(:first-child) { text-align: center; }

.sp-ext { display: inline-block; min-width: 38px; text-align: center; font-size: 10px; font-weight: 800; padding: 3px 4px; border-radius: 4px; color: #fff; background: #8a909b; margin-right: 6px; vertical-align: 1px; }
.sp-ext--pdf { background: #c8372d; }
.sp-ext--doc { background: #2b5fb8; }
.sp-ext--xls { background: #1f7a4a; }

.sp-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin: 1px 4px 1px 0; white-space: nowrap; }
.sp-badge--pending { background: #eef0f4; color: #4b515c; }
.sp-badge--submitted { background: #fff3dc; color: var(--sp-amber); }
.sp-badge--accepted { background: #e5f4eb; color: var(--sp-green); }
.sp-badge--rejected { background: #fde9e2; color: #a4471f; }
.sp-badge--overdue { background: #fde5e5; color: var(--sp-red); }
.sp-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: #eef0f4; color: #4b515c; font-size: 12px; text-align: center; font-weight: 700; }
.sp-count.is-bad { background: #fde5e5; color: var(--sp-red); }

.sp-repo__head { display: flex; justify-content: space-between; align-items: baseline; }
.sp-repo__body { display: grid; grid-template-columns: 250px 1fr; gap: 26px; }
.sp-folders { list-style: none; margin: 0 0 12px; padding: 0; }
.sp-folders li a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 7px; text-decoration: none; color: var(--sp-ink); }
.sp-folders li a::before { content: ""; width: 16px; height: 12px; border-radius: 2px; background: #c9d5ee; margin-right: 9px; flex: none; }
.sp-folders li a { justify-content: flex-start; }
.sp-folders li a .sp-count { margin-left: auto; }
.sp-folders li.is-active a { background: #eef3fd; font-weight: 700; color: var(--sp-blue); }
.sp-folders li.is-active a::before { background: var(--sp-blue); }
.sp-newfolder { display: flex; gap: 6px; }
.sp-folder-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.sp-rename { display: flex; gap: 8px; align-items: center; }
.sp-rename input { font-weight: 700; font-size: 16px !important; max-width: 300px; }

.sp-upload { margin-top: 18px; display: grid; gap: 10px; }
.sp-upload--compact { margin-top: 8px; grid-template-columns: 1fr auto; align-items: center; }
.sp-drop { position: relative; display: grid; place-items: center; text-align: center; border: 2px dashed #b9c4da; border-radius: var(--sp-radius); padding: 22px; cursor: pointer; background: #fafbfd; transition: .15s; }
.sp-upload--compact .sp-drop { padding: 10px; }
.sp-drop:hover, .sp-drop.is-over { border-color: var(--sp-blue); background: #eef3fd; }
.sp-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sp-drop__text { font-weight: 700; color: var(--sp-blue); }
.sp-drop__hint { font-size: 12px; color: var(--sp-muted); }
.sp-drop__list { font-size: 13px; color: var(--sp-ink); margin-top: 4px; }
.sp-drop__list .is-bad { color: var(--sp-red); }

.sp-requests { list-style: none; margin: 0; padding: 0; }
.sp-request { border: 1px solid var(--sp-line); border-left: 4px solid #c9ced8; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; }
.sp-request.is-overdue { border-left-color: var(--sp-red); }
.sp-request__head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp-request p { margin: 8px 0; }
.sp-note { background: #fff6ef; border-radius: 6px; padding: 8px 10px; font-size: 14px; }
.sp-reject input { width: 240px !important; padding: 6px 9px !important; font-size: 13px !important; }

.sp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--sp-line); margin: 18px 0 20px; flex-wrap: wrap; }
.sp-tabs a { border-radius: 0; border-bottom: 3px solid transparent; padding: 10px 14px; }
.sp-tabs a.is-active { border-bottom-color: var(--sp-blue); color: var(--sp-blue); }
.sp-client-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sp-clientpick { border: 1px solid var(--sp-line); border-radius: 8px; padding: 10px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.sp-clientpick legend { font-weight: 700; font-size: 13px; padding: 0 6px; }

.sp-login { max-width: 420px; margin: 30px auto; background: #fff; border: 1px solid var(--sp-line); border-radius: var(--sp-radius); padding: 30px; }
.sp-login form p { margin: 0 0 14px; }
.sp-login label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.sp-login .login-remember label { display: inline; font-weight: 400; }
.sp-login input[type=submit] { background: var(--sp-blue); color: #fff; border: 0; border-radius: 7px; padding: 11px 22px; font-weight: 700; cursor: pointer; width: 100%; font: inherit; font-weight: 700; }

@media (max-width: 1000px) {
	.sp-repo__body { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
	.sp-grid2, .sp-grid3 { grid-template-columns: 1fr; }
	.sp-stats { grid-template-columns: repeat(2, 1fr); }
	.sp-table th:nth-child(2), .sp-table td:nth-child(2) { display: none; }
	.sp-upload--compact { grid-template-columns: 1fr; }
}
