* { box-sizing: border-box; }

:root {
    --bg: #eef4fb;
    --card: #ffffff;
    --text: #17314d;
    --muted: #6a7f97;
    --line: #dce7f2;
    --blue: #0f67c7;
    --blue-dark: #0a4f9b;
    --blue-soft: #eaf4ff;
    --green: #28a55a;
    --yellow: #f2b530;
    --red: #ef4b58;
    --shadow: 0 18px 40px rgba(16, 60, 110, 0.12);
    --radius: 24px;
}

body {
    margin: 0;
    font-family: Inter, Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #f4f8fd 0%, #edf3fb 100%);
    color: var(--text);
    padding-bottom: 92px;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3, p { margin-top: 0; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(180deg, #0b6fd3 0%, #0c67c1 100%);
    color: #fff;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 0 12px 28px rgba(9, 77, 148, 0.28);
}

.header-wave {
    height: 18px;
    background: radial-gradient(circle at 12% -50%, rgba(255,255,255,0.35) 0, rgba(255,255,255,0) 55%),
                radial-gradient(circle at 85% -60%, rgba(255,255,255,0.28) 0, rgba(255,255,255,0) 52%);
}

.header-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: 14px 18px 18px;
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    align-items: center;
    gap: 12px;
}

.brand-lockup {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
}

.brand-copy strong,
.login-brand strong {
    display: block;
    font-size: 1.65rem;
    line-height: 1;
    color: inherit;
}

.brand-copy small,
.login-brand small {
    display: block;
    margin-top: 2px;
    font-size: 0.95rem;
    opacity: .92;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #f7d978 0 18%, transparent 19%),
                radial-gradient(circle at 50% 50%, #ffffff 0 33%, transparent 34%),
                linear-gradient(135deg, #52b4ff 0%, #0a57bf 100%);
    box-shadow: inset 0 0 0 4px rgba(255,255,255,0.7), 0 8px 18px rgba(0,0,0,0.15);
    position: relative;
}

.brand-mark.big {
    width: 54px;
    height: 54px;
}

.circle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-weight: 800;
    backdrop-filter: blur(10px);
}

.muted-icon { opacity: .55; }

.page-shell {
    max-width: 1220px;
    margin: 0 auto;
    padding: 20px 16px;
}

.flash-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.flash {
    border-radius: 16px;
    padding: 12px 14px;
    font-weight: 600;
    box-shadow: var(--shadow);
    border: 1px solid transparent;
    background: #fff;
}

.flash-success { border-color: #cdeed7; background: #f2fbf5; color: #1b7e47; }
.flash-danger { border-color: #ffd9df; background: #fff3f5; color: #c4384f; }
.flash-warning { border-color: #ffe8ba; background: #fff9ed; color: #b17611; }
.flash-info { border-color: #d7e8ff; background: #f3f8ff; color: #2167b9; }

.admin-quick-nav {
    max-width: 1220px;
    margin: 0 auto;
    padding: 12px 16px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-link {
    background: rgba(255,255,255,0.92);
    color: var(--blue);
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.65);
}

.admin-link.active { background: #dcecff; }

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 12px;
    width: min(100% - 18px, 430px);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    background: rgba(12, 103, 193, 0.95);
    color: rgba(255,255,255,0.8);
    border-radius: 26px;
    padding: 10px;
    box-shadow: 0 24px 42px rgba(8, 65, 122, 0.35);
    backdrop-filter: blur(18px);
    z-index: 30;
}

.bottom-link {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 18px;
    font-weight: 700;
}

.bottom-link.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.bottom-link span { font-size: 1.15rem; }
.bottom-link small { font-size: .78rem; }

.phone-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 20px;
}

.phone-screen,
.panel,
.stat-card,
.login-card,
.alert-card,
.record-card,
.summary-card,
.menu-card {
    background: var(--card);
    border-radius: 30px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.phone-screen {
    padding: 18px;
    min-height: 640px;
    position: relative;
    overflow: hidden;
}

.phone-screen::before {
    content: "";
    display: block;
    width: 108px;
    height: 16px;
    border-radius: 999px;
    background: #143964;
    margin: 0 auto 14px;
}

.screen-title-row,
.panel-head,
.record-header,
.action-group,
.alert-card-head,
.mini-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.screen-title-row h1,
.panel h1,
.admin-hero h1 { font-size: 1.8rem; margin-bottom: 6px; }
.screen-title-row p,
.panel p,
.muted, .subtitle { color: var(--muted); }

.avatar-circle {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ffe7d3 0%, #fbcfb5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #925735;
    border: 4px solid #fff;
    box-shadow: 0 12px 22px rgba(29, 59, 88, 0.15);
}

.status-stack,
.list-stack,
.reason-chip-list,
.menu-grid,
.stats-grid { display: grid; gap: 12px; }

.status-pill {
    border-radius: 16px;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
}

.status-blue { background: linear-gradient(135deg, #1d82e0, #0f66c7); }
.status-yellow { background: linear-gradient(135deg, #ffd55f, #f2b632); color: #684500; }
.status-red { background: linear-gradient(135deg, #ff787c, #ef4b58); }

.mini-card-block,
.alert-body-box,
.action-card-block,
.recommend-box,
.list-item,
.hero-card,
.admin-hero,
.alert-title-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
}

.mini-card-block h3,
.alert-body-box h2,
.action-card-block h3,
.panel h2 { margin-bottom: 10px; }

.agenda-list,
.mission-mini-list {
    display: grid;
    gap: 10px;
}

.agenda-item,
.mission-mini-item {
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.agenda-item:last-child,
.mission-mini-item:last-child { border-bottom: 0; padding-bottom: 0; }

.agenda-item strong { color: var(--blue-dark); min-width: 54px; }

.tiny-pill,
.pill,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: .78rem;
    font-weight: 800;
}

.tiny-pill { background: #eff5ff; color: var(--blue); }
.tiny-realizada, .pill-realizada, .pill-resolvido { background: #edf8f1; color: #228850; }
.tiny-parcial, .pill-pendente, .pill-parcial, .pill-ativo { background: #fff5df; color: #b97912; }
.tiny-nao_realizada { background: #fff0f2; color: #c53d56; }

.summary-card {
    padding: 16px;
    display: grid;
    gap: 6px;
    border-radius: 22px;
}

.summary-card span { font-size: 1.8rem; font-weight: 800; }
.summary-heart { background: linear-gradient(135deg, #fff0f2, #ffffff); }
.summary-moon { background: linear-gradient(135deg, #eef6ff, #ffffff); }
.summary-social { background: linear-gradient(135deg, #effaf2, #ffffff); }

.mini-chart {
    height: 138px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    align-items: end;
}

.chart-col {
    background: linear-gradient(180deg, #f7fbff 0%, #eef5fd 100%);
    border-radius: 18px;
    height: 100%;
    display: flex;
    align-items: end;
    padding: 8px;
}

.chart-col span {
    width: 100%;
    display: block;
    border-radius: 12px 12px 8px 8px;
    background: linear-gradient(180deg, #86d057 0%, #3ca948 100%);
}

.alert-screen {
    background: linear-gradient(180deg, #fefefe 0%, #f7fbff 100%);
}

.alert-banner {
    background: linear-gradient(135deg, #ff5764, #ef404e);
    color: white;
    border-radius: 18px;
    padding: 16px;
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 14px;
}

.alert-reasons {
    display: grid;
    gap: 10px;
}

.reason-item,
.action-option,
.reason-chip {
    background: #fff9e6;
    color: #7f5b05;
    padding: 12px 14px;
    border-radius: 16px;
    font-weight: 600;
    border: 1px solid #ffe6a4;
}

.action-card-block {
    background: #f1f8ff;
}

.primary-cta,
.btn,
.quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 16px;
    font-weight: 800;
    cursor: pointer;
}

.primary-cta {
    background: linear-gradient(135deg, #1d7de0, #0b63c0);
    color: #fff;
    padding: 14px 16px;
    width: 100%;
    margin-top: 12px;
}

.insight-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.insight-strip div {
    background: #f5fbff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
}

.insight-strip strong { display: block; color: #279250; margin-bottom: 6px; }
.insight-strip span { font-size: 1.6rem; font-weight: 800; }

.insight-text { line-height: 1.55; }
.advances-list { margin: 0; padding-left: 18px; color: var(--text); display: grid; gap: 8px; }

.line-points {
    position: relative;
    height: 150px;
    border-radius: 18px;
    background:
        linear-gradient(#edf3fb 1px, transparent 1px) 0 0/100% 25%,
        linear-gradient(90deg, #edf3fb 1px, transparent 1px) 0 0/20% 100%;
}

.line-points span {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #f0b533;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

.line-points span:nth-child(1) { left: 6%; background: #ef4b58; }
.line-points span:nth-child(2) { left: 24%; background: #1d7de0; }
.line-points span:nth-child(3) { left: 42%; background: #1d7de0; }
.line-points span:nth-child(4) { left: 60%; background: #65b93e; }
.line-points span:nth-child(5) { left: 78%; background: #1d7de0; }
.line-points span:nth-child(6) { left: 90%; background: #f0b533; }

.compact-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
}

.stat-label {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-card strong { font-size: 2rem; }

.panel,
.hero-card,
.admin-hero,
.alert-title-card {
    padding: 22px;
    margin-bottom: 18px;
}

.hero-card,
.admin-hero,
.alert-title-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.grid-2, .admin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.menu-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.menu-card {
    padding: 18px;
    display: grid;
    gap: 8px;
}

.menu-card strong { font-size: 1.05rem; color: var(--blue-dark); }
.menu-card span { color: var(--muted); }

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    background: #fbfdff;
}

.detail-stack, .record-grid { display: grid; gap: 10px; }

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    background: #fff;
}

th, td {
    text-align: left;
    padding: 14px;
    border-bottom: 1px solid #edf2f7;
}

th { background: #f8fbff; color: var(--blue-dark); }

.form-grid {
    display: grid;
    gap: 14px;
}

.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compact-form { margin-top: 18px; }

.form-grid label {
    display: grid;
    gap: 8px;
    font-weight: 700;
}

.form-grid .full { grid-column: 1 / -1; }
input, select, textarea, button {
    font: inherit;
}

input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
    color: var(--text);
}

textarea { resize: vertical; }

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 4px 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f7fbff;
    border-radius: 14px;
    border: 1px solid var(--line);
    font-weight: 600;
}

.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
    border: 1px solid transparent;
    padding: 12px 16px;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #1d7de0, #0b63c0);
}

.btn-outline {
    border-color: var(--line);
    background: #fff;
    color: var(--text);
}

.btn-sm { padding: 10px 12px; font-size: .9rem; }
.btn-full { width: 100%; }

.pill {
    background: #eef5ff;
    color: var(--blue-dark);
}

.badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0;
}

.badge {
    background: #f8fbff;
    color: var(--muted);
    border: 1px solid var(--line);
}

.badge-danger { background: #fff0f2; color: #c53d56; border-color: #ffd7df; }

.alert-card {
    padding: 18px;
}

.modern-alert.active-alert {
    border-color: #ffd0d6;
    background: linear-gradient(180deg, #fffdfd 0%, #fff5f7 100%);
}

.reason-chip-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 12px 0;
}

.reason-chip {
    background: #fff5d7;
    color: #9c6d08;
    border-color: #ffe3a1;
}

.recommend-box {
    background: #f3f9ff;
    margin-bottom: 12px;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.quick-link {
    background: #fff;
    border: 1px solid var(--line);
    padding: 16px;
    box-shadow: var(--shadow);
}

.login-body {
    min-height: 100vh;
    background: linear-gradient(180deg, #0d69c8 0%, #0a5db2 36%, #eef4fb 36%, #eef4fb 100%);
}

.login-shell {
    max-width: 460px;
    margin: 0 auto;
    padding: 40px 16px 24px;
}

.login-card {
    padding: 28px;
    margin-top: 48px;
}

.login-brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    color: var(--blue-dark);
}

.login-hint {
    margin-top: 16px;
    padding: 14px;
    border-radius: 18px;
    background: #f4f9ff;
    border: 1px solid var(--line);
    display: grid;
    gap: 4px;
}

.eyebrow {
    color: var(--blue);
    font-size: .76rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-weight: 800;
}

.eyebrow.light { color: #dcecff; }

.empty-state,
.small { color: var(--muted); font-size: .92rem; }
.text-right { text-align: right; }

@media (max-width: 1100px) {
    .phone-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-grid, .compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .page-shell { padding: 16px 12px; }
    .phone-grid,
    .grid-2,
    .admin-grid,
    .quick-links,
    .menu-grid,
    .stats-grid,
    .compact-stats,
    .two-columns,
    .compact-grid {
        grid-template-columns: 1fr;
    }
    .phone-screen { min-height: auto; }
    .hero-card, .admin-hero, .alert-title-card { padding: 18px; }
    .brand-copy strong { font-size: 1.4rem; }
    .bottom-nav { width: min(100% - 12px, 430px); bottom: 8px; }
    body { padding-bottom: 98px; }
}


.admin-list-card {
    align-items: flex-start;
}

.admin-quick-nav {
    padding-bottom: 6px;
}

.admin-quick-nav .admin-link {
    box-shadow: 0 8px 18px rgba(10, 70, 130, 0.08);
}

@media (max-width: 768px) {
    .admin-quick-nav {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    .admin-link {
        white-space: nowrap;
    }
}

.narrow { max-width: 980px; margin-left: auto; margin-right: auto; }
.row-gap { display: grid; gap: 6px; }
.align-end { justify-items: end; }
.cell-person { display: flex; align-items: center; gap: 12px; }
.table-avatar, .hero-avatar-image {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 8px 18px rgba(16, 60, 110, 0.18);
}
.table-avatar.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eef5ff;
    color: var(--blue);
    font-size: 1rem;
}
.hero-card-photo {
    align-items: center;
}
.hero-card-main {
    display: flex;
    align-items: center;
    gap: 16px;
}
.hero-avatar-wrap { flex-shrink: 0; }
.hero-avatar-image {
    width: 92px;
    height: 92px;
}
.list-item-photo {
    align-items: center;
}
.face-widget {
    background: #f7fbff;
    border: 1px dashed #cfe0f4;
    border-radius: 20px;
    padding: 16px;
    display: grid;
    gap: 14px;
}
.face-widget-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
}
.face-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.face-capture-shell {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
}
.face-preview-box,
.face-camera-box {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
}
.face-preview-image,
.face-video,
.face-canvas {
    width: 100%;
    border-radius: 14px;
    background: #f0f5fb;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}
.face-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    background: #f0f5fb;
    text-align: center;
    padding: 16px;
}
.face-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
@media (max-width: 768px) {
    .face-grid,
    .face-capture-shell,
    .hero-card-main {
        grid-template-columns: 1fr;
        display: grid;
    }
    .align-end { justify-items: start; }
}


.mobile-admin-toggle { border: 0; cursor: pointer; }
.mobile-admin-panel {
    position: fixed;
    inset: 0;
    background: rgba(7, 33, 65, 0.45);
    display: none;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 18px;
    z-index: 60;
}
.mobile-admin-panel.open { display: flex; }
.mobile-admin-card {
    width: min(100%, 340px);
    background: #fff;
    color: var(--text);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 18px;
    max-height: calc(100vh - 36px);
    overflow: auto;
}
.mobile-admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.mobile-admin-links {
    display: grid;
    gap: 10px;
}
.mobile-admin-links a {
    background: var(--blue-soft);
    color: var(--blue-dark);
    border-radius: 16px;
    padding: 12px 14px;
    font-weight: 700;
}
.admin-actions-inline,
.actions-row {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.toggle-line {
    display: flex;
    align-items: center;
    gap: 10px;
}
.toggle-line input[type="checkbox"] {
    width: 18px;
    height: 18px;
}
@media (min-width: 901px) {
    .mobile-admin-toggle,
    .mobile-admin-panel { display: none !important; }
}
@media (max-width: 900px) {
    .admin-quick-nav {
        display: none;
    }
    .page-shell {
        padding: 18px 12px;
    }
    .panel,
    .phone-screen,
    .summary-card,
    .stat-card {
        border-radius: 22px;
    }
    .table-wrap {
        overflow-x: auto;
    }
}


.portal-card-grid {
    display: grid;
    gap: 16px;
}

.access-box {
    margin-top: 8px;
    padding: 18px;
    border: 1px solid rgba(28, 73, 168, 0.12);
    border-radius: 20px;
    background: rgba(242, 247, 255, 0.85);
}
.access-box .panel-head.compact {
    margin-bottom: 10px;
}
.access-grid {
    margin-top: 10px;
}
.access-flags {
    display: grid;
    gap: 10px;
    align-content: start;
}
.inline-help {
    margin-top: 8px;
    font-size: 0.92rem;
}
.login-links {
    margin-top: 14px;
    display: flex;
    justify-content: center;
}
.login-links a {
    color: var(--primary, #1c49a8);
    font-weight: 600;
    text-decoration: none;
}
.warning-box {
    border: 1px solid rgba(255, 168, 0, 0.3);
    background: rgba(255, 248, 231, 0.95);
}
.action-stack {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.action-stack form {
    margin: 0;
}
