:root {
  --bg: #FFFFFF;
  --bg-soft: #F7F7F5;
  --surface: #FFFFFF;
  --ink: #37352F;
  --ink-soft: #8A8886;
  --line: #EBEBEA;
  --line-strong: #DEDEDC;
  --primary: #2F7B67;
  --primary-dark: #256155;
  --accent: #4e73df;
  --radius: 8px;
  --font-sans: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
body { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 14.5px; }
.view { display:none; }
.view.active { display:block; }

.auth-screen { display:flex; min-height:100vh; align-items:center; justify-content:center; background: var(--bg-soft); }
.login-card { width: 340px; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.04); }

.app-navbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: .55rem 1rem; }
.app-navbar .navbar-brand { font-weight:600; letter-spacing:-.01em; color: var(--ink); }
.app-navbar .navbar-brand i { color: var(--primary); }
.app-navbar .nav-btn { color: var(--ink-soft); border: none; background: none; font-size:.85rem; padding: .3rem .2rem; border-bottom: 2px solid transparent; border-radius: 0; }
.app-navbar .nav-btn.active-tab { color: var(--ink); font-weight:600; border-bottom-color: var(--accent); }
.app-navbar .user-toggle { color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: var(--radius); }
.app-navbar .user-toggle:hover { background: var(--bg-soft); }

/* Late-tasks bell badge — positioned inside the button's own box (not
   Bootstrap's top-0/start-100/translate-middle, which pushed it out far
   enough to overlap the neighboring settings icon). */
#lateBadgeCount { position:absolute; top:2px; right:2px; font-size:.6rem; line-height:1; padding:.2em .4em; }
#lateBadgeBtn:has(#lateBadgeCount:not(.d-none)) i.bi-bell { display:inline-block; transform-origin:top center; animation: late-bell-wiggle 2.4s ease-in-out infinite; }
@keyframes late-bell-wiggle {
  0%, 92%, 100% { transform: rotate(0); }
  93% { transform: rotate(-12deg); }
  94.5% { transform: rotate(10deg); }
  96% { transform: rotate(-8deg); }
  97.5% { transform: rotate(6deg); }
  99% { transform: rotate(0); }
}

.btn { border-radius: var(--radius); font-size:.85rem; box-shadow:none !important; }
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-secondary { color: var(--ink-soft); border-color: var(--line-strong); }
.btn-outline-secondary:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--line-strong); }
.form-control, .form-select { border-radius: var(--radius); border-color: var(--line-strong); font-size:.85rem; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 .15rem rgba(47,123,103,.15); }
.form-control:disabled { background: var(--bg-soft); color: var(--ink-soft); }
.card { border-radius: var(--radius); border-color: var(--line); box-shadow: none; }
.shadow, .shadow-sm { box-shadow: 0 1px 2px rgba(0,0,0,.04) !important; }
.modal-content { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.08); }

.tag { display:inline-flex; align-items:center; font-size:.7rem; padding:.1rem .5rem; border-radius:999px; border:1px solid; white-space:nowrap; }

th.small-th { font-size:.75rem; font-weight:600; }
table thead th.small-th { background: var(--bg-soft); color: var(--ink-soft); border-color: var(--line); text-transform:uppercase; letter-spacing:.02em; }
table.table-striped-custom tbody tr:nth-child(even) { background: var(--bg-soft); }
table.table-striped-custom td, table.table-striped-custom th { border-color: var(--line); }
/* Colored banner on edit/create modal headers */
.modal-header.banner { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.modal-header.banner .modal-title { color: var(--ink); font-size:1rem; font-weight:600; }
.modal-header.banner .btn-close { font-size:.75rem; }

/* Bold field labels (project/task/profile forms) */
.bold-label { font-weight:700; font-size:.78rem; color: var(--ink-soft); text-transform:uppercase; letter-spacing:.02em; }

.brand-icon { color: var(--primary); }
.section-title { font-size:.85rem; font-weight:600; margin-bottom:1rem; }
.coming-soon { color: var(--ink-soft); font-style:italic; }

/* Main menu: 6 entries — scroll horizontally on narrow screens instead of wrapping */
.app-navbar .nav-links { overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch; }

/* No focus ring on the main menu (it showed up after clicks too): keyboard focus is shown by the text color instead */
.app-navbar .nav-btn:focus { outline:none; box-shadow:none; }

/* Transactions list */
.tx-table td { font-size:.82rem; }
.amount-in { color: #2F9E6E; }
.amount-out { color: #C1443C; }
.pagination .page-link { color: var(--ink); border-color: var(--line-strong); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); color:#fff; }
.tx-inactive td { opacity:.5; }
.app-navbar .nav-btn:focus-visible { color: var(--primary); }
.tx-table td .icon-btn + .icon-btn { margin-left:.15rem; }

/* Dashboards (Trésorerie, Résultats) */
.dash-section { font-size:.8rem; font-weight:600; text-transform:uppercase; letter-spacing:.02em; color: var(--ink); margin-bottom:.6rem; }
.stat-tile { background: var(--surface); border:1px solid var(--line); border-radius: var(--radius); padding:.8rem 1rem; height:100%; }
.stat-label { font-size:.75rem; color: var(--ink-soft); text-transform:uppercase; letter-spacing:.02em; }
.stat-value { font-size:1.35rem; font-weight:600; font-variant-numeric: tabular-nums; margin:.15rem 0; }
.stat-sub { font-size:.72rem; color: var(--ink-soft); }
