﻿:root {
  --font-main: 'Manrope', sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow-soft: 0 18px 45px rgba(12, 40, 68, 0.12);
  --sidebar-width: 290px;
  --sidebar-width-collapsed: 108px;
}

body[data-theme='maritime'] {
  --bg-main: #eef6fb;
  --bg-grad-1: rgba(27, 154, 170, 0.18);
  --bg-grad-2: rgba(15, 76, 129, 0.12);
  --surface: #ffffff;
  --surface-soft: #f6fbff;
  --text-main: #10243e;
  --text-muted: #6b7b90;
  --primary: #0f4c81;
  --secondary: #1b9aaa;
  --accent: #f2b134;
  --success: #198754;
  --danger: #c0392b;
  --border: rgba(15, 76, 129, 0.10);
  --sidebar-start: #0d3558;
  --sidebar-end: #13496f;
  --icon-tone: #76d7ea;
  --icon-soft: rgba(118, 215, 234, 0.16);
  --icon-strong: #0f4c81;
}

body[data-theme='finance'] {
  --bg-main: #f4f7f4;
  --bg-grad-1: rgba(25, 135, 84, 0.15);
  --bg-grad-2: rgba(52, 58, 64, 0.09);
  --surface: #ffffff;
  --surface-soft: #f8faf8;
  --text-main: #1c2b23;
  --text-muted: #6a746f;
  --primary: #198754;
  --secondary: #2d6a4f;
  --accent: #95d5b2;
  --success: #198754;
  --danger: #b02a37;
  --border: rgba(25, 135, 84, 0.10);
  --sidebar-start: #1f2d2a;
  --sidebar-end: #2d4d44;
  --icon-tone: #7ed957;
  --icon-soft: rgba(126, 217, 87, 0.16);
  --icon-strong: #198754;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top left, var(--bg-grad-1), transparent 28%), radial-gradient(circle at bottom right, var(--bg-grad-2), transparent 25%), var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

html[dir='rtl'] body { font-family: var(--font-ar); }
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  inset-inline-start: 0;
  top: 0;
  background: linear-gradient(180deg, var(--sidebar-start), var(--sidebar-end));
  color: #fff;
  padding: 1.5rem 1.2rem;
  box-shadow: var(--shadow-soft);
  z-index: 1030;
  overflow: hidden;
}
.sidebar-shell {
  min-height: calc(100vh - 3rem);
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline-end: .2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.24) transparent;
}
.sidebar-shell::-webkit-scrollbar { width: 8px; }
.sidebar-shell::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22);
  border-radius: 999px;
}
.main-content { margin-inline-start: var(--sidebar-width); padding: 2rem; transition: margin-inline-start .24s ease; }
.sidebar-toggle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: .15rem;
  padding: 0;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
}
.sidebar-toggle .icon {
  color: #ffffff;
  font-size: .8rem;
}
.sidebar-toggle:hover {
  background: rgba(255,255,255,.16);
  border-color: rgba(255,255,255,.22);
}
.brand-box, .topbar, .page-card, .stat-card { background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.brand-box {
  background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.06));
  color: #fff;
  border-radius: 24px;
  padding: 1.35rem 1.15rem 1.1rem;
  margin-bottom: 1.75rem;
  border: 1px solid rgba(255,255,255,.12);
}
.brand-box small { color: rgba(255,255,255,.72); }
.sidebar-logo, .topbar-logo { object-fit: contain; flex: 0 0 auto; }
.sidebar-logo { width: 78px; height: 78px; }
.topbar-logo { width: 36px; height: 36px; }
.brand-title { letter-spacing: .03em; }
.sidebar-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .9rem;
}
.sidebar-brand-logo-wrap {
  width: 106px;
  height: 106px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, rgba(255,255,255,.28), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 18px 34px rgba(3, 18, 31, 0.18);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.sidebar-brand-name {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .4rem;
  line-height: 1;
}
.brand-main {
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: .04em;
}
.brand-accent-text {
  font-size: 1rem;
  font-weight: 800;
  color: var(--icon-tone);
  letter-spacing: .18em;
  text-transform: uppercase;
}
.sidebar-brand-subtitle {
  max-width: 220px;
  color: rgba(255,255,255,.76);
  font-size: .9rem;
  line-height: 1.4;
  letter-spacing: .03em;
}
.logo-themeable {
  transition: transform .25s ease, filter .25s ease;
  filter: drop-shadow(0 10px 20px rgba(15, 76, 129, 0.16));
}
.logo-themeable:hover { transform: scale(1.04); }
.logo-float { animation: logoFloat 4.2s ease-in-out infinite; }
body[data-theme='finance'] .logo-themeable {
  filter: hue-rotate(55deg) saturate(.95) drop-shadow(0 10px 22px rgba(25, 135, 84, 0.18));
}
.auth-logo {
  width: min(100%, 320px);
  height: auto;
  display: inline-block;
}
.app-link {
  color: rgba(255,255,255,.82);
  border-radius: 16px;
  padding: .92rem 1rem;
  display: flex;
  gap: .9rem;
  align-items: center;
  margin-bottom: .42rem;
  border: 1px solid transparent;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.app-link span {
  font-weight: 700;
  letter-spacing: .02em;
}
.app-link:hover,
.app-link.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(255,255,255,.14), rgba(255,255,255,.20));
  border-color: rgba(255,255,255,.12);
  transform: translateX(4px);
}
.icon {
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--icon-strong);
}
.icon:hover {
  transform: scale(1.15);
}
.app-link .icon,
.btn .icon,
.datetime-chip .icon,
.stat-card .icon {
  width: 1.1rem;
}
.app-link:hover .icon,
.btn:hover .icon {
  color: var(--accent, currentColor);
}
.sidebar .app-link .icon {
  color: var(--icon-tone);
}
.sidebar .app-link.active .icon,
.sidebar .app-link:hover .icon {
  color: #ffffff;
}
.topbar .btn .icon,
.datetime-chip .icon {
  color: var(--icon-strong);
}
.stat-card .icon {
  color: var(--icon-strong);
  background: var(--icon-soft);
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
}
.btn-app-primary .icon {
  color: #ffffff;
}
.btn-app-light .icon {
  color: var(--primary);
}
.btn-app-danger .icon {
  color: var(--danger);
}
.badge-soft-info .icon,
.badge-soft-success .icon,
.badge-soft-danger .icon {
  color: inherit;
}
.badge-soft-warning {
  background: color-mix(in srgb, #f59e0b 16%, white);
  color: #b45309;
}
.season-toolbar-badge {
  display: inline-flex;
  align-items: center;
  padding: .55rem .8rem;
  font-size: .84rem;
  border-radius: 999px;
}
.sidebar-divider { height: 1px; background: rgba(255,255,255,.18); }
.sidebar-product-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  text-align: center;
  color: rgba(255,255,255,.68);
  font-size: .78rem;
  line-height: 1.5;
}
.sidebar-footer-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .35rem .6rem;
  border-radius: 999px;
  color: rgba(255,255,255,.82);
  font-weight: 800;
  letter-spacing: .05em;
  transition: background .2s ease, transform .2s ease;
}
.sidebar-footer-line:hover {
  background: rgba(255,255,255,.08);
  transform: translateY(-1px);
}
.sidebar-footer-line .icon {
  color: var(--icon-tone);
  width: auto;
}
.sidebar-footer-version {
  margin-top: .45rem;
  opacity: .78;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sidebar-footer-copy {
  margin-top: .2rem;
  opacity: .62;
}
.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
}
.sidebar-collapsed .main-content {
  margin-inline-start: var(--sidebar-width-collapsed);
}
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .app-link span,
.sidebar-collapsed .sidebar-divider,
.sidebar-collapsed .sidebar-product-footer {
  display: none;
}
.sidebar-collapsed .brand-box {
  padding: .9rem .6rem;
}
.sidebar-collapsed .sidebar-brand-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: 20px;
}
.sidebar-collapsed .sidebar-logo {
  width: 52px;
  height: 52px;
}
.sidebar-collapsed .app-link {
  justify-content: center;
  padding: .85rem .5rem;
}
.sidebar-collapsed .sidebar-toggle {
  display: flex;
  margin-inline: auto;
}
.sidebar-collapsed .app-link:hover,
.sidebar-collapsed .app-link.active {
  transform: none;
}
.topbar, .page-card, .stat-card, .modal-content { border-radius: var(--radius-lg); }
.topbar, .page-card { padding: 1rem 1.25rem; }
.topbar { padding: .9rem 1.15rem; }
.page-title-wrap { line-height: 1.1; }
.page-icon-shell {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-soft);
  border: 1px solid color-mix(in srgb, var(--icon-strong) 18%, white);
  flex: 0 0 auto;
  animation: pageIconFade .35s ease;
}
.page-icon {
  font-size: 20px;
  opacity: .92;
  color: var(--icon-strong);
  transition: transform .2s ease, color .2s ease;
}
.page-icon-shell:hover .page-icon {
  transform: scale(1.08);
  color: var(--primary);
}
.card-head { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.btn-app-primary { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; border: 0; border-radius: var(--radius-sm); font-weight: 700; }
.btn-app-light { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 700; }
.btn-app-danger { background: color-mix(in srgb, var(--danger) 10%, white); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 20%, white); border-radius: var(--radius-sm); font-weight: 700; }
.btn-app-accent { background: color-mix(in srgb, var(--accent) 16%, white); color: var(--primary); border: 1px solid color-mix(in srgb, var(--accent) 38%, white); border-radius: var(--radius-sm); font-weight: 700; }
.btn-app-primary,
.btn-app-light,
.btn-app-danger,
.btn-app-accent,
.btn-action,
.badge,
.season-metric-value {
  white-space: nowrap;
}
.btn-app-primary,
.btn-app-light,
.btn-app-danger,
.btn-app-accent,
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.btn-app-primary,
.btn-app-light,
.btn-app-danger,
.btn-app-accent {
  gap: 8px;
  min-height: 38px;
}
.season-metric-value,
.table-app td .btn-action,
.table-app td .badge {
  direction: ltr;
  unicode-bidi: isolate;
}
.season-tab-tool .btn,
.season-header-actions .btn,
.table-app td .btn-action {
  flex: 0 0 auto;
}
.table-app th,
.table-app td {
  font-variant-numeric: tabular-nums;
}
.season-row-clickable {
  cursor: pointer;
}
.season-row-clickable:hover > td {
  background: color-mix(in srgb, var(--primary) 5%, white);
}
.btn-action {
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  line-height: 1;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.btn-action:hover {
  transform: translateY(-1px);
}
.btn-action i {
  font-size: 13px;
  line-height: 1;
}

.attachment-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}

