:root {
    --color-primary: #cbf404;
    --color-primary-light: #dcfd7d;
    --color-primary-dim: rgba(203, 244, 4, 0.15);
    --color-dark: #000000;
    --color-white: #ffffff;
    --color-neutral-light: #fafafa;
    --color-neutral-medium: #656565;
    --color-neutral-dark: #a39eba;
    --color-footer-bg: #1f1741;
    --color-panel-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-sidebar-bg: #0d0f12;
    --color-sidebar-border: rgba(255, 255, 255, 0.06);
    --color-sidebar-text: #c9d1db;
    --color-sidebar-muted: #5a6478;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    --radius-sm: 6px;
    --radius-base: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 8px 24px rgba(203, 244, 4, 0.22);

    --text-strong: #0d1117;
    --text-body: #374151;
    --text-muted: #6b7280;
    --border-soft: #e8eaed;

    --sidebar-width: 272px;
    --topbar-height: 68px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "nebulica", "bahnschrift", Arial, sans-serif;
    color: var(--text-body);
    background-color: var(--color-panel-bg);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.page-auth {
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3, h4, h5 {
    font-family: "avenir-especial", "nebulica", Arial, sans-serif;
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

a {
    transition: color 0.18s ease, opacity 0.18s ease;
}

/* ─── PUBLIC NAVBAR ─────────────────────────────────────── */
.maranata-navbar {
    background: #fff;
    box-shadow: 0 1px 0 var(--border-soft), var(--shadow-sm);
    border-bottom: 1px solid var(--border-soft);
    padding: 0;
    height: 66px;
}

.maranata-navbar .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
}

.maranata-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
    padding: 12px 0;
}

.maranata-brand img {
    height: 36px;
    width: auto;
    
    object-fit: contain;
}

/* ─── BUTTONS ────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 22px;
    font-size: 12px;
    transition: all 0.18s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-dark);
    border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--color-dark);
    color: var(--color-primary);
    border-color: var(--color-dark);
    box-shadow: none;
}

.btn-navbar {
    background-color: var(--color-primary);
    color: var(--color-dark);
    border-color: var(--color-primary);
}

.btn-navbar:hover {
    background-color: var(--color-dark);
    color: var(--color-primary);
    border-color: var(--color-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--color-dark);
    border-color: var(--color-dark);
}

.btn-ghost:hover {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-dark-inv {
    background: var(--color-dark);
    color: var(--color-primary);
    border-color: var(--color-dark);
}

.btn-dark-inv:hover {
    background: var(--color-primary);
    color: var(--color-dark);
    border-color: var(--color-primary);
}

/* ─── APP SHELL ──────────────────────────────────────────── */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    color: var(--color-sidebar-text);
    border-right: 1px solid var(--color-sidebar-border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1030;
    scrollbar-width: thin;
    display: flex;
    flex-direction: column;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.app-sidebar::-webkit-scrollbar {
    width: 4px;
}

.app-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.app-sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--color-sidebar-border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-sidebar-brand a {
    display: flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.app-sidebar-brand img {
    height: 32px;
    width: auto;
    object-fit: contain;
    display: block;
}

.app-sidebar-brand span {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--color-sidebar-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.app-sidebar-nav {
    padding: 12px 10px 24px;
}

.app-sidebar-footer {
    margin-top: auto;
    padding: 20px 20px 24px;
    border-top: 1px solid var(--color-sidebar-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.app-sidebar-footer-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 4px 0;
    transition: opacity .15s;
}
.app-sidebar-footer-link:hover {
    opacity: .75;
    color: var(--color-primary);
    text-decoration: underline;
}

.app-sidebar-footer-label {
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--color-sidebar-muted);
}

.app-sidebar-footer-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.app-sidebar-footer-logos img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    opacity: 0.95;
}

.app-sidebar-footer-logos img.partner-logo-ja {
    width: 50px;
    height: 50px;
}

.app-nav-section-title {
    color: var(--color-sidebar-muted);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin: 20px 10px 6px;
    font-weight: 700;
}

.app-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-base);
    padding: 9px 12px;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.16s ease;
    position: relative;
}

.app-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
    text-decoration: none;
}

