:root {
    --app-bg: #f6f8fc;
    --app-surface: #ffffff;
    --app-surface-alt: #f8fafd;
    --app-border: #dde3eb;
    --app-text: #202124;
    --app-muted: #6c7892;
    --app-accent: #1a73e8;
    --app-accent-dark: #0b57d0;
    --app-accent-soft: #e8f0fe;
    --app-radius: 18px;
    --app-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px 1px rgba(60, 64, 67, 0.08);
    --app-shadow-hover: 0 2px 6px rgba(60, 64, 67, 0.18), 0 1px 2px rgba(60, 64, 67, 0.14);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Roboto", "Segoe UI", sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

.app-shell {
    min-height: 100vh;
    display: flex;
    background: var(--app-bg);
}

.sidebar {
    width: 284px;
    padding: 20px 16px 18px;
    background: var(--app-surface);
    color: var(--app-text);
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    min-height: 100vh;
    border-right: 1px solid var(--app-border);
    box-shadow: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 10px 10px;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: var(--app-accent-soft);
    border: 1px solid rgba(26, 115, 232, 0.12);
    color: var(--app-accent-dark);
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-brand h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 500;
}

.sidebar-brand p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.sidebar-nav {
    display: grid;
    gap: 6px;
}

.sidebar-nav-group {
    display: grid;
    gap: 4px;
}

.sidebar-nav .nav-link {
    border-radius: 999px;
    padding: 12px 14px;
    color: var(--app-text);
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: var(--app-accent-soft);
    color: var(--app-accent-dark);
    transform: none;
}

.sidebar-subnav {
    display: grid;
    gap: 4px;
    margin-left: 18px;
    padding-left: 10px;
    border-left: 1px solid rgba(26, 115, 232, 0.14);
}

.sidebar-subnav-scroll {
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

.sidebar-subnav-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-subnav-scroll::-webkit-scrollbar-thumb {
    background: #d9e2ef;
    border-radius: 999px;
}

.sidebar-subnav .nav-sublink {
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--app-muted);
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.sidebar-subnav .nav-sublink span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-subnav .nav-sublink:hover,
.sidebar-subnav .nav-sublink.active {
    background: var(--app-accent-soft);
    color: var(--app-accent-dark);
}

.sidebar-card {
    margin-top: auto;
    background: var(--app-surface-alt);
    border: 1px solid var(--app-border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: none;
}

.sidebar-card-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--app-muted);
    margin-bottom: 10px;
}

.sidebar-card h2 {
    font-size: 1rem;
    margin: 0 0 4px;
    font-weight: 500;
}

.sidebar-card p {
    color: var(--app-muted);
    margin-bottom: 18px;
}

.app-content {
    flex: 1;
    min-width: 0;
    background: var(--app-bg);
}

.app-content .container-fluid {
    max-width: 1680px;
    margin: 0 auto;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.page-head h1 {
    margin: 0;
    font-size: 1.72rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.page-head p {
    margin: 4px 0 0;
    color: var(--app-muted);
    font-size: 0.95rem;
}

.panel-card,
.stat-card,
.table-card,
.detail-card,
.auth-card {
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.stat-card {
    padding: 20px;
    height: 100%;
}

.stat-card-compact {
    padding: 12px 14px;
}

.stat-card-link {
    display: block;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.stat-card-link:hover {
    transform: translateY(-1px);
    border-color: rgba(26, 115, 232, 0.18);
    box-shadow: var(--app-shadow-hover);
}

.stat-card-compact.stat-card-link:hover {
    transform: none;
    box-shadow: none;
    background: var(--app-surface-alt);
}

.stat-card .stat-label {
    color: var(--app-muted);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.stat-card-compact .stat-label {
    font-size: 0.84rem;
    line-height: 1.25;
    margin-bottom: 4px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.stat-card-compact .stat-value {
    font-size: 1.45rem;
    line-height: 1.1;
    margin-bottom: 0;
}

.stat-card .stat-caption {
    color: var(--app-muted);
    font-size: 0.92rem;
    margin: 0;
}

.stat-highlight {
    color: var(--app-accent-dark);
}

.panel-card,
.table-card,
.detail-card {
    padding: 22px;
}

.inner-section-flat {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

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

.panel-title h2 {
    font-size: 1.15rem;
    margin: 0;
    font-weight: 500;
}

.panel-title p {
    margin: 6px 0 0;
    color: var(--app-muted);
}

.soft-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--app-accent-soft);
    color: var(--app-accent-dark);
    font-weight: 500;
    font-size: 0.88rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 999px;
    font-weight: 500;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: none;
    min-height: 34px;
    padding: 0.48rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.2;
    border-width: 1px;
}

.btn:hover {
    transform: none;
    box-shadow: none;
}

.btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(26, 115, 232, 0.14);
}

.btn-sm {
    min-height: 30px;
    padding: 0.34rem 0.72rem;
    font-size: 0.76rem;
}

.btn-primary,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-check:checked + .btn-primary {
    background: #e8f0fe;
    border-color: #d2e3fc;
    color: #0b57d0;
}

.btn-primary:hover {
    background: #dce8fd;
    border-color: #c0d4fb;
    color: #0b57d0;
}

.btn-danger,
.btn-danger:focus,
.btn-danger:active,
.btn-danger.active,
.btn-check:checked + .btn-danger {
    background: #fce8ef;
    border-color: #f7d3df;
    color: #b93861;
}

.btn-danger:hover {
    background: #f9dee9;
    border-color: #f1bfd0;
    color: #a92f56;
}

.btn-success,
.btn-success:focus,
.btn-success:active,
.btn-success.active,
.btn-check:checked + .btn-success {
    background: #e6f4ea;
    border-color: #cde8d5;
    color: #1f7a50;
}

.btn-success:hover {
    background: #d9efe0;
    border-color: #bfe1cb;
    color: #166b43;
}

.btn-outline-primary,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background: #f1f6ff;
    border-color: #d2e3fc;
    color: #0b57d0;
}

.btn-outline-primary:hover {
    background: #e8f0fe;
    border-color: #c0d4fb;
    color: #0b57d0;
}

.btn-outline-danger,
.btn-outline-danger:focus,
.btn-outline-danger:active,
.btn-outline-danger.active,
.btn-check:checked + .btn-outline-danger {
    background: #fdf1f5;
    border-color: #f7d3df;
    color: #b93861;
}

.btn-outline-danger:hover {
    background: #fce8ef;
    border-color: #f1bfd0;
    color: #a92f56;
}

.btn-outline-success,
.btn-outline-success:focus,
.btn-outline-success:active,
.btn-outline-success.active,
.btn-check:checked + .btn-outline-success {
    background: #eff8f2;
    border-color: #cde8d5;
    color: #1f7a50;
}

.btn-outline-success:hover {
    background: #e6f4ea;
    border-color: #bfe1cb;
    color: #166b43;
}

.btn-outline-warning,
.btn-outline-warning:focus,
.btn-outline-warning:active,
.btn-outline-warning.active,
.btn-check:checked + .btn-outline-warning {
    background: #fef7e0;
    border-color: #f9e2a3;
    color: #9a6f0a;
}

.btn-outline-warning:hover {
    background: #fcefc3;
    border-color: #f2d785;
    color: #8c6407;
}

.btn-outline-secondary,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-check:checked + .btn-outline-secondary {
    background: #eef3f8;
    border-color: #dde5ef;
    color: #5e6a84;
}

.btn-outline-secondary:hover {
    background: #e6edf5;
    border-color: #d1dae7;
    color: #525e77;
}

.btn-light,
.btn-light:focus,
.btn-light:active,
.btn-light.active,
.btn-check:checked + .btn-light {
    background: #f5f7fb;
    border-color: #e0e5ed;
    color: #334054;
}

.btn-light:hover {
    background: #edf1f7;
    border-color: #d2dae7;
    color: #263246;
}

.badge-pastel-secondary {
    background: #eceff6;
    color: #66728e;
}

.badge-pastel-primary {
    background: #e3ebff;
    color: #5377c9;
}

.badge-pastel-success {
    background: #dcf5e8;
    color: #2f8f66;
}

.badge-pastel-warning {
    background: #fff2cf;
    color: #b88716;
}

.badge-pastel-info {
    background: #dff2fb;
    color: #3c7da1;
}

.badge-pastel-dark {
    background: #e7e6f0;
    color: #615d7b;
}

.badge {
    font-weight: 700;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.table thead th {
    color: var(--app-muted);
    border-bottom-width: 1px;
    border-color: #e6eaf0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.88rem 0.75rem;
    background: var(--app-surface-alt);
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.84rem;
    padding: 0.86rem 0.75rem;
    border-color: #eceff3;
}

.table tbody td a,
.table tbody td .btn {
    font-size: 0.82rem;
}

.table tbody td small {
    font-size: 0.76rem;
}

.table tbody tr {
    transition: background-color 0.18s ease;
}

.table tbody tr:hover > td {
    background: #fbfdff;
}

.activity-section-row td {
    padding: 18px 0.75rem 8px !important;
    border: 0 !important;
    background: transparent !important;
}

.activity-section-row:hover > td {
    background: transparent !important;
}

.activity-section-label {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.activity-client-row td {
    padding: 0.95rem 1rem !important;
    border-top: 1px solid #d5dde8 !important;
    border-bottom: 1px solid #d5dde8 !important;
    background: #f4f7fb !important;
}

.activity-client-row:hover > td {
    background: #f4f7fb !important;
}

.activity-item-row + .activity-client-row td {
    border-top: 14px solid var(--app-surface) !important;
}

.activity-client-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.activity-client-heading-main {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.activity-client-name {
    font-size: 1.03rem;
    font-weight: 800;
    color: var(--app-text);
}

.activity-client-source {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.activity-item-row > td {
    padding-top: 0.64rem;
    padding-bottom: 0.64rem;
    font-size: 0.8rem;
    border-color: #f0f3f7;
}

.activity-item-row:hover > td {
    background: #fcfdff;
}

.activity-item-row .activity-title-cell {
    padding-left: 1.55rem;
}

.activity-item-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-text);
    font-size: 0.82rem !important;
    font-weight: 500 !important;
}

.activity-item-title::before {
    content: "";
    width: 10px;
    height: 1px;
    border-radius: 999px;
    background: #b8c3d3;
    flex: 0 0 auto;
}

.activity-group-separator td {
    padding: 6px 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.activity-table tr.activity-group-direct-end > td {
    border-bottom: 0 !important;
}

.activity-group-separator-line {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(227, 235, 255, 0.9) 0%, rgba(244, 246, 251, 0.45) 100%);
}

.filter-bar {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 16px;
    background: var(--app-surface-alt);
    border: 1px solid var(--app-border);
}

.filter-bar-compact {
    gap: 8px;
    margin-bottom: 16px;
}

.filter-bar-compact .form-label {
    margin-bottom: 0.28rem;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--app-muted);
    font-weight: 700;
}

.filter-bar-compact .form-select,
.filter-bar-compact .form-control {
    min-height: 38px;
    padding-top: 0.42rem;
    padding-bottom: 0.42rem;
    font-size: 0.84rem;
}

.filter-check-group {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 0 2px 2px;
}

.filter-bar-compact .form-check {
    margin-bottom: 0;
}

.filter-bar-compact .form-check-label {
    font-size: 0.82rem;
    color: var(--app-text);
}

.filter-actions {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-actions .btn {
    padding: 0.46rem 0.86rem;
    font-size: 0.8rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--app-muted);
}

.form-control,
.form-select {
    min-height: 44px;
    border-radius: 12px;
    border: 1px solid #d2d7e0;
    background: #ffffff;
    color: var(--app-text);
    box-shadow: none;
}

textarea.form-control {
    min-height: 120px;
}

.form-control:focus,
.form-select:focus {
    border-color: #a8c7fa;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.form-check-input {
    border-color: #c9d1db;
}

.form-check-input:checked {
    background-color: var(--app-accent);
    border-color: var(--app-accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.14);
}

.alert {
    border-radius: 16px;
    border-width: 1px;
    box-shadow: none;
}

.alert-danger {
    background: #fce8e6;
    border-color: #fad2cf;
    color: #9b3b31;
}

.alert-success {
    background: #e6f4ea;
    border-color: #cee9d5;
    color: #19663c;
}

.alert-warning {
    background: #fef7e0;
    border-color: #f9e5ac;
    color: #8a6514;
}

.alert-info {
    background: #e8f0fe;
    border-color: #d2e3fc;
    color: #174ea6;
}

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

.info-item {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.info-item-label {
    font-size: 0.85rem;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.info-item-value {
    font-size: 1rem;
    font-weight: 700;
}

.auth-page {
    min-height: 100vh;
}

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

.auth-main {
    width: 100%;
}

.auth-card {
    max-width: 980px;
    margin: 0 auto;
    overflow: hidden;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
}

.auth-side {
    background: linear-gradient(180deg, #f5f8ff 0%, #edf3fb 100%);
    color: var(--app-text);
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--app-border);
}

.auth-side h1 {
    font-size: 2.1rem;
    font-weight: 500;
    margin-bottom: 16px;
}

.auth-side p,
.auth-side li {
    color: var(--app-muted);
}

.auth-form {
    padding: 48px;
    background: #ffffff;
}

.section-subtitle {
    color: var(--app-muted);
    margin-top: 6px;
}

.badge-direct {
    background: #f1f4fa;
    border-color: #dce4f0;
    color: #66728e;
}

.list-clean {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-clean li + li {
    margin-top: 12px;
}

.mini-kpi {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-accent-soft);
    border: 1px solid rgba(26, 115, 232, 0.14);
}

.mini-kpi strong {
    display: block;
    font-size: 1.3rem;
}

.form-hint {
    font-size: 0.88rem;
    color: var(--app-muted);
}

.reseller-summary-card {
    padding-top: 20px;
    padding-bottom: 20px;
}

.reseller-summary-matrix {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 18px;
    align-items: start;
    padding: 14px 18px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.reseller-summary-head {
    font-size: 0.82rem;
    color: var(--app-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.reseller-summary-value {
    font-size: 1rem;
    font-weight: 800;
    color: var(--app-text);
    min-width: 0;
    overflow-wrap: anywhere;
}

.reseller-summary-note {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.activity-summary-card {
    padding-top: 18px;
    padding-bottom: 18px;
}

.activity-summary-card .panel-title {
    margin-bottom: 14px;
}

.activity-summary-card .panel-title h2 {
    font-size: 1.02rem;
}

.activity-summary-card .panel-title p {
    font-size: 0.86rem;
}

.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 10px;
}

.activity-summary-item {
    min-width: 0;
    padding: 11px 13px;
    border-radius: 16px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.activity-summary-item .info-item-label {
    margin-bottom: 3px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
}

.activity-summary-item .info-item-value {
    font-size: 0.88rem;
    line-height: 1.28;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.activity-summary-item .badge {
    font-size: 0.72rem;
}

.client-summary-card {
    padding-top: 20px;
    padding-bottom: 20px;
}

.client-summary-card-compact {
    padding: 16px 18px;
}

.client-summary-card-compact .panel-title {
    margin-bottom: 10px;
}

.client-summary-card-compact .panel-title h2 {
    font-size: 1rem;
}

.client-summary-card-compact .panel-title p {
    font-size: 0.82rem;
}

.client-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.client-summary-card-compact .client-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.client-summary-item {
    min-width: 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.client-summary-card-compact .client-summary-item {
    padding: 9px 11px;
    border-radius: 4px;
    background: var(--app-surface-alt);
}

.client-summary-item .info-item-label {
    margin-bottom: 4px;
}

.client-summary-card-compact .client-summary-item .info-item-label,
.client-summary-card-compact .client-summary-note .info-item-label {
    margin-bottom: 2px;
    font-size: 0.68rem;
    letter-spacing: 0.04em;
}

.client-summary-item .info-item-value {
    font-size: 0.98rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.client-summary-card-compact .client-summary-item .info-item-value,
.client-summary-card-compact .client-summary-note .info-item-value {
    font-size: 0.82rem;
    line-height: 1.3;
    font-weight: 600;
}

.client-summary-card-compact .badge {
    font-size: 0.68rem;
}

.client-summary-note {
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.client-summary-card-compact .client-summary-note {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 4px;
    background: var(--app-surface-alt);
}

.client-modal-link {
    color: var(--app-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.client-modal-link:hover {
    color: var(--app-accent-dark);
}

.client-workspace-filters {
    margin-bottom: 16px;
}

.client-workspace {
    display: grid;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.client-workspace-list {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow: auto;
}

.client-workspace-list-items {
    display: grid;
    gap: 8px;
}

.client-workspace-group-label {
    padding: 8px 12px 2px;
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-workspace-group-label:not(:first-child) {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--app-border);
}

.client-workspace-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    color: inherit;
    background: transparent;
}

.client-workspace-item:hover,
.client-workspace-item.active {
    background: var(--app-surface-alt);
    border-color: var(--app-border);
}

.client-workspace-item-main {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.client-workspace-item-name {
    font-weight: 700;
    overflow-wrap: anywhere;
}

.client-workspace-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: var(--app-muted);
    font-size: 0.78rem;
}

.client-workspace-item-side {
    display: grid;
    justify-items: end;
    gap: 6px;
    flex: 0 0 auto;
}

.client-workspace-count {
    color: var(--app-muted);
    font-size: 0.76rem;
    font-weight: 600;
}

.client-workspace-empty,
.client-workspace-placeholder {
    color: var(--app-muted);
}

.client-workspace-detail {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.client-workspace-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.client-workspace-detail-head h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 500;
}

.client-workspace-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    color: var(--app-muted);
    font-size: 0.86rem;
}

.client-activities-modal .modal-content {
    border: 1px solid var(--app-border);
    border-radius: 20px;
    box-shadow: var(--app-shadow-hover);
}

.meeting-preview-modal .modal-body {
    padding-top: 12px;
}

.meeting-preview-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.meeting-preview-meta-item,
.meeting-preview-section {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.meeting-preview-body {
    display: grid;
    gap: 12px;
}

.meeting-preview-text {
    margin-top: 6px;
    color: var(--app-text);
    line-height: 1.52;
    font-size: 0.9rem;
    white-space: pre-line;
    overflow: hidden;
    max-height: calc(1.52em * 8);
}

.meeting-preview-text-short {
    max-height: calc(1.52em * 3);
}

.client-activity-list {
    display: grid;
    gap: 12px;
}

.client-activity-item,
.client-activity-empty {
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.client-activity-item {
    display: block;
    color: inherit;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.client-activity-item:hover {
    transform: none;
    border-color: rgba(26, 115, 232, 0.18);
    background: #fbfdff;
    box-shadow: none;
}

.client-activity-item-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.client-activity-item-title {
    font-weight: 700;
    color: var(--app-text);
}

.client-activity-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.8rem;
    color: var(--app-muted);
}

.checklist-progress-wrap {
    margin-bottom: 18px;
}

.checklist-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--app-muted);
    font-weight: 700;
}

.checklist-progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #edf2fb;
    overflow: hidden;
    margin-bottom: 10px;
}

.checklist-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #b9cdfd 0%, #bde7d1 100%);
}

.checklist-list {
    display: grid;
    gap: 12px;
}

.checklist-item,
.checklist-empty {
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    box-shadow: none;
}

.checklist-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.checklist-item.is-completed {
    border-color: rgba(47, 143, 102, 0.22);
    background: linear-gradient(180deg, #ffffff 0%, #fbfffd 100%);
}

.checklist-item-main {
    min-width: 0;
    flex: 1;
}

.checklist-item-top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.checklist-item-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--app-text);
    overflow-wrap: anywhere;
}

.checklist-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 0.8rem;
    color: var(--app-muted);
}

.checklist-item-note {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--app-text);
    line-height: 1.5;
}

.checklist-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.checklist-complete-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.checklist-completion-date {
    width: 148px;
}

.checklist-item-actions .btn {
    font-size: 0.8rem;
}

.info-item,
.mini-kpi,
.reseller-summary-matrix,
.reseller-summary-note,
.activity-summary-item,
.client-summary-item,
.client-summary-note,
.meeting-preview-meta-item,
.meeting-preview-section,
.client-activity-item,
.client-activity-empty,
.checklist-item,
.checklist-empty {
    border: 0;
    border-radius: 0;
    background: var(--app-surface-alt);
    box-shadow: none;
}

.checklist-item.is-completed {
    border: 0;
    background: var(--app-surface-alt);
}

.description-editor-card .soft-pill {
    background: var(--app-accent-soft);
    color: var(--app-accent-dark);
}

.description-editor-textarea {
    min-height: 220px;
    resize: vertical;
    line-height: 1.6;
    font-size: 0.94rem;
}

.section-stack + .section-stack {
    margin-top: 28px;
}

@media (max-width: 991.98px) {
    .app-shell {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
    }

    .sidebar-nav {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    }

    .sidebar-nav .nav-link:hover,
    .sidebar-nav .nav-link.active {
        transform: none;
    }

    .sidebar-subnav {
        margin-left: 12px;
    }

    .sidebar-subnav-scroll {
        max-height: 180px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

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

    .client-workspace-list {
        position: static;
        max-height: none;
    }
}

@media (max-width: 575.98px) {
    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-card,
    .table-card,
    .detail-card,
    .auth-form,
    .auth-side {
        padding: 20px;
    }

    .stat-card {
        padding: 18px;
    }

    .stat-card-compact {
        padding: 12px 14px;
    }

    .client-workspace-detail-head,
    .client-workspace-item {
        flex-direction: column;
    }

    .client-workspace-item-side {
        justify-items: start;
    }

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

@media (max-width: 575.98px) {
    .checklist-item {
        flex-direction: column;
    }

    .checklist-item-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .checklist-complete-form {
        justify-content: flex-start;
    }

    .reseller-summary-matrix {
        grid-template-columns: 1fr;
    }
}
