:root {
    --bg: #07111f;
    --bg-soft: rgba(13, 23, 38, 0.82);
    --panel: rgba(18, 32, 53, 0.86);
    --line: rgba(147, 185, 255, 0.24);
    --text: #f1f5fb;
    --muted: #c0cede;
    --accent: #1fb6ff;
    --accent-strong: #3ddc97;
    --danger: #ff6b6b;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(31, 182, 255, 0.2), transparent 28%),
        radial-gradient(circle at bottom right, rgba(61, 220, 151, 0.14), transparent 30%),
        linear-gradient(135deg, #050b16 0%, #081423 45%, #04070d 100%);
    color: var(--text);
    font-family: "IBM Plex Sans", sans-serif;
}

h1, h2, h3, h4, .navbar-brand {
    font-family: "Space Grotesk", sans-serif;
}

a {
    color: #8dd6ff;
    text-decoration: none;
}

a:hover {
    color: #b9e7ff;
}

.page-shell {
    min-height: 100vh;
    backdrop-filter: blur(14px);
}

.app-nav {
    background: rgba(8, 18, 34, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.navbar-brand {
    color: #f8fbff;
    font-weight: 700;
}

.navbar-brand:hover,
.navbar-brand:focus {
    color: #ffffff;
}

.app-nav .nav-link {
    color: #d9e8f7;
    font-weight: 500;
}

.app-nav .nav-link:hover,
.app-nav .nav-link:focus,
.app-nav .nav-link.active {
    color: #ffffff;
}

.nav-item-sync {
    display: flex;
    align-items: center;
}

.nav-link-sync {
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
    border: 1px solid rgba(61, 220, 151, 0.38);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(61, 220, 151, 0.14), rgba(31, 182, 255, 0.12));
    color: #dffef0;
    line-height: 1.2;
    padding: 0.42rem 0.95rem;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, color 160ms ease;
}

.nav-link-sync:hover,
.nav-link-sync:focus {
    color: #ffffff;
    border-color: rgba(61, 220, 151, 0.62);
    background: linear-gradient(135deg, rgba(61, 220, 151, 0.24), rgba(31, 182, 255, 0.18));
    transform: translateY(-1px);
}

.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.22);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(31, 182, 255, 0.22);
}

.navbar-toggler-icon {
    filter: invert(1) brightness(1.8);
}

.glass-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.hero-panel {
    display: grid;
    gap: 2rem;
    align-items: end;
}

.dashboard-shell {
    max-width: 1440px;
    margin: 0 auto;
}

.dashboard-hero {
    padding: 2rem;
}

.backup-inspector-panel {
    padding: 1.75rem;
}

.sync-overview-panel {
    padding: 1.75rem;
}

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

.backup-inspector-layout {
    display: grid;
    gap: 1.5rem;
}

.inspection-result-card {
    border-radius: 22px;
    border: 1px solid rgba(147, 185, 255, 0.18);
    background: rgba(255, 255, 255, 0.035);
    padding: 1.25rem;
}

.inspection-result-header,
.inspection-empty-state {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}

.inspection-result-header span,
.inspection-empty-state span,
.inspection-period-box span,
.inspection-kpi-grid article span {
    color: rgba(241, 245, 251, 0.78);
    font-size: 0.9rem;
}

.inspection-result-header strong,
.inspection-empty-state strong,
.inspection-period-box strong,
.inspection-kpi-grid article strong {
    font-family: "Space Grotesk", sans-serif;
}

.inspection-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.inspection-kpi-grid article,
.inspection-period-box {
    border-radius: 18px;
    border: 1px solid rgba(147, 185, 255, 0.14);
    background: rgba(9, 19, 34, 0.72);
    padding: 0.95rem 1rem;
}

.inspection-kpi-grid article strong {
    display: block;
    margin-top: 0.45rem;
    font-size: 1.8rem;
    line-height: 1;
}

.inspection-period-box {
    margin-bottom: 1rem;
}

.inspection-period-box small {
    display: block;
    color: var(--muted);
}

.inspection-breakdown-grid {
    display: grid;
    gap: 1rem;
}

