:root {
    --bg: #eef4fb;
    --surface: #fbfdff;
    --surface-strong: #ffffff;
    --text: #1f2933;
    --muted: #667085;
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --secondary: #0f766e;
    --danger: #b42318;
    --success: #067647;
    --border: #cbd7e6;
    --shadow: 0 18px 40px rgba(30, 64, 175, 0.08);
    --radius: 22px;
}

body.theme-dark,
html.theme-dark-pending body {
    --bg: #0f141b;
    --surface: #171e27;
    --surface-strong: #202936;
    --text: #f4f7fb;
    --muted: #a6b4c3;
    --primary: #60a5fa;
    --primary-soft: #172554;
    --secondary: #22c7b8;
    --danger: #ef6461;
    --success: #41d390;
    --border: #334151;
    --shadow: 0 20px 46px rgba(0, 0, 0, 0.34);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #edf4fb 100%);
    color: var(--text);
}

html {
    scrollbar-gutter: stable;
}

body.theme-dark,
html.theme-dark-pending body {
    background:
        linear-gradient(180deg, #0f141b 0%, #121922 52%, #0f141b 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.sidebar {
    padding: 28px 22px;
    background: linear-gradient(180deg, #102a56 0%, #16457f 100%);
    color: #f8fbff;
}

body.theme-dark .sidebar,
html.theme-dark-pending body .sidebar {
    background: linear-gradient(180deg, #08111f 0%, #111821 64%, #0f1f38 100%);
    border-right: 1px solid rgba(96, 165, 250, 0.12);
}

.sidebar-brand {
    display: grid;
    gap: 10px;
}

.sidebar-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 64px;
    overflow: hidden;
    border-radius: 10px;
}

.sidebar .sidebar-logo-frame .sidebar-logo {
    display: block;
    width: 140px !important;
    height: 56px !important;
    max-width: 140px !important;
    max-height: 56px !important;
    object-fit: contain;
}

.brand {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.brand-subtitle {
    color: rgba(253, 248, 239, 0.72);
    line-height: 1.5;
}

.nav {
    display: grid;
    gap: 10px;
    margin-top: 28px;
}

.nav a {
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(253, 248, 239, 0.86);
}

.nav a.active,
.nav a:hover {
    background: rgba(219, 234, 254, 0.14);
    color: #eff6ff;
}

body.theme-dark .nav a.active,
body.theme-dark .nav a:hover,
html.theme-dark-pending body .nav a.active,
html.theme-dark-pending body .nav a:hover {
    background: rgba(96, 165, 250, 0.15);
    color: #eff6ff;
}

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

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.topbar h1 {
    margin: 0 0 4px;
    font-size: 2rem;
}

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

.panel,
.card,
.login-card,
.calendar-day {
    background: rgba(255, 253, 250, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

body.theme-dark .panel,
body.theme-dark .card,
body.theme-dark .login-card,
body.theme-dark .calendar-day,
html.theme-dark-pending body .panel,
html.theme-dark-pending body .card,
html.theme-dark-pending body .login-card,
html.theme-dark-pending body .calendar-day {
    background: rgba(23, 30, 39, 0.96);
    border-color: rgba(192, 202, 213, 0.22);
}

.panel,
.login-card {
    padding: 24px;
}

.grid {
    display: grid;
    gap: 18px;
}

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

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

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

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

.card {
    padding: 20px;
}

.metric-label {
    color: var(--muted);
    font-size: 0.95rem;
}

.metric-value {
    margin-top: 10px;
    font-size: 2rem;
    font-weight: 700;
}

.metric-accent {
    width: 52px;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
    margin-top: 18px;
}

body.theme-dark .metric-accent,
html.theme-dark-pending body .metric-accent {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

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

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #bfd0e3;
    background: #fff;
    font: inherit;
    min-width: 0;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea,
html.theme-dark-pending body input,
html.theme-dark-pending body select,
html.theme-dark-pending body textarea {
    background: #111821;
    border-color: var(--border);
    color: var(--text);
}

body.theme-dark input:focus,
body.theme-dark select:focus,
body.theme-dark textarea:focus,
html.theme-dark-pending body input:focus,
html.theme-dark-pending body select:focus,
html.theme-dark-pending body textarea:focus {
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
    outline: none;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder,
html.theme-dark-pending body input::placeholder,
html.theme-dark-pending body textarea::placeholder {
    color: #7d8b99;
}

.native-searchable-select {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-trigger {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: 26px 1fr 22px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid #bfd0e3;
    background: #fff;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.searchable-select.open .searchable-select-trigger,
.searchable-select-trigger:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
    outline: none;
}

.searchable-select.invalid .searchable-select-trigger {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.12);
}

.searchable-select-icon,
.searchable-select-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
}

.searchable-select-icon svg,
.searchable-select-arrow svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.searchable-select-value {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4b5563;
}

.searchable-select.has-value .searchable-select-value {
    color: var(--text);
}

.searchable-select-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 50;
    display: none;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: 0 18px 42px rgba(30, 64, 175, 0.18);
}

.searchable-select.open .searchable-select-dropdown {
    display: block;
}

.searchable-select-input {
    border-radius: 8px;
    border-color: #c8d2df;
    margin-bottom: 10px;
}

.searchable-select-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

.searchable-select-options {
    display: grid;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.searchable-select-options::-webkit-scrollbar {
    width: 8px;
}

.searchable-select-options::-webkit-scrollbar-track {
    background: #eef2f7;
    border-radius: 999px;
}

.searchable-select-options::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
}

.searchable-select-option {
    width: 100%;
    padding: 11px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.selected {
    background: #eff6ff;
    color: #1d4ed8;
}

.searchable-select-empty {
    display: none;
    padding: 12px 10px;
    color: var(--muted);
}

body.theme-dark .searchable-select-trigger,
body.theme-dark .searchable-select-dropdown,
html.theme-dark-pending body .searchable-select-trigger,
html.theme-dark-pending body .searchable-select-dropdown {
    background: #111821;
    border-color: var(--border);
}

body.theme-dark .searchable-select.open .searchable-select-trigger,
body.theme-dark .searchable-select-trigger:focus,
html.theme-dark-pending body .searchable-select.open .searchable-select-trigger,
html.theme-dark-pending body .searchable-select-trigger:focus {
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

body.theme-dark .searchable-select-value,
html.theme-dark-pending body .searchable-select-value {
    color: #a6b4c3;
}

body.theme-dark .searchable-select.has-value .searchable-select-value,
html.theme-dark-pending body .searchable-select.has-value .searchable-select-value {
    color: var(--text);
}

body.theme-dark .searchable-select-option:hover,
body.theme-dark .searchable-select-option.selected,
html.theme-dark-pending body .searchable-select-option:hover,
html.theme-dark-pending body .searchable-select-option.selected {
    background: rgba(96, 165, 250, 0.16);
    color: #dbeafe;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 12px 18px;
    border: none;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    line-height: 1.2;
    min-height: 44px;
    text-align: center;
}

.button:hover {
    filter: brightness(1.02);
}

.button-muted {
    background: #e5edf7;
    color: #1e3a5f;
}

body.theme-dark .button-muted {
    background: #263140;
    color: #f3f6f8;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

body.theme-dark .button,
html.theme-dark-pending body .button {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

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

.notification-menu {
    position: relative;
}

.notification-menu summary {
    list-style: none;
}

.notification-menu summary::-webkit-details-marker {
    display: none;
}

.notification-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.notification-bell svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notification-bell span {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid var(--surface-strong);
}

body.theme-dark .notification-bell,
html.theme-dark-pending body .notification-bell {
    background: #202936;
    border-color: rgba(192, 202, 213, 0.22);
    color: #fbd38d;
}

.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    z-index: 30;
    width: min(360px, 88vw);
    padding: 14px;
    border-radius: 18px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    box-shadow: 0 20px 46px rgba(30, 64, 175, 0.16);
}

.notification-dropdown-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.notification-dropdown-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
}

.notification-list {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.notification-item {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(224, 242, 254, 0.55);
}

.notification-item:hover {
    background: #e0f2fe;
}

.notification-item strong {
    color: #075985;
}

.notification-item span,
.notification-item small {
    color: var(--muted);
}

.notification-empty {
    padding: 18px 0 10px;
    color: var(--muted);
}

.notification-view-all {
    display: inline-flex;
    color: var(--secondary);
    font-weight: 700;
}

.notification-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}

.notification-actions form {
    margin: 0;
}

body.theme-dark .notification-dropdown,
html.theme-dark-pending body .notification-dropdown {
    background: #202936;
    border-color: rgba(192, 202, 213, 0.22);
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.38);
}

body.theme-dark .notification-dropdown-head,
html.theme-dark-pending body .notification-dropdown-head {
    border-bottom-color: rgba(192, 202, 213, 0.22);
}

body.theme-dark .notification-dropdown-head span,
html.theme-dark-pending body .notification-dropdown-head span,
body.theme-dark .notification-item,
html.theme-dark-pending body .notification-item {
    background: rgba(14, 165, 233, 0.17);
    color: #7dd3fc;
}

body.theme-dark .notification-item:hover,
html.theme-dark-pending body .notification-item:hover {
    background: rgba(14, 165, 233, 0.25);
}

body.theme-dark .notification-item strong,
html.theme-dark-pending body .notification-item strong {
    color: #7dd3fc;
}

.button-secondary {
    background: var(--secondary);
}

.button-danger {
    background: var(--danger);
}

.button-small {
    padding: 8px 12px;
    font-size: 0.86rem;
    min-height: 36px;
}

.icon-button {
    height: 34px;
    min-height: 34px;
    min-width: 34px;
    padding: 0;
    width: 34px;
}

.icon-button svg {
    display: block;
    fill: none;
    height: 18px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 18px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    gap: 12px;
}

.section-header h2 {
    margin: 0;
}

.table-wrapper {
    border: 1px solid rgba(203, 215, 230, 0.7);
    border-radius: 16px;
    overflow-x: auto;
    scrollbar-color: #9aa9ba transparent;
    scrollbar-width: thin;
}

body.theme-dark .table-wrapper,
html.theme-dark-pending body .table-wrapper {
    border-color: rgba(192, 202, 213, 0.18);
}

.excel-table {
    min-width: 1900px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid #d8e3ef;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    white-space: nowrap;
}

body.theme-dark th,
body.theme-dark td,
html.theme-dark-pending body th,
html.theme-dark-pending body td {
    border-bottom-color: #2d3845;
}

th {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.92rem;
    background: rgba(239, 246, 255, 0.92);
    white-space: nowrap;
}

body.theme-dark th,
html.theme-dark-pending body th {
    background: rgba(32, 41, 54, 0.96);
}

tbody tr:hover {
    background: rgba(239, 246, 255, 0.6);
}

body.theme-dark tbody tr:hover,
html.theme-dark-pending body tbody tr:hover {
    background: rgba(96, 165, 250, 0.08);
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: 700;
}

.status-prospect {
    background: #eef4ff;
    color: #1d4ed8;
}

.status-aucun {
    background: #f1f5f9;
    color: #475569;
}

.status-interesse {
    background: #e8fff5;
    color: var(--success);
}

.status-devis_en_attente {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-test_produit {
    background: #f4ebff;
    color: #7a2bbf;
}

.status-client_actif {
    background: #ecfdf3;
    color: #067647;
}

.status-confirmer {
    background: #e0f2fe;
    color: #075985;
}

.status-a_relancer {
    background: #eff6ff;
    color: #1d4ed8;
}

.status-refus {
    background: #fff1f3;
    color: var(--danger);
}

.status-abondon {
    background: #f1f5f9;
    color: #475569;
}

body.theme-dark .status-prospect,
html.theme-dark-pending body .status-prospect {
    background: rgba(59, 130, 246, 0.16);
    color: #93c5fd;
}

body.theme-dark .status-aucun,
html.theme-dark-pending body .status-aucun {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

body.theme-dark .status-interesse,
body.theme-dark .status-client_actif,
html.theme-dark-pending body .status-interesse,
html.theme-dark-pending body .status-client_actif {
    background: rgba(65, 211, 144, 0.14);
    color: #8ff0bd;
}

body.theme-dark .status-confirmer,
html.theme-dark-pending body .status-confirmer {
    background: rgba(14, 165, 233, 0.17);
    color: #7dd3fc;
}

body.theme-dark .status-devis_en_attente,
html.theme-dark-pending body .status-devis_en_attente {
    background: rgba(96, 165, 250, 0.17);
    color: #bfdbfe;
}

body.theme-dark .status-test_produit,
html.theme-dark-pending body .status-test_produit {
    background: rgba(168, 85, 247, 0.17);
    color: #d8b4fe;
}

body.theme-dark .status-a_relancer,
html.theme-dark-pending body .status-a_relancer {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
}

body.theme-dark .status-refus,
html.theme-dark-pending body .status-refus {
    background: rgba(239, 100, 97, 0.15);
    color: #fca5a5;
}

body.theme-dark .status-abondon,
html.theme-dark-pending body .status-abondon {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 14px;
}

.alert-success {
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #a6f4c5;
}

.alert-error {
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
}

.confirmed-visits-panel {
    border-color: rgba(14, 165, 233, 0.35);
}

.notification-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-weight: 800;
    font-size: 1.1rem;
}

body.theme-dark .confirmed-visits-panel,
html.theme-dark-pending body .confirmed-visits-panel {
    border-color: rgba(125, 211, 252, 0.34);
}

body.theme-dark .notification-count,
html.theme-dark-pending body .notification-count {
    background: rgba(14, 165, 233, 0.17);
    color: #7dd3fc;
}

body.theme-dark .alert-success,
html.theme-dark-pending body .alert-success {
    background: rgba(65, 211, 144, 0.13);
    border-color: rgba(65, 211, 144, 0.34);
    color: #9af2c2;
}

body.theme-dark .alert-error,
html.theme-dark-pending body .alert-error {
    background: rgba(239, 100, 97, 0.13);
    border-color: rgba(239, 100, 97, 0.34);
    color: #fecaca;
}

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

.login-card {
    width: min(460px, 100%);
}

.login-card h1 {
    margin-top: 0;
}

.filter-bar {
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
}

.calendar-day {
    min-height: 150px;
    padding: 12px;
}

.calendar-day.muted {
    opacity: 0.45;
}

.calendar-day h3 {
    margin-top: 0;
    font-size: 1rem;
}

.calendar-event {
    background: var(--primary-soft);
    border-left: 4px solid var(--primary);
    padding: 8px 10px;
    border-radius: 12px;
    margin-top: 8px;
    font-size: 0.88rem;
}

body.theme-dark .calendar-event,
html.theme-dark-pending body .calendar-event {
    background: rgba(96, 165, 250, 0.13);
}

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

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
}

.toolbar-grid {
    align-items: end;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
    align-items: end;
}

.actions-cell {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, max-content);
    min-width: 0;
}

.actions-cell form:not(.zone-inline-form) {
    display: contents;
    margin: 0;
}

.actions-cell .button {
    min-width: 82px;
    white-space: nowrap;
    width: auto;
}

.actions-cell .zone-inline-form {
    grid-column: 1 / -1;
    width: 100%;
}

.zone-inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: min(420px, 100%);
}

.zone-inline-form input {
    min-width: 180px;
}

.details-grid {
    gap: 16px;
}

.pagination-bar {
    margin-top: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
}

.pagination-links .button {
    min-width: 38px;
    padding-left: 12px;
    padding-right: 12px;
}

.pagination-ellipsis {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-weight: 800;
    min-height: 36px;
    padding: 0 4px;
}

.client-list-hero {
    display: grid;
    gap: 18px;
}

.client-list-intro {
    display: grid;
    gap: 20px;
}

.client-list-hero .section-header {
    align-items: flex-start;
    margin-bottom: 0;
}

.client-list-hero .section-header > div:first-child {
    max-width: 520px;
}

.client-list-hero .section-header h2 {
    font-size: 1.85rem;
    line-height: 1.2;
}

.client-list-hero .section-header p {
    margin: 10px 0 0;
    line-height: 1.45;
}

.client-count-badge {
    min-width: 110px;
    padding: 14px 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary-soft), #eef7ff);
    color: #1d4ed8;
    text-align: center;
}

body.theme-dark .client-count-badge,
html.theme-dark-pending body .client-count-badge {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.17), rgba(34, 199, 184, 0.12));
    color: #bfdbfe;
    border: 1px solid rgba(96, 165, 250, 0.22);
}

.client-count-badge strong {
    display: block;
    font-size: 1.8rem;
    line-height: 1;
}

.client-count-badge span {
    display: block;
    margin-top: 6px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.client-filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 18px;
}

.client-filter-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    min-width: max-content;
}