.app-nav-item.is-active {
    background: rgba(203, 244, 4, 0.12);
    color: var(--color-primary);
    border-color: rgba(203, 244, 4, 0.2);
    font-weight: 700;
}

.app-nav-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--color-primary);
    border-radius: 0 3px 3px 0;
}

/* ─── MAIN AREA ──────────────────────────────────────────── */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-panel-bg);
}

/* ─── TOP BAR ────────────────────────────────────────────── */
.app-topbar {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 var(--space-lg);
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-sidebar-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-base);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    background: var(--color-white);
    margin-right: auto;
    cursor: pointer;
}

.app-sidebar-toggle span {
    width: 16px;
    height: 1.5px;
    background: #13151a;
    border-radius: 10px;
    display: block;
    transition: all 0.2s ease;
}

.app-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-user-menu {
    position: relative;
}

.app-notification-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-base);
    border: 1px solid var(--border-soft);
    background: var(--color-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-strong);
    text-decoration: none;
    position: relative;
    transition: all 0.18s ease;
}

.app-notification-link:hover {
    color: var(--color-dark);
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
    text-decoration: none;
}

.app-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    border-radius: 99px;
    background: #e53e3e;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid var(--color-panel-bg);
}

/* ─── USER CHIP (topbar) ─────────────────────────────────── */
.app-user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 99px;
    border: 1px solid var(--border-soft);
    background: var(--bg-card);
    text-decoration: none;
    transition: border-color .15s, background .15s;
    max-width: 200px;
}

.app-user-menu-toggle {
    cursor: pointer;
    font: inherit;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
}

.app-user-menu-toggle:focus,
.app-user-menu-toggle:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(203, 244, 4, 0.18);
}

.app-user-chip:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-dim);
    text-decoration: none;
}
.app-user-chip-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--color-primary);
}
.app-user-chip-initials {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: .5px;
}
.app-user-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

/* ─── USER DROPDOWN ─────────────────────────────────────────── */
.app-user-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(13, 15, 18, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 40;
}

.app-user-menu.is-open .app-user-menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.app-user-menu-header {
    padding: 8px 10px 12px;
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 8px;
}

.app-user-menu-title {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.app-user-menu-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.app-user-menu-link {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
}

.app-user-menu-link:hover {
    background: var(--color-primary-dim);
    color: var(--color-dark);
    text-decoration: none;
}

.app-user-menu-form {
    margin: 0;
}

.app-user-menu-link-danger {
    cursor: pointer;
}

.app-user-menu-link-danger:hover {
    background: rgba(229, 62, 62, 0.08);
    color: #b83232;
}

/* ─── CONTENT AREA ───────────────────────────────────────── */
.app-content {
    flex: 1;
    padding-bottom: var(--space-xl);
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.app-breadcrumb-wrap {
    padding: 10px var(--space-lg);
    border-bottom: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.7);
}

.app-breadcrumb {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.app-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.app-breadcrumb-item + .app-breadcrumb-item::before {
    content: "›";
    margin-right: 4px;
    color: #d1d5db;
    font-size: 14px;
    font-weight: 400;
}

.app-breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.app-breadcrumb-item a:hover {
    color: var(--text-strong);
}

.app-breadcrumb-item.is-current span {
    color: var(--text-strong);
}

.app-content main.container {
    max-width: 1240px;
    padding-top: var(--space-lg);
}

.app-content main.container h1,
.app-content main.container h2 {
    color: var(--text-strong);
    margin-bottom: 0;
}

.app-content main.container .text-muted {
    color: var(--text-muted) !important;
}

/* ─── FORM LABELS ────────────────────────────────────────── */
.app-content .form-group label,
.form-group label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-strong);
}

/* Checkboxes de aceite (cadastro/login): texto corrido legível,
   sem herdar a caixa-alta/negrito dos labels de campo. */
.form-group.form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding-left: 0;
    margin-bottom: 14px;
}

.form-group.form-check .form-check-input {
    position: static;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
}

.app-content .form-group.form-check label,
.form-group.form-check .form-check-label {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.5;
    color: var(--text-muted);
}

