/* Bootstrap CSS & Icons sont chargés via <link> dans src/routes/__root.tsx */

/* Bootstrap CSS & Icons sont chargés via <link> dans src/routes/__root.tsx */

:root {
  --brand: #173d83;
  --brand-dark: #0f2a5c;
  --brand-light: #2456b8;
  --brand-soft: #eef2fb;
  --sidebar-width: 270px;
  --topbar-height: 64px;
  --bs-primary: #173d83;
  --bs-primary-rgb: 23, 61, 131;
  --bs-link-color: #173d83;
  --bs-link-hover-color: #0f2a5c;
}

html, body, #root { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f4f6fb;
  color: #1f2a44;
  -webkit-font-smoothing: antialiased;
}

/* === Bootstrap primary overrides === */
.btn-primary {
  background-color: var(--brand);
  border-color: var(--brand);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  background-color: var(--brand-dark) !important;
  border-color: var(--brand-dark) !important;
  box-shadow: 0 4px 14px rgba(23, 61, 131, 0.25);
}
.btn-outline-primary {
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.text-primary { color: var(--brand) !important; }
.bg-primary { background-color: var(--brand) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 0.2rem rgba(23, 61, 131, 0.15);
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

/* === AUTH PAGE === */
.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 991px) { .auth-shell { grid-template-columns: 1fr; } .auth-hero { display: none !important; } }

.auth-hero {
  position: relative;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255,255,255,0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(255,255,255,0.08), transparent 60%),
    linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 60%, var(--brand-light) 100%);
  color: #fff;
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 75%);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: .85rem; font-weight: 700; font-size: 1.05rem; position: relative; z-index: 1; }
.auth-brand-logo {
  background: #fff;
  border-radius: 18px;
  padding: 12px 18px;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px -8px rgba(0,0,0,0.4);
}
.auth-brand-logo img { height: 88px; width: auto; display: block; }
.auth-hero-content { position: relative; z-index: 1; }
.auth-hero h1 { font-size: 2.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.auth-hero p { opacity: .85; font-size: 1.05rem; max-width: 480px; }
.auth-stats { display: flex; gap: 2.5rem; position: relative; z-index: 1; }
.auth-stat .num { font-size: 1.8rem; font-weight: 700; }
.auth-stat .lbl { font-size: .8rem; opacity: .75; text-transform: uppercase; letter-spacing: .08em; }

.auth-form-wrap {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2rem; background: #fff;
}
.auth-form { width: 100%; max-width: 420px; }
.auth-form h2 { font-weight: 700; color: var(--brand-dark); letter-spacing: -0.01em; }
.auth-form .form-label { font-size: .85rem; font-weight: 600; color: #4a5878; margin-bottom: .35rem; }
.auth-form .form-control { padding: .75rem 1rem; border-radius: 10px; border-color: #e3e8f1; }
.auth-form .input-group-text { background: #fff; border-color: #e3e8f1; color: #94a3b8; }
.btn-brand {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff; border: 0; padding: .85rem 1rem; border-radius: 10px;
  font-weight: 600; letter-spacing: .02em;
  box-shadow: 0 8px 20px -8px rgba(23, 61, 131, 0.5);
  transition: all .2s ease;
}
.btn-brand:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(23, 61, 131, 0.6); color: #fff; }

/* === ADMIN LAYOUT === */
.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid #e6ebf3;
  position: fixed; top: 0; bottom: 0; left: 0;
  display: flex; flex-direction: column;
  z-index: 1030;
  transition: transform .25s ease;
}

.sidebar1 {
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid #e6ebf3;
  position: absolute; top: 0;
  display: flex; flex-direction: column;
  z-index: 1030;
  transition: transform .25s ease;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex; align-items: center; gap: .65rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid #eef1f6;
  font-weight: 700; color: var(--brand-dark);
}
.sidebar-mark, .sidebar-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: #fff; border: 1px solid #e6ebf3;
  display: grid; place-items: center; overflow: hidden;
  flex-shrink: 0;
}
.sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }
.sidebar-mark {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(23, 61, 131, 0.45);
}
.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 1rem .5rem 2rem;
  scrollbar-width: thin; scrollbar-color: #c8d1e0 transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #d2dae8; border-radius: 4px; }

.nav-group-label {
  padding: .85rem .9rem .35rem;
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: #94a3b8;
}
.nav-item-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .55rem .9rem;
  margin: 1px .25rem;
  border-radius: 8px;
  color: #4a5878; text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-item-link i { font-size: 1rem; width: 18px; text-align: center; color: #94a3b8; }
.nav-item-link:hover { background: var(--brand-soft); color: var(--brand); }
.nav-item-link:hover i { color: var(--brand); }
.nav-item-link.active {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(23, 61, 131, 0.5);
}
.nav-item-link.active i { color: #fff; }

.nav-collapser {
  width: 100%; background: transparent; border: 0;
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .9rem;
  margin: 1px .25rem;
  border-radius: 8px;
  color: #4a5878; font-size: .9rem; font-weight: 500;
  text-align: left;
  transition: background .15s ease;
}
.nav-collapser:hover { background: #f4f6fb; }
.nav-collapser .chev { margin-left: auto; transition: transform .2s ease; font-size: .85rem; color: #94a3b8; }
.nav-collapser[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-collapser .lead-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: .95rem;
}

/* === MAIN === */
.main-area {
  margin-left: var(--sidebar-width);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid #e6ebf3;
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 1020;
}
.topbar-search {
  flex: 1; max-width: 420px;
  position: relative;
}
.topbar-search input {
  width: 100%; border: 1px solid #e6ebf3; background: #f4f6fb;
  padding: .55rem .9rem .55rem 2.4rem;
  border-radius: 10px; font-size: .9rem;
}
.topbar-search input:focus { outline: none; border-color: var(--brand-light); background: #fff; }
.topbar-search i { position: absolute; top: 50%; left: .85rem; transform: translateY(-50%); color: #94a3b8; }

.topbar-user {
  display: flex; align-items: center; gap: .65rem;
  padding: .25rem .65rem .25rem .25rem;
  border-radius: 999px; cursor: pointer;
  transition: background .15s ease;
}
.topbar-user:hover { background: #f4f6fb; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: #fff; display: grid; place-items: center;
  font-weight: 600; font-size: .85rem;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid #e6ebf3; background: #fff;
  display: grid; place-items: center; color: #4a5878;
  position: relative; cursor: pointer;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--brand); border-color: var(--brand-light); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ef4444; border: 2px solid #fff;
}

.page-content { padding: 1.75rem; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--brand-dark); letter-spacing: -0.01em; margin: 0; }
.page-header .lead { color: #64748b; font-size: .95rem; margin-top: .25rem; }
.breadcrumb { font-size: .82rem; margin-bottom: .35rem; }
.breadcrumb a { text-decoration: none; color: #94a3b8; }
.breadcrumb-item.active { color: var(--brand); font-weight: 500; }

/* === Cards / KPI === */
.card { border: 1px solid #eaeef6; border-radius: 14px; box-shadow: 0 1px 2px rgba(20,30,60,0.03); }
.card-title { color: var(--brand-dark); font-weight: 600; }

.kpi-card { padding: 1.25rem 1.35rem; }
.kpi-card .label { font-size: .78rem; color: #64748b; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi-card .value { font-size: 1.85rem; font-weight: 700; color: var(--brand-dark); margin: .35rem 0 .15rem; letter-spacing: -.01em; }
.kpi-card .delta { font-size: .82rem; font-weight: 600; }
.kpi-card .delta.up { color: #16a34a; }
.kpi-card .delta.down { color: #ef4444; }
.kpi-card .icon-wrap {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 1.4rem;
}

.section-title { font-size: 1.05rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 1rem; }

.badge-soft-primary { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.badge-soft-success { background: #e6f7ee; color: #0f8a4a; font-weight: 600; }
.badge-soft-warning { background: #fff4e0; color: #b97500; font-weight: 600; }

.placeholder-page {
  background: #fff; border: 1px dashed #d9e0ee; border-radius: 14px;
  padding: 3rem 2rem; text-align: center; color: #64748b;
}
.placeholder-page .ico {
  width: 64px; height: 64px; border-radius: 16px; margin: 0 auto 1rem;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 1.8rem;
}

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
}

/* === Chart cards (professional) === */
.chart-card { position: relative; overflow: hidden; transition: box-shadow .25s ease, transform .25s ease; }
.chart-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-light) 100%);
  opacity: .9;
}
.chart-card:hover { box-shadow: 0 8px 24px rgba(20,30,60,0.08); transform: translateY(-2px); }
.chart-card .card-body { padding: 1.25rem 1.35rem 1rem; }
.chart-card .chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; margin-bottom: .85rem; }
.chart-card .chart-title { font-size: .82rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .07em; margin: 0; }
.chart-card .chart-sub { font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); letter-spacing: -.01em; margin-top: .15rem; }
.chart-card .chart-icon {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 1rem; flex-shrink: 0;
}

/* === Data tables (professional) === */
.data-card .card-body { padding: 0; }
.data-card .data-head {
  padding: 1.1rem 1.35rem; border-bottom: 1px solid #eef1f6;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.data-card .data-head .section-title { margin: 0; }
.data-card .data-head .data-sub { font-size: .8rem; color: #94a3b8; margin-top: .15rem; }
.data-card .data-head .data-badge {
  font-size: .72rem; font-weight: 600; padding: .35rem .65rem;
  background: var(--brand-soft); color: var(--brand); border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}

.table-pro { margin: 0; }
.table-pro thead th {
  background: #f8fafc;
  font-size: .72rem; font-weight: 600; color: #64748b;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .85rem 1.35rem; border-bottom: 1px solid #eef1f6; border-top: 0;
  white-space: nowrap;
}
.table-pro tbody td {
  padding: .9rem 1.35rem; border-top: 1px solid #f1f4f9;
  color: #334155; font-size: .9rem; vertical-align: middle;
}
.table-pro tbody tr:hover td { background: #fafbfd; }
.table-pro tbody tr:last-child td { border-bottom: 0; }
.table-pro td.cat { font-weight: 600; color: var(--brand-dark); }
.table-pro td.num { font-variant-numeric: tabular-nums; font-weight: 500; color: #1f2a44; }
.table-pro tfoot td, .table-pro tr.total td {
  background: #f8fafc; font-weight: 700; color: var(--brand-dark);
  border-top: 2px solid #e2e8f0;
}

/* === Pro form inputs (section page) === */
.form-pro .form-label {
  font-size: .78rem; font-weight: 600; color: #4a5878;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: .4rem;
}
.form-pro .form-control,
.form-pro .form-select {
  border: 1px solid #e3e8f1;
  background: #f8fafc;
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .92rem;
  color: #1f2a44;
  box-shadow: inset 0 1px 2px rgba(20,30,60,0.02);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.form-pro .form-control::placeholder { color: #94a3b8; }
.form-pro .form-control:hover,
.form-pro .form-select:hover { border-color: #c8d2e3; background: #fff; }
.form-pro .form-control:focus,
.form-pro .form-select:focus {
  border-color: var(--brand-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 61, 131, 0.10);
  outline: none;
}
.form-pro textarea.form-control { min-height: 120px; resize: vertical; line-height: 1.5; }
.form-pro .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 14px;
  padding-right: 2.4rem;
}
.form-pro input[type="date"].form-control { font-variant-numeric: tabular-nums; }

.dashboard-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  border: 1px solid transparent;
  font-family: var(--font-display);
}

/* Action buttons */
.operators-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--muted-color);
  cursor: pointer;
  transition: all 0.2s;
}
.operators-action-btn:hover {
  background: var(--copper);
  color: #fff;
  border-color: var(--copper);
}
.operators-action-btn-danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.sidebar-chapter {
  padding: 0.85rem 1.25rem 0.35rem;
  margin-top: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #1f2a44;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.sidebar-nav > div:first-child > .sidebar-chapter,
.sidebar-chapter:first-child {
  border-top: none;
  margin-top: 0;
}
