@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Sora:wght@400;500;600;700;800&display=swap');

:root {
    --portal-primary: #0B0F0C;
    --portal-accent: #43A047;
    --portal-accent-strong: #2E7D32;
    --portal-accent-soft: #81C784;
    --portal-bg: #0B0F0C;
    --portal-bg-alt: #151A16;
    --portal-bg-panel: rgba(21, 26, 22, 0.9);
    --portal-surface: linear-gradient(180deg, rgba(24, 30, 25, 0.96) 0%, rgba(18, 24, 20, 0.92) 100%);
    --portal-surface-soft: rgba(25, 32, 27, 0.82);
    --portal-surface-muted: rgba(31, 39, 34, 0.78);
    --portal-border: rgba(129, 199, 132, 0.14);
    --portal-border-strong: rgba(129, 199, 132, 0.3);
    --portal-text: #F5F7F6;
    --portal-text-soft: #D9E2DC;
    --portal-text-muted: #98A9A1;
    --portal-danger: #E57373;
    --portal-danger-surface: rgba(124, 37, 37, 0.24);
    --portal-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
    --portal-page-background:
        radial-gradient(circle at top left, rgba(67, 160, 71, 0.22), transparent 24%),
        radial-gradient(circle at top right, rgba(46, 125, 50, 0.18), transparent 22%),
        radial-gradient(circle at bottom center, rgba(129, 199, 132, 0.08), transparent 26%),
        linear-gradient(180deg, #0b0f0c 0%, #101511 42%, #151a16 100%);
    --portal-safe-top: env(safe-area-inset-top, 0px);
    --portal-safe-right: env(safe-area-inset-right, 0px);
    --portal-safe-bottom: env(safe-area-inset-bottom, 0px);
    --portal-safe-left: env(safe-area-inset-left, 0px);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--portal-text-soft);
    background-color: var(--portal-bg);
    background-image: var(--portal-page-background);
}

body.app-shell {
    padding-bottom: calc(6rem + var(--portal-safe-bottom));
}

body.public-shell {
    padding-bottom: calc(2rem + var(--portal-safe-bottom));
}

img,
svg,
video,
canvas {
    display: block;
    max-width: 100%;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

button,
.touch-target {
    min-height: 2.9rem;
}

.touch-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

::selection {
    background: rgba(67, 160, 71, 0.38);
    color: #f5f7f6;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(11, 15, 12, 0.85);
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(67, 160, 71, 0.38);
    border: 2px solid rgba(11, 15, 12, 0.85);
}

.portal-grid {
    background-image:
        linear-gradient(rgba(129, 199, 132, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(129, 199, 132, 0.05) 1px, transparent 1px),
        var(--portal-page-background);
    background-size: 38px 38px, 38px 38px, auto;
}

.glass-panel {
    background: var(--portal-surface);
    backdrop-filter: blur(24px);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    overflow-wrap: anywhere;
}

.headline-gradient {
    background: linear-gradient(135deg, #f5f7f6 0%, #81c784 42%, #43a047 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    color: var(--portal-text-muted);
    border: 1px solid transparent;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: linear-gradient(180deg, rgba(46, 125, 50, 0.22) 0%, rgba(31, 59, 45, 0.22) 100%);
    border-color: rgba(129, 199, 132, 0.2);
    color: var(--portal-text);
    transform: translateY(-1px);
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]).form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="url"],
input[type="search"],
input[type="tel"],
input[type="file"],
select,
textarea,
select.form-select,
textarea.form-textarea,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    min-height: 3rem;
    border-radius: 1rem;
    border: 1px solid rgba(129, 199, 132, 0.16);
    background: rgba(11, 15, 12, 0.92) !important;
    padding: 0.9rem 1rem;
    color: var(--portal-text) !important;
    -webkit-text-fill-color: var(--portal-text);
    caret-color: var(--portal-accent-soft);
    appearance: none;
    -webkit-appearance: none;
    background-clip: padding-box;
    font-size: 16px;
    color-scheme: dark;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

input.form-input::placeholder,
textarea.form-textarea::placeholder,
.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(217, 226, 220, 0.45);
}

input[type="file"]::file-selector-button {
    margin-right: 0.85rem;
    border: 1px solid rgba(129, 199, 132, 0.18);
    border-radius: 0.8rem;
    background: rgba(46, 125, 50, 0.22);
    color: var(--portal-text);
    padding: 0.65rem 0.9rem;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button {
    margin-right: 0.85rem;
    border: 1px solid rgba(129, 199, 132, 0.18);
    border-radius: 0.8rem;
    background: rgba(46, 125, 50, 0.22);
    color: var(--portal-text);
    padding: 0.65rem 0.9rem;
    cursor: pointer;
}

select.form-select option,
.form-select option {
    background: #151a16;
    color: #f5f7f6;
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
}

input.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus,
select.form-select:focus,
textarea.form-textarea:focus,
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: rgba(67, 160, 71, 0.65);
    box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.14);
    background: rgba(13, 19, 15, 0.98) !important;
}