/* ─── CARDS ──────────────────────────────────────────────── */
.status-card,
.card-feature,
.table-responsive.status-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
}

.status-card,
.table-responsive.status-card,
.list-group,
.card-feature {
    position: relative;
    overflow: hidden;
}

.status-card {
    padding: var(--space-xl);
}

.card-feature {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card-feature:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Stat Cards — dashboard metrics */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    padding: var(--space-lg) var(--space-xl);
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, rgba(203,244,4,0.2) 100%);
}

.stat-card-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

.stat-card-value {
    font-family: "avenir-especial", "nebulica", Arial, sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text-strong);
    line-height: 1;
    display: block;
    letter-spacing: -0.02em;
}

.stat-card-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

/* Milestone / Progress Card */
.milestone-card {
    background: var(--color-dark);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(203, 244, 4, 0.2);
    padding: var(--space-xl);
    color: #fff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.milestone-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 100%, rgba(203,244,4,0.12) 0%, transparent 60%);
    pointer-events: none;
}

.milestone-card-label {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
}

/* Layout horizontal: ícone + info */
.milestone-card-body {
    display: flex;
    align-items: center;
    gap: 20px;
}

.milestone-card-icon {
    font-size: 3rem;
    line-height: 1;
    flex-shrink: 0;
    filter: drop-shadow(0 0 12px rgba(203,244,4,0.4));
}

.milestone-card-info {
    flex: 1;
    min-width: 0;
}

.milestone-card-title {
    font-family: "avenir-especial", "nebulica", Arial, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 4px;
    line-height: 1.15;
}

.milestone-card-next {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 14px;
}

.progress-track {
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    height: 14px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #8fcc00, var(--color-primary));
    border-radius: 99px;
    transition: width 0.8s cubic-bezier(.22,.61,.36,1);
    box-shadow: 0 0 10px rgba(203,244,4,0.5);
}

.progress-percent {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    margin-top: 6px;
    text-align: right;
}

/* Page header pattern */
.page-header {
    padding: var(--space-lg) var(--space-lg) 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.page-header h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin: 0;
}

.page-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* Section headings */
.section-heading {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-md);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

/* ─── TABLES ─────────────────────────────────────────────── */
.table thead th {
    border-top: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-soft);
    font-weight: 700;
    padding: 12px 16px;
    background: var(--color-panel-bg);
}

.table td,
.table th {
    vertical-align: middle;
    padding: 12px 16px;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.14s ease;
}

.table tbody tr:hover {
    background: rgba(203, 244, 4, 0.05);
}

.table td {
    color: var(--text-body);
    font-size: 14px;
}

/* ─── PAGINATION ─────────────────────────────────────────── */
.pagination .page-item.active .page-link {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #111;
    font-weight: 700;
}

.pagination .page-link {
    color: var(--text-strong);
    border-radius: var(--radius-sm);
    margin: 0 2px;
    border-color: var(--border-soft);
    font-size: 13px;
}

.pagination .page-link:hover {
    background: var(--color-primary-dim);
    border-color: var(--color-primary);
    color: var(--text-strong);
}

/* ─── FORMS ──────────────────────────────────────────────── */
.form-control,
.custom-select {
    border-radius: var(--radius-base);
    border-color: var(--border-soft);
    min-height: 44px;
    font-size: 14px;
    color: var(--text-strong);
    background-color: #fff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.form-control:focus,
.custom-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(203, 244, 4, 0.2);
    outline: none;
}

.form-control::placeholder {
    color: #b0b7c3;
}

/* ─── ALERTS ─────────────────────────────────────────────── */
.alert {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 14px;
    padding: 14px 18px;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.07);
    color: #166534;
}

.alert-danger {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.07);
    color: #991b1b;
}

.alert-warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.08);
    color: #78350f;
}

.alert-info {
    border-color: rgba(14, 165, 233, 0.25);
    background: rgba(14, 165, 233, 0.07);
    color: #0c4a6e;
}

/* ─── STICKY NOTICE ──────────────────────────────────────── */
/* Aviso permanente de consequência de uma ação (ex.: reavaliar uma
   submissão notifica o participante). Fica colado abaixo da topbar para
   continuar visível enquanto o formulário é preenchido — ao contrário de
   um alerta de flash, não desaparece. */
