:root {
    --bg: #f4efe6;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #fffdf8;
    --text: #1f2933;
    --muted: #5e6c7b;
    --line: rgba(31, 41, 51, 0.08);
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --accent: #f59e0b;
    --danger: #b91c1c;
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.22), transparent 24%),
        radial-gradient(circle at left bottom, rgba(13, 148, 136, 0.22), transparent 20%),
        linear-gradient(135deg, #f6f0e7 0%, #f1f5f9 100%);
}

.auth-body {
    min-height: 100vh;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    position: relative;
}

.sidebar-overlay,
.mobile-topbar {
    display: none;
}

.sidebar {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    padding: 32px 24px;
    background: #113946;
    color: #f7fafc;
}

.sidebar-top {
    display: grid;
    gap: 14px;
}

.sidebar-badge,
.sidebar-user {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-badge span,
.sidebar-user small {
    color: rgba(247, 250, 252, 0.72);
    font-size: 0.82rem;
}

.brand-kicker,
.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    color: var(--accent);
}

.sidebar h1,
.hero h2,
.panel h2,
.panel h3 {
    margin: 0;
}

.menu {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.menu-heading {
    margin: 12px 0 2px;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(247, 250, 252, 0.58);
}

.menu a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    transition: 0.2s ease;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.sidebar-logout {
    margin-top: auto;
}

.sidebar-logout .secondary-button {
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.content {
    padding: 32px;
    min-width: 0;
}

.auth-content {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.auth-shell {
    width: min(520px, 100%);
}

.auth-card {
    display: grid;
    gap: 22px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.auth-brand {
    display: grid;
    gap: 8px;
}

.brand-logo-block {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-logo-block img {
    display: block;
    max-width: 220px;
    max-height: 86px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-brand-logo {
    margin-bottom: 6px;
}

.sidebar-brand-logo {
    margin-bottom: 12px;
}

.sidebar-brand-logo img {
    max-width: 180px;
    max-height: 68px;
}

.dashboard-hero-content {
    display: grid;
    gap: 12px;
}

.dashboard-brand-logo {
    padding: 12px 14px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    width: fit-content;
}

.dashboard-brand-logo strong {
    display: block;
}

.auth-domain-badge {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(13, 148, 136, 0.08);
}

.auth-domain-badge span {
    color: var(--muted);
    font-size: 0.82rem;
}

.auth-actions {
    justify-content: stretch;
}

.auth-actions .primary-button {
    width: 100%;
}

.company-form {
    display: grid;
    gap: 24px;
}

.hero,
.panel,
.stat-card {
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    padding: 32px;
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.88), rgba(255, 255, 255, 0.72));
}

.hero-tight {
    padding: 28px;
}

.hero h2 {
    margin-top: 8px;
    font-size: clamp(2rem, 4vw, 3.2rem);
    max-width: 800px;
}

.hero-text {
    max-width: 760px;
    color: var(--muted);
    font-size: 1rem;
}

.dashboard-page {
    display: grid;
    gap: 24px;
    overflow: hidden;
}

.dashboard-page > img,
.dashboard-page > figure,
.dashboard-page > canvas,
.dashboard-page > svg {
    display: none !important;
}

.dashboard-page .stats-grid {
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0;
}

.stat-card {
    display: grid;
    gap: 8px;
    padding: 24px;
    border-radius: 24px;
    background: var(--surface);
}

.stat-card span {
    color: var(--muted);
}

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

.panel {
    padding: 28px;
    border-radius: 28px;
    background: var(--surface);
    position: relative;
    overflow: visible;
}

.panel-highlight {
    margin-bottom: 24px;
}

.setup-panel {
    margin-bottom: 24px;
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.78));
}

.error-panel {
    border-color: rgba(185, 28, 28, 0.2);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.92), rgba(255, 255, 255, 0.82));
}

.success-panel {
    border-color: rgba(13, 148, 136, 0.2);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.82));
}

.license-panel {
    margin-bottom: 24px;
}

.license-panel-ok {
    border-color: rgba(13, 148, 136, 0.18);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.82));
}

.license-panel-warning {
    border-color: rgba(245, 158, 11, 0.28);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.82));
}

.license-panel-expired,
.license-panel-blocked {
    border-color: rgba(185, 28, 28, 0.24);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 255, 255, 0.84));
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin-bottom: 22px;
}

.collapsible-panel-body[hidden] {
    display: none !important;
}

.collapsible-toggle-button {
    min-width: 150px;
}

