@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@600;700;800&display=swap');

:root {
    --bg: #03090b;
    --bg-soft: #071416;
    --bg-elevated: rgba(9, 20, 24, 0.88);
    --panel: rgba(8, 19, 23, 0.9);
    --panel-strong: rgba(10, 24, 28, 0.96);
    --panel-accent: rgba(16, 31, 35, 0.98);
    --line: rgba(112, 249, 231, 0.12);
    --line-strong: rgba(112, 249, 231, 0.22);
    --text: #ecfffc;
    --muted: #84aca8;
    --muted-strong: #b9d9d5;
    --primary: #36e9ce;
    --primary-strong: #0fb9a5;
    --primary-soft: rgba(54, 233, 206, 0.14);
    --accent: #74fae8;
    --warning: #ffc55c;
    --warning-soft: rgba(255, 197, 92, 0.12);
    --danger: #ff7385;
    --danger-soft: rgba(255, 115, 133, 0.14);
    --success-soft: rgba(54, 233, 206, 0.14);
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
    --shadow-soft: 0 16px 38px rgba(0, 0, 0, 0.28);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --font-ui: "Manrope", "Segoe UI Variable Text", "Trebuchet MS", sans-serif;
    --font-display: "Sora", "Manrope", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(54, 233, 206, 0.18), transparent 22%),
        radial-gradient(circle at 100% 12%, rgba(116, 250, 232, 0.12), transparent 20%),
        radial-gradient(circle at 18% 82%, rgba(54, 233, 206, 0.08), transparent 26%),
        linear-gradient(180deg, #020708 0%, #051012 48%, #020708 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: -1;
    filter: blur(30px);
}

body::before {
    width: 240px;
    height: 240px;
    top: 8%;
    right: -40px;
    background: rgba(54, 233, 206, 0.12);
}

body::after {
    width: 280px;
    height: 280px;
    bottom: -60px;
    left: -80px;
    background: rgba(116, 250, 232, 0.08);
}

body.sidebar-open::selection {
    background: rgba(54, 233, 206, 0.22);
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    letter-spacing: -0.04em;
    line-height: 1.06;
}

p,
small,
span,
label,
li,
td,
th {
    line-height: 1.55;
}

strong {
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

code {
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(116, 250, 232, 0.12);
    color: var(--accent);
    font-size: 0.88rem;
}

.app-shell {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
}

.app-shell::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 8, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 20;
}

body.sidebar-open .app-shell::after {
    opacity: 1;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(88vw, 320px);
    padding: 1rem;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    z-index: 30;
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
    padding: 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(4, 14, 17, 0.98), rgba(4, 10, 12, 0.98)),
        linear-gradient(180deg, rgba(54, 233, 206, 0.08), transparent);
    box-shadow: var(--shadow);
    overflow-y: auto;
}

.brand {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.brand-mark,
.sidebar-user-mark,
.menu-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #001715;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(54, 233, 206, 0.2);
}

.brand-copy strong {
    display: block;
    font-size: 1.08rem;
}

.brand-copy small {
    display: block;
    color: var(--muted);
}

.sidebar-highlight {
    padding: 1rem;
    border-radius: var(--radius-md);
    background:
        radial-gradient(circle at top right, rgba(54, 233, 206, 0.12), transparent 40%),
        rgba(7, 18, 22, 0.88);
    border: 1px solid rgba(116, 250, 232, 0.08);
}

.sidebar-highlight p {
    margin: 0.6rem 0 0;
    color: var(--muted-strong);
    font-size: 0.94rem;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: fit-content;
    padding: 0.34rem 0.72rem;
    border-radius: 999px;
    background: rgba(54, 233, 206, 0.1);
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.menu {
    display: grid;
    gap: 0.6rem;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.82rem 0.88rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    color: #e4fffb;
    transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.menu-link:hover,
.menu-link.active {
    transform: translateX(4px);
    border-color: rgba(116, 250, 232, 0.12);
    background: rgba(54, 233, 206, 0.1);
    box-shadow: var(--shadow-soft);
}

.menu-link.logout {
    background: rgba(255, 115, 133, 0.08);
    border-color: rgba(255, 115, 133, 0.1);
}

.menu-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.menu-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.menu-copy strong,
.menu-copy small {
    display: block;
}

.menu-copy small {
    color: var(--muted);
    font-size: 0.83rem;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 0.8rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.88rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-user-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(54, 233, 206, 0.12);
    color: var(--accent);
    font-weight: 800;
}

.sidebar-user small {
    color: var(--muted);
}

.app-main {
    min-width: 0;
    padding: 0.95rem 0.95rem 1.8rem;
}

.topbar {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0.9rem;
    justify-content: space-between;
    margin-bottom: 1.05rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(6, 15, 19, 0.8), rgba(5, 11, 14, 0.76));
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.topbar-copy {
    display: grid;
    gap: 0.4rem;
    max-width: 72ch;
}

.topbar h1 {
    font-size: clamp(1.7rem, 4vw, 2.55rem);
}

.topbar p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 0.98rem;
}

.topbar-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.6rem;
}

