/* O-Office - Feuille de style principale
   Design inspire de Microsoft 365 : moderne, coins arrondis, bleu, professionnel. */

:root {
    --oo-primary: #2563eb;
    --oo-primary-dark: #1d4ed8;
    --oo-primary-light: #dbeafe;
    --oo-bg: #f4f6fb;
    --oo-surface: #ffffff;
    --oo-surface-alt: #f8fafc;
    --oo-text: #0f172a;
    --oo-muted: #64748b;
    --oo-border: #e2e8f0;
    --oo-success: #16a34a;
    --oo-danger: #dc2626;
    --oo-warning: #d97706;
    --oo-radius: 14px;
    --oo-radius-sm: 8px;
    --oo-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
    --oo-shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] {
    --oo-primary: #3b82f6;
    --oo-primary-dark: #60a5fa;
    --oo-primary-light: #1e3a8a;
    --oo-bg: #0f172a;
    --oo-surface: #1e293b;
    --oo-surface-alt: #162032;
    --oo-text: #e2e8f0;
    --oo-muted: #94a3b8;
    --oo-border: #334155;
    --oo-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --oo-shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --oo-primary: #3b82f6;
        --oo-primary-dark: #60a5fa;
        --oo-primary-light: #1e3a8a;
        --oo-bg: #0f172a;
        --oo-surface: #1e293b;
        --oo-surface-alt: #162032;
        --oo-text: #e2e8f0;
        --oo-muted: #94a3b8;
        --oo-border: #334155;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--oo-bg);
    color: var(--oo-text);
    font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    transition: background-color 0.2s ease, color 0.2s ease;
}

a {
    color: var(--oo-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.oo-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.oo-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--oo-surface);
    border-bottom: 1px solid var(--oo-border);
    box-shadow: var(--oo-shadow);
}

.oo-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--oo-text);
}

.oo-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--oo-primary), var(--oo-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
}

.oo-main {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
}

.oo-card {
    background: var(--oo-surface);
    border: 1px solid var(--oo-border);
    border-radius: var(--oo-radius);
    box-shadow: var(--oo-shadow);
    padding: 32px;
    width: 100%;
    max-width: 560px;
}

.oo-card-lg {
    max-width: 760px;
}

.oo-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.oo-subtitle {
    color: var(--oo-muted);
    margin: 0 0 24px;
    font-size: 0.95rem;
}

.oo-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 28px;
}

.oo-step {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--oo-border);
}

.oo-step.is-active,
.oo-step.is-done {
    background: var(--oo-primary);
}

.oo-field {
    margin-bottom: 18px;
}

.oo-label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.oo-input,
.oo-select {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--oo-radius-sm);
    border: 1px solid var(--oo-border);
    background: var(--oo-surface-alt);
    color: var(--oo-text);
    font-size: 0.95rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.oo-input:focus,
.oo-select:focus {
    outline: none;
    border-color: var(--oo-primary);
    box-shadow: 0 0 0 3px var(--oo-primary-light);
}

.oo-error {
    color: var(--oo-danger);
    font-size: 0.82rem;
    margin-top: 5px;
}

.oo-row {
    display: flex;
    gap: 16px;
}

.oo-row > .oo-field {
    flex: 1;
}

.oo-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 26px;
}

.oo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--oo-radius-sm);
    border: none;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.oo-btn:hover {
    text-decoration: none;
}

.oo-btn-primary {
    background: var(--oo-primary);
    color: #fff;
}

.oo-btn-primary:hover {
    background: var(--oo-primary-dark);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.oo-btn-ghost {
    background: transparent;
    color: var(--oo-muted);
}

.oo-btn-ghost:hover {
    color: var(--oo-text);
}

.oo-checklist {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oo-check-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--oo-radius-sm);
    background: var(--oo-surface-alt);
    border: 1px solid var(--oo-border);
}

.oo-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.oo-badge-ok {
    background: rgba(22, 163, 74, 0.12);
    color: var(--oo-success);
}

.oo-badge-fail {
    background: rgba(220, 38, 38, 0.12);
    color: var(--oo-danger);
}

.oo-badge-warn {
    background: rgba(217, 119, 6, 0.12);
    color: var(--oo-warning);
}

.oo-alert {
    padding: 12px 16px;
    border-radius: var(--oo-radius-sm);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.oo-alert-error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--oo-danger);
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.oo-alert-success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--oo-success);
    border: 1px solid rgba(22, 163, 74, 0.25);
}

.oo-success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(22, 163, 74, 0.12);
    color: var(--oo-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 20px;
}

.oo-theme-toggle {
    border: 1px solid var(--oo-border);
    background: var(--oo-surface-alt);
    color: var(--oo-text);
    border-radius: 999px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oo-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.oo-stat-card {
    background: var(--oo-surface-alt);
    border: 1px solid var(--oo-border);
    border-radius: var(--oo-radius-sm);
    padding: 16px;
}

.oo-stat-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.oo-stat-label {
    color: var(--oo-muted);
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .oo-row {
        flex-direction: column;
        gap: 0;
    }

    .oo-card {
        padding: 22px;
    }
}

/* Gestionnaire de fichiers */

.oo-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.oo-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--oo-muted);
}

.oo-breadcrumb a {
    color: var(--oo-text);
}

.oo-breadcrumb .oo-sep {
    color: var(--oo-muted);
}

.oo-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.oo-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--oo-border);
    border-radius: var(--oo-radius-sm);
    background: var(--oo-surface);
}

.oo-file-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--oo-primary-light);
    color: var(--oo-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.oo-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.oo-file-name a {
    color: var(--oo-text);
}

.oo-file-meta {
    color: var(--oo-muted);
    font-size: 0.82rem;
    width: 150px;
    flex-shrink: 0;
    text-align: right;
}

.oo-file-fav {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--oo-muted);
    padding: 4px;
    flex-shrink: 0;
}

.oo-file-fav.is-active {
    color: #f59e0b;
}

.oo-disclosure {
    position: relative;
    flex-shrink: 0;
}

.oo-disclosure summary {
    list-style: none;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--oo-radius-sm);
    border: 1px solid var(--oo-border);
    background: var(--oo-surface-alt);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--oo-text);
}

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

.oo-disclosure[open] summary {
    background: var(--oo-primary-light);
}

.oo-disclosure-panel {
    position: absolute;
    right: 0;
    z-index: 20;
    margin-top: 6px;
    background: var(--oo-surface);
    border: 1px solid var(--oo-border);
    border-radius: var(--oo-radius-sm);
    box-shadow: var(--oo-shadow-lg);
    padding: 14px;
    width: 260px;
}

.oo-disclosure-panel form + form,
.oo-disclosure-panel form + button {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--oo-border);
}

.oo-empty {
    color: var(--oo-muted);
    padding: 32px;
    text-align: center;
    border: 1px dashed var(--oo-border);
    border-radius: var(--oo-radius-sm);
}

.oo-btn-danger {
    background: transparent;
    color: var(--oo-danger);
}

.oo-btn-danger:hover {
    background: rgba(220, 38, 38, 0.08);
}

.oo-btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.oo-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.oo-activity-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--oo-radius-sm);
    background: var(--oo-surface-alt);
    border: 1px solid var(--oo-border);
    font-size: 0.88rem;
}

.oo-activity-date {
    color: var(--oo-muted);
    font-size: 0.78rem;
    flex-shrink: 0;
}