.primary-button,
.secondary-button,
.actions button,
.actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.primary-button {
    background: var(--primary);
    color: #fff;
}

.primary-button:hover {
    background: var(--primary-dark);
}

.secondary-button,
.actions a {
    background: rgba(17, 57, 70, 0.08);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.table-input {
    min-width: 84px;
    padding: 10px 12px;
    border-radius: 10px;
}

th,
td {
    padding: 16px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.12);
    color: var(--primary-dark);
    font-size: 0.85rem;
}

.proposal-form {
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

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

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

.field-span-2 {
    grid-column: span 2;
}

.field-span-3 {
    grid-column: span 3;
}

.form-section {
    display: grid;
    gap: 16px;
}

.section-headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.section-headline h3 {
    margin: 0;
}

.stack-list {
    display: grid;
    gap: 14px;
}

.agenda-list {
    display: grid;
    gap: 14px;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.calendar-month-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-title {
    margin: 0;
    font-size: 1.2rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.7);
}

.calendar-weekday {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 57, 70, 0.05);
}

.calendar-day {
    min-height: 180px;
    padding: 12px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: grid;
    align-content: start;
    gap: 10px;
    background: rgba(255, 255, 255, 0.68);
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day-muted {
    background: rgba(17, 57, 70, 0.03);
}

.calendar-day-today {
    background: rgba(245, 158, 11, 0.12);
}

.calendar-day-number {
    justify-self: end;
    font-weight: 700;
}

.calendar-day-events {
    display: grid;
    gap: 8px;
}

.calendar-event {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.96), rgba(15, 118, 110, 0.92));
    color: #fff;
    box-shadow: 0 14px 24px rgba(13, 148, 136, 0.18);
}

.calendar-event strong {
    font-size: 0.88rem;
    line-height: 1.25;
}

.calendar-event small,
.calendar-event-label {
    font-size: 0.74rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.9);
}

.calendar-reminder-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.calendar-reminder-card {
    display: grid;
    gap: 6px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(13, 148, 136, 0.12);
    background: linear-gradient(135deg, rgba(240, 253, 250, 0.9), rgba(255, 255, 255, 0.8));
}

.calendar-reminder-card small {
    color: var(--muted);
}

.agenda-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) auto;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.06), rgba(255, 255, 255, 0.78));
}

.agenda-card-main,
.agenda-card-side {
    display: grid;
    gap: 6px;
}

.agenda-card-main strong {
    font-size: 1rem;
}

.agenda-card-main small,
.agenda-card-side span {
    color: var(--muted);
}

.agenda-card-side {
    justify-items: end;
}

.agenda-reminder {
    display: inline-flex;
    width: fit-content;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    font-size: 0.82rem;
    font-weight: 600;
}

.repeat-card {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(17, 57, 70, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.66);
}

.category-card {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(255, 255, 255, 0.82));
}

.category-card-compact {
    padding: 14px 16px;
}

.repeat-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    align-items: end;
}

.partner-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(247, 250, 252, 0.74));
}

.ghost-button {
    padding: 10px 14px;
    border: 1px dashed rgba(17, 57, 70, 0.2);
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.toggle-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.toggle-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--text);
}

.toggle-card input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.toggle-card span {
    font-weight: 700;
}

.toggle-card small,
.muted {
    color: var(--muted);
}

.admin-master-card {
    gap: 18px;
}

.master-section-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.master-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(17, 57, 70, 0.08);
    color: var(--text);
    font-weight: 600;
    transition: 0.2s ease;
}

.master-section-link:hover {
    background: rgba(17, 57, 70, 0.14);
}

.master-section-link.is-active {
    background: var(--primary);
    color: #fff;
}

.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
}

.radio-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
}

.radio-group span {
    font-weight: 600;
    color: var(--text);
}

.sticky-actions {
    position: sticky;
    bottom: 16px;
    z-index: 2;
    gap: 12px;
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.92);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.info-grid div,
.info-columns > div {
    display: grid;
    gap: 6px;
}

.info-grid span,
.info-columns h3 {
    color: var(--muted);
}

.info-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.clean-list {
    display: grid;
    gap: 10px;
    padding-left: 18px;
    margin: 0;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(17, 57, 70, 0.12);
    border-radius: 14px;
    background: var(--surface-strong);
}

textarea {
    resize: vertical;
}

.panel-compact {
    padding: 16px 18px;
    border-radius: 18px;
    margin-bottom: 18px;
}