.attachment-name {
  max-width: 150px;
  font-size: .75rem;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: center;
  word-break: break-word;
}

.attachment-manager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem .9rem;
  border: 1px dashed var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
}

.attachment-meta {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

.attachment-meta-label {
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.inline-source-form {
  margin: 0;
}

.inline-source-select {
  min-width: 190px;
  max-width: 240px;
  margin: 0 auto;
}

.season-expense-stat {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.season-expense-total {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
}

.season-auto-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.crew-incentives-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
td.actions {
  white-space: nowrap;
  text-align: end;
}
td.actions .btn-action {
  margin-right: 5px;
}
html[dir='rtl'] td.actions .btn-action {
  margin-right: 0;
  margin-left: 5px;
}
.table-app {
  width: 100%;
  table-layout: auto;
}
.table-app thead th,
.table-app tbody td {
  vertical-align: middle;
  text-align: center;
}
.table-app tbody td,
.table-app tbody td .season-summary-chip,
.table-app tbody td .btn,
.season-metric-value,
.season-summary-chip strong,
.season-summary-chip span:last-child {
  unicode-bidi: plaintext;
}
.table-app thead th {
  text-transform: uppercase;
  font-size: .82rem;
  color: var(--text-muted);
  background: var(--surface-soft);
}
.table-app thead th:first-child,
.table-app tbody td:first-child {
  text-align: start;
  white-space: nowrap;
}
.table-app thead th:last-child,
.table-app tbody td:last-child {
  text-align: end;
  white-space: nowrap;
}
.table-app tbody td.actions > div {
  justify-content: flex-end;
}
.table-app tbody tr:hover { background: color-mix(in srgb, var(--primary) 5%, white); }
.season-crew-table {
  table-layout: fixed;
  min-width: 1700px;
}

.season-crew-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: .35rem;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent;
}

.season-crew-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.season-crew-table-wrap::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--primary) 28%, white);
  border-radius: 999px;
}

