:root {
    --bg: #f5f7f8;
    --panel: #ffffff;
    --text: #172026;
    --muted: #65727e;
    --line: #dbe2e7;
    --accent: #146c5c;
    --accent-dark: #0f5145;
    --warning: #a66a00;
    --danger: #a23b3b;
    --success: #237344;
    --sidebar: #18232b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

body.login-page {
    background: #18232b;
}

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

a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
}

code {
    background: #edf1f3;
    border-radius: 4px;
    color: #293843;
    padding: 2px 5px;
}

.login-shell {
    align-items: center;
    display: grid;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
    margin: 0 auto;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.login-brand {
    display: grid;
    gap: 2px;
    margin-bottom: 24px;
}

.login-brand strong {
    font-size: 24px;
}

.login-brand span,
.login-panel p {
    color: var(--muted);
}

.login-panel h1 {
    font-size: 26px;
    margin: 0 0 4px;
}

.login-panel p {
    margin: 0 0 20px;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    display: grid;
    gap: 5px;
}

.login-form label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.login-form input {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
}

.login-form input:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(20, 108, 92, 0.12);
}

.app-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: var(--sidebar);
    color: #ffffff;
    padding: 22px 16px;
}

.brand {
    margin-bottom: 28px;
}

.brand strong {
    display: block;
    font-size: 22px;
}

.brand > span {
    color: #b5c3cc;
    font-size: 13px;
}

.project-dashboard-link {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: grid;
    gap: 1px;
    margin-top: 12px;
    padding: 10px 12px;
    text-decoration: none;
}

.project-dashboard-link span {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.project-dashboard-link small {
    color: #b5c3cc;
    font-size: 12px;
}

.project-dashboard-link:hover {
    background: #26343e;
    text-decoration: none;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav a,
.nav-section summary {
    border-radius: 6px;
    color: #d9e3e8;
    padding: 10px 12px;
    text-decoration: none;
}

.nav a:hover,
.nav a.active,
.nav-section summary:hover {
    background: #26343e;
    color: #ffffff;
}

.grouped-nav {
    gap: 8px;
}

.nav-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    overflow: hidden;
}

.nav-section summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-weight: 700;
    justify-content: space-between;
    list-style: none;
}

.nav-section summary::-webkit-details-marker {
    display: none;
}

.nav-section[open] summary {
    background: #22313a;
    color: #ffffff;
}

.nav-arrow {
    color: #b5c3cc;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.nav-section[open] .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu {
    display: grid;
    gap: 2px;
    padding: 5px;
}

.nav-submenu a {
    color: #cbd8df;
    font-size: 14px;
    padding: 8px 10px 8px 18px;
}

.nav-submenu a:hover,
.nav-submenu a.active {
    padding-left: 22px;
}

.nav-logout {
    margin-top: 4px;
}

.main {
    min-width: 0;
    padding: 24px;
}

.topbar {
    align-items: flex-start;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.topbar h1 {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 4px;
}

.topbar p {
    color: var(--muted);
    margin: 0;
}

.topbar-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.topbar-meta span {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    padding: 7px 10px;
}

.topbar-link {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--accent);
    padding: 7px 10px;
}

.topbar-link:hover {
    background: #edf1f3;
    text-decoration: none;
}

.project-switcher {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 6px 8px;
}

.project-switcher label {
    align-items: center;
    display: flex;
    gap: 8px;
}

.project-switcher span {
    border: 0;
    color: var(--muted);
    padding: 0;
}

.project-switcher select {
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--text);
    min-height: 28px;
    max-width: 220px;
}

.stats-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 12px;
}

.stat-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stat-card {
    min-height: 58px;
    padding: 8px 10px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    line-height: 1.2;
    margin-bottom: 3px;
}

.stat-card strong {
    font-size: 18px;
    line-height: 1.1;
}

.detail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 14px;
}

.detail-grid article {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 70px;
    padding: 12px;
}

.detail-grid span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
}

.detail-grid strong {
    display: block;
    font-size: 15px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.health-summary {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 10px;
}

.health-summary article {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 7px;
    min-height: 50px;
    padding: 8px 9px;
}

.health-summary span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    line-height: 1.15;
    margin-bottom: 3px;
}

.health-summary strong {
    display: block;
    font-size: 13px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.reset-link-panel {
    margin-bottom: 18px;
}

.reset-link-panel p {
    color: var(--muted);
    margin: 0 16px 10px;
}

.reset-link-panel code {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: block;
    margin: 0 16px 16px;
    overflow-wrap: anywhere;
    padding: 10px;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 18px;
}

.focus-panel {
    margin-bottom: 18px;
}

.focus-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
}