.sticky-notice {
    position: sticky;
    top: var(--topbar-height);
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: var(--space-lg);
    padding: 14px 18px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--color-white);
    /* Elevação maior que os cards: o painel passa por cima do conteúdo que
       rola por baixo dele, e precisa ficar claro que está flutuando. */
    box-shadow: var(--shadow-md);
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Fio de destaque à esquerda: sinaliza consequência sem transformar o painel
   inteiro em alerta colorido, que competiria com os flashes de erro/sucesso. */
.sticky-notice::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    background: var(--color-primary);
}

.sticky-notice-icon {
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-primary-dim);
    color: #5c6b00;
}

.sticky-notice-icon svg {
    width: 18px;
    height: 18px;
}

.sticky-notice-body strong {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-strong);
}

/* Em telas estreitas o aviso fica colado no topo o tempo todo, então precisa
   ocupar o mínimo de altura possível. */
@media (max-width: 575.98px) {
    .sticky-notice {
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
        font-size: 12.5px;
        line-height: 1.45;
    }

    .sticky-notice-icon {
        flex-basis: 28px;
        width: 28px;
        height: 28px;
    }

    .sticky-notice-icon svg {
        width: 15px;
        height: 15px;
    }
}

/* ─── BADGES ─────────────────────────────────────────────── */
.badge {
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: var(--radius-pill);
    padding: 4px 10px;
    font-size: 11px;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef9c3;
    color: #854d0e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #e0f2fe;
    color: #075985;
}

.badge-secondary {
    background-color: #f1f5f9;
    color: #64748b;
}

.badge-pill {
    border-radius: var(--radius-pill);
}

/* Badge para destaque (primary) */
.badge-primary {
    background-color: var(--color-primary);
    color: var(--color-dark);
}

/* ─── LIST GROUP ─────────────────────────────────────────── */
.list-group-item {
    border-color: var(--border-soft);
    font-size: 14px;
    transition: background 0.14s ease;
}

.list-group-item:hover {
    background: rgba(203, 244, 4, 0.05);
}

/* ─── HOME PAGE ──────────────────────────────────────────── */
.hero-wrapper {
    background: #ffffff;
}

.hero-section {
    background: var(--color-dark);
    position: relative;
    overflow: hidden;
    padding: 80px 0;
}

.hero-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 50%, rgba(203,244,4,0.18) 0%, transparent 50%),
        radial-gradient(circle at 90% 20%, rgba(203,244,4,0.1) 0%, transparent 40%);
    pointer-events: none;
}

.hero-section .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(203,244,4,0.12);
    border: 1px solid rgba(203,244,4,0.25);
    color: var(--color-primary);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-section h1 {
    color: #ffffff;
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

.hero-section h1 .accent {
    color: var(--color-primary);
}

.hero-section .hero-lead {
    color: rgba(255,255,255,0.65);
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-partner {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-top: 44px;
    padding-top: 32px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.hero-partner-label {
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero-partner-logo {
    height: 120px;
    width: 120px;
    object-fit: contain;
    object-position: left center;
    opacity: 1;
}

.hero-partner-logo.partner-logo-ja {
    height: 88px;
    width: 88px;
}

.hero-stat-block {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    backdrop-filter: blur(8px);
}

.hero-stat-block .stat-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 14px;
}

.hero-stat-block .stat-line:last-child {
    border-bottom: none;
}

.hero-stat-block .stat-line-label {
    color: rgba(255,255,255,0.5);
}

.hero-stat-block .stat-line-value {
    color: var(--color-primary);
    font-weight: 700;
}

.features-section {
    padding: 72px 0;
    background: var(--color-panel-bg);
}

.feature-card {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.feature-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-card:hover::after {
    opacity: 1;
}

.feature-card-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.feature-card-icon svg {
    width: 22px;
    height: 22px;
    color: var(--color-dark);
}

.feature-card h4 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-strong);
}

.feature-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
}

/* ─── AUTH PAGES ─────────────────────────────────────────── */
.auth-wrapper {
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: stretch;
    background: var(--color-dark);
}

.auth-panel {
    flex: 0 0 460px;
    max-width: 460px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    padding: 60px 48px;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox: oculta a barra de rolagem */
}

.auth-panel::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge: oculta a barra de rolagem */
}

