@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-var.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Shared presentation for the existing ciurme portal. */
:root {
    color-scheme: dark;
    --gold: #d6bc7c;
    --gold-dark: #bca163;
    --ciurme-gold: #d6bc7c;
    --ciurme-gold-dark: #bca163;
    --text-primary: #edf0f2;
    --text-muted: #a7b2bb;
    --bg-dark: #0d141b;
    --surface: #131d26;
    --surface-raised: #19252f;
    --line: #2b3945;
    --card-border: #2b3945;
    --glass-bg: #131d26;
    --glass-border: #2b3945;
    --font-body: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: var(--font-body);
    --accent-green: #84c9a2;
    --accent-red: #e59797;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body {
    margin: 0;
    color: var(--text-primary);
    background: var(--bg-dark);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
[hidden] { display: none !important; }

.portal-page { height: auto; min-height: 100dvh; overflow: auto; }
.portal-page .dashboard-shell { min-height: 100dvh; overflow: visible; }
.portal-page .dashboard-wrapper {
    min-width: 0;
    height: auto;
    overflow: visible;
    padding: 32px clamp(20px, 3vw, 48px) 56px;
}
.portal-page .dashboard-layout {
    width: 100%;
    height: auto;
    min-width: 0;
    overflow: visible;
}
.portal-page .dashboard-sidebar {
    width: 244px;
    padding: 28px 16px 20px;
    gap: 30px;
    background: #101921;
    border-color: var(--line);
    box-shadow: none;
    height: 100dvh;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 22px;
    margin-bottom: -8px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--text-primary);
}
.sidebar-brand img { width: 38px; height: 38px; object-fit: contain; }
.sidebar-brand span { font-size: 13px; font-weight: 600; line-height: 1.35; }
.sidebar-brand small { display: block; color: var(--text-muted); font-weight: 400; }
.portal-page .sidebar-profile { padding: 0 10px; gap: 10px; }
.portal-page .sidebar-profile__avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    font: 600 14px var(--font-body);
    background-color: #24313b;
    border: 1px solid #3e4a54;
    color: var(--text-primary);
}
.portal-page .sidebar-profile__details { min-width: 0; }
.portal-page .sidebar-profile__name {
    font-size: 14px;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}