.topbar-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.7rem 0.92rem;
    border-radius: 999px;
    border: 1px solid rgba(116, 250, 232, 0.12);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    font-size: 0.9rem;
    font-weight: 600;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(116, 250, 232, 0.14);
    background: rgba(54, 233, 206, 0.08);
    color: var(--accent);
    font-weight: 700;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
}

.content {
    display: grid;
    gap: 1rem;
}

.content > * {
    animation: fadeUp 0.45s ease both;
}

.content > *:nth-child(2) {
    animation-delay: 0.04s;
}

.content > *:nth-child(3) {
    animation-delay: 0.08s;
}

.content > *:nth-child(4) {
    animation-delay: 0.12s;
}

.panel,
.metric-card,
.mini-card,
.detail-card,
.login-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(54, 233, 206, 0.08), transparent 28%),
        linear-gradient(180deg, rgba(10, 21, 26, 0.96), rgba(5, 11, 15, 0.94));
    box-shadow: var(--shadow-soft);
}

.panel::before,
.metric-card::before,
.mini-card::before,
.detail-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(116, 250, 232, 0.26), transparent 60%);
}

.panel {
    padding: 1rem;
}

.panel-spotlight {
    background:
        radial-gradient(circle at top right, rgba(54, 233, 206, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(10, 24, 30, 0.98), rgba(5, 12, 16, 0.96));
}

.panel-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.panel-header p {
    margin: 0.3rem 0 0;
    color: var(--muted-strong);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
}

.summary-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.template-grid,
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.metric-card,
.mini-card,
.detail-card {
    padding: 1rem;
}

.metric-card span,
.mini-card span,
.detail-card span {
    display: block;
    color: var(--muted);
    font-size: 0.9rem;
}

.metric-card strong,
.mini-card strong,
.detail-card strong {
    display: block;
    margin-top: 0.38rem;
    font-size: 1.32rem;
}

.metric-card small,
.detail-card small,
.mini-card small {
    display: block;
    margin-top: 0.44rem;
    color: var(--muted);
}

.metric-card.danger {
    background:
        radial-gradient(circle at top right, rgba(255, 115, 133, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(22, 12, 16, 0.98), rgba(10, 11, 14, 0.94));
}

.metric-card.warning {
    background:
        radial-gradient(circle at top right, rgba(255, 197, 92, 0.14), transparent 32%),
        linear-gradient(180deg, rgba(22, 18, 10, 0.98), rgba(10, 11, 14, 0.94));
}

.note-card {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.note-card strong {
    display: block;
    margin-bottom: 0.28rem;
}

.note-card p {
    margin: 0;
    color: var(--muted-strong);
}

.form-grid,
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.inline-form,
.form-actions,
.actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
}

.field-span-2 {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 0.48rem;
    font-weight: 600;
    color: #d9fffa;
}

label small {
    color: var(--muted);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(116, 250, 232, 0.12);
    border-radius: 16px;
    padding: 0.92rem 0.98rem;
    background: rgba(4, 12, 15, 0.94);
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

select {
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--accent) 50%),
        linear-gradient(135deg, var(--accent) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-right: 2.4rem;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #6d9691;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(54, 233, 206, 0.42);
    box-shadow: 0 0 0 4px rgba(54, 233, 206, 0.08);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 54px;
}

.checkbox-inline input {
    width: auto;
    accent-color: var(--primary);
}

.form-help {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.84rem 1.14rem;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.button-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #001613;
    font-weight: 800;
}

.button-secondary {
    background: rgba(54, 233, 206, 0.1);
    border-color: rgba(54, 233, 206, 0.16);
    color: var(--accent);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.button-danger {
    background: rgba(255, 115, 133, 0.1);
    border-color: rgba(255, 115, 133, 0.16);
    color: #ffd2d8;
}

.button-block {
    width: 100%;
}

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(116, 250, 232, 0.08);
    background: rgba(0, 0, 0, 0.14);
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

th,
td {
    padding: 0.92rem 0.78rem;
    text-align: left;
    border-bottom: 1px solid rgba(116, 250, 232, 0.07);
    vertical-align: top;
}

th {
    color: #8dcfc8;
    font-size: 0.79rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(116, 250, 232, 0.03);
}

td strong,
td small {
    display: block;
}

td small {
    color: var(--muted);
    margin-top: 0.22rem;
}

.status-pill,
.risk-pill,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.38rem 0.74rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 0.8rem;
    font-weight: 700;
}

.badge-success,
.status-em-dia,
.status-quitado,
.status-log-sucesso,
.risk-low {
    background: var(--success-soft);
    border-color: rgba(54, 233, 206, 0.16);
    color: var(--accent);
}

.badge-muted,
.status-cancelado,
.risk-neutral {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
    color: #d4e2df;
}

.badge-outline {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(116, 250, 232, 0.12);
    color: var(--accent);
}

.badge-accent {
    background: rgba(116, 250, 232, 0.12);
    border-color: rgba(116, 250, 232, 0.18);
    color: #dffef9;
}

.status-proximo,
.status-log-ignorado,
.risk-medium {
    background: var(--warning-soft);
    border-color: rgba(255, 197, 92, 0.16);
    color: #ffd98b;
}

.status-vencido,
.status-log-falha,
.risk-critical {
    background: var(--danger-soft);
    border-color: rgba(255, 115, 133, 0.18);
    color: #ffcad2;
}

.risk-high {
    background: rgba(15, 185, 165, 0.16);
    border-color: rgba(15, 185, 165, 0.22);
    color: #8dfff1;
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-weight: 600;
}

.alert-success {
    background: rgba(54, 233, 206, 0.1);
    border-color: rgba(54, 233, 206, 0.16);
}

.alert-error {
    background: rgba(255, 115, 133, 0.1);
    border-color: rgba(255, 115, 133, 0.16);
}

.subtle {
    color: var(--muted);
}

.stack {
    display: grid;
    gap: 0.7rem;
}

.clean-list {
    margin: 0;
    padding-left: 1.2rem;
}

.clean-list-spaced li + li {
    margin-top: 0.45rem;
}

.template-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: rgba(9, 19, 24, 0.9);
}

.template-card-system {
    background:
        radial-gradient(circle at top right, rgba(54, 233, 206, 0.08), transparent 30%),
        rgba(9, 19, 24, 0.9);
}

.template-card-manual {
    background:
        radial-gradient(circle at top right, rgba(255, 197, 92, 0.08), transparent 30%),
        rgba(9, 19, 24, 0.9);
}

.template-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
}