/* Painel mais largo para o cadastro (formulário maior).
   Só vale no layout lado a lado (desktop); no mobile o painel
   vira largura total via media query. */
.auth-panel--wide {
    flex-basis: 500px;
    max-width: 500px;
}

.auth-bg {
    flex: 1;
    background:
        radial-gradient(circle at 30% 60%, rgba(203,244,4,0.2) 0%, transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(203,244,4,0.1) 0%, transparent 40%),
        #0d0f12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3xl);
    position: relative;
    overflow: hidden;
}

.auth-bg-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-2xl);
}

.auth-bg-logo img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.auth-bg-text {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    line-height: 1.7;
    max-width: 340px;
}

.auth-bg-text strong {
    color: var(--color-primary);
    font-weight: 700;
}

.auth-bg-partner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    max-width: 340px;
}

.auth-bg-partner-label {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-bg-partner-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.auth-bg-partner-logos img {
    height: 192px;
    width: 192px;
    object-fit: contain;
    opacity: 0.95;
}

.auth-bg-partner-logos img.partner-logo-ja {
    height: 140px;
    width: 140px;
}

.auth-panel-logo {
    margin-bottom: var(--space-2xl);
}

.auth-panel-logo img {
    height: 28px;
    width: auto;
    
}

.auth-panel h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-strong);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-panel .auth-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: var(--space-xl);
}

.auth-test-credentials {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid rgba(13, 15, 18, 0.08);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(203, 244, 4, 0.12) 0%, rgba(203, 244, 4, 0.04) 100%);
}

