/* Editor space: screens 5a to 5g (templates/editor), after docs/wireframes. */

.editor-brand { align-items: center; }
.editor-brand-text { display: flex; flex-direction: column; font-size: 17px; font-weight: 700; line-height: 1.2; }
.editor-brand-text--large { font-size: 22px; letter-spacing: -0.01em; }
.editor-brand-space { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--accent-text); }
.editor-brand-text--large .editor-brand-space { font-size: 13px; }

/* 5a: login */
.editor-login { flex-direction: column; gap: 24px; padding: 48px 16px; }
.editor-login-brand { display: flex; align-items: center; gap: 12px; }
.editor-login-brand img { border-radius: 10px; box-shadow: 0 0 0 1px var(--logo-ring), var(--shadow-accent); }
.editor-login-card {
    width: 100%; max-width: 420px; padding: 40px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; display: flex; flex-direction: column; gap: 24px;
}
.editor-login-card h1 { margin: 0; font-size: 26px; font-weight: 700; }
.editor-login-text { margin: -16px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-muted); }
.editor-login-button {
    min-height: 48px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-accent);
    font-size: 15px; font-weight: 600; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.editor-login-button:hover { background: var(--accent-hover); color: var(--on-accent); }
.editor-login-help { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.editor-login-refused {
    width: 100%; max-width: 420px; padding: 16px 20px; display: flex; gap: 12px; align-items: flex-start;
    background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 14px; line-height: 1.5;
}
@media (max-width: 480px) {
    .editor-login-card { padding: 24px; }
}

/* Pages */
.editor-page { width: 100%; max-width: 1100px; padding: 24px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.editor-head .page-intro { flex: 1 1 420px; }
.editor-head-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.editor-head-action .button { gap: 8px; border: none; font: inherit; font-weight: 600; }
/* A screen still to come: dashed, as the wireframes mark what is pending. */
.editor-button-disabled:disabled {
    background: var(--surface); color: var(--text-muted); border: 1px dashed var(--border-strong); cursor: not-allowed;
}
.editor-muted { color: var(--text-muted); }
.editor-nowrap { white-space: nowrap; }

.editor-search { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.editor-search label { font-size: 14px; font-weight: 500; }
.editor-search-box {
    display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text-muted);
}
.editor-search-box input {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font: inherit; font-size: 15px; color: var(--text);
}
.editor-search-box:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Cards */
.editor-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 6px; }
.editor-card h3 { margin: 0 0 6px; font-size: 17px; font-weight: 700; }
.editor-card--table { padding: 16px 24px 12px; }
.editor-card--dashed { border-style: dashed; border-color: var(--border-strong); }
.editor-card-note { margin: 0; padding-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.editor-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.editor-rows { margin: 0; }
.editor-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--divider); font-size: 14px; }
.editor-row dt { color: var(--text-muted); }
.editor-row dd { margin: 0; font-weight: 500; text-align: right; }
.editor-support-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-soft); }

/* Tables */
.editor-scroll { overflow-x: auto; }
.editor-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.editor-table th {
    padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--text-muted);
}
.editor-table td { padding: 14px 12px; vertical-align: top; }
.editor-table th:first-child, .editor-table td:first-child { padding-left: 0; }
.editor-table th:last-child, .editor-table td:last-child { padding-right: 0; }
.editor-table tbody tr { border-top: 1px solid var(--divider); }
.editor-table-end { text-align: right !important; }
.editor-company-link { font-weight: 600; }
.editor-empty { color: var(--text-soft); }
.editor-cell-title { display: block; font-weight: 600; }
.editor-cell-meta { display: block; margin-top: 2px; font-size: 13px; color: var(--text-muted); }
.editor-table code, .editor-routing code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/*
 * Status badges: plain when fine, bold border for an alert, dashed when not known.
 * The colour follows the icon that already says it: the leaf green of --success with a check, the red of --danger with a cross.
 */
.editor-status {
    display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px;
    border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text);
}
.editor-status:has(> .icon--check) { border-color: var(--success-border); background: var(--success-bg); color: var(--success); }
.editor-status:has(> .icon--x) { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger); }
.editor-status--alert { border: 2px solid var(--warning-border); background: var(--warning-bg); color: var(--warning); }
.editor-status--unknown { border-style: dashed; color: var(--text-soft); }

