/* ═══════════════════════════════════════════════
   AD Migration Platform – Global Styles
   Works with MudBlazor theming
   ═══════════════════════════════════════════════ */

html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

/* ── Responsive helpers ── */
@media (max-width: 599.98px) {
    .hide-on-mobile { display: none !important; }
    .mud-table .mud-table-cell { font-size: 0.8125rem; padding: 6px 8px !important; }
    .mud-table .mud-table-head .mud-table-cell { font-size: 0.75rem; }
    .page-header { flex-direction: column !important; align-items: flex-start !important; gap: 0.75rem; }
}

@media (max-width: 959.98px) {
    .hide-on-tablet { display: none !important; }
}

/* ── Gradient stat cards ── */
.stat-card {
    border-radius: 12px !important;
    padding: 20px !important;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}
.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card-blue    { background: linear-gradient(135deg, #1565c0 0%, #42a5f5 100%); }
.stat-card-green   { background: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%); }
.stat-card-orange  { background: linear-gradient(135deg, #e65100 0%, #ffa726 100%); }
.stat-card-purple  { background: linear-gradient(135deg, #6a1b9a 0%, #ba68c8 100%); }
.stat-card-red     { background: linear-gradient(135deg, #c62828 0%, #ef5350 100%); }
.stat-card-teal    { background: linear-gradient(135deg, #00695c 0%, #4db6ac 100%); }
.stat-card-indigo  { background: linear-gradient(135deg, #283593 0%, #7986cb 100%); }

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.8125rem;
    opacity: 0.85;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Section cards ── */
.section-card {
    border-radius: 12px !important;
    overflow: hidden;
}
.section-card .section-header {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Tables – responsive, cleaner ── */
.mud-table-container {
    border-radius: 8px;
}
.mud-table .mud-table-head {
    background: rgba(0,0,0,0.02);
}
.mud-table .mud-table-row:hover {
    transition: background-color 0.15s ease;
}

/* ── Chips ── */
.mud-chip { font-weight: 500; letter-spacing: 0.01em; }

/* ── Page container – proper padding ── */
.mud-main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}
.page-container {
    padding: 24px 32px;
}
@media (max-width: 599.98px) {
    .page-container { padding: 16px; }
}
@media (min-width: 600px) and (max-width: 959.98px) {
    .page-container { padding: 20px 24px; }
}

/* ── Page titles ── */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* ── Progress bars ── */
.mud-progress-linear {
    border-radius: 4px !important;
}

/* ── Smooth transitions ── */
.mud-paper {
    transition: box-shadow 0.2s ease;
}
.mud-nav-link {
    transition: background-color 0.15s ease;
}

/* ── Welcome banner ── */
.welcome-banner {
    border-radius: 16px;
    padding: 28px 32px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 60%, #00897b 100%);
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.welcome-banner::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    pointer-events: none;
}
.welcome-banner .welcome-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
}
.welcome-banner .welcome-subtitle {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

/* ── Stat card icon ── */
.stat-card .stat-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    opacity: 0.2;
    font-size: 2.5rem;
}

/* ── Chart containers ── */
.chart-card {
    border-radius: 12px !important;
    padding: 24px !important;
}
.chart-card .chart-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Activity timeline ── */
.activity-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-timeline li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.activity-timeline li:last-child {
    border-bottom: none;
}
.activity-timeline .timeline-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}
.activity-timeline .timeline-content {
    flex: 1;
    min-width: 0;
}
.activity-timeline .timeline-time {
    font-size: 0.75rem;
    opacity: 0.55;
    white-space: nowrap;
}

/* ── Health indicator ── */
.health-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
}
.health-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}
.health-dot-green  { background: #43a047; }
.health-dot-yellow { background: #ffa726; }
.health-dot-red    { background: #ef5350; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Brand logo in AppBar ── */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-logo .brand-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
}
.brand-logo .brand-text {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}
.brand-logo .brand-tagline {
    font-size: 0.65rem;
    opacity: 0.6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ── Nav drawer header ── */
.nav-brand-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    margin-bottom: 8px;
}
.nav-brand-header .nav-brand-name {
    font-weight: 700;
    font-size: 1rem;
    color: #1565c0;
}
.nav-brand-header .nav-brand-edition {
    font-size: 0.7rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nav-user-section {
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 4px;
}

/* ── Metric mini-card inside panels ── */
.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.metric-row:last-child { border-bottom: none; }
.metric-row .metric-label {
    font-size: 0.8125rem;
    opacity: 0.7;
    font-weight: 400;
}
.metric-row .metric-value {
    font-size: 1rem;
    font-weight: 600;
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ── Blazor infrastructure ── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IH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uNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}
.blazor-error-boundary::after { content: "An error has occurred."; }

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid #e50000; }
.validation-message { color: #e50000; }