.season-crew-table-wrap::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.season-crew-table .crew-col-sailor {
  width: 240px;
}

.season-crew-table .crew-col-mission {
  width: 170px;
}

.season-crew-table .crew-col-part {
  width: 90px;
}

.season-crew-table .crew-col-presence {
  width: 7%;
}

.season-crew-table .crew-col-ratio {
  width: 6%;
}

.season-crew-table .crew-col-real-part {
  width: 6.5%;
}

.season-crew-table .crew-col-base-amount {
  width: 6.5%;
}

.season-crew-table .crew-col-mission-dynamic {
  width: 6.5%;
}

.season-crew-table .crew-col-incentives {
  width: 7%;
}

.season-crew-table .crew-col-advances {
  width: 7%;
}

.season-crew-table .crew-col-net-remaining {
  width: 7%;
}

.season-crew-table .crew-col-total {
  width: 6.5%;
}

.season-crew-table .crew-col-actions {
  width: 120px;
}

.season-crew-table th,
.season-crew-table td {
  padding-inline: .75rem;
}

.season-crew-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-soft);
  box-shadow: inset 0 -1px 0 rgba(16, 36, 62, 0.08);
}

.season-crew-table td {
  overflow-wrap: normal;
  background: var(--surface);
}

.season-crew-table td:not(:first-child):not(:nth-child(2)) {
  white-space: nowrap;
}