.client-filter-actions .button {
    min-width: 122px;
    min-height: 58px;
    white-space: nowrap;
}

.client-list-actions {
    display: grid;
    grid-template-columns: auto auto;
    gap: 12px;
    align-items: center;
    justify-content: end;
}

.client-list-actions .client-count-badge {
    grid-row: span 2;
}

.client-list-actions .button {
    min-width: 196px;
    min-height: 56px;
    white-space: nowrap;
}

.client-import-form {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) 198px;
    gap: 18px;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #d8e3ef;
}

body.theme-dark .client-import-form,
html.theme-dark-pending body .client-import-form {
    border-top-color: var(--border);
}

.client-import-form p {
    margin: 10px 0 0;
}

.client-import-actions {
    display: grid;
    gap: 10px;
}

.client-import-form .button {
    min-height: 58px;
    white-space: nowrap;
}

.client-status-form {
    margin: 0;
    min-width: 130px;
}

.client-status-form select {
    padding: 8px 10px;
    border-radius: 10px;
}

.client-status-select {
    font-weight: 700;
}

.client-status-select.status-client {
    background: #ecfdf3;
    border-color: #75e0a7;
    color: #067647;
}

body.theme-dark .client-status-select.status-client,
html.theme-dark-pending body .client-status-select.status-client {
    background: rgba(65, 211, 144, 0.14);
    border-color: rgba(65, 211, 144, 0.4);
    color: #9af2c2;
}

