html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.px-4 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* ── Design System (Theme-aware) ── */

/* Page header with dark gradient */
.page-header {
    background: linear-gradient(135deg, #0d2137 0%, #1a3a5c 50%, #1565C0 100%);
    border-radius: 12px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}
.page-header * {
    position: relative;
    z-index: 1;
}
.page-header .mud-typography { color: white !important; }
.page-header .mud-icon-root { color: rgba(255,255,255,0.7) !important; }
.page-header .mud-button-root { color: white !important; }
.page-header .page-header-title {
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white !important;
}
.page-header .page-header-subtitle {
    color: rgba(255,255,255,0.65) !important;
}

/* Card header accent (bottom border separator) */
.card-header-accent {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

/* Gradient card headers */
.card-header-blue {
    background: linear-gradient(135deg, #1565C0 0%, #0D47A1 100%);
}
.card-header-green {
    background: linear-gradient(135deg, #2E7D32 0%, #388E3C 100%);
}
.card-header-teal {
    background: linear-gradient(135deg, #00695C 0%, #00796B 100%);
}
.card-header-orange {
    background: linear-gradient(135deg, #E65100 0%, #F57C00 100%);
}
.card-header-purple {
    background: linear-gradient(135deg, #4527A0 0%, #5E35B1 100%);
}
.card-header-slate {
    background: linear-gradient(135deg, #455A64 0%, #37474F 100%);
}
.card-header-blue *,
.card-header-green *,
.card-header-teal *,
.card-header-orange *,
.card-header-purple *,
.card-header-slate * {
    color: white !important;
}

/* Monospace code block with left accent border */
.code-block {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: var(--mud-palette-background);
    border-left: 3px solid #2E7D32;
    padding: 10px 12px;
    border-radius: 0 6px 6px 0;
}

/* Info row with icon + content */
.info-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}
.info-row .mud-icon-root {
    margin-top: 2px;
    flex-shrink: 0;
}

/* Stat card with left border accent */
.stat-card {
    border-radius: 10px !important;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--mud-palette-surface) !important;
    cursor: pointer;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12) !important;
}
.stat-card-blue { border-left: 4px solid var(--mud-palette-primary); }
.stat-card-green { border-left: 4px solid var(--mud-palette-success); }
.stat-card-orange { border-left: 4px solid #F57C00; }
.stat-card-red { border-left: 4px solid var(--mud-palette-error); }
.stat-card-purple { border-left: 4px solid #7B1FA2; }
.stat-card-teal { border-left: 4px solid #00796B; }

/* Stat card count */
.stat-count {
    font-weight: 700;
    line-height: 1;
}
.stat-label {
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
}

/* Section title with icon */
.section-title {
    font-weight: 600 !important;
}

/* Rounded alerts */
.status-banner {
    border-radius: 8px !important;
}

/* Sticky summary sidebar */
.sticky-summary {
    position: sticky;
    top: 20px;
}

/* ── Shared info-section-title ── */
.info-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--mud-palette-lines-default);
}

/* ── Shared field-row pattern ── */
.field-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 10px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}
.field-row:last-child { border-bottom: none; }
.field-label {
    font-size: 0.82rem;
    color: var(--mud-palette-text-secondary);
    font-weight: 500;
    min-width: 160px;
    flex-shrink: 0;
}
.field-value {
    font-size: 0.92rem;
    color: var(--mud-palette-text-primary);
    font-weight: 500;
    text-align: right;
}
.field-value.mono { font-family: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace; letter-spacing: 0.5px; }
.field-value.muted { color: var(--mud-palette-text-disabled); font-style: italic; font-weight: 400; }

/* ── Sidebar card pattern ── */
.sidebar-card {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    background: var(--mud-palette-surface) !important;
    overflow: hidden;
}
.sidebar-card-header {
    background: var(--mud-palette-background);
    padding: 14px 20px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-card-header .header-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-card-body { padding: 16px 20px; }

/* ── Status dots ── */
.status-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.status-dot.green { background: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,0.4); }
.status-dot.orange { background: #ff9800; box-shadow: 0 0 6px rgba(255,152,0,0.4); }
.status-dot.red { background: #f44336; box-shadow: 0 0 6px rgba(244,67,54,0.4); }
.status-dot.blue { background: #2196f3; box-shadow: 0 0 6px rgba(33,150,243,0.4); }

/* ── Main card ── */
.main-card {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    background: var(--mud-palette-surface) !important;
}

/* ── Filter card ── */
.filter-card {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    background: var(--mud-palette-surface) !important;
    padding: 20px;
}

/* ── Summary banner ── */
.summary-banner {
    border-radius: 10px !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    background: var(--mud-palette-surface) !important;
    padding: 16px 24px;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
    .page-header {
        padding: 20px 16px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    .field-row {
        flex-direction: column;
        gap: 2px;
        padding: 8px 0;
    }
    .field-label {
        min-width: unset;
        font-size: 0.75rem;
    }
    .field-value {
        text-align: left;
        font-size: 0.88rem;
    }
    .sidebar-card { border-radius: 8px !important; }
    .sidebar-card-body { padding: 12px 16px; }
    .info-section-title {
        font-size: 0.65rem;
        margin-bottom: 12px;
    }
    .stat-card { border-radius: 8px !important; }
    .filter-card { padding: 12px; }
}