.season-crew-table th:first-child,
.season-crew-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 5;
  background: var(--surface);
  box-shadow: 10px 0 16px -16px rgba(16, 36, 62, 0.28);
}

.season-crew-table thead th:first-child {
  z-index: 8;
  background: var(--surface-soft);
}

.season-crew-table th:nth-child(2),
.season-crew-table td:nth-child(2) {
  position: sticky;
  left: 240px;
  z-index: 5;
  background: var(--surface);
  box-shadow: 10px 0 16px -16px rgba(16, 36, 62, 0.22);
}

.season-crew-table thead th:nth-child(2) {
  z-index: 8;
  background: var(--surface-soft);
}

.season-crew-table th:nth-child(3),
.season-crew-table td:nth-child(3) {
  position: sticky;
  left: 410px;
  z-index: 5;
  background: var(--surface);
  box-shadow: 10px 0 16px -16px rgba(16, 36, 62, 0.18);
}

.season-crew-table thead th:nth-child(3) {
  z-index: 8;
  background: var(--surface-soft);
}

.season-crew-table td.actions,
.season-crew-table th:last-child {
  white-space: nowrap;
}

.season-crew-table th:last-child,
.season-crew-table td.actions {
  position: sticky;
  right: 0;
  background: var(--surface);
  box-shadow: -10px 0 16px -14px rgba(16, 36, 62, 0.35);
}

.season-crew-table thead th:last-child {
  z-index: 3;
}

.season-crew-table td.actions {
  z-index: 2;
}

.season-crew-table td.actions > div {
  display: flex;
  flex-wrap: nowrap !important;
  gap: .28rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 108px;
}

.season-crew-table td.actions form {
  display: inline-flex;
  margin: 0;
}

.season-crew-table .btn-icon-only {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  justify-content: center;
}