body.theme-dark .client-status-select.status-prospect,
html.theme-dark-pending body .client-status-select.status-prospect {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
    color: #bfdbfe;
}

.client-status-select.status-prospect {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.client-actions-cell {
    min-width: 0;
}

.client-row-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, max-content);
    width: max-content;
}

.client-row-actions .button,
.client-row-actions form {
    width: auto;
}

.client-row-actions form {
    margin: 0;
}

.client-row-actions .button {
    justify-content: center;
    white-space: nowrap;
}

.client-form-section {
    margin-top: 18px;
}

.settings-logo-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #d8e3ef;
}

body.theme-dark .settings-logo-form,
html.theme-dark-pending body .settings-logo-form {
    border-top-color: var(--border);
}

.settings-logo-preview {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #d8e3ef;
    border-radius: 14px;
    background: #fff;
}

body.theme-dark .settings-logo-preview,
html.theme-dark-pending body .settings-logo-preview {
    background: #111821;
    border-color: var(--border);
}

.settings-logo-preview img {
    display: block;
    width: 120px;
    max-height: 90px;
    object-fit: contain;
}

.chart-card {
    padding: 12px 0 4px;
}

.chart-bars {
    min-height: 240px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 16px;
    align-items: end;
}

.chart-bar-group {
    display: grid;
    gap: 10px;
    justify-items: center;
}