.auth-test-credentials-title {
    margin-bottom: 10px;
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-test-credentials-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

.auth-test-credentials-row + .auth-test-credentials-row {
    margin-top: 6px;
}

.auth-test-credentials-group-label {
    margin: 12px 0 6px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-test-credentials-group-label:first-of-type {
    margin-top: 4px;
}

.auth-test-credentials-row span {
    color: var(--text-muted);
}

.auth-test-credentials-row strong {
    color: var(--text-strong);
    font-weight: 700;
}

.auth-link {
    color: var(--text-strong);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-link:hover {
    color: var(--color-dark);
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.maranata-footer {
    background-color: var(--color-footer-bg);
    color: rgba(255,255,255,0.55);
    font-size: 13px;
}

.app-footer {
    margin-top: auto;
    padding: 14px 0;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.footer-copy {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-align: center;
    color: rgba(255,255,255,0.55);
}

.footer-copy strong {
    color: rgba(255,255,255,0.8);
    font-weight: 700;
}

/* ─── QUICK LINKS ────────────────────────────────────────── */
.quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: #fff;
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    margin-bottom: 8px;
}

.quick-link:hover {
    background: var(--color-dark);
    color: var(--color-primary);
    border-color: var(--color-dark);
    text-decoration: none;
    transform: translateX(4px);
}

.quick-link svg {
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.18s;
}

.quick-link:hover svg {
    opacity: 1;
}

/* ─── RANK MEDAL ─────────────────────────────────────────── */
.rank-medal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.rank-medal-1 { background: #fef08a; color: #854d0e; }
.rank-medal-2 { background: #e2e8f0; color: #334155; }
.rank-medal-3 { background: #fed7aa; color: #9a3412; }
.rank-medal-n { background: var(--color-panel-bg); color: var(--text-muted); }

/* ─── ACHIEVEMENT BADGE ──────────────────────────────────── */
.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    background: #fff;
    gap: 8px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.achievement-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.achievement-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.achievement-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-strong);
    line-height: 1.3;
}

/* ─── RANKING TABLE ──────────────────────────────────────── */
.ranking-row-current {
    background: rgba(203, 244, 4, 0.06) !important;
}

.ranking-row-current td {
    font-weight: 600;
}

/* ─── COORDINATOR QUEUE ──────────────────────────────────── */
.submission-preview {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.submission-preview img,
.submission-preview video {
    max-width: 100%;
    border-radius: var(--radius-base);
}

/* ─── ANIMATIONS ─────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
    .ui-reveal {
        opacity: 0;
        transform: translateY(12px);
        animation: uiRevealIn 0.4s ease forwards;
        animation-delay: var(--ui-delay, 0ms);
    }

    .btn,
    .app-notification-link,
    .status-card,
    .card-feature,
    .stat-card,
    .table-responsive.status-card {
        transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.18s ease, background 0.18s ease;
    }

    .btn:active {
        transform: translateY(1px) scale(0.98);
    }

    .status-card:hover,
    .table-responsive.status-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }
}

body.app-loading .status-card,
body.app-loading .table-responsive.status-card,
body.app-loading .list-group {
    position: relative;
}

body.app-loading .status-card::after,
body.app-loading .table-responsive.status-card::after,
body.app-loading .list-group::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 48%, rgba(255,255,255,0) 100%);
    animation: skeletonSweep 0.9s linear infinite;
    pointer-events: none;
}

@keyframes skeletonSweep {
    from { transform: translateX(-100%); }
    to   { transform: translateX(100%); }
}

@keyframes uiRevealIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1199px) {
    :root { --sidebar-width: 250px; }
}

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
        width: 260px;
    }

    .app-main {
        margin-left: 0;
    }

    .app-shell.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-shell.sidebar-open::after {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1025;
    }

    .app-sidebar-toggle {
        display: inline-flex;
        position: relative;
        z-index: 1035;
    }

    /* Auth: stacked on mobile */
    body.page-auth {
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .auth-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }

    .auth-panel {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
        min-height: 100vh;
        padding: 32px 24px 44px;
        order: 1;
        justify-content: flex-start;
    }

    .auth-panel-logo {
        margin-bottom: 20px;
    }

    .auth-panel h2 {
        font-size: 1.5rem;
    }

    .auth-panel .auth-subtitle {
        margin-bottom: 18px;
    }

    .auth-panel .form-group {
        margin-bottom: 14px;
    }

    .auth-bg {
        min-height: 200px;
        order: 0;
        padding: 40px 24px;
    }
}

@media (max-width: 768px) {
    .status-card {
        padding: var(--space-lg);
    }

    .app-topbar {
        padding: 0 var(--space-md);
    }

    .app-content main.container {
        padding-top: var(--space-md);
    }

    .app-breadcrumb-wrap {
        padding: 8px var(--space-md);
    }

    .page-header {
        padding: var(--space-md) var(--space-md) 0;
    }

    .hero-section {
        padding: 56px 0;
    }

    .hero-section h1 {
        font-size: 1.9rem;
    }

    .features-section {
        padding: 48px 0;
    }

    /* Form rows: restore vertical spacing when cols stack */
    .form-row .form-group {
        margin-bottom: var(--space-sm) !important;
    }

    /* Page header action area: allow buttons to wrap */
    .page-header > .d-flex {
        flex-wrap: wrap;
    }

    /* Card section inner headers */
    .d-flex.align-items-center.justify-content-between.px-4.pt-4 {
        padding: var(--space-md) var(--space-md) var(--space-sm) !important;
    }

    /* ── Mobile card table ─────────────────────────────────── */
    /* Hides thead, turns each tr into a card, each td into a labeled row */
    .table-card thead {
        display: none;
    }

    .table-card tbody tr {
        display: block;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        margin-bottom: 10px;
        background: #fff;
        overflow: hidden;
    }

    /* Zebra stripes on card: reset */
    .table-striped .table-card tbody tr,
    .table-card.table-striped tbody tr {
        background: #fff !important;
    }

    .table-card tbody td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 14px;
        border: none !important;
        border-bottom: 1px solid #f0f2f4 !important;
        font-size: 13px;
        min-height: 38px;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: unset !important;
        max-width: none !important;
    }

    .table-card tbody td:last-child {
        border-bottom: none !important;
    }

    .table-card tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--text-muted);
        flex-shrink: 0;
        padding-top: 2px;
        min-width: 80px;
    }

    /* Actions cell: no label, buttons wrap */
    .table-card tbody td.td-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-end;
        padding: 10px 14px;
    }

    .table-card tbody td.td-actions::before {
        display: none;
    }

    /* Hide low-priority columns on mobile */
    .col-hide-mobile {
        display: none !important;
    }
}

/* ─── RESPONSIVE: Small phones (≤575px) ─────────────────── */
@media (max-width: 575px) {
    /* Auth layout */
    .auth-panel {
        padding: 36px 20px;
    }

    .auth-bg {
        min-height: 140px;
        padding: 28px 20px;
    }

    .auth-bg-logo img {
        height: 36px;
    }

    /* Cards */
    .status-card {
        padding: var(--space-md);
    }

    .stat-card {
        padding: var(--space-md) var(--space-md);
    }

    .stat-card-value {
        font-size: 1.75rem;
    }

    .milestone-card {
        padding: var(--space-lg);
    }
    .milestone-card-icon {
        font-size: 2.2rem;
    }
    .milestone-card-body {
        gap: 14px;
    }

    /* Topbar: compact gap */
    .app-topbar {
        gap: 6px;
    }
    .app-user-chip-name { display: none; }
    .app-user-chip { padding: 4px; }
    .app-user-menu-dropdown {
        right: 0;
        min-width: 200px;
    }

    /* Page header: let buttons go full width on tiny screens */
    .page-header {
        gap: var(--space-sm);
    }

    .page-header > .d-flex,
    .page-header > a.btn {
        width: 100%;
    }

    /* Hero */
    .hero-section {
        padding: 40px 0;
    }

    .hero-section h1 {
        font-size: 1.6rem;
    }

    .hero-section .hero-lead {
        font-size: 0.95rem;
        margin-bottom: 24px;
    }

    .hero-stat-block {
        padding: var(--space-lg);
    }

    /* iOS touch scroll on tables */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }

    /* Public navbar buttons: compact */
    .maranata-navbar .btn-sm {
        padding: 7px 12px;
        font-size: 11px;
    }

    /* Form row last col (button): full width */
    .form-row [class*="col-"]:last-child {
        width: 100%;
    }

    .form-row [class*="col-"]:last-child .btn {
        width: 100%;
    }

    /* Reduce form-row spacing */
    .form-row .form-group {
        margin-bottom: 10px !important;
    }

    /* Breadcrumb: hide intermediate items if too long */
    .app-breadcrumb-item {
        font-size: 10px;
    }

    /* Section heading table header */
    .px-4.pt-4.pb-3 {
        padding: var(--space-md) !important;
    }

    /* Reduce section padding */
    .features-section {
        padding: 36px 0;
    }

    /* Feature cards grid: full width on tiny screens */
    .row .col-md-4 {
        margin-bottom: var(--space-md);
    }
}