.table-app td.actions .btn-action {
  width: 32px;
  min-width: 32px;
  padding: 0;
  gap: 0;
  font-size: 0;
  justify-content: center;
}

.table-app td.actions .btn-action .icon {
  font-size: 13px;
}

.table-app td.actions form {
  display: inline-flex;
  margin: 0;
}

.table-actions-row {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
}

.season-metric-card.compact {
  min-height: auto;
  padding: .65rem .7rem;
}

.season-metric-card.compact .season-metric-value {
  font-size: .98rem;
}

.crew-settlement-dialog {
  max-width: min(1420px, 96vw);
}

.crew-settlement-body {
  min-height: 68vh;
}

.crew-settlement-pane-left,
.crew-settlement-pane-right {
  min-width: 0;
}

.crew-settlement-pane-left .table-responsive,
.crew-settlement-pane-right .table-responsive {
  max-height: 58vh;
}

.crew-settlement-pane-right .page-card {
  border-radius: 20px;
}

.crew-settlement-cleared-row td {
  background: color-mix(in srgb, var(--success) 7%, white);
}

.crew-settlement-cleared-row td:nth-child(5) {
  color: var(--success);
}

.owner-settlement-dialog {
  max-width: min(980px, 94vw);
}

.season-crew-table td.actions form {
  display: inline-flex;
  margin: 0;
}

.season-crew-table td.actions .btn-action {
  flex: 0 0 auto;
}

.season-crew-table .btn-action:not(.btn-icon-only) {
  white-space: nowrap;
  min-width: max-content;
}
.badge-soft-success { background: color-mix(in srgb, var(--success) 12%, white); color: var(--success); }
.badge-soft-danger { background: color-mix(in srgb, var(--danger) 10%, white); color: var(--danger); }
.badge-soft-info { background: color-mix(in srgb, var(--primary) 10%, white); color: var(--primary); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--border); padding-top: .72rem; padding-bottom: .72rem; }
.modal-content { border: 0; }
.advance-breakdown-dialog {
  max-width: 680px;
}
.advance-breakdown-content {
  border: 1px solid color-mix(in srgb, var(--primary) 14%, white);
  box-shadow: 0 34px 90px rgba(8, 35, 64, 0.32);
}
.advance-breakdown-header {
  cursor: move;
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(233, 242, 252, 0.94));
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 12%, white);
}
.expense-head-filter {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.expense-filter-btn {
  width: 28px;
  height: 28px;
  padding: 0;
}
.expense-filter-menu {
  max-height: 320px;
  overflow: auto;
}
.expense-filter-menu .dropdown-item.active,
.expense-filter-menu .dropdown-item:active {
  background: color-mix(in srgb, var(--primary) 14%, white);
  color: var(--primary);
}
.datetime-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: auto;
  padding: 0 .15rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text-main);
  font-weight: 700;
  flex: 0 0 auto;
}
.datetime-chip span {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#currentDate { min-width: 10ch; }
#currentTime { min-width: 8ch; }

.table-search-wrap {
  max-width: 360px;
}

.table-search-box {
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(16, 36, 62, 0.06);
}

.table-search-box .input-group-text {
  background: var(--surface-soft);
  border-color: var(--border);
  color: var(--primary);
}

.table-search-box .form-control {
  border-left: 0;
}

.table-search-box:focus-within {
  transform: translateY(-1px);
  transition: .2s ease;
}
.datetime-chip i { color: var(--primary); }
.btn-app-primary .icon,
.btn-app-light .icon,
.btn-app-danger .icon { width: auto; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 1.25rem; background: linear-gradient(135deg, var(--sidebar-start), var(--sidebar-end)); }
.auth-card { width: 100%; max-width: 470px; background: rgba(255,255,255,.94); border-radius: 28px; overflow: hidden; box-shadow: 0 25px 65px rgba(0,0,0,.22); }
.auth-card-wide { max-width: 760px; }
.auth-head { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; padding: 2rem; }
.auth-brand-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.auth-logo-main { width: min(100%, 360px); }
.auth-brand-title {
  width: 100%;
  text-align: center;
}
.auth-subtitle { opacity: .88; letter-spacing: .04em; }
.auth-description {
  max-width: 100%;
  margin: .85rem auto 0;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-panel {
  background: rgba(255,255,255,.82);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 1.4rem;
}
.auth-panel-header { text-align: center; margin-bottom: 1.2rem; }
.auth-panel-title { font-size: 1.05rem; font-weight: 800; color: var(--text-main); }
.auth-panel-note { margin-top: .3rem; color: var(--text-muted); font-size: .9rem; }
.input-group-auth .input-group-text {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--primary);
}
.auth-submit { min-height: 52px; box-shadow: 0 16px 30px rgba(15, 76, 129, 0.16); }
.auth-links-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1.3rem;
}
.auth-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  min-height: 110px;
  padding: 1rem;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-main);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.auth-link-button { width: 100%; }