.template-head h3 {
    margin-top: 0.45rem;
    font-size: 1.08rem;
}

.template-preview {
    margin: 0;
    color: var(--muted-strong);
}

.template-toggle {
    justify-content: flex-start;
}

.template-delete {
    margin-top: auto;
}

.empty-state {
    padding: 1.2rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(116, 250, 232, 0.16);
    background: rgba(255, 255, 255, 0.02);
}

.empty-state strong {
    display: block;
    margin-bottom: 0.35rem;
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

.empty-cell {
    text-align: center;
    color: var(--muted);
    padding: 1.2rem 0.9rem;
}

.login-body,
.cron-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.login-card {
    width: min(1020px, 100%);
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}

.login-copy {
    padding: 1.4rem;
    background:
        radial-gradient(circle at top left, rgba(54, 233, 206, 0.16), transparent 34%),
        linear-gradient(145deg, rgba(3, 11, 14, 0.98), rgba(8, 19, 23, 0.96));
}

.login-copy p {
    max-width: 44ch;
    color: #bbeae4;
}

.login-form {
    padding: 1.4rem;
    display: grid;
    gap: 1rem;
    align-content: center;
    background: rgba(4, 12, 15, 0.94);
}

.login-hint {
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.cron-panel {
    width: min(1120px, 100%);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(116, 250, 232, 0.18);
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    table {
        min-width: 100%;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 0.9rem;
        padding: 0.8rem;
    }

    tr {
        padding: 0.4rem;
        border-radius: var(--radius-md);
        background: rgba(255, 255, 255, 0.02);
        border: 1px solid rgba(116, 250, 232, 0.08);
    }

    td {
        display: grid;
        gap: 0.2rem;
        padding: 0.7rem 0.7rem 0.7rem 6.8rem;
        min-height: 3.1rem;
        position: relative;
        border-bottom: 1px solid rgba(116, 250, 232, 0.06);
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 0.7rem;
        top: 0.7rem;
        max-width: 5.2rem;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
    }
}

@media (min-width: 640px) {
    .app-main {
        padding: 1.15rem 1.15rem 1.9rem;
    }

    .panel,
    .metric-card,
    .mini-card,
    .detail-card,
    .login-copy,
    .login-form {
        padding: 1.2rem;
    }

    .inline-form,
    .form-actions,
    .actions,
    .panel-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .button {
        width: auto;
    }
}

@media (min-width: 900px) {
    .app-main {
        padding: 1.35rem 1.35rem 2rem;
    }

    .login-card {
        grid-template-columns: 1.12fr 0.96fr;
    }

    .login-copy,
    .login-form {
        padding: 2rem;
    }
}

@media (min-width: 1024px) {
    .app-shell::after {
        display: none;
    }

    .app-shell {
        grid-template-columns: 318px minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        inset: 0;
        width: auto;
        height: 100vh;
        transform: none;
        padding: 1rem 0 1rem 1rem;
    }

    .app-main {
        padding: 1.5rem 1.55rem 2.2rem;
    }

    .menu-toggle {
        display: none;
    }
}