/* ─── PROFILE PAGE ───────────────────────────────────────── */
.profile-photo-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--color-primary);
    flex-shrink: 0;
    display: block;
}

.profile-photo-initials {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-dark);
    font-size: 26px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 1px;
}

.profile-photo-input {
    display: none;
}

.profile-photo-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-photo-filename {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.profile-photo-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}

.profile-divider {
    border: 0;
    border-top: 1px solid var(--border-soft);
    margin: var(--space-lg) 0;
}

.profile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: var(--space-md);
}

.label-optional {
    font-size: 11px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-muted);
}

@media (max-width: 575px) {
    .profile-photo-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================================================
   Toast notifications (canto superior direito, auto-dismiss)
   ========================================================================== */
.app-toast-container {
    position: fixed;
    top: calc(var(--topbar-height, 68px) + 0.75rem);
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(360px, calc(100vw - 2rem));
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
    color: #fff;
    background: #334155;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    word-break: break-word;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.app-toast.is-leaving {
    opacity: 0;
    transform: translateX(120%);
}

.app-toast-success {
    background: #16a34a;
}

.app-toast-danger {
    background: #dc2626;
}

.app-toast-warning {
    background: #d97706;
    color: #1f2937;
}

.app-toast-info {
    background: #334155;
}

@media (prefers-reduced-motion: reduce) {
    .app-toast {
        transition: opacity 0.2s ease;
        transform: none;
    }

    .app-toast.is-visible,
    .app-toast.is-leaving {
        transform: none;
    }
}

/* ==========================================================================
   Modal genérico (ex.: detalhes da atividade)
   ========================================================================== */
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.app-modal[hidden] {
    display: none;
}

.app-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.app-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 2rem;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: appModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.app-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted, #64748b);
}

