/* Styles Généraux et Thématiques pour Informatique 2000 */
/* Auteur: UX/UI Designer Senior */
/* Date: Juillet 2026 */

/* 1. Configuration Générale */
html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Scrollbars Premium */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.25);
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.15);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.45);
}

/* 3. Effet Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 4. Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.animate-shake {
    animation: shake 0.6s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes zoom {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-zoom {
    animation: zoom 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Éviter le débordement des selects */
select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.dark select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%239ca3af' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
}

/* ============================================================
   DASHBOARD — Interface recréée
   ============================================================ */

@keyframes dashFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-dash-in {
    animation: dashFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--delay, 0ms);
}

/* Hero */
.dash-hero {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid rgba(255, 204, 0, 0.15);
}

.dash-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
    z-index: 0;
}

.dash-hero-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255, 204, 0, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.dash-hero-bg::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 204, 0, 0.3), transparent);
}

.dash-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.75rem 2rem 1.25rem;
}

.dash-hero-title {
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.025em;
    color: #fff;
    line-height: 1.2;
}

.dash-hero-subtitle {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.375rem;
}

.dash-hero-subtitle strong {
    color: #ffcc00;
    font-weight: 700;
}

.dash-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 204, 0, 0.15);
    color: #ffcc00;
    border: 1px solid rgba(255, 204, 0, 0.25);
}

.dash-badge-outline {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    border-color: rgba(255, 255, 255, 0.1);
}

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

.dash-period-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.875rem;
    padding: 0.5rem 1rem;
    backdrop-filter: blur(8px);
}

.dash-period-picker input[type="month"] {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 0.75rem;
    font-weight: 700;
    outline: none;
    cursor: pointer;
    color-scheme: dark;
}

.dash-btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #ffcc00;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 4px 14px rgba(255, 204, 0, 0.25);
}

.dash-btn-export:hover {
    background: #ffb900;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 204, 0, 0.35);
}

.dash-hero-stats {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 1rem 2rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.dash-hero-stat {
    flex: 1;
    min-width: 120px;
    padding: 0.25rem 1rem;
}

.dash-hero-stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.dash-hero-stat-value small {
    font-size: 0.65rem;
    font-weight: 600;
    opacity: 0.6;
}

.dash-hero-stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin-top: 0.125rem;
}

.dash-hero-stat-divider {
    width: 1px;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* Score ring (hero) */
.dash-score-ring {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    background: conic-gradient(var(--ring-color) calc(var(--score) * 3.6deg), rgba(255,255,255,0.08) 0);
    position: relative;
}

.dash-score-ring::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: #0f172a;
}

.dash-score-ring span {
    position: relative;
    z-index: 1;
    color: #fff;
}

.dash-score-ring-emerald { --ring-color: #10b981; }
.dash-score-ring-amber   { --ring-color: #ffcc00; }
.dash-score-ring-rose    { --ring-color: #f43f5e; }

/* Alert */
.dash-alert {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(255, 204, 0, 0.08);
    border: 1px solid rgba(255, 204, 0, 0.2);
    color: #b45309;
}

.dark .dash-alert {
    color: #fbbf24;
    background: rgba(255, 204, 0, 0.06);
}

.dash-alert-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 204, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.dash-alert-action {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 0.5rem 1rem;
    border-radius: 0.625rem;
    background: rgba(255, 204, 0, 0.15);
    transition: background 0.2s;
}

.dash-alert-action:hover {
    background: rgba(255, 204, 0, 0.25);
}

/* KPI Cards */
.dash-kpi-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.25rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.dark .dash-kpi-card {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.06);
}

.dash-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
}

.dark .dash-kpi-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

.dash-kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 1.25rem 1.25rem 0 0;
}