.logo-preview-box {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.logo-preview-box img {
    width: 160px;
    max-width: 100%;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
}

.autocomplete-option-rich {
    display: grid;
    gap: 4px;
}

.autocomplete-option-rich strong {
    font-weight: 700;
}

.autocomplete-option-rich small {
    color: var(--muted);
    font-size: 0.82rem;
}

.licitacao-percentual-actions {
    display: flex;
    align-items: end;
    gap: 12px;
    flex-wrap: wrap;
}

.form-actions {
    display: flex;
    justify-content: end;
}

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

.actions form {
    margin: 0;
}

.actions .pdf-sign-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.actions .pdf-sign-form select {
    width: auto;
    min-width: 170px;
    padding: 11px 14px;
}

.actions .pdf-sign-form .primary-button {
    background: var(--primary);
    color: #fff;
}

.actions .pdf-sign-form .primary-button:hover {
    background: var(--primary-dark);
}

.actions button {
    background: rgba(185, 28, 28, 0.12);
    color: var(--danger);
}

.pagination-bar {
    display: flex;
    justify-content: end;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.is-disabled {
    pointer-events: none;
    opacity: 0.45;
}

.documentation-stack {
    margin-top: 24px;
}

.document-panel {
    display: grid;
    gap: 22px;
}

.documentation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 22px;
}

.document-area {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.54);
}

.document-list {
    gap: 12px;
}

.document-item,
.document-upload-row {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 16px;
}

.document-item-main {
    display: grid;
    gap: 6px;
}

.document-item-main span,
.document-item-main small {
    color: var(--muted);
}

.document-simple-list {
    display: grid;
    gap: 10px;
}

.document-simple-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.72);
}

.document-simple-main {
    display: grid;
    gap: 4px;
}

.document-simple-main small {
    color: var(--muted);
}

.document-upload-form {
    display: grid;
    gap: 16px;
}

.autocomplete-field {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: grid;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(17, 57, 70, 0.1);
    border-radius: 14px;
    background: #fffdf8;
    box-shadow: 0 20px 30px rgba(15, 23, 42, 0.08);
    z-index: 3000;
}

.autocomplete-results[hidden] {
    display: none !important;
}

.autocomplete-results-floating {
    z-index: 99999;
}

.autocomplete-option {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: rgba(17, 57, 70, 0.06);
    text-align: left;
    cursor: pointer;
}

.autocomplete-option:hover {
    background: rgba(13, 148, 136, 0.12);
}

.licitacao-item-card {
    overflow: visible;
}

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

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

.licitacao-toolbar {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.licitacao-detail-grid {
    margin-bottom: 20px;
}

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

.detail-card {
    padding: 18px 20px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.6);
}

.detail-card strong {
    line-height: 1.5;
}

.detail-object-box {
    display: grid;
    gap: 8px;
    padding-top: 12px;
}

.detail-object-box-wide {
    padding: 22px 24px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.66);
}

.detail-object-box span {
    color: var(--muted);
}

.detail-object-box p {
    margin: 0;
    line-height: 1.6;
}

.licitacao-add-item-grid {
    display: grid;
    grid-template-columns: 2fr 0.6fr 0.8fr 1.4fr 0.7fr 0.7fr 0.8fr 0.8fr auto;
    gap: 12px;
    align-items: end;
}

.licitacao-add-item-form {
    display: block;
}

.licitacao-add-panel {
    z-index: 2000;
    isolation: isolate;
}

.inline-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.inline-field label {
    display: block;
}

.inline-field label span {
    display: block;
    color: var(--muted);
}

.inline-field-search {
    position: relative;
    z-index: 2500;
}

.inline-field-search input[type="hidden"] {
    display: none;
}

.inline-field-action .primary-button {
    width: 56px;
    height: 48px;
    padding: 0;
    border-radius: 12px;
    font-size: 1.4rem;
}