input.form-input:-webkit-autofill,
input[type="text"]:-webkit-autofill,
input[type="email"]:-webkit-autofill,
input[type="password"]:-webkit-autofill,
input[type="number"]:-webkit-autofill,
input[type="date"]:-webkit-autofill,
input[type="url"]:-webkit-autofill,
input[type="search"]:-webkit-autofill,
input[type="tel"]:-webkit-autofill,
input.form-input:-webkit-autofill:hover,
input[type="text"]:-webkit-autofill:hover,
input[type="email"]:-webkit-autofill:hover,
input[type="password"]:-webkit-autofill:hover,
input[type="number"]:-webkit-autofill:hover,
input[type="date"]:-webkit-autofill:hover,
input[type="url"]:-webkit-autofill:hover,
input[type="search"]:-webkit-autofill:hover,
input[type="tel"]:-webkit-autofill:hover,
input.form-input:-webkit-autofill:focus,
input[type="text"]:-webkit-autofill:focus,
input[type="email"]:-webkit-autofill:focus,
input[type="password"]:-webkit-autofill:focus,
input[type="number"]:-webkit-autofill:focus,
input[type="date"]:-webkit-autofill:focus,
input[type="url"]:-webkit-autofill:focus,
input[type="search"]:-webkit-autofill:focus,
input[type="tel"]:-webkit-autofill:focus,
input.form-input:-webkit-autofill:active,
input[type="text"]:-webkit-autofill:active,
input[type="email"]:-webkit-autofill:active,
input[type="password"]:-webkit-autofill:active,
input[type="number"]:-webkit-autofill:active,
input[type="date"]:-webkit-autofill:active,
input[type="url"]:-webkit-autofill:active,
input[type="search"]:-webkit-autofill:active,
input[type="tel"]:-webkit-autofill:active,
select.form-select:-webkit-autofill,
select:-webkit-autofill,
textarea.form-textarea:-webkit-autofill {
    -webkit-text-fill-color: var(--portal-text) !important;
    caret-color: var(--portal-accent-soft);
    transition: background-color 9999s ease-out 0s;
    -webkit-box-shadow: 0 0 0 1000px rgba(11, 15, 12, 0.96) inset !important;
    box-shadow: 0 0 0 1000px rgba(11, 15, 12, 0.96) inset !important;
    border-color: rgba(129, 199, 132, 0.22) !important;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    color: var(--portal-text) !important;
    -webkit-text-fill-color: var(--portal-text) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(92%) sepia(6%) saturate(338%) hue-rotate(83deg) brightness(103%) contrast(94%);
    cursor: pointer;
}

