:root {
    --fc-primary: #3056d3;
    --fc-soft: #eef3ff;
    --fc-text: #1f2937;
    --fc-text-strong: #111827;
    --fc-text-muted: #374151;
    --fc-surface-soft: #f8fafc;
}

body {
    background: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
    min-height: 100vh;
    color: var(--fc-text);
}

.navbar-brand {
    letter-spacing: 0.02em;
}

.card {
    border: none;
    border-radius: 1rem;
    box-shadow: 0 12px 30px rgba(47, 72, 112, 0.08);
}

.card-title {
    color: var(--fc-text-strong);
}

.metric-box {
    background: var(--fc-soft);
    border-radius: 0.9rem;
    padding: 1rem;
    color: var(--fc-text-strong);
}

.table thead th {
    white-space: nowrap;
}

.table-tools {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(48, 86, 211, 0.16);
    border-radius: 0.9rem;
    padding: 0.9rem;
}

.table-tools label.text-muted,
.table-tools .text-muted {
    color: var(--fc-text-muted) !important;
}

.table-sortable thead th[data-sortable-column] {
    cursor: pointer;
    position: relative;
    user-select: none;
    padding-right: 1.75rem;
}

.table-sortable thead th[data-sortable-column]::after {
    content: '↕';
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #64748b;
}

.table-sortable thead th[data-sort-direction="asc"]::after {
    content: '↑';
    color: var(--fc-primary);
}

.table-sortable thead th[data-sort-direction="desc"]::after {
    content: '↓';
    color: var(--fc-primary);
}

.table-sortable thead th[data-sortable-column]:hover {
    background: rgba(48, 86, 211, 0.06);
}

.table-empty-state {
    border-style: dashed;
    background: var(--fc-surface-soft);
    color: var(--fc-text);
}

.text-muted {
    color: var(--fc-text-muted) !important;
}

small.text-muted,
.footer-note {
    color: var(--fc-text-muted) !important;
}

.alert-light {
    color: #111827;
}

.form-text {
    color: var(--fc-text) !important;
}

.form-control::placeholder,
.form-select::placeholder,
textarea.form-control::placeholder {
    color: #6b7280;
    opacity: 1;
}

.badge-soft {
    background-color: var(--fc-soft);
    color: var(--fc-primary);
}

.badge-action-add {
    background-color: #dcfce7;
    color: #166534;
}

.badge-action-delete {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-action-calc {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.badge-action-export {
    background-color: #ede9fe;
    color: #6d28d9;
}

.badge-action-login {
    background-color: #ccfbf1;
    color: #0f766e;
}

.badge-action-logout {
    background-color: #f3f4f6;
    color: #374151;
}

.badge-action-failure {
    background-color: #fef3c7;
    color: #92400e;
}

.footer-note {
    font-size: 0.95rem;
}


/* Castellum : marque, tuiles du tableau de bord, administration */
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: var(--fc-primary);
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
}

.navbar .nav-link.active {
    color: var(--fc-primary);
}

.tool-tile {
    color: var(--fc-text);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.tool-tile:hover,
a.tool-tile:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(47, 72, 112, 0.14);
}

.tool-tile-soon {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: none;
    border: 1px dashed rgba(48, 86, 211, 0.25);
}

.tool-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.8rem;
    background: var(--fc-soft);
    color: var(--fc-primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.tool-icon-admin {
    background: #fff4e5;
    color: #9a5b00;
}

.metric-box-warning {
    background: #fff4e5;
}

.admin-table td input[name="nom"] {
    min-width: 9rem;
}

.admin-table td input[type="email"] {
    min-width: 15rem;
}

.admin-table td select {
    min-width: 10rem;
}

.admin-table .input-dix {
    min-width: 6rem;
    max-width: 7rem;
}

/* Statuts de paiement et comptes bloqués */
.badge-paye {
    background: #e7f6ec;
    color: #1d6b3a;
}

.badge-a-payer {
    background: #fff4e5;
    color: #8a4b00;
}

.badge-bloque {
    background: #fde8e8;
    color: #9b1c1c;
}

/* Tableau d'administration des copropriétaires : actions compactes */
.admin-table .actions-cell {
    white-space: nowrap;
    width: 1%;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
}

.admin-table .btn-enregistrer:disabled {
    background: transparent;
    border-color: #ced4da;
    color: #6c757d;
}

.admin-table tr.ligne-modifiee > td {
    background: var(--fc-soft);
}

.dialog-castellum {
    border: none;
    border-radius: 1rem;
    padding: 1.5rem;
    width: min(26rem, calc(100vw - 2rem));
    box-shadow: 0 24px 60px rgba(17, 24, 39, 0.25);
}

.dialog-castellum::backdrop {
    background: rgba(17, 24, 39, 0.45);
}

.metric-box-ok {
    background: #e7f6ec;
}

/* Barre de navigation */
.castellum-nav .nav-link {
    color: var(--fc-text-muted);
    font-weight: 500;
    border-radius: 0.5rem;
}

.castellum-nav .nav-link:hover,
.castellum-nav .nav-link:focus-visible {
    color: var(--fc-primary);
}

.castellum-nav .nav-link.active {
    color: var(--fc-primary);
}

@media (min-width: 992px) {
    .castellum-nav .navbar-nav > .nav-item > .nav-link {
        padding: 0.5rem 0.85rem;
    }

    .castellum-nav .navbar-nav > .nav-item > .nav-link.active {
        background: var(--fc-soft);
    }
}

.castellum-nav .dropdown-menu {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 12px 30px rgba(47, 72, 112, 0.14);
    padding: 0.4rem;
}

.castellum-nav .dropdown-item {
    border-radius: 0.5rem;
    padding: 0.45rem 0.75rem;
}

.castellum-nav .dropdown-item.active,
.castellum-nav .dropdown-item:active {
    background: var(--fc-soft);
    color: var(--fc-primary);
    font-weight: 600;
}

.castellum-nav .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: var(--fc-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Agenda */
.agenda-date {
    flex: 0 0 auto;
    width: 3.25rem;
    border-radius: 0.75rem;
    background: var(--fc-soft);
    color: var(--fc-primary);
    padding: 0.35rem 0;
    line-height: 1.1;
}

.agenda-date-jour {
    font-size: 1.3rem;
    font-weight: 700;
}

.agenda-date-semaine {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.agenda-date-sm {
    width: 2.9rem;
}

.agenda-date-sm .agenda-date-jour {
    font-size: 1.1rem;
}

.agenda-description {
    color: var(--fc-text-muted);
    white-space: pre-line;
}

.min-w-0 {
    min-width: 0;
}

.tool-icon-sm {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
    border-radius: 0.6rem;
}
