:root {
    --bg-primary: #eff4f8;
    --bg-secondary: #f8fafc;
    --surface: rgba(255, 255, 255, 0.92);
    --border: rgba(148, 163, 184, 0.28);
    --text-main: #162033;
    --text-muted: #5f6f86;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --accent-soft: rgba(15, 118, 110, 0.08);
    --line-soft: rgba(148, 163, 184, 0.18);
    --shadow: 0 24px 60px rgba(15, 23, 42, 0.10);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
}

body {
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(20, 184, 166, 0.12), transparent 30%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.10), transparent 35%),
        linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Eu reduzi e padronizei os raios para deixar a interface mais institucional e menos "inflada". */
.institution-bar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(10px);
}

.institution-mark,
.institution-meta,
.hero-badge,
.action-button,
.summary-card,
.empty-state-icon,
.field-label,
.price-badge,
.stock-badge,
.date-chip,
.thumb-placeholder,
.preview-placeholder-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.institution-mark {
    display: flex;
}

.institution-icon,
.summary-icon,
.empty-state-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(59, 130, 246, 0.16));
    color: var(--accent-dark);
    font-size: 1.4rem;
}

.institution-icon {
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.institution-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.institution-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.institution-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.page-hero,
.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.page-hero {
    position: relative;
    overflow: hidden;
}

.page-hero > * {
    position: relative;
    z-index: 1;
}

.page-hero::after {
    content: '';
    position: absolute;
    inset: auto -60px -60px auto;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.22) 0%, rgba(15, 118, 110, 0) 72%);
    pointer-events: none;
}

.content-card {
    padding: 2rem;
}

.hero-badge {
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-md);
}

.metric-card {
    width: 100%;
    min-height: 124px;
    padding: 1rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(15, 118, 110, 0.08);
    border: 1px solid rgba(15, 118, 110, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.metric-card strong,
.metric-card span {
    display: block;
}

.metric-card iconify-icon {
    font-size: 1.5rem;
    color: var(--accent-dark);
    margin-bottom: 0.35rem;
}

.metric-card strong {
    font-size: 1.4rem;
}

.metric-card span {
    font-size: 0.86rem;
    color: var(--text-muted);
}

.action-button {
    display: inline-flex;
    justify-content: center;
    cursor: pointer;
}

.action-button iconify-icon {
    font-size: 1.1rem;
    pointer-events: none;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
    width: 168px;
    flex: 0 0 168px;
}

.hero-actions .action-button {
    width: 100%;
    min-height: 56px;
}

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

.summary-card {
    width: 100%;
    padding: 1.1rem 1.15rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line-soft);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
    column-gap: 0.9rem;
}

.summary-card strong {
    display: block;
    margin-bottom: 0.2rem;
}

.summary-card p {
    color: var(--text-muted);
    font-size: 0.93rem;
}

.summary-icon-shell {
    width: 64px;
    min-width: 64px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.1rem;
}

.summary-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
    border-color: var(--accent-dark);
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--accent-dark) 0%, #134e4a 100%);
    border-color: #134e4a;
}

/* Alertas personalizados
   Eu concentrei aqui o visual dos avisos e confirmações para manter o sistema inteiro
   com a mesma linguagem visual e evitar a aparência genérica dos alerts nativos. */
.feedback-alert {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.06);
    margin-bottom: 1.25rem;
}

.feedback-alert-success {
    border-color: rgba(15, 118, 110, 0.18);
    background: linear-gradient(135deg, rgba(236, 253, 245, 0.95), rgba(240, 253, 250, 0.92));
}

.feedback-alert-warning {
    border-color: rgba(245, 158, 11, 0.20);
    background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 247, 237, 0.92));
}

.feedback-alert-danger {
    border-color: rgba(239, 68, 68, 0.18);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.96), rgba(255, 241, 242, 0.92));
}

.feedback-alert-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    color: var(--accent-dark);
    font-size: 1.35rem;
}

.feedback-alert-warning .feedback-alert-icon {
    color: #b45309;
}

.feedback-alert-danger .feedback-alert-icon {
    color: #b91c1c;
}

.feedback-alert-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.feedback-alert-content strong {
    font-size: 0.98rem;
}

.feedback-alert-content span {
    color: var(--text-muted);
}

.feedback-alert ul {
    padding-left: 1.35rem;
    color: #475569;
}

.feedback-alert-close {
    border: 0;
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.custom-alert-open {
    overflow: hidden;
}

.custom-alert-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(6px);
    z-index: 1080;
}

.custom-alert-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    z-index: 1090;
}

.custom-alert-card {
    width: min(100%, 560px);
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.20);
    padding: 1.4rem;
}

.custom-alert-header {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.custom-alert-badge {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(59, 130, 246, 0.16));
    color: var(--accent-dark);
    font-size: 1.5rem;
}