.auth-link-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(16, 36, 62, 0.10);
  border-color: color-mix(in srgb, var(--primary) 35%, white);
  color: var(--primary);
}
.auth-link-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-soft);
  color: var(--icon-strong);
  font-size: 1.15rem;
}
.auth-link-label { font-weight: 800; text-align: center; line-height: 1.4; }
.auth-link-meta {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-word;
}
.about-block {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.about-block p { margin-bottom: 0; color: var(--text-muted); line-height: 1.7; }
.about-contact { display: flex; flex-wrap: wrap; gap: 1rem; color: var(--text-muted); font-size: .92rem; }
.stat-card { padding: 1.4rem; }
.saison-tabs { gap: .65rem; }
.saison-tabs .nav-link {
  border-radius: 999px;
  padding: .7rem 1rem;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, white);
}
.saison-tabs .nav-link.active {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}
.season-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.season-kpi-grid.compact { gap: .85rem; }
.season-kpi-grid > div {
  padding: 1rem;
  border-radius: 16px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.season-kpi-grid strong { font-size: 1.15rem; }
.season-log-list { display: grid; gap: 1rem; }
.season-log-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  padding: 1rem;
  border-radius: 18px;
  background: var(--surface-soft);
}
.season-log-step {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--icon-soft);
  color: var(--icon-strong);
  font-weight: 800;
}
.season-log-json {
  font-size: .83rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.season-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: .75rem;
}

.season-mission-participants-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.mission-participant-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-soft);
}

.mission-participant-card .mission-participant {
  margin-top: .2rem;
  flex: 0 0 auto;
}