.focus-grid article {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 120px;
    padding: 12px;
}

.focus-grid h3 {
    font-size: 14px;
    margin: 0 0 10px;
}

.focus-grid ul {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.focus-grid li {
    align-items: start;
    display: grid;
    gap: 3px;
}

.focus-grid a {
    font-weight: 700;
}

.focus-grid span {
    color: var(--muted);
    font-size: 12px;
}

.focus-grid span.late {
    color: var(--danger);
    font-weight: 700;
}

.decision-panel {
    margin-bottom: 18px;
}

.decision-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 14px;
}

.decision-card {
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    min-height: 142px;
    padding: 12px;
}

.decision-card h3 {
    font-size: 14px;
    margin: 0 0 10px;
}

.bar-row {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(58px, 1fr) minmax(80px, 2fr) auto;
    margin-bottom: 8px;
}

.bar-row span,
.decision-list span,
.decision-number span {
    color: var(--muted);
    font-size: 12px;
}

.bar-row div {
    background: #e0e8ec;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.bar-row i {
    background: #0f8f6f;
    display: block;
    height: 100%;
}

.decision-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.decision-list li {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.decision-list a {
    font-weight: 700;
}

.decision-split {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.decision-number {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    padding: 12px;
    text-align: center;
    text-decoration: none;
}

.decision-number strong {
    display: block;
    font-size: 26px;
}

.project-context {
    align-items: center;
    background: #eaf2f7;
    border: 1px solid #cfe0e8;
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.project-context strong {
    font-size: 17px;
}

.project-context span {
    color: #4b6576;
}

.alert-panel {
    margin-bottom: 18px;
}

.alert-list {
    display: grid;
    gap: 8px;
    padding: 14px 16px;
}

.alert-item {
    align-items: center;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 7px;
    color: var(--text);
    display: grid;
    gap: 8px;
    grid-template-columns: 92px minmax(0, 1fr) minmax(180px, 0.7fr);
    padding: 10px 12px;
    text-decoration: none;
}

.alert-item:hover {
    border-color: #b8cbd3;
    background: #f7fafb;
}

.alert-item.danger {
    border-left-color: var(--danger);
}

.alert-item.warning {
    border-left-color: var(--warning);
}

.alert-item.info {
    border-left-color: var(--accent);
}

.alert-item strong,
.alert-item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.alert-item small {
    color: var(--muted);
}

.scheduler-status {
    margin-bottom: 18px;
}

.scheduler-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    padding: 16px 18px 10px;
}

.scheduler-details {
    display: grid;
    gap: 10px;
    padding: 0 18px 18px;
}

.scheduler-details p {
    align-items: start;
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 7px;
    display: grid;
    gap: 6px;
    grid-template-columns: 170px minmax(0, 1fr);
    margin: 0;
    padding: 10px 12px;
}

.scheduler-details strong {
    color: var(--text);
    font-size: 13px;
}

.scheduler-details span,
.scheduler-details code {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.scheduler-details span {
    color: var(--muted);
}

.project-home {
    margin-bottom: 18px;
}

.project-home-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.project-home-header h2 {
    font-size: 22px;
    margin: 0 0 4px;
}

.project-home-header p {
    color: var(--muted);
    margin: 0;
}

.project-cards {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.project-card.active {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.project-card > div:first-child {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.project-card strong {
    font-size: 18px;
}

.project-card p {
    color: var(--muted);
    margin: 0;
    min-height: 42px;
}

.project-card dl {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.project-card dt {
    color: var(--muted);
    font-size: 12px;
}

.project-card dd {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.export-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    padding: 16px;
}

.export-complete {
    align-items: center;
    background: #eaf6f1;
    border: 1px solid #b8dfd1;
    border-radius: 8px;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: 16px 16px 0;
    padding: 14px;
}

.export-complete strong {
    display: block;
    margin-bottom: 5px;
}

.export-complete p {
    color: #42675b;
    margin: 0;
}

.export-card {
    align-items: flex-start;
    background: #f8fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 112px;
    padding: 14px;
}

.export-card strong {
    display: block;
    margin-bottom: 6px;
}

.export-card p {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.button-link {
    align-items: center;
    background: #0f8f6f;
    border-radius: 6px;
    color: #ffffff;
    display: inline-flex;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 12px;
    text-decoration: none;
}

.button-link:hover {
    background: #0b6f57;
}

.form-panel {
    margin-bottom: 18px;
}

.page-tabs {
    margin-bottom: 18px;
}

.tab-list {
    background: #e9eef2;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    padding: 6px;
}

.tab-list .tab-button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #344955;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 36px;
    padding: 7px 12px;
}

.tab-list .tab-button.active,
.tab-list .tab-button:hover {
    background: #ffffff;
    color: var(--accent-dark);
}

.panel {
    overflow: hidden;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-title {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.panel-title h2 {
    font-size: 17px;
    margin: 0;
}

.panel-title span {
    color: var(--muted);
    font-size: 13px;
}

.panel-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

.panel-actions form {
    display: inline;
}

.inline-form {
    align-items: center;
    display: flex;
    gap: 8px;
}

.onboarding-checks {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin: 0;
    padding: 14px;
}

.onboarding-checks legend {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    padding: 0 6px;
}

.inline-form input {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 90px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f9fbfc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.row-unread td {
    background: #f9fbfc;
}

td small {
    color: var(--muted);
    display: block;
    font-size: 12px;
    margin-top: 2px;
}

.badge {
    background: #edf1f3;
    border-radius: 999px;
    color: #40505b;
    display: inline-block;
    font-size: 12px;
    padding: 3px 8px;
    white-space: nowrap;
}

.badge.faible,
.badge.success {
    background: #e7f4ed;
    color: var(--success);
}

.badge.moyen,
.badge.warning {
    background: #fff4dd;
    color: var(--warning);
}

.badge.eleve,
.badge.error,
.badge.danger,
.badge.bloque {
    background: #fbe8e8;
    color: var(--danger);
}

.badge.fait {
    background: #e7f4ed;
    color: var(--success);
}

.badge.publie,
.badge.valide {
    background: #e7f4ed;
    color: var(--success);
}

.badge.brouillon,
.badge.idee,
.badge.a_valider,
.badge.a_contacter,
.badge.contacte,
.badge.nouveau,
.badge.a_traiter {
    background: #fff4dd;
    color: var(--warning);
}

.badge.repondu,
.badge.interesse,
.badge.partenaire {
    background: #e7f4ed;
    color: var(--success);
}

.badge.refuse {
    background: #fbe8e8;
    color: var(--danger);
}

.badge.lu,
.badge.ignore {
    background: #edf1f3;
    color: #40505b;
}

.badge.demande {
    background: #fff4dd;
    color: var(--warning);
}

.badge.obtenu {
    background: #e7f4ed;
    color: var(--success);
}

.badge.perdu {
    background: #fbe8e8;
    color: var(--danger);
}

.badge.en_attente,
.badge.en_cours {
    background: #fff4dd;
    color: var(--warning);
}

.badge.termine {
    background: #e7f4ed;
    color: var(--success);
}

.badge.erreur,
.badge.annule {
    background: #fbe8e8;
    color: var(--danger);
}

.badge.actif {
    background: #e7f4ed;
    color: var(--success);
}

.badge.active,
.badge.terminee {
    background: #e7f4ed;
    color: var(--success);
}

.score-pill {
    background: #edf1f3;
    border-radius: 999px;
    color: #40505b;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
    min-width: 38px;
    padding: 3px 9px;
}

.score-pill.fort {
    background: #dff4e8;
    color: #17633a;
}

.score-pill.moyen {
    background: #fff0cf;
    color: #8a5200;
}

.score-pill.faible {
    background: #f3e4e4;
    color: #843030;
}

.badge.preparee {
    background: #eaf2f7;
    color: #305f7f;
}

.badge.pause {
    background: #fff4dd;
    color: var(--warning);
}

.badge.archive {
    background: #edf1f3;
    color: #40505b;
}

.empty {
    color: var(--muted);
}

.empty-state {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.empty-state .button {
    flex: 0 0 auto;
}

.flash {
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.flash.success {
    background: #e7f4ed;
    color: var(--success);
}

.flash.danger {
    background: #fbe8e8;
    color: var(--danger);
}

.flash.info {
    background: #eaf2f7;
    color: #305f7f;
}

.readonly-notice {
    margin-bottom: 14px;
}

.form-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 16px;
}

.form-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid label {
    display: grid;
    gap: 5px;
}

.form-grid label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

.form-grid textarea {
    min-height: 84px;
    resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(20, 108, 92, 0.12);
}

.form-grid .wide {
    grid-column: span 2;
}

.form-grid .full {
    grid-column: 1 / -1;
}

.checks {
    align-content: start;
    display: grid;
    gap: 8px;
    grid-column: span 2;
    padding-top: 20px;
}

.checks label {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: 8px;
}

.checks input {
    min-height: auto;
    width: auto;
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 10px;
}

button,
.button {
    background: var(--accent);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 14px;
}

.button.secondary {
    background: #edf1f3;
    color: var(--text);
}

.button.secondary:hover {
    background: #dce5ea;
    color: var(--text);
}

.button.scheduler-button {
    background: #d45500;
    color: #ffffff;
}

.button.scheduler-button:hover {
    background: #b14400;
    color: #ffffff;
}

.button.sync-button {
    background: #0077c8;
    color: #ffffff;
}

.button.sync-button:hover {
    background: #005f9f;
    color: #ffffff;
}

.button.schedule-button {
    background: #e85d04;
    color: #ffffff;
}

.button.schedule-button:hover {
    background: #c94f03;
    color: #ffffff;
}

button:hover,
.button:hover {
    background: var(--accent-dark);
    color: #ffffff;
    text-decoration: none;
}

.row-actions {
    white-space: nowrap;
}

.row-actions form {
    display: inline;
}

.compact-actions {
    align-items: center;
    white-space: nowrap;
    gap: 5px;
}

.compact-actions form {
    display: inline-flex;
}

.icon-action {
    align-items: center;
    background: #edf1f3;
    border: 0;
    border-radius: 6px;
    color: #33444f;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    line-height: 1;
    min-height: 30px;
    min-width: 30px;
    padding: 0;
    text-decoration: none;
    width: 30px;
}

.icon-action:hover {
    background: #dce5ea;
    color: var(--accent-dark);
    text-decoration: none;
}

.icon-action.add {
    background: #e4f3ec;
    color: var(--success);
}

.icon-action.add:hover {
    background: #d0eadc;
    color: #17633a;
}

.icon-action.link {
    background: #e8f0fa;
    color: #305f7f;
}

.icon-action.link:hover {
    background: #d4e3f3;
    color: #21465f;
}

.icon-action.watch {
    background: #f0e8fa;
    color: #5b3f7f;
}

.icon-action.watch:hover {
    background: #e2d4f3;
    color: #442d61;
}

.icon-action.contact {
    background: #e5f4f3;
    color: #146c6a;
}

.icon-action.contact:hover {
    background: #cfe9e7;
    color: #0f514f;
}

.icon-action.done {
    background: #dff4e8;
    color: #17633a;
}

.icon-action.done:hover {
    background: #c8ead8;
    color: #0f4f2f;
}

.icon-action.danger {
    background: #f3e4e4;
    color: var(--danger);
}

.icon-action.danger:hover {
    background: #ead0d0;
    color: #7f2626;
}

.row-actions > a[href*="?edit="],
.row-actions form:last-child .link-danger {
    align-items: center;
    background: #edf1f3;
    border-radius: 6px;
    color: #33444f;
    display: inline-flex;
    font-size: 0;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    line-height: 1;
    margin-left: 5px;
    min-height: 30px;
    min-width: 30px;
    padding: 0;
    text-decoration: none;
    width: 30px;
}

.row-actions > a[href*="?edit="]::before {
    content: "✎";
    font-size: 15px;
}

.row-actions form:last-child .link-danger {
    background: #f3e4e4;
    color: var(--danger);
}

.row-actions form:last-child .link-danger::before {
    content: "×";
    font-size: 17px;
}

.row-actions > a[href*="?edit="]:hover {
    background: #dce5ea;
    color: var(--accent-dark);
    text-decoration: none;
}

.row-actions form:last-child .link-danger:hover {
    background: #ead0d0;
    color: #7f2626;
    text-decoration: none;
}

.link-danger {
    background: transparent;
    color: var(--danger);
    font-weight: 400;
    min-height: auto;
    padding: 0 0 0 8px;
}

.link-danger:hover {
    background: transparent;
    color: #7f2626;
    text-decoration: underline;
}

.link-action {
    background: transparent;
    color: var(--accent);
    font-weight: 400;
    min-height: auto;
    padding: 0 0 0 8px;
}

.link-action:hover {
    background: transparent;
    color: var(--accent-dark);
    text-decoration: underline;
}

.notice-list {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
}

.notice {
    border-left: 4px solid var(--accent);
    padding: 8px 10px;
}

.notice strong,
.notice span {
    display: block;
}

.notice span {
    color: var(--muted);
    margin-top: 2px;
}

.help-trigger {
    align-items: center;
    background: #ffb000;
    border: 0;
    border-radius: 999px;
    bottom: 22px;
    box-shadow: 0 12px 32px rgba(23, 32, 38, 0.24);
    color: #172026;
    cursor: pointer;
    display: flex;
    font-size: 24px;
    font-weight: 800;
    height: 54px;
    justify-content: center;
    position: fixed;
    right: 22px;
    width: 54px;
    z-index: 80;
}

.help-trigger:hover {
    background: #ffc23d;
}

.help-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    bottom: 88px;
    box-shadow: 0 24px 80px rgba(23, 32, 38, 0.26);
    max-height: min(680px, calc(100vh - 120px));
    overflow: auto;
    padding: 18px;
    position: fixed;
    right: 22px;
    width: min(430px, calc(100vw - 44px));
    z-index: 79;
}

.help-panel-header {
    align-items: start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.help-panel-header span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.help-panel h2,
.help-panel h3 {
    margin: 0;
}

.help-panel h2 {
    font-size: 20px;
}

.help-panel h3 {
    font-size: 14px;
    margin-top: 16px;
}

.help-panel p {
    color: var(--muted);
    margin: 0 0 12px;
}

.help-panel ol,
.help-panel ul {
    display: grid;
    gap: 7px;
    margin: 8px 0 0;
    padding-left: 20px;
}

.help-panel dl {
    display: grid;
    gap: 8px;
    margin: 8px 0 0;
}

.help-panel dt {
    font-weight: 700;
}

.help-panel dd {
    color: var(--muted);
    margin: -6px 0 0;
}

.help-close {
    align-items: center;
    background: #edf1f3;
    border: 0;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.help-close:hover {
    background: #dce5ea;
}

.help-doc-link {
    margin-top: 16px;
}

.documentation-hero {
    margin-bottom: 18px;
}

.documentation-hero p {
    color: var(--muted);
    margin: 0;
    padding: 0 18px 18px;
}

.workflow-list,
.doc-page-list,
.rules-grid {
    display: grid;
    gap: 12px;
    padding: 16px 18px 18px;
}

.workflow-step,
.doc-page-card,
.rules-grid article {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
}

.workflow-step h3,
.doc-page-card h3,
.rules-grid h3 {
    margin: 0 0 6px;
}

.workflow-step p,
.doc-page-card p,
.rules-grid p {
    color: var(--muted);
    margin: 0;
}

.doc-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.doc-links a,
.doc-page-card > a {
    background: #edf1f3;
    border-radius: 6px;
    color: var(--accent);
    display: inline-flex;
    font-weight: 700;
    padding: 6px 9px;
    text-decoration: none;
}

.doc-links a:hover,
.doc-page-card > a:hover {
    background: #dce5ea;
}

.rules-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.doc-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.doc-page-card {
    display: grid;
    gap: 10px;
}

.doc-page-card small {
    color: var(--muted);
}

.doc-page-card ol {
    color: var(--muted);
    margin: 0;
    padding-left: 18px;
}

@media (max-width: 1000px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .decision-grid,
    .detail-grid,
    .focus-grid,
    .health-summary,
    .project-cards,
    .rules-grid,
    .doc-page-list,
    .form-grid,
    .form-grid.compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .alert-item {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .alert-item small {
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 16px;
    }

    .topbar {
        display: grid;
    }

    .project-home-header,
    .project-context,
    .export-complete {
        align-items: stretch;
        display: grid;
    }

    .tab-list {
        display: grid;
    }

    .dashboard-grid,
    .decision-grid,
    .detail-grid,
    .focus-grid,
    .health-summary,
    .project-cards,
    .rules-grid,
    .doc-page-list,
    .form-grid,
    .form-grid.compact,
    .nav {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .empty-state {
        align-items: flex-start;
        display: grid;
    }

    .form-grid .wide,
    .checks {
        grid-column: 1 / -1;
    }

    .alert-item {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .alert-item small {
        grid-column: auto;
        white-space: normal;
    }

    .scheduler-details p {
        align-items: start;
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .help-trigger {
        bottom: 16px;
        height: 48px;
        right: 16px;
        width: 48px;
    }

    .help-panel {
        bottom: 74px;
        right: 16px;
        width: calc(100vw - 32px);
    }
}