.metric-card {
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid rgba(129, 199, 132, 0.12);
    background: linear-gradient(180deg, rgba(24, 31, 26, 0.96) 0%, rgba(18, 24, 20, 0.94) 100%);
    padding: 1.4rem;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.table-wrap {
    overflow: hidden;
    border-radius: 1.5rem;
    border: 1px solid rgba(129, 199, 132, 0.12);
    background: linear-gradient(180deg, rgba(23, 29, 25, 0.98) 0%, rgba(17, 22, 19, 0.96) 100%);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap th,
.table-wrap td {
    padding: 1rem 1.2rem;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}

.table-wrap thead {
    background: rgba(46, 125, 50, 0.12);
}

.table-wrap tbody tr {
    background: transparent;
}

.table-wrap tbody tr + tr td {
    border-top: 1px solid rgba(129, 199, 132, 0.1);
}

.table-wrap tbody tr:hover td {
    background: rgba(46, 125, 50, 0.05);
}

.alert-enter {
    animation: alert-slide 240ms ease;
}

.topbar-blur {
    backdrop-filter: blur(20px);
}

.mobile-drawer {
    transform: translateX(-100%);
    transition: transform 220ms ease;
}

.mobile-drawer.is-open {
    transform: translateX(0);
}

.app-install {
    position: fixed;
    right: 1rem;
    bottom: calc(6.25rem + var(--portal-safe-bottom));
    z-index: 50;
}

.mobile-tabbar {
    padding-bottom: calc(0.75rem + var(--portal-safe-bottom));
}

.mobile-tabbar a {
    min-height: 3.2rem;
}

.prose,
.prose p,
.prose li,
.prose blockquote {
    color: var(--portal-text-soft);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose strong,
.prose code {
    color: var(--portal-text);
}

.prose a {
    color: var(--portal-accent-soft);
}

.text-slate-950,
.text-slate-900,
.text-slate-800,
.text-white,
.hover\:text-slate-950:hover {
    color: var(--portal-text) !important;
}

.text-slate-700,
.text-slate-600,
.hover\:text-slate-950:hover,
.hover\:text-slate-900:hover {
    color: var(--portal-text-soft) !important;
}

.text-slate-500,
.text-slate-400,
.text-slate-300 {
    color: var(--portal-text-muted) !important;
}

.bg-white,
.bg-white\/92,
.bg-white\/80,
.bg-white\/75,
.bg-white\/70,
.bg-white\/90 {
    background: var(--portal-bg-panel) !important;
}

.border-white\/70,
.border-white\/60,
.border-white\/50 {
    border-color: rgba(129, 199, 132, 0.12) !important;
}

.bg-slate-950 {
    background-color: var(--portal-accent) !important;
}

.hover\:bg-slate-800:hover {
    background-color: var(--portal-accent-strong) !important;
}

.bg-slate-950\/35 {
    background-color: rgba(5, 8, 6, 0.72) !important;
}

.bg-slate-900 {
    background-color: #101511 !important;
}

.bg-slate-200,
.bg-slate-300 {
    background-color: rgba(67, 160, 71, 0.18) !important;
}

.bg-slate-100,
.bg-slate-50 {
    background-color: rgba(31, 59, 45, 0.24) !important;
}

.border-slate-300,
.border-slate-200,
.border-slate-100,
.hover\:border-slate-950:hover {
    border-color: rgba(129, 199, 132, 0.16) !important;
}

.border-dashed.border-slate-300 {
    border-color: rgba(129, 199, 132, 0.22) !important;
}

.bg-amber-50,
.bg-amber-100,
.bg-sky-50,
.bg-sky-100,
.bg-emerald-50,
.bg-emerald-100 {
    background-color: rgba(46, 125, 50, 0.18) !important;
}

.border-amber-200,
.border-amber-300,
.border-sky-200,
.border-emerald-200 {
    border-color: rgba(67, 160, 71, 0.28) !important;
}

.text-amber-800,
.text-amber-700,
.text-amber-600,
.text-sky-700,
.text-emerald-700,
.hover\:text-amber-900:hover,
.hover\:text-emerald-900:hover {
    color: #9fe0a2 !important;
}

.bg-emerald-500 {
    background-color: #43a047 !important;
}

.bg-emerald-400 {
    background-color: #3a9443 !important;
}

.bg-emerald-300,
.bg-sky-500,
.bg-amber-500 {
    background-color: #2e7d32 !important;
}

.bg-rose-50,
.bg-rose-100 {
    background-color: rgba(132, 43, 43, 0.18) !important;
}

.border-rose-200,
.border-rose-300,
.border-rose-500 {
    border-color: rgba(229, 115, 115, 0.28) !important;
}

.text-rose-600,
.text-rose-700,
.hover\:text-rose-900:hover {
    color: #ffb4b4 !important;
}

.bg-rose-500 {
    background-color: rgba(67, 160, 71, 0.34) !important;
}

.bg-zinc-200 {
    background-color: rgba(90, 108, 97, 0.28) !important;
}

.text-zinc-700 {
    color: #c2cec8 !important;
}

.focus\:ring-amber-500:focus,
.focus\:ring-rose-500:focus {
    --tw-ring-color: rgba(67, 160, 71, 0.35) !important;
}

.text-slate-900.transition:hover,
.font-semibold.text-slate-900.transition:hover,
.hover\:text-amber-700:hover {
    color: #9fe0a2 !important;
}

a,
button {
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.bg-slate-950,
.bg-amber-50,
.bg-amber-100,
.bg-emerald-100 {
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
}

.touch-target:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.14);
}

@keyframes alert-slide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 767px) {
    .glass-panel,
    .metric-card,
    .table-wrap {
        border-radius: 1.4rem;
    }

    .app-install {
        left: 1rem;
        right: 1rem;
        bottom: calc(6.75rem + var(--portal-safe-bottom));
    }

    .responsive-table thead {
        display: none;
    }

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

    .responsive-table tbody {
        padding: 0.75rem;
    }

    .responsive-table tr {
        border-radius: 1.2rem;
        border: 1px solid rgba(129, 199, 132, 0.14);
        background: rgba(18, 24, 20, 0.98);
        padding: 0.75rem;
    }

    .responsive-table tr + tr {
        margin-top: 0.75rem;
    }

    .responsive-table td {
        padding: 0.65rem 0;
        border-top: 1px solid rgba(129, 199, 132, 0.1);
    }

    .responsive-table td:first-child {
        border-top: 0;
        padding-top: 0;
    }

    .responsive-table td:last-child {
        padding-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.35rem;
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        color: var(--portal-text-muted);
    }

    .responsive-table td[data-label="Acoes"]::before,
    .responsive-table td[data-label="Detalhes"]::before {
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 1024px) {
    body.app-shell {
        padding-bottom: 0;
    }
}