.mission-participant-main {
  display: block;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.mission-participant-meta {
  display: block;
  margin-top: .2rem;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.avance-type-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}

.avance-type-btn {
  min-height: 42px;
  font-weight: 800;
}

.avance-type-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.season-presence-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.presence-sale-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 58px;
  background: var(--surface);
  border-color: var(--border) !important;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.presence-sale-item:hover {
  background: var(--surface-soft);
  border-color: color-mix(in srgb, var(--primary) 30%, white) !important;
  transform: translateY(-1px);
}
.presence-sale-item .form-check-input {
  margin-top: 0;
  flex: 0 0 auto;
}
.presence-sale-item span {
  display: block;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.45;
}
.presence-sale-item-disabled {
  opacity: .55;
  background: color-mix(in srgb, var(--text-muted) 10%, white);
  border-style: dashed !important;
}
.presence-sale-item-disabled:hover {
  transform: none;
  background: color-mix(in srgb, var(--text-muted) 10%, white);
  border-color: var(--border) !important;
}
.presence-sale-item-disabled .form-check-input {
  pointer-events: none;
}
.season-summary-inline {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: .75rem;
}
.season-header {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.season-header-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}
.season-header-info {
  min-width: 0;
  justify-self: start;
}
.season-header-main .season-summary-inline {
  justify-content: center;
  grid-column: 2;
}
.season-header-actions {
  grid-column: 3;
  justify-self: end;
}
.season-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .8rem;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: .88rem;
}
.season-summary-chip strong {
  color: var(--text-main);
  font-weight: 800;
}
.season-metric-card {
  min-width: 0;
  padding: .8rem .95rem;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(246,251,255,.9));
  border: 1px solid var(--border);
  box-shadow: 0 10px 24px rgba(12, 40, 68, 0.07);
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.season-metric-label {
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}
.season-metric-value {
  font-size: 1.12rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
}
.season-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: nowrap;
}
.saison-tabs {
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.season-tab-tools {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  overflow: hidden;
}
.season-tab-tool {
  width: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: nowrap;
}
html[dir='rtl'] .season-tabs-bar {
  flex-direction: row-reverse;
}
html[dir='rtl'] .season-tab-tools,
html[dir='rtl'] .season-tab-tool {
  justify-content: flex-start;
}
.season-tab-tool .table-search-wrap {
  margin-bottom: 0 !important;
  flex: 1 1 240px;
  min-width: 0;
}
.season-tab-tool .table-search-box {
  min-width: 220px;
  width: 100%;
}
.season-sale-main-row.season-sale-expandable {
  cursor: pointer;
}
.season-sale-index,
.season-sale-child-index {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.season-sale-toggle {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: var(--icon-soft);
  color: var(--icon-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, background .2s ease;
}
.season-sale-toggle[aria-expanded='true'] i {
  transform: rotate(90deg);
}
.season-sale-toggle:hover {
  background: color-mix(in srgb, var(--primary) 18%, white);
}
.season-sale-child-row {
  background: color-mix(in srgb, var(--primary) 3%, white);
}
.season-sale-child-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 40%, white);
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes pageIconFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 991px) {
  .sidebar { position: static; width: 100%; height: auto; min-height: auto; }
  .sidebar-shell { min-height: auto; max-height: none; overflow: visible; }
  .main-content { margin-inline-start: 0; padding: 1rem; }
  .sidebar-collapsed .sidebar { width: 100%; }
  .sidebar-collapsed .main-content { margin-inline-start: 0; }
  .sidebar-collapsed .sidebar-brand-text,
  .sidebar-collapsed .app-link span,
  .sidebar-collapsed .sidebar-divider,
  .sidebar-collapsed .sidebar-product-footer {
    display: initial;
  }
  .sidebar-collapsed .app-link {
    justify-content: flex-start;
    padding: .92rem 1rem;
  }
  .sidebar-collapsed .brand-box {
    padding: 1.35rem 1.15rem 1.1rem;
  }
  .sidebar-collapsed .sidebar-brand-logo-wrap {
    width: 90px;
    height: 90px;
  }
  .sidebar-collapsed .sidebar-logo {
    width: 64px;
    height: 64px;
  }
  .sidebar-logo { width: 64px; height: 64px; }
  .sidebar-brand-logo-wrap { width: 90px; height: 90px; }
  .brand-main { font-size: 1.55rem; }
  .topbar-logo { width: 32px; height: 32px; }
  .auth-logo { width: min(100%, 260px); }
  .auth-links-grid { grid-template-columns: 1fr; }
  .auth-card-wide { max-width: 100%; }
  .auth-description {
    white-space: normal;
    text-overflow: initial;
  }
  .season-kpi-grid { grid-template-columns: 1fr; }
  .season-tabs-bar,
  .season-tab-tool,
  .season-tab-tools {
    width: 100%;
  }
  .season-tabs-bar {
    display: flex;
    flex-wrap: wrap;
  }
  .season-header-main {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: .75rem;
  }
  .season-header-main .season-summary-inline {
    grid-column: auto;
  }
  .season-header-actions {
    justify-self: stretch;
    justify-content: flex-start;
  }
  .season-summary-inline {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
  .season-tab-tools {
    justify-content: stretch;
    margin-inline-start: 0;
  }
  .season-tab-tool .table-search-box {
    min-width: 100%;
  }
  .page-icon-shell { width: 30px; height: 30px; }
  .page-icon { font-size: 18px; }
}