.app-modal-dialog h3 {
    font-weight: 800;
    margin: 0.75rem 0 1rem;
}

.app-modal-desc {
    line-height: 1.8;
    color: var(--text-body, #334155);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 1.5rem;
}

.app-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
    .app-modal-dialog {
        animation: none;
    }
}

/* ==========================================================================
   Pódio do ranking (2º à esquerda, 1º ao centro/maior, 3º à direita)
   ========================================================================== */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.podium-item {
    width: 180px;
    max-width: 42vw;
    padding: 1.1rem 1rem;
    text-align: center;
}

.podium-item--first {
    width: 210px;
    padding: 1.5rem 1.1rem;
    transform: translateY(-14px);
    border: 2px solid var(--color-primary, #b6e90b);
    order: 0;
}

.podium-medal {
    font-size: 2rem;
    line-height: 1;
}

.podium-item--first .podium-medal {
    font-size: 2.75rem;
}

.podium-campo {
    font-weight: 800;
    font-size: 0.95rem;
    margin: 0.4rem 0;
}

.podium-item--first .podium-campo {
    font-size: 1.1rem;
}

.podium-points {
    font-size: 1.2rem;
    font-weight: 700;
}

.podium-item--first .podium-points {
    font-size: 1.55rem;
}

@media (max-width: 575px) {
    .podium {
        align-items: stretch;
    }

    .podium-item,
    .podium-item--first {
        width: 100%;
        max-width: 320px;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .podium-item--first {
        transform: none;
    }
}

/* ==========================================================================
   Toggle switch (ativar/desativar)
   ========================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    margin: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 24px;
    transition: background 0.2s ease;
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.switch input:checked + .switch-slider {
    background: var(--color-primary, #cbf404);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(18px);
}

.switch input:disabled + .switch-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Tabelas de ranking em cartões no mobile (linha vira card com rótulos)
   ========================================================================== */
@media (max-width: 575px) {
    .ranking-table thead {
        display: none;
    }

    .ranking-table,
    .ranking-table tbody,
    .ranking-table tr,
    .ranking-table td {
        display: block;
        width: 100%;
    }

    .ranking-table {
        padding: 12px;
    }

    .ranking-table tr {
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 12px 14px;
        margin: 0 0 10px;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        box-sizing: border-box;
    }

    .ranking-table tr:last-child {
        margin-bottom: 0;
    }

    .ranking-table tr.ranking-row-current {
        border-color: var(--color-primary, #cbf404);
        box-shadow: 0 0 0 2px var(--color-primary, #cbf404);
    }

    .ranking-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 5px 0;
        border: none;
        text-align: right;
    }

    .ranking-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: var(--text-muted, #64748b);
        text-align: left;
    }

    /* Posição/medalha na mesma linha do nome (1ª e 2ª células inline) */
    .ranking-table td:first-child {
        display: inline-flex;
        align-items: center;
        width: auto;
        padding: 0;
        margin: 0 8px 0 0;
        font-size: 1.3rem;
        border-bottom: none;
        vertical-align: middle;
    }

    .ranking-table td:first-child::before {
        content: none;
    }

    .ranking-table td:nth-child(2) {
        display: inline;
        width: auto;
        font-weight: 700;
        font-size: 1rem;
        text-align: left;
        vertical-align: middle;
    }

    .ranking-table td:nth-child(2)::before {
        content: none;
    }

    /* Separador depois da linha "medalha + nome" */
    .ranking-table td:nth-child(3) {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px dashed #eef0f3;
    }

    /* A barra de engajamento ocupa o espaço disponível */
    .ranking-table td .progress-eng {
        flex: 1;
    }
}