.inspection-breakdown-grid h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.inspection-breakdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.55rem;
}

.inspection-breakdown-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(147, 185, 255, 0.1);
}

.inspection-breakdown-list-scroll {
    max-height: 18rem;
    overflow: auto;
    padding-right: 0.25rem;
}

.hero-copy {
    max-width: 42rem;
}

.hero-copy h1 {
    margin-bottom: 0.9rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}

.hero-copy .lead {
    max-width: 38rem;
    font-size: 1.1rem;
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.hero-cta {
    min-width: 13rem;
    padding: 0.9rem 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(135deg, #f7fbff, #cfe4ff);
    box-shadow: 0 10px 24px rgba(18, 72, 132, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.hero-cta:hover,
.hero-cta:focus {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(18, 72, 132, 0.34);
    background: linear-gradient(135deg, #ffffff, #d9ebff);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.hero-cta-secondary {
    min-width: 13rem;
    padding: 0.9rem 1.35rem;
    font-weight: 700;
    border-width: 1px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-self: stretch;
}

.metric-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 10.5rem;
    padding: 1.4rem 1.35rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.metric-card-primary {
    background: linear-gradient(180deg, rgba(33, 56, 88, 0.72), rgba(20, 34, 55, 0.88));
}

.metric-card span {
    color: rgba(241, 245, 251, 0.82);
    font-size: 0.95rem;
}

.metric-card strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.1rem, 4vw, 3rem);
    line-height: 1;
}

@media (min-width: 992px) {
    .hero-panel {
        grid-template-columns: 1.7fr 1fr;
    }

    .backup-inspector-layout {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        align-items: start;
    }

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

@media (max-width: 767.98px) {
    .inspection-kpi-grid {
        grid-template-columns: 1fr;
    }
}

.eyebrow {
    color: var(--accent-strong);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-bottom: 0.6rem;
}

.lead,
.text-secondary,
.form-text,
td,
dd,
.small {
    color: var(--muted) !important;
}

th,
dt,
label,
.form-label,
.h5,
.h6 {
    color: var(--text);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading.compact {
    margin-bottom: 1rem;
}

.panel-fill {
    height: 100%;
}

.auth-layout {
    min-height: calc(100vh - 6rem);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(100%, 500px);
}

.form-control,
.form-select {
    background: rgba(8, 16, 30, 0.88);
    border: 1px solid rgba(191, 214, 239, 0.24);
    color: var(--text);
}

.form-control::placeholder {
    color: #aebfd2;
}

.form-control:focus,
.form-select:focus {
    background: rgba(3, 9, 19, 0.92);
    color: var(--text);
    border-color: rgba(31, 182, 255, 0.8);
    box-shadow: 0 0 0 0.2rem rgba(31, 182, 255, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #1796ff);
    border: 0;
}

.btn-light {
    background: linear-gradient(135deg, #f7fbff, #dcecff);
    color: #08111f;
    border: 0;
    font-weight: 600;
}

.btn-light:hover,
.btn-light:focus {
    color: #08111f;
    background: linear-gradient(135deg, #ffffff, #e7f2ff);
}

.btn-outline-light,
.btn-outline-warning {
    border-color: rgba(255, 255, 255, 0.28);
    color: #f4f8fc;
}

.btn-outline-light:hover,
.btn-outline-warning:hover {
    color: #08111f;
}

.flash-stack {
    width: min(100%, 48rem);
    margin-inline: auto;
}

.flash-stack .alert {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    padding: 0.95rem 1.1rem;
    line-height: 1.5;
    font-weight: 500;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
    word-break: break-word;
}

.flash-stack .alert-danger {
    background: #ffd9d9;
    color: #5b1313;
    border-color: #ffb0b0;
}

.flash-stack .alert-warning {
    background: #ffe8b8;
    color: #5f4300;
    border-color: #ffd06a;
}

.flash-stack .alert-success {
    background: #d7f7e6;
    color: #12492d;
    border-color: #97e0b5;
}

.flash-stack .alert-info {
    background: #d8eefc;
    color: #123d5c;
    border-color: #98d3f7;
}

@media (max-width: 991.98px) {
    .nav-item-sync {
        margin-top: 0.35rem;
    }

    .nav-item-sync .nav-link-sync {
        width: 100%;
    }

    .nav-item-sync .nav-link-sync {
        justify-content: center;
    }
}

.table-dark {
    --bs-table-bg: transparent;
    --bs-table-border-color: rgba(255, 255, 255, 0.06);
}

.truncate-cell {
    max-width: 18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.emails-page {
    max-width: 1600px;
    margin: 0 auto;
}

.direction-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.direction-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(147, 185, 255, 0.18);
    background: rgba(15, 27, 45, 0.72);
    color: var(--muted);
    text-decoration: none;
    transition: 160ms ease;
}

.direction-tab:hover,
.direction-tab.is-active {
    color: var(--text);
    border-color: rgba(111, 249, 190, 0.34);
    background: rgba(111, 249, 190, 0.12);
}

.search-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.search-results-count {
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.96rem;
}

.search-results-count strong {
    color: var(--text);
    font-size: 1.05rem;
}

.email-list-panel {
    padding: 1.25rem 1rem 1.5rem;
}

.email-table {
    min-width: 1280px;
    table-layout: fixed;
}

.email-table th,
.email-table td {
    padding: 1rem 0.95rem;
    vertical-align: top;
}

.email-table thead th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(241, 245, 251, 0.84);
}

.email-table .date-col {
    width: 9.5rem;
}

.email-table .direction-col {
    width: 9rem;
}

.email-table .attachments-col {
    width: 6rem;
    text-align: center;
}

.date-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.subject-cell a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    line-height: 1.5;
}

.address-cell {
    color: var(--text);
    overflow-wrap: anywhere;
    line-height: 1.5;
}

.address-secondary {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.direction-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 7.5rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.direction-pill-received {
    background: rgba(61, 167, 255, 0.14);
    color: #cceaff;
    border-color: rgba(61, 167, 255, 0.28);
}

.direction-pill-sent {
    background: rgba(111, 249, 190, 0.14);
    color: #dffaf0;
    border-color: rgba(111, 249, 190, 0.28);
}

.direction-pill-internal {
    background: rgba(255, 196, 92, 0.14);
    color: #ffe8bd;
    border-color: rgba(255, 196, 92, 0.28);
}

.direction-pill-unknown {
    background: rgba(255, 255, 255, 0.08);
    color: #eef4fb;
    border-color: rgba(255, 255, 255, 0.14);
}

.email-pagination-shell {
    display: flex;
    justify-content: center;
}

.pagination-modern {
    gap: 0.45rem;
    flex-wrap: wrap;
}

.pagination-modern .page-link {
    min-width: 2.7rem;
    padding: 0.72rem 0.9rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    text-align: center;
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, rgba(31, 182, 255, 0.28), rgba(23, 150, 255, 0.38));
    border-color: rgba(115, 203, 255, 0.45);
    color: #ffffff;
}

.pagination-modern .page-item.disabled .page-link {
    background: rgba(255, 255, 255, 0.025);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(192, 206, 222, 0.52);
}

.pagination-modern .page-link:hover,
.pagination-modern .page-link:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.pagination-modern .ellipsis {
    min-width: 2.2rem;
}

.job-list,
.attachment-list {
    display: grid;
    gap: 0.9rem;
}

.job-item,
.attachment-item {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.job-item header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.35rem;
}

.archive-overview {
    padding: 2rem;
}

.overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.35fr);
    gap: 1.5rem;
    align-items: stretch;
}

.overview-intro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
    padding-right: 0.5rem;
}

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

.overview-stat {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
    border-radius: 20px;
    padding: 1.3rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 12.5rem;
}

.overview-stat-wide {
    grid-column: 1 / -1;
}

.overview-stat span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.overview-stat strong {
    display: block;
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    line-height: 1.15;
    margin-bottom: 0.35rem;
}

.overview-stat small {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
}

.overview-stat p {
    color: var(--muted);
    margin: 0;
}

.overview-note {
    padding: 1.1rem 1.2rem;
    border-radius: 18px;
    border: 1px solid rgba(141, 214, 255, 0.18);
    background: linear-gradient(180deg, rgba(7, 21, 38, 0.72), rgba(9, 18, 32, 0.88));
}

.overview-note strong {
    display: block;
    margin-bottom: 0.45rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
}

.stat-divider {
    width: 100%;
    height: 1px;
    margin: 0.9rem 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
}

@media (max-width: 991.98px) {
    .dashboard-hero,
    .archive-overview {
        padding: 1.5rem;
    }

    .hero-metrics,
    .overview-grid {
        grid-template-columns: 1fr;
    }

    .overview-layout {
        grid-template-columns: 1fr;
    }
}

.meta-list {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 0.5rem 0.8rem;
    margin: 0;
}

.meta-list dd {
    overflow-wrap: anywhere;
}

.meta-list dt {
    color: var(--text);
}

.email-body {
    white-space: pre-wrap;
    background: rgba(3, 9, 19, 0.55);
    border-radius: 16px;
    padding: 1.25rem;
    color: var(--text);
    margin: 0;
    min-height: 18rem;
    line-height: 1.65;
    font-size: 0.97rem;
    font-family: "IBM Plex Sans", sans-serif;
    overflow-wrap: anywhere;
}

.html-preview {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    border-radius: 16px;
    padding: 1.25rem;
    overflow: auto;
    max-height: 36rem;
    line-height: 1.65;
}

.detail-header {
    align-items: start;
}

.detail-page {
    max-width: 1480px;
    margin: 0 auto;
}

.detail-heading-copy {
    max-width: 64rem;
}

.detail-heading-copy h1 {
    margin-bottom: 0.75rem;
    max-width: 34ch;
    line-height: 1.08;
}

.detail-subtitle {
    max-width: 56rem;
    color: var(--muted);
    margin: 0;
}

.detail-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.import-modal-content {
    background: linear-gradient(180deg, rgba(18, 32, 53, 0.98) 0%, rgba(10, 18, 31, 0.98) 100%);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 24px;
}

.import-modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    align-items: start;
}

.import-modal-content .modal-body,
.import-modal-content .modal-title,
.import-modal-content p,
.import-modal-content strong,
.import-modal-content span {
    color: var(--text);
}

.import-modal-content .btn-close {
    opacity: 0.9;
}

.import-modal-content .btn-close:hover {
    opacity: 1;
}

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

.import-summary-totals article {
    border-radius: 18px;
    padding: 0.95rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.import-summary-totals span {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.import-summary-totals strong {
    font-size: 1.7rem;
}

.import-summary-note {
    margin-bottom: 1rem;
    color: var(--muted);
    line-height: 1.55;
}

.sync-progress-card {
    margin: 1rem 0 1.1rem;
    padding: 1rem 1.05rem;
    border-radius: 18px;
    border: 1px solid rgba(141, 214, 255, 0.16);
    background: rgba(255, 255, 255, 0.035);
}

.sync-progress-header,
.sync-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.sync-progress-header {
    margin-bottom: 0.7rem;
}

.sync-progress-bar-shell {
    width: 100%;
    height: 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
    margin-bottom: 0.7rem;
}

.sync-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(31, 182, 255, 0.78), rgba(61, 220, 151, 0.82));
    transition: width 220ms ease;
}

.sync-direction-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.sync-direction-grid article {
    padding: 0.9rem 0.95rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.sync-direction-grid span {
    display: block;
    color: var(--muted);
    margin-bottom: 0.4rem;
}

.sync-direction-grid strong {
    font-size: 1.5rem;
    line-height: 1;
}

.import-modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.import-job-list {
    display: grid;
    gap: 0.75rem;
}

.import-job-item {
    padding: 0.95rem 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.import-job-item header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
}

.import-job-status {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.import-job-status-completed {
    color: #dffaf0;
}

.import-job-status-failed {
    color: #ffd5d5;
}

.import-job-status-running,
.import-job-status-queued {
    color: #cceaff;
}

.import-job-error {
    margin: 0.55rem 0 0;
    color: #ffd5d5;
    font-size: 0.92rem;
}

@media (max-width: 767.98px) {
    .sync-direction-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.detail-summary-card {
    background: linear-gradient(180deg, rgba(22, 38, 62, 0.88) 0%, rgba(15, 27, 45, 0.82) 100%);
    border: 1px solid rgba(147, 185, 255, 0.18);
    border-radius: 20px;
    padding: 1.05rem 1.15rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.detail-summary-card span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.45rem;
}

.detail-summary-card strong {
    display: block;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.45;
    word-break: break-word;
}

.detail-summary-compact strong {
    font-size: 1.35rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.95fr);
    gap: 1.6rem;
    align-items: start;
    margin-bottom: 1.6rem;
}

.detail-panel {
    height: auto;
    border-radius: 24px;
}

.detail-main-column,
.detail-side-column {
    min-width: 0;
}

.detail-main-column,
.detail-side-column {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.detail-panel-primary {
    padding: 1.35rem;
}

.detail-panel-secondary {
    background: linear-gradient(180deg, rgba(19, 34, 56, 0.88) 0%, rgba(13, 25, 42, 0.82) 100%);
    border: 1px solid rgba(147, 185, 255, 0.16);
}

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

.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.attachment-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.attachment-copy {
    min-width: 0;
}

.attachment-name {
    display: block;
    overflow-wrap: anywhere;
}

.attachment-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.detail-quick-panel {
    padding-bottom: 1.15rem;
}

.detail-quick-list {
    display: grid;
    gap: 0.9rem;
    margin: 0;
}

.detail-quick-list div {
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-quick-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-quick-list dt {
    margin-bottom: 0.28rem;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.detail-quick-list dd {
    margin: 0;
    color: var(--text);
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.detail-badge {
    min-width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(111, 249, 190, 0.12);
    border: 1px solid rgba(111, 249, 190, 0.24);
    color: #dffaf0;
    font-weight: 700;
}

.detail-metadata-panel {
    padding: 1.35rem;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: 12rem minmax(0, 1fr) 12rem minmax(0, 1fr);
    gap: 0.95rem 1.25rem;
    margin: 0;
}

.detail-meta-grid dt {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-meta-grid dd {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.pdf-preview-shell {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
}

.pdf-preview-frame {
    display: block;
    width: 100%;
    height: 48rem;
    border: 0;
    background: white;
}

.html-details {
    padding: 1.1rem;
}

.html-details[open] .html-details-toggle {
    content: "Chiudi";
}

.html-details-summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.html-details-summary::-webkit-details-marker {
    display: none;
}

.html-details-toggle {
    color: #dff2ff;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.45rem 0.8rem;
}

.html-details[open] .html-details-toggle {
    color: #08111f;
    background: #e8f4ff;
}

.html-details[open] .html-details-toggle::before {
    content: "Chiudi";
}

.html-details:not([open]) .html-details-toggle::before {
    content: "Apri";
}

.page-link {
    background: rgba(3, 9, 19, 0.8);
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.08);
}

.alert {
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #f7fbff;
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

@media (max-width: 767px) {
    .glass-panel {
        padding: 1.1rem;
        border-radius: 18px;
    }

    .section-heading {
        align-items: start;
        flex-direction: column;
    }

    .meta-list {
        grid-template-columns: 1fr;
    }

    .direction-tabs {
        gap: 0.5rem;
    }

    .direction-tab {
        width: 100%;
    }
}

@media (max-width: 991px) {
    .detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-meta-grid {
        grid-template-columns: 10rem minmax(0, 1fr);
    }
}

@media (max-width: 575px) {
    .detail-summary {
        grid-template-columns: 1fr;
    }

    .detail-actions {
        width: 100%;
    }

    .detail-actions .btn {
        width: 100%;
    }

    .attachment-item,
    .html-details-summary,
    .attachment-actions,
    .content-panel-header {
        flex-direction: column;
        align-items: stretch;
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .pdf-preview-frame {
        height: 34rem;
    }
}