.dash-kpi-amber::before  { background: linear-gradient(90deg, #ffcc00, #ffb900); }
.dash-kpi-emerald::before { background: linear-gradient(90deg, #10b981, #059669); }
.dash-kpi-rose::before   { background: linear-gradient(90deg, #f43f5e, #e11d48); }
.dash-kpi-blue::before   { background: linear-gradient(90deg, #3b82f6, #2563eb); }

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

.dash-kpi-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.dash-kpi-amber .dash-kpi-icon  { background: rgba(255, 204, 0, 0.12); color: #d97706; }
.dash-kpi-emerald .dash-kpi-icon { background: rgba(16, 185, 129, 0.12); color: #059669; }
.dash-kpi-rose .dash-kpi-icon   { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.dash-kpi-blue .dash-kpi-icon   { background: rgba(59, 130, 246, 0.12); color: #2563eb; }

.dark .dash-kpi-amber .dash-kpi-icon  { color: #ffcc00; }
.dark .dash-kpi-emerald .dash-kpi-icon { color: #34d399; }
.dark .dash-kpi-rose .dash-kpi-icon   { color: #fb7185; }
.dark .dash-kpi-blue .dash-kpi-icon   { color: #60a5fa; }

.dash-kpi-ring {
    width: 2.75rem;
    height: 2.75rem;
    position: relative;
}

.dash-kpi-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.dash-kpi-ring-bg {
    stroke: #e2e8f0;
}

.dark .dash-kpi-ring-bg {
    stroke: rgba(255, 255, 255, 0.08);
}

.dash-kpi-amber .dash-kpi-ring-fill  { stroke: #ffcc00; }
.dash-kpi-emerald .dash-kpi-ring-fill { stroke: #10b981; }
.dash-kpi-rose .dash-kpi-ring-fill   { stroke: #f43f5e; }
.dash-kpi-blue .dash-kpi-ring-fill   { stroke: #3b82f6; }

.dash-kpi-ring-fill {
    stroke-linecap: round;
    transition: stroke-dasharray 1s ease;
}

.dash-kpi-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 800;
    color: #64748b;
}

.dash-kpi-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.dash-kpi-value {
    font-size: 1.625rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #0f172a;
    line-height: 1.1;
}

.dark .dash-kpi-value {
    color: #f1f5f9;
}

.dash-kpi-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 0.875rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.7rem;
}

.dark .dash-kpi-footer {
    border-color: rgba(255, 255, 255, 0.06);
}

.dash-kpi-target {
    color: #94a3b8;
    font-weight: 600;
}

.dash-kpi-delta {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Panels */
.dash-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1.25rem;
    padding: 1.5rem;
    transition: box-shadow 0.25s;
}

.dark .dash-panel {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.06);
}

.dash-panel:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.dark .dash-panel:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

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

.dash-panel-title {
    font-size: 0.875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #0f172a;
}

.dark .dash-panel-title {
    color: #f1f5f9;
}

.dash-panel-desc {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 0.125rem;
}

.dash-legend {
    display: flex;
    gap: 1rem;
}

.dash-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.dash-legend-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}

.dash-link {
    font-size: 0.7rem;
    font-weight: 700;
    color: #ffcc00;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.dash-link:hover {
    opacity: 0.8;
}

/* Charts */
.dash-chart-container {
    height: 20rem;
    position: relative;
}

.dash-donut-wrap {
    height: 11rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.dash-class-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #f1f5f9;
}

.dark .dash-class-grid {
    border-color: rgba(255, 255, 255, 0.06);
}

.dash-class-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.dash-class-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-top: 0.3rem;
    flex-shrink: 0;
}

.dash-class-name {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 0.04em;
}

.dash-class-name small {
    font-weight: 600;
    opacity: 0.7;
}

.dash-class-count {
    font-size: 1.125rem;
    font-weight: 900;
    color: #0f172a;
    line-height: 1.2;
}

.dark .dash-class-count {
    color: #f1f5f9;
}

/* Empty state */
.dash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
}

.dash-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 0.75rem;
}

.dark .dash-empty-icon {
    background: rgba(255, 255, 255, 0.04);
    color: #475569;
}

.dash-btn-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.25rem;
    background: #ffcc00;
    color: #0f172a;
    font-size: 0.75rem;
    font-weight: 800;
    border-radius: 0.75rem;
    transition: all 0.2s;
}

.dash-btn-primary:hover {
    background: #ffb900;
}

/* DSM list */
.dash-dsm-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dash-dsm-item {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.75rem;
    border-radius: 0.875rem;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.dash-dsm-item:hover {
    background: #f8fafc;
}

.dark .dash-dsm-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.dash-dsm-rank {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.5rem;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    color: #64748b;
    flex-shrink: 0;
}

.dark .dash-dsm-rank {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.dash-dsm-item:first-child .dash-dsm-rank {
    background: rgba(255, 204, 0, 0.15);
    color: #d97706;
}

.dark .dash-dsm-item:first-child .dash-dsm-rank {
    color: #ffcc00;
}

.dash-bar-track {
    height: 0.375rem;
    background: #f1f5f9;
    border-radius: 9999px;
    overflow: hidden;
}

.dark .dash-bar-track {
    background: rgba(255, 255, 255, 0.06);
}

.dash-bar-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-bar-emerald { background: linear-gradient(90deg, #10b981, #34d399); }
.dash-bar-amber   { background: linear-gradient(90deg, #ffcc00, #ffb900); }
.dash-bar-rose    { background: linear-gradient(90deg, #f43f5e, #fb7185); }

/* Table */
.dash-table-wrap {
    overflow-x: auto;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.dash-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.75rem;
}

.dash-table thead th {
    padding: 0.625rem 0.75rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    border-bottom: 1px solid #f1f5f9;
    white-space: nowrap;
}

.dark .dash-table thead th {
    border-color: rgba(255, 255, 255, 0.06);
}

.dash-table tbody tr {
    transition: background 0.15s;
}

.dash-table tbody tr:hover {
    background: #f8fafc;
}

.dark .dash-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.dash-table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}

.dark .dash-table tbody td {
    border-color: rgba(255, 255, 255, 0.03);
}

.dash-txid {
    font-family: ui-monospace, monospace;
    font-size: 0.65rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.dark .dash-txid {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.dash-type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #64748b;
    white-space: nowrap;
}

.dark .dash-type-badge {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
}

.dash-status {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
}

.dash-status-ok {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.dark .dash-status-ok {
    color: #34d399;
}

.dash-status-fail {
    background: rgba(244, 63, 94, 0.12);
    color: #e11d48;
}

.dark .dash-status-fail {
    color: #fb7185;
}

.dash-kpi-icon {
    font-size: 1rem;
}

.dash-kpi-ok   { color: #10b981; }
.dash-kpi-fail { color: #f43f5e; }

/* Responsive */
@media (max-width: 640px) {
    .dash-hero-content {
        padding: 1.25rem 1.25rem 1rem;
    }

    .dash-hero-stats {
        padding: 0.75rem 1.25rem;
    }

    .dash-hero-stat-divider {
        display: none;
    }

    .dash-hero-stat {
        min-width: 50%;
    }

    .dash-hero-title {
        font-size: 1.375rem;
    }
}