/* 5d */
.editor-breadcrumb { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--text-muted); }
.editor-breadcrumb [aria-current="page"] { color: var(--text); }
.editor-title { display: flex; flex-direction: column; gap: 6px; }
.editor-title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-title h2 { margin: 0; font-size: 26px; font-weight: 700; }
.editor-title-meta { margin: 0; font-size: 14px; color: var(--text-muted); }
.editor-people { margin: 0; padding: 0; list-style: none; }
.editor-person { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--divider); }
.editor-avatar { width: 32px; height: 32px; font-size: 12px; }
.editor-person-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.editor-person-name { font-size: 14px; font-weight: 600; }
.editor-person-email { font-size: 13px; color: var(--text-muted); overflow-wrap: anywhere; }

/* 5d: actions (decision 0013) */
.editor-title--actions { flex-direction: row; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.editor-title-action form { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.editor-title-action .button { border: none; font: inherit; font-weight: 600; cursor: pointer; }
.editor-title-action .button--secondary { border: 1px solid var(--border-strong); }
.editor-action-note { font-size: 12px; color: var(--text-muted); }
.editor-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-card-head h3 { margin: 0; }
.button--small { padding: 4px 10px; font-size: 13px; }
/* Outlined in the red of --danger, with its icon (app.css). */
.button--danger { font: inherit; font-weight: 600; cursor: pointer; }
.notice--warning { border-color: var(--warning-border); background: var(--warning-bg); color: var(--warning); font-size: 14px; line-height: 1.5; }
.editor-person-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-person-actions form { margin: 0; }
.editor-add { padding-top: 10px; font-size: 14px; }
.editor-add summary { cursor: pointer; font-weight: 600; }
.editor-add-form { display: flex; flex-direction: column; gap: 6px; max-width: 360px; padding-top: 10px; }
.editor-add-form label { font-size: 13px; color: var(--text-soft); }
.editor-add-form input { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.editor-add-form .button { align-self: flex-start; }
/*
 * « Supprimer », beside « Suspendre » for every company (outlined in the red of --danger, app.css).
 * Its confirmation opens in the flow, on a line of its own under the buttons and their note,
 * and pushes the page down, at every width: it stays inside the column wherever the button is.
 * Drawn over the page and hung from the button's right edge, it ran under the menu whenever
 * the actions wrapped to the left of the column, and hid « Suspendue le … ».
 */
.editor-title-action { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.editor-delete > summary { list-style: none; }
.editor-delete > summary::-webkit-details-marker { display: none; }
.editor-delete[open] { flex-basis: 100%; min-width: 0; }
.editor-delete[open] > .editor-delete-toggle { background: var(--danger-bg); }
.editor-delete-panel { max-width: 560px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--danger-border); border-radius: var(--radius); background: var(--surface); }
.editor-delete-panel h3 { margin: 0; font-size: 16px; color: var(--danger); }
.editor-delete-panel .editor-card-note { margin: 0; }
.editor-title-action .editor-delete-form { align-items: stretch; max-width: none; padding-top: 4px; }
.editor-step-up-error { position: relative; margin: 0; padding: 8px 12px 8px 36px; border: 1px solid var(--danger-border); border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 13px; }
.editor-step-up-error::before { position: absolute; left: 12px; top: 9px; margin: 0; }
.editor-step-up-error a { color: inherit; font-weight: 600; }

/* 5g */
.editor-routing { display: flex; flex-direction: column; gap: 12px; }
.editor-routing h3 { margin: 0; font-size: 17px; font-weight: 700; }
.editor-routing .notice { font-size: 14px; line-height: 1.5; }
.editor-routing-intro { margin: 0; font-size: 14px; color: var(--text-soft); }
.editor-rules { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.editor-rule {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px;
    border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 14px;
}
.editor-rule--fixed { border: 2px solid var(--accent); }
.editor-rule-when { flex: 1 1 240px; }
.editor-rule-arrow { color: var(--text-muted); }
.editor-rule-model { flex: 1 1 200px; font-weight: 600; }
.editor-rule-fixed { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.editor-rule-state { padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--border-strong); font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.editor-rule-state--applied { border-style: solid; border-color: var(--success-border); background: var(--success-bg); color: var(--text); }
.editor-rule-how { flex: 1 1 100%; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.editor-snippet { margin: 0; padding: 12px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; line-height: 1.5; }
.editor-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; }
.new-company-field select {
    box-sizing: border-box; width: 100%; height: 48px; padding: 0 14px;
    border: 1px solid var(--border-strong); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit; font-size: 15px;
}

@media (max-width: 820px) {
    .editor-page { padding: 20px 16px 32px; }
    .editor-head-action { align-items: flex-start; }
}