.portal-page .sidebar-profile__email { font-size: 12px; gap: 4px; }
.portal-page .sidebar-section__label { padding: 0 10px; letter-spacing: .07em; font-size: 10px; }
.portal-page .sidebar-menu { gap: 3px; }
.portal-page .sidebar-link {
    padding: 10px 12px;
    gap: 10px;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    transform: none;
    transition: color .15s, background-color .15s;
}
.portal-page .sidebar-link i { width: 18px; font-size: 14px; }
.portal-page .sidebar-link:hover { background: #1b2832; color: #fff; }
.portal-page .sidebar-link.is-active {
    background: #252b2b;
    border-color: #4b493b;
    color: #e6cea0;
    box-shadow: none;
}
.portal-page .sidebar-footer { padding: 16px 4px 0; border-top: 1px solid var(--line); }
.portal-page .sidebar-logout button {
    padding: 10px 8px;
    background: transparent;
    color: var(--text-muted);
    border: 0;
    border-radius: 5px;
    box-shadow: none;
    transform: none;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.portal-page .sidebar-logout button:hover { color: #efb7b7; background: #2a2025; box-shadow: none; }

.portal-page :is(.home-header, .profile-header, .admin-header, .audit-header,
    .announcements-header, .xp-header, .ciurme-header) {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    padding: 0 0 24px;
    margin-bottom: 4px;
}
.portal-page h1, .portal-page .dashboard-heading {
    font-family: var(--font-body);
    font-size: clamp(24px, 2.4vw, 30px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.025em;
    text-transform: none;
    color: var(--text-primary);
    background: none;
    -webkit-text-fill-color: currentColor;
    text-shadow: none;
}
.portal-page :is(h2, h3) {
    font-family: var(--font-body);
    color: var(--text-primary);
    text-shadow: none;
    letter-spacing: -.015em;
    text-transform: none;
}
.portal-page h2 { font-size: 18px; font-weight: 600; }
.portal-page h3 { font-size: 16px; font-weight: 600; }
.portal-page :is(.home-eyebrow, .profile-eyebrow, .header-eyebrow, .audit-eyebrow, .xp-eyebrow) {
    font-size: 11px;
    letter-spacing: .06em;
    color: var(--text-muted);
}
.portal-page :is(.welcome-pill, .role-pill, .status-chip, .announcement-count) {
    padding: 5px 0;
    background: none;
    border: 0;
    border-radius: 0;
    color: var(--text-muted);
    font-size: 13px;
    box-shadow: none;
}
.portal-page :is(.stats-panel, .crew-panel, .announcements-panel, .profile-overview,
    .profile-panel, .panel-card, .filter-panel, .users-panel, .audit-panel, .xp-board,
    .composer-panel, .announcements-list-panel, .admin-card, .dashboard-card) {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
    backdrop-filter: none;
}
.portal-page :is(.stat-card, .admin-stat, .audit-stat, .xp-summary-card, .stat-pill) {
    background: #14202a;
    border: 1px solid var(--line);
    border-radius: 6px;
    box-shadow: none;
    transform: none;
}
.portal-page :is(.stat-card, .admin-stat, .audit-stat, .xp-summary-card, .stat-pill):hover {
    transform: none;
    box-shadow: none;
}
.portal-page :is(.stat-card, .admin-stat, .audit-stat)::before,
.portal-page :is(.stat-card, .admin-stat, .audit-stat)::after { display: none; }
.portal-page :is(.stat-card-value, .xp-level-value, .stat-pill strong, .admin-stat strong,
    .audit-stat strong, .xp-summary-card strong) {
    font-family: var(--font-body);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.025em;
    text-shadow: none;
}
.portal-page :is(.stat-card-icon, .admin-stat-icon, .panel-title-icon, .crew-panel-icon,
    .section-icon, .form-title-icon, .xp-header-icon) {
    color: var(--gold);
    background: transparent;
    border: 0;
    box-shadow: none;
}
.portal-page .xp-progress-card { background: none; border: 0; box-shadow: none; border-radius: 0; }
.portal-page .xp-level-caption { gap: 10px; }
.portal-page .xp-level-caption > i { display: none; }
.portal-page .xp-live-badge {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: #8abda2;
    letter-spacing: 0;
    font-size: 11px;
    box-shadow: none;
    animation: none;
}
.portal-page .xp-progress-segment-fill { background: #cbb27a; box-shadow: none; }
.portal-page :is(.announcement-card, .crew-card) {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: none;
}
.portal-page :is(.announcement-card, .crew-card):last-child { border-bottom: 0; }
.portal-page .crew-emblem { border-radius: 6px; box-shadow: none; background: #22313b; color: var(--gold); }
.portal-page :is(.crew-meta-item, .crew-role) { border: 0; background: none; border-radius: 0; }

.portal-page :is(.form-control, .form-select, .filter-input, .filter-select,
    .xp-search, .search-input, .twofactor-input, .profile-input) {
    background: #0e171f;
    border: 1px solid #40505e;
    border-radius: 5px;
    box-shadow: none;
    color: var(--text-primary);
}
.portal-page :is(input, textarea)::placeholder { color: #8e9ba6; opacity: 1; }
.portal-page :is(.form-control, .form-select, .filter-input, .filter-select,
    .xp-search, .search-input):focus { border-color: var(--gold); box-shadow: none; }
.portal-page :is(.btn, .header-action, .manage-announcements, .form-close-button,
    .action-button, .filter-button, .xp-search-button, .twofactor-button,
    .twofactor-submit, .avatar-button, .submit-button, .profile-button) {
    border-radius: 5px;
    box-shadow: none;
    transform: none;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
    font-size: 13px;
    text-shadow: none;
}
.portal-page :is(.btn, .header-action, .manage-announcements, .action-button,
    .xp-search-button, .twofactor-button, .twofactor-submit):hover {
    transform: none;
    box-shadow: none;
}
.portal-page :is(.btn-primary, .twofactor-submit) {
    color: #171b1f;
    background: var(--gold);
    border: 1px solid var(--gold);
}
.portal-page :is(.btn-primary, .twofactor-submit):hover { background: #e0c894; }
.portal-page :is(.btn-secondary, .header-action, .manage-announcements) {
    background: #1d2a35;
    border: 1px solid #42505d;
    color: var(--text-primary);
}
.portal-page :is(.form-section, .subrank-card, .channel-item, .sottorank-item) {
    border-radius: 6px;
    box-shadow: none;
}
.portal-page .form-section-nav a { border-radius: 4px; box-shadow: none; }
.portal-page :is(.section-heading, .ciurme-panel-header, .form-title-block) p,
.portal-page :is(.panel-title, .crew-panel-title) p { color: var(--text-muted); font-size: 13px; }
.portal-page :is(.form-grid-three, .form-grid-two) { gap: 16px; }
.portal-page table { border-collapse: collapse; }
.portal-page th { background: #18252f; color: #b7c2cb; text-transform: none; letter-spacing: 0; font-weight: 600; }
.portal-page td { border-color: var(--line); }
.portal-page :is(.twofactor-modal__content, .sync-preview-modal, .audit-modal-content) {
    background: #15212b;
    border: 1px solid #455563;
    border-radius: 10px;
    box-shadow: 0 16px 64px #0008;
}
.portal-page :is(.twofactor-modal__close, .email-toggle):hover { transform: none; }

.portal-page .panel-card.ciurme-header {
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 0 0 22px;
}
.portal-page :is(.composer-card, .announcement-list-card, .users-card, .audit-table-card) {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: none;
}
.portal-page .xp-live-badge {
    font-size: 11px !important;
    font-weight: 400;
    color: #9fb6a9 !important;
    text-transform: none;
}
.portal-page .xp-live-badge.is-offline { color: #c8b68d !important; }
.portal-page .xp-live-badge::before { display: none; }
.portal-page .xp-level-caption { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
.portal-page .xp-level-value strong { color: var(--gold); text-shadow: none; font-weight: 600; }
.portal-page .xp-progress-current > strong { font-size: 18px; color: var(--text-primary); }
.portal-page .xp-progress-track {
    height: 8px;
    padding: 0;
    gap: 0;
    border-radius: 3px;
    background: #344550;
    box-shadow: none;
    overflow: hidden;
}
.portal-page .xp-progress-segment,
.portal-page .xp-progress-segment:is(.is-filled, .is-partial) {
    width: 100%;
    height: 8px;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    animation: none;
}
.portal-page .xp-progress-segment::before,
.portal-page .xp-progress-segment::after,
.portal-page .xp-progress-segment-fill::after { display: none; }
.portal-page .xp-progress-segment-fill { background: none; border-radius: 0; }
.portal-page .xp-progress-segment-fill::before {
    background: #cbb27a;
    transform: scaleX(var(--fill-level, 0));
    transform-origin: left center;
    transition: transform .2s;
}
.portal-page .stat-card-label { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 500; }
.portal-page .ciurme-form-card .form-section {
    padding: 20px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
}
.portal-page .ciurme-form-card .section-heading > span { background: none; border-radius: 0; }
.portal-page .ciurme-form-card .pl-column { padding: 0; background: none; border: 0; border-radius: 0; }
.portal-page .ciurme-form-card .form-control { border-radius: 5px; }
.portal-page .ciurme-form-card .section-add-button { border-radius: 5px; font-weight: 500; }
.portal-page .ciurme-form-card .form-section-nav {
    background: none;
    padding: 0 0 12px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
}
.portal-page .ciurme-form-card .form-actions {
    margin-top: 16px;
    background: var(--surface);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    padding: 16px 0 0;
    box-shadow: none;
}
.portal-page .ciurme-form-card .form-actions .btn { border-radius: 5px; }

@media (max-width: 1100px) {
    .portal-page .dashboard-shell { padding: 0; gap: 0; }
    .portal-page .dashboard-sidebar {
        position: static;
        width: 100%;
        height: auto;
        max-height: none;
        border-radius: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 18px 20px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 20px;
    }
    .portal-page .sidebar-brand { flex-basis: calc(50% - 10px); margin: 0; padding: 0; border: 0; }
    .portal-page .sidebar-profile { margin-left: auto; padding: 0; }
    .portal-page .dashboard-sidebar > div:has(.sidebar-menu) { flex: 1 1 260px; }
    .portal-page .sidebar-section__label { padding: 0 8px; }
    .portal-page .sidebar-menu { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .portal-page .sidebar-link { padding: 8px 10px; }
    .portal-page .sidebar-footer { padding: 0; margin: 0; border: 0; align-self: flex-end; }
    .portal-page .dashboard-wrapper { padding: 24px 20px 40px; }
}
@media (max-width: 600px) {
    .portal-page .dashboard-wrapper { padding: 24px 14px 36px; }
    .portal-page .dashboard-sidebar { padding: 16px 14px; gap: 16px; }
    .portal-page .sidebar-brand { flex-basis: auto; flex: 1; }
    .portal-page .sidebar-profile__email { display: none; }
    .portal-page .sidebar-profile__avatar { width: 32px; height: 32px; }
    .portal-page .sidebar-profile__name { font-size: 12px; }
    .portal-page .sidebar-link { padding: 8px; font-size: 12px; }
    .portal-page .sidebar-link i { width: 14px; font-size: 12px; }
    .portal-page :is(.home-header, .profile-header, .admin-header, .audit-header, .xp-header) { gap: 12px; }
    .portal-page .welcome-pill { display: none; }
    .portal-page .ciurme-header { padding-bottom: 20px; }
    .portal-page .ciurme-stats { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Typography: one local family, readable labels and restrained emphasis. */
body { font-synthesis: none; }
.portal-page { font-size: 16px; font-weight: 400; line-height: 1.55; }
.portal-page :is(button, input, select, textarea) { font-family: var(--font-body); }
.portal-page strong, .portal-page b { font-weight: 600; }
.portal-page h1, .portal-page .dashboard-heading {
    font-size: clamp(27px, 2.3vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.025em;
}
.portal-page h2 { font-size: 20px; font-weight: 600; line-height: 1.35; }
.portal-page h3 { font-size: 17px; font-weight: 600; line-height: 1.4; }
.portal-page .sidebar-brand span { font-size: 14px; font-weight: 600; }
.portal-page .sidebar-brand small { font-size: 12px; font-weight: 400; }
.portal-page .sidebar-link { font-size: 14px; font-weight: 500; line-height: 1.35; }
.portal-page .sidebar-profile__name { font-size: 15px; font-weight: 600; }
.portal-page .sidebar-section__label,
.portal-page :is(.home-eyebrow, .profile-eyebrow, .header-eyebrow, .audit-eyebrow, .xp-eyebrow) {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .01em;
    text-transform: none;
}
.portal-page :is(label, .profile-field-label, .filter-field label, .input-block label),
.portal-page .ciurme-form-card .form-group > label {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
    text-transform: none;
}
.portal-page :is(.form-control, .form-select, .filter-input, .filter-select, .search-input,
    .xp-search, .user-email, .user-role-select) { font-size: 15px; font-weight: 400; }
.portal-page :is(.profile-field-value, .profile-meta-row dd) { font-size: 15px; font-weight: 500; }
.portal-page :is(.profile-panel-title, .section-title) { font-size: 17px; font-weight: 600; letter-spacing: 0; }
.portal-page :is(.profile-panel-description, .announcement-body) { font-size: 15px; line-height: 1.6; }
.portal-page :is(.panel-title, .crew-panel-title, .section-heading) p,
.portal-page .ciurme-form-card .section-heading p,
.portal-page :is(.section-helper, .twofactor-modal-text, .xp-toolbar p, .composer-note) {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}
.portal-page :is(.btn, .header-action, .manage-announcements, .action-button,
    .xp-search-button, .profile-action, .filter-button, .section-add-button) {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}
.portal-page :is(.stat-card-label, .stat-pill span, .admin-stat-copy span,
    .audit-stat span, .xp-summary-card span, .xp-metric span) {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
.portal-page :is(.stat-card-value, .stat-pill strong, .admin-stat strong, .audit-stat strong, .xp-summary-card strong) {
    font-size: 26px;
    font-weight: 500;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}
.portal-page .xp-level-value strong { font-size: 30px; font-weight: 500; }
.portal-page :is(.stat-card-note, .crew-meta-item, .announcement-meta, .date-stack small,
    .discord-name-preview, .avatar-help, .pagination-summary, .profile-meta-row dt) {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
}
.portal-page :is(th, td) { font-family: var(--font-body); line-height: 1.45; }
.portal-page th { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.portal-page table thead th { font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.portal-page td { font-size: 14px; font-weight: 400; }
.portal-page :is(.crew-name, .user-name strong, .user-cell strong, .xp-user strong, .xp-metric strong) {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}
.portal-page :is(.status-pill, .crew-status, .action-badge, .protected-admin-badge) {
    font-size: 12px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
@media (max-width: 600px) {
    .portal-page .sidebar-profile__name { font-size: 13px; }
    .portal-page .sidebar-link { font-size: 14px; }
    .portal-page .sidebar-brand span { font-size: 13px; }
    .portal-page .sidebar-brand small { font-size: 12px; }
    .portal-page .stat-card-value { font-size: 24px; }
}

/* One content width and a common spacing scale for every internal page. */
.portal-page {
    --content-max-width: 1360px;
    --content-gap: 20px;
    --panel-padding: 20px;
}
.portal-page .dashboard-layout {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
}
.portal-page .dashboard-layout > :is(.home-wrapper, .profile-wrapper, .ciurme-wrapper,
    .announcements-wrapper, .admin-wrapper, .audit-wrapper, .xp-wrapper, .mg-wrapper) {
    width: 100%;
    max-width: var(--content-max-width);
    min-width: 0;
    margin: 0 auto 48px;
    padding-inline: 0;
    gap: var(--content-gap);
}
.portal-page :is(.profile-overview, .profile-panel, .stats-panel, .crew-panel,
    .announcements-panel, .composer-card, .announcement-list-card, .users-panel,
    .filter-panel, .audit-table-card, .xp-board, .ciurme-table-card, .ciurme-form-card) {
    padding: var(--panel-padding);
    min-width: 0;
}
.portal-page .profile-overview {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: var(--content-gap);
    align-items: start;
}
.portal-page :is(.profile-overview > div, .profile-field, .profile-panel, .avatar-card,
    .form-group, .input-block, .filter-field, .composer-card, .announcements-list-card) {
    min-width: 0;
}
.portal-page .profile-fields { gap: 16px; }
.portal-page .profile-panels { gap: var(--content-gap); }
.portal-page .profile-panel-header { flex-wrap: wrap; }
.portal-page :is(.form-group, .input-block, .filter-field) > :is(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]), select, textarea),
.portal-page .twofactor-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.portal-page .profile-fields,
.portal-page .profile-panels,
.portal-page .announcements-workspace { min-width: 0; }
.portal-page .table-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.portal-page .mg-wrapper .table-scroll table { width: 100%; min-width: 520px; }
@media (max-width: 900px) {
    .portal-page .profile-overview { grid-template-columns: minmax(0, 1fr); }
    .portal-page .avatar-card { min-height: 160px; }
}
@media (max-width: 760px) {
    .portal-page .profile-panels { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .portal-page { --panel-padding: 16px; --content-gap: 16px; }
    .portal-page .profile-fields { grid-template-columns: minmax(0, 1fr); }
    .portal-page .profile-header { flex-wrap: wrap; }
    .portal-page .profile-meta-row { flex-wrap: wrap; }
}