.chart-bar {
    width: 100%;
    max-width: 52px;
    border-radius: 18px 18px 8px 8px;
    background: linear-gradient(180deg, #93c5fd 0%, var(--primary) 100%);
    box-shadow: inset 0 -8px 18px rgba(30, 64, 175, 0.15);
}

.chart-bar-value,
.chart-bar-label {
    text-align: center;
    font-size: 0.86rem;
}

.chart-bar-value {
    color: var(--muted);
}

.chart-bar-label {
    font-weight: 700;
}

.chart-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.legend-dot-sales {
    background: var(--secondary);
}

.legend-dot-objective {
    background: var(--primary);
}

.objective-chart {
    min-height: 320px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 18px;
    align-items: end;
    padding-top: 8px;
}

.objective-chart-item {
    display: grid;
    grid-template-rows: auto 190px auto auto;
    gap: 10px;
    min-width: 0;
}

.objective-chart-rate {
    text-align: center;
    font-weight: 800;
    color: var(--secondary);
}

.objective-chart-bars {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
    height: 190px;
    padding: 12px 10px 0;
    border-bottom: 1px solid #d8e3ef;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.8), rgba(251, 253, 255, 0));
    border-radius: 14px 14px 0 0;
}

body.theme-dark .objective-chart-bars,
html.theme-dark-pending body .objective-chart-bars {
    border-bottom-color: var(--border);
    background: linear-gradient(180deg, rgba(32, 41, 54, 0.78), rgba(23, 30, 39, 0));
}

.objective-bar {
    width: min(34px, 42%);
    min-height: 8px;
    border-radius: 10px 10px 4px 4px;
}

.objective-bar-sales {
    background: linear-gradient(180deg, #35b7ad, var(--secondary));
}

.objective-bar-target {
    background: linear-gradient(180deg, #93c5fd, var(--primary));
}

.objective-chart-name {
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.objective-chart-values {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    text-align: center;
}

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

.mini-stat {
    padding: 16px;
    border: 1px solid #d8e3ef;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.92), #fbfdff 100%);
}

body.theme-dark .mini-stat,
html.theme-dark-pending body .mini-stat {
    border-color: rgba(148, 163, 184, 0.2);
    background: linear-gradient(180deg, rgba(32, 41, 54, 0.86), rgba(23, 30, 39, 0.94) 100%);
}

.mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.25rem;
}

.progress-list {
    display: grid;
    gap: 14px;
}

.progress-item {
    padding: 14px 16px;
    border: 1px solid #d8e3ef;
    border-radius: 18px;
    background: rgba(255, 250, 244, 0.7);
}

body.theme-dark .progress-item,
html.theme-dark-pending body .progress-item {
    border-color: rgba(148, 163, 184, 0.2);
    background: rgba(32, 41, 54, 0.62);
}

.progress-head,
.progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.progress-meta {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.progress-track {
    margin-top: 10px;
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #f1e6d8;
    overflow: hidden;
}

body.theme-dark .progress-track,
html.theme-dark-pending body .progress-track {
    background: #273241;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #38bdf8);
}

.progress-track-secondary {
    background: #dff3f1;
}

body.theme-dark .progress-track-secondary,
html.theme-dark-pending body .progress-track-secondary {
    background: rgba(34, 199, 184, 0.16);
}

.progress-fill-secondary {
    background: linear-gradient(90deg, var(--secondary), #35b7ad);
}


@media (max-width: 1100px) {
    .grid-4,
    .grid-5,
    .grid-3,
    .grid-2,
    .mini-stats-grid,
    .form-grid,
    .form-grid-4,
    .client-filter-grid,
    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .sidebar {
        padding-bottom: 12px;
    }

    .sidebar-brand {
        align-items: center;
        grid-template-columns: auto 1fr;
    }

    .nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: 260px;
        overflow-y: auto;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }

}

@media (max-width: 640px) {
    .main-content,
    .sidebar {
        padding: 18px;
    }

    .grid-4,
    .grid-5,
    .grid-3,
    .grid-2,
    .form-grid,
    .form-grid-4,
    .client-filter-grid,
    .calendar-grid,
    .nav {
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .toolbar-actions,
    .client-filter-actions,
    .client-list-actions,
    .client-import-form {
        flex-direction: column;
    }

    .actions-cell,
    .client-row-actions {
        grid-template-columns: repeat(2, max-content);
        min-width: 0;
        width: max-content;
    }

    .client-row-actions {
        grid-template-columns: repeat(3, max-content);
    }

    .actions-cell .button,
    .client-row-actions .button {
        width: auto;
    }

    .pagination-links {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
        justify-content: stretch;
    }

    .client-import-form {
        grid-template-columns: 1fr;
    }

    .pagination-bar {
        align-items: stretch;
        display: grid;
    }

    .client-list-hero .section-header,
    .client-list-actions {
        display: grid;
        justify-content: stretch;
    }

    .client-list-actions {
        grid-template-columns: 1fr;
    }

    .client-list-actions .client-count-badge {
        grid-row: auto;
    }

    .client-list-actions .button,
    .client-filter-actions .button,
    .client-import-form .button {
        min-width: 0;
    }
}