.custom-alert-header strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 0.35rem;
}

.custom-alert-header p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
}

.custom-alert-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.table thead th {
    color: var(--text-muted);
    border-bottom-width: 1px;
    white-space: nowrap;
    background: rgba(248, 250, 252, 0.8);
}

.products-table tbody tr {
    border-color: var(--line-soft);
}

.products-table tbody tr:hover {
    background: rgba(15, 118, 110, 0.03);
}

.products-table tbody td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.product-thumb {
    width: 76px;
    height: 76px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.76rem;
    text-align: center;
}

.thumb-placeholder {
    flex-direction: column;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.5rem;
}

.thumb-placeholder iconify-icon {
    font-size: 1.2rem;
}

.product-thumb img,
.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-description {
    max-width: 340px;
    line-height: 1.45;
}

.price-badge,
.stock-badge,
.date-chip {
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    font-size: 0.9rem;
}

.price-badge {
    background: rgba(15, 118, 110, 0.10);
    color: var(--accent-dark);
}

.stock-badge {
    background: rgba(59, 130, 246, 0.10);
    color: #1d4ed8;
}

.date-chip {
    background: rgba(15, 23, 42, 0.06);
    color: #334155;
}

.empty-state {
    padding: 4rem 2rem;
    text-align: center;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.65);
}

.empty-state-icon {
    margin-bottom: 1rem;
}

.empty-state-icon iconify-icon {
    font-size: 1.5rem;
}

.form-shell {
    max-width: 1120px;
}

.product-metrics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(180px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.metric-field {
    min-width: 0;
}

.metric-field-unit {
    max-width: 220px;
}

.field-helper {
    display: block;
    margin-top: 0.45rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.upload-panel {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(248, 250, 252, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.24);
}

.upload-panel-copy {
    min-width: 0;
}

.upload-panel-preview {
    min-width: 0;
}

.upload-panel-text {
    color: var(--text-muted);
    line-height: 1.55;
}

.upload-panel-note {
    font-size: 0.92rem;
}

.upload-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.upload-actions .btn {
    min-height: 48px;
}

.file-status {
    min-height: 22px;
    margin-bottom: 0.9rem;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.camera-capture-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(6px);
    z-index: 1080;
}

.camera-capture-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    z-index: 1090;
}

.camera-capture-card {
    width: min(100%, 720px);
    border-radius: var(--radius-lg);
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.22);
    padding: 1.25rem;
}

.camera-capture-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.camera-capture-header strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.camera-capture-header p {
    margin: 0;
    color: var(--text-muted);
}

.camera-capture-preview {
    width: 100%;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #0f172a;
    aspect-ratio: 4 / 3;
}

.camera-capture-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-capture-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.field-label {
    font-weight: 700;
    color: #334155;
}

.field-label iconify-icon {
    color: var(--accent-dark);
    font-size: 1.05rem;
}

.preview-card {
    width: 100%;
    min-height: 280px;
    aspect-ratio: 16 / 8.5;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #dbeafe;
}

.preview-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.10), rgba(59, 130, 246, 0.14)),
        #f8fafc;
}

.preview-placeholder-inner {
    flex-direction: column;
    text-align: center;
}

.preview-placeholder-inner iconify-icon {
    font-size: 2rem;
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border-color: rgba(148, 163, 184, 0.45);
    min-height: 48px;
}

.btn {
    border-radius: var(--radius-sm);
}

.table {
    --bs-table-bg: transparent;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 0 0 0.25rem rgba(15, 118, 110, 0.12);
}

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

@media (max-width: 767.98px) {
    .institution-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .institution-meta {
        justify-content: flex-start;
    }

    .content-card {
        padding: 1.25rem;
        border-radius: var(--radius-md);
    }

    .page-hero {
        border-radius: var(--radius-md);
    }

    .product-thumb {
        width: 60px;
        height: 60px;
    }

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

    .hero-actions {
        width: 100%;
        max-width: 220px;
    }

    .summary-card {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .product-description {
        max-width: none;
    }

    .product-metrics-grid,
    .upload-panel,
    .upload-actions {
        grid-template-columns: 1fr;
    }

    .metric-field-unit {
        max-width: none;
    }

    .preview-card {
        min-height: 240px;
        aspect-ratio: 4 / 3;
    }

    .camera-capture-header,
    .camera-capture-actions {
        flex-direction: column;
    }

    .camera-capture-actions .btn,
    .camera-capture-header .btn {
        width: 100%;
    }

    .custom-alert-card {
        padding: 1.15rem;
    }

    .custom-alert-header {
        grid-template-columns: 1fr;
    }

    .custom-alert-actions {
        flex-direction: column-reverse;
    }

    .custom-alert-actions .btn {
        width: 100%;
    }
}