.licitacao-percentual-field {
    min-width: 220px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 24, 39, 0.42);
    z-index: 100000;
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-card {
    width: min(680px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(255, 255, 255, 0.95));
    box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

.modal-header {
    margin-bottom: 18px;
}

.modal-product-name {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-helper-text {
    margin: 0;
    color: var(--muted);
}

.modal-actions {
    gap: 12px;
}

.backup-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.update-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.update-kpi {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(238, 244, 248, 0.92);
    border: 1px solid rgba(13, 148, 136, 0.12);
}

.update-kpi span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-bottom: 6px;
}

.update-kpi strong {
    font-size: 1.05rem;
}

.update-table-wrap table {
    min-width: 640px;
}

.update-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.doc-viewer {
    margin: 0;
    padding: 16px 18px;
    min-height: 240px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid rgba(31, 41, 51, 0.08);
    color: #1f2937;
    font: 0.92rem/1.55 Consolas, "Courier New", monospace;
}

.backup-card {
    display: grid;
    gap: 14px;
}

.backup-version-badge {
    display: grid;
    gap: 4px;
    justify-items: end;
    padding: 10px 16px;
    border-radius: 16px;
    background: rgba(13, 148, 136, 0.12);
    color: #0f766e;
}

.backup-version-badge span {
    font-size: 0.82rem;
    color: var(--muted);
}

.backup-version-badge strong {
    font-size: 1rem;
}

.backup-checklist {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.backup-last-run {
    display: grid;
    gap: 6px;
    align-content: end;
    padding: 14px 16px;
    border: 1px solid rgba(17, 57, 70, 0.08);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.62);
}

.backup-last-run span,
.backup-last-run small {
    color: var(--muted);
}

.success-panel {
    border: 1px solid rgba(22, 163, 74, 0.18);
    background: rgba(34, 197, 94, 0.08);
    color: #166534;
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        position: sticky;
        top: 12px;
        z-index: 25;
        margin-bottom: 16px;
        padding: 12px 14px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(12px);
        box-shadow: var(--shadow);
    }

    .mobile-topbar-brand {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        min-width: 0;
        flex: 1;
    }

    .mobile-topbar-brand img {
        display: block;
        max-width: 150px;
        max-height: 42px;
        width: auto;
        height: auto;
        object-fit: contain;
    }

    .mobile-menu-button {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        width: 46px;
        height: 46px;
        padding: 0 12px;
        border: none;
        border-radius: 14px;
        background: rgba(17, 57, 70, 0.08);
        cursor: pointer;
        flex-shrink: 0;
    }

    .mobile-menu-button span {
        display: block;
        width: 100%;
        height: 2px;
        border-radius: 999px;
        background: #113946;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(88vw, 340px);
        max-width: 340px;
        padding: 24px 18px;
        gap: 18px;
        overflow-y: auto;
        transform: translateX(-108%);
        transition: transform 0.24s ease;
        z-index: 40;
    }

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

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        border: none;
        background: rgba(15, 23, 42, 0.36);
        cursor: pointer;
    }

    .app-shell.sidebar-open .sidebar-overlay {
        display: block;
    }

    .stats-grid,
    .form-grid,
    .form-grid-2,
    .form-grid-3,
    .toggle-grid,
    .documentation-grid,
    .document-top-grid,
    .document-form-grid,
    .licitacao-add-item-grid,
    .document-simple-row,
    .info-grid,
    .info-columns,
    .repeat-card-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2,
    .field-span-3 {
        grid-column: span 1;
    }

    .hero,
    .panel-header {
        flex-direction: column;
        align-items: start;
    }

    .hero {
        padding: 24px 20px;
    }

    .section-headline,
    .sticky-actions,
    .agenda-card,
    .actions,
    .form-actions,
    .licitacao-toolbar,
    .licitacao-percentual-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .agenda-card {
        grid-template-columns: 1fr;
    }

    .agenda-card-side {
        justify-items: start;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .calendar-weekday {
        display: none;
    }

    .calendar-day {
        min-height: auto;
        border-right: none;
    }

    .backup-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 16px;
    }

    .panel,
    .auth-card {
        padding: 22px;
        border-radius: 22px;
    }

    .actions a,
    .actions button,
    .primary-button,
    .secondary-button {
        width: 100%;
    }

    .actions .pdf-sign-form {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .actions .pdf-sign-form select {
        width: 100%;
        min-width: 0;
    }

    .table-wrap {
        margin-inline: -6px;
        padding-inline: 6px;
    }

    table {
        min-width: 680px;
    }
}

@media (max-width: 680px) {
    .content {
        padding: 12px;
    }

    .hero,
    .panel,
    .auth-card,
    .stat-card {
        padding: 18px;
        border-radius: 18px;
    }

    .hero h2 {
        font-size: clamp(1.5rem, 8vw, 2.2rem);
    }

    .brand-logo-block img,
    .dashboard-brand-logo img,
    .sidebar-brand-logo img {
        max-width: 140px;
        max-height: 54px;
    }

    th,
    td {
        padding: 12px 10px;
    }

    .table-input,
    input,
    select,
    textarea {
        min-width: 0;
    }

    .modal-actions {
        flex-direction: column;
    }

    .auth-content {
        padding: 16px;
    }
}
