:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --primary: #4f46e5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.hero {
    background: linear-gradient(135deg, #ffffff, #eef2ff);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.eyebrow {
    color: var(--primary);
    font-weight: 800;
    margin: 0 0 8px;
}

h1 {
    margin: 0 0 8px;
    font-size: 32px;
}

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

.button {
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-weight: 800;
    white-space: nowrap;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.card,
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
}

.card span,
.card small {
    display: block;
    color: var(--muted);
}

.card strong {
    display: block;
    margin-top: 10px;
    font-size: 28px;
}

.panel h2 {
    margin: 0 0 16px;
    font-size: 20px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: right;
    padding: 14px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 800px) {
    .hero {
        flex-direction: column;
        align-items: stretch;
    }

    .cards {
        grid-template-columns: 1fr;
    }
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-form input {
    flex: 1;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 14px;
    font-family: inherit;
}

.search-form button,
.search-form a,
.pagination a {
    border: 0;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    font-family: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.search-form a {
    background: #64748b;
}

.pagination {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

@media (max-width: 800px) {
    .search-form {
        flex-direction: column;
    }
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.filters-form input,
.filters-form select {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 12px;
    font-family: inherit;
    background: white;
}

.filters-form button,
.filters-form a {
    border: 0;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    font-family: inherit;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.filters-form a {
    background: #64748b;
}

@media (max-width: 900px) {
    .filters-form {
        grid-template-columns: 1fr;
    }
}

.success-box {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    padding: 14px 18px;
    margin-bottom: 16px;
    font-weight: 800;
}

.lead-summary {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.lead-summary p {
    margin: 0;
}

.edit-form {
    display: grid;
    gap: 16px;
}

.edit-form label {
    display: grid;
    gap: 8px;
    font-weight: 800;
}

.edit-form select,
.edit-form textarea {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
}

.edit-form button {
    border: 0;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    padding: 14px 18px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.mini-link {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    border-radius: 10px;
    padding: 7px 10px;
    font-weight: 800;
    text-decoration: none;
}

.export-row {
    margin: 12px 0 16px;
}

.export-button {
    display: inline-block;
    background: #16a34a;
    color: white;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 800;
    text-decoration: none;
}

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

.login-card {
    width: min(420px, 100%);
    background: white;
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.login-form {
    display: grid;
    gap: 12px;
    margin: 20px 0;
}

.login-form input {
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 14px;
    font-family: inherit;
}

.login-form button {
    border: 0;
    background: var(--primary);
    color: white;
    border-radius: 14px;
    padding: 13px 16px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-radius: 14px;
    padding: 12px;
    margin-top: 16px;
}

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

.button.secondary {
    background: #64748b;
}

.button.danger {
    background: #ef4444;
}

html[data-theme="dark"] {
    --bg: #0f172a;
    --card: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: #243244;
    --primary: #6366f1;
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.16), transparent 34%),
        var(--bg);
}

html[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #111827, #1e1b4b);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .login-card {
    background: var(--card);
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    color: var(--text);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #0b1220;
    color: var(--text);
    border-color: var(--border);
}

.button.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
    transform: translateY(-2px);
}

table tbody tr:hover {
    background: rgba(99, 102, 241, 0.06);
}

html[data-theme="dark"] table tbody tr:hover {
    background: rgba(99, 102, 241, 0.14);
}

.button.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.app-sidebar {
    position: fixed;
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: 250px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.10);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}

.profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.sidebar-profile strong,
.sidebar-profile span {
    display: block;
}

.sidebar-profile span {
    color: var(--muted);
    font-size: 13px;
    margin-top: 3px;
}

.side-nav {
    display: grid;
    gap: 8px;
}

.side-nav a {
    padding: 13px 14px;
    border-radius: 16px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 800;
}

.side-nav a:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.10);
}

.sidebar-bottom {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.sidebar-bottom button,
.sidebar-bottom a {
    border: 0;
    border-radius: 16px;
    padding: 13px 14px;
    font-family: inherit;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-bottom button {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.sidebar-bottom a {
    background: #ef4444;
    color: white;
}

.has-sidebar .page {
    width: auto;
    max-width: 1280px;
    margin-right: 292px;
    margin-left: 24px;
}

html[data-theme="dark"] .app-sidebar {
    background: var(--card);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
}

@media (max-width: 1000px) {
    .app-sidebar {
        position: static;
        width: auto;
        margin: 16px;
    }

    .has-sidebar .page {
        width: min(1180px, calc(100% - 32px));
        margin: 0 auto;
    }

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

.dashboard-charts {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 18px;
    margin: 18px 0;
}

.chart-panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
}

.chart-panel canvas {
    max-height: 320px;
}

@media (max-width: 1000px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.dashboard-charts {
    grid-template-columns: 360px 1fr;
    align-items: stretch;
}

.dashboard-charts + .panel {
    margin-top: 0;
}

.chart-panel {
    min-height: 360px;
}

.chart-panel canvas {
    max-height: 270px;
}

@media (max-width: 1200px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

.region-panel canvas {
    margin: 10px 0 20px;
    max-height: 260px;
}

.region-panel .table-wrap {
    margin-top: 12px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 13px;
    white-space: nowrap;
}

.status-badge.is-new {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-badge.is-called {
    color: #047857;
    background: #d1fae5;
}

.status-badge.is-follow {
    color: #b45309;
    background: #fef3c7;
}

.status-badge.is-interested {
    color: #7e22ce;
    background: #f3e8ff;
}

.status-badge.is-sold {
    color: #15803d;
    background: #dcfce7;
}

.status-badge.is-rejected {
    color: #b91c1c;
    background: #fee2e2;
}

.phone-link {
    color: var(--primary);
    font-weight: 900;
    text-decoration: none;
}

.phone-link:hover {
    text-decoration: underline;
}

.mini-link {
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.table-wrap table {
    font-size: 14px;
}

.table-wrap tbody tr {
    transition: background 0.15s ease;
}

html[data-theme="dark"] .status-badge.is-new {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.18);
}

html[data-theme="dark"] .status-badge.is-called {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.16);
}

html[data-theme="dark"] .status-badge.is-follow {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.16);
}

html[data-theme="dark"] .status-badge.is-interested {
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.16);
}

html[data-theme="dark"] .status-badge.is-sold {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.16);
}

html[data-theme="dark"] .status-badge.is-rejected {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.16);
}

.no-phone-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 900;
    font-size: 13px;
    color: #475569;
    background: #e2e8f0;
}

html[data-theme="dark"] .no-phone-badge {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.16);
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.placeholder-grid div {
    border: 1px dashed var(--border);
    border-radius: 18px;
    padding: 18px;
    background: rgba(99, 102, 241, 0.05);
}

.placeholder-grid strong,
.placeholder-grid span {
    display: block;
}

.placeholder-grid strong {
    margin-bottom: 8px;
    font-size: 18px;
}

.placeholder-grid span {
    color: var(--muted);
}

@media (max-width: 1000px) {
    .placeholder-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body {
        overflow-x: hidden;
    }

    .app-sidebar {
        margin: 10px;
        padding: 14px;
        border-radius: 22px;
    }

    .sidebar-profile {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .side-nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .side-nav a {
        text-align: center;
        padding: 11px 8px;
        font-size: 14px;
    }

    .sidebar-bottom {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }

    .has-sidebar .page {
        width: calc(100% - 20px);
        margin: 0 auto;
        padding: 10px 0 24px;
    }

    .hero {
        padding: 20px;
        border-radius: 22px;
        margin-bottom: 14px;
    }

    .hero h1 {
        font-size: 28px;
        line-height: 1.3;
    }

    .hero .muted {
        font-size: 14px;
        line-height: 1.9;
    }

    .cards,
    .cards-grid,
    .dashboard-charts {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    .card,
    .panel {
        border-radius: 20px;
        padding: 16px;
    }

    .card strong {
        font-size: 26px;
    }

    .chart-panel canvas,
    .region-panel canvas {
        max-height: 240px;
    }

    .filters-form {
        grid-template-columns: 1fr !important;
    }

    .export-button {
        width: 100%;
        text-align: center;
    }

    .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 920px;
        font-size: 13px;
    }

    th,
    td {
        padding: 12px 10px;
        white-space: nowrap;
    }

    .placeholder-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 420px) {
    .side-nav {
        grid-template-columns: 1fr;
    }

    .sidebar-bottom {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 24px;
    }
}

/* Mobile layout hard fix */
@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body.has-sidebar {
        display: block;
        padding: 0;
    }

    .app-sidebar {
        position: relative !important;
        inset: auto !important;
        width: calc(100% - 20px) !important;
        height: auto !important;
        margin: 10px auto !important;
        border-radius: 20px;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
    }

    .has-sidebar .page,
    .page {
        width: calc(100% - 20px) !important;
        max-width: none !important;
        margin: 0 auto !important;
        padding: 0 0 24px !important;
    }

    .hero {
        width: 100%;
        margin: 10px 0 12px;
        padding: 18px;
        border-radius: 20px;
    }

    .hero h1 {
        font-size: 25px;
        line-height: 1.35;
        margin-bottom: 8px;
    }

    .hero .eyebrow {
        font-size: 13px;
    }

    .hero .muted {
        font-size: 13px;
        line-height: 1.8;
    }

    .cards {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 10px;
        margin-bottom: 12px;
    }

    .card {
        min-height: auto;
        padding: 16px;
    }

    .dashboard-charts {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin: 12px 0;
    }

    .panel,
    .chart-panel,
    .region-panel {
        width: 100%;
        min-width: 0;
        padding: 16px;
        border-radius: 20px;
    }

    .chart-panel canvas,
    .region-panel canvas {
        width: 100% !important;
        max-height: 230px;
    }

    .region-panel .table-wrap {
        width: 100%;
        overflow-x: auto;
    }

    .region-panel table {
        min-width: 420px;
    }

    .filters-form {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .filters-form input,
    .filters-form select,
    .filters-form button,
    .filters-form a {
        width: 100%;
    }

    .export-row {
        width: 100%;
    }

    .export-button {
        width: 100%;
        text-align: center;
    }

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-wrap table {
        min-width: 980px;
    }

    .placeholder-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 430px) {
    .app-sidebar {
        padding: 12px;
    }

    .sidebar-profile {
        gap: 10px;
    }

    .profile-avatar {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .side-nav {
        grid-template-columns: 1fr 1fr !important;
    }

    .side-nav a {
        font-size: 13px;
        padding: 10px 8px;
    }

    .sidebar-bottom {
        grid-template-columns: 1fr 1fr !important;
    }

    .sidebar-bottom button,
    .sidebar-bottom a {
        font-size: 13px;
        padding: 11px 8px;
    }
}

@media (max-width: 760px) {
    .dashboard-charts .region-panel .table-wrap {
        display: none;
    }

    .dashboard-charts .region-panel {
        padding-bottom: 22px;
    }

    .dashboard-charts .region-panel canvas {
        margin-bottom: 0;
    }
}

@media (max-width: 760px) {
    .region-panel table,
    .region-panel thead,
    .region-panel tbody,
    .region-panel tr,
    .region-panel th,
    .region-panel td,
    .region-panel .table-wrap {
        display: none !important;
    }

    .region-panel {
        overflow: hidden !important;
    }
}

.scraper-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 20px;
}

.scraper-form label {
    display: grid;
    gap: 8px;
    font-weight: 900;
}

.scraper-form select,
.scraper-form input[type="number"] {
    height: 46px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 12px;
    font-family: inherit;
    background: var(--card);
    color: var(--text);
}

.checkbox-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 12px;
    color: var(--muted);
}

.scraper-form button {
    border: 0;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-family: inherit;
    font-weight: 900;
    padding: 13px 16px;
    cursor: not-allowed;
    opacity: 0.65;
}

.log-box {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(15, 23, 42, 0.04);
}

.log-box strong {
    display: block;
    margin-bottom: 10px;
}

.log-box pre {
    margin: 0;
    white-space: pre-wrap;
    color: var(--muted);
}

@media (max-width: 760px) {
    .scraper-form {
        grid-template-columns: 1fr;
    }
}

.scraper-form button:not(:disabled) {
    cursor: pointer;
    opacity: 1;
}

.log-box {
    position: relative;
}

.log-box .mini-link {
    margin-bottom: 12px;
}

.output-files-box {
    margin-top: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.05);
}

.output-files-box h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.output-files-list {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.output-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: var(--card);
}

.output-file-row strong,
.output-file-row span {
    display: block;
}

.output-file-row span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
    direction: ltr;
    text-align: right;
}

@media (max-width: 760px) {
    .output-file-row {
        align-items: stretch;
        flex-direction: column;
    }

    .output-file-row .mini-link {
        text-align: center;
    }
}

.file-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.file-actions form {
    margin: 0;
}

.mini-button {
    border: 0;
    background: #16a34a;
    color: white;
    border-radius: 10px;
    padding: 7px 10px;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
}

@media (max-width: 760px) {
    .file-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mini-button,
    .file-actions .mini-link {
        width: 100%;
        text-align: center;
    }
}

.settings-actions {
    margin: 18px 0;
}

.quick-status-form {
    margin: 0;
}

.quick-status-select {
    width: 140px;
    min-height: 36px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 999px;
    padding: 6px 12px;
    font-family: inherit;
    font-weight: 900;
    color: var(--text);
    background: rgba(99, 102, 241, 0.10);
    cursor: pointer;
}

html[data-theme="dark"] .quick-status-select {
    background: rgba(99, 102, 241, 0.16);
    color: var(--text);
}

.quick-status-select:focus {
    outline: 2px solid rgba(99, 102, 241, 0.35);
    outline-offset: 2px;
}

.quick-status-select {
    appearance: auto;
    color-scheme: dark;
}

.quick-status-select option {
    background: #111827;
    color: #f8fafc;
    font-weight: 800;
}

html[data-theme="light"] .quick-status-select {
    color-scheme: light;
}

html[data-theme="light"] .quick-status-select option {
    background: #ffffff;
    color: #0f172a;
}

.quick-status-select.status-new {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

.quick-status-select.status-called {
    background: rgba(100, 116, 139, 0.18);
    border-color: rgba(100, 116, 139, 0.45);
    color: #cbd5e1;
}

.quick-status-select.status-follow {
    background: rgba(139, 92, 246, 0.20);
    border-color: rgba(139, 92, 246, 0.55);
    color: #c4b5fd;
}

.quick-status-select.status-interested {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.50);
    color: #fcd34d;
}

.quick-status-select.status-sold {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.50);
    color: #86efac;
}

.quick-status-select.status-rejected {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.50);
    color: #fca5a5;
}

html[data-theme="light"] .quick-status-select.status-new {
    background: #dbeafe;
    color: #1d4ed8;
}

html[data-theme="light"] .quick-status-select.status-called {
    background: #e2e8f0;
    color: #334155;
}

html[data-theme="light"] .quick-status-select.status-follow {
    background: #ede9fe;
    color: #6d28d9;
}

html[data-theme="light"] .quick-status-select.status-interested {
    background: #fef3c7;
    color: #92400e;
}

html[data-theme="light"] .quick-status-select.status-sold {
    background: #dcfce7;
    color: #166534;
}

html[data-theme="light"] .quick-status-select.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

/* Stronger status select backgrounds */
.quick-status-select.status-new {
    background: rgba(59, 130, 246, 0.28) !important;
}

.quick-status-select.status-called {
    background: rgba(100, 116, 139, 0.28) !important;
}

.quick-status-select.status-follow {
    background: rgba(139, 92, 246, 0.30) !important;
}

.quick-status-select.status-interested {
    background: rgba(245, 158, 11, 0.28) !important;
}

.quick-status-select.status-sold {
    background: rgba(34, 197, 94, 0.28) !important;
}

.quick-status-select.status-rejected {
    background: rgba(239, 68, 68, 0.28) !important;
}

html[data-theme="light"] .quick-status-select.status-new {
    background: rgba(59, 130, 246, 0.16) !important;
}

html[data-theme="light"] .quick-status-select.status-called {
    background: rgba(100, 116, 139, 0.16) !important;
}

html[data-theme="light"] .quick-status-select.status-follow {
    background: rgba(139, 92, 246, 0.16) !important;
}

html[data-theme="light"] .quick-status-select.status-interested {
    background: rgba(245, 158, 11, 0.18) !important;
}

html[data-theme="light"] .quick-status-select.status-sold {
    background: rgba(34, 197, 94, 0.16) !important;
}

html[data-theme="light"] .quick-status-select.status-rejected {
    background: rgba(239, 68, 68, 0.16) !important;
}

.filters-form select {
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0 14px;
    font-family: inherit;
    font-weight: 800;
    background: var(--card);
    color: var(--text);
}

html[data-theme="dark"] .filters-form select {
    background: #0b1220;
    color: #f8fafc;
}

.filters-form select option {
    background: #111827;
    color: #f8fafc;
}

html[data-theme="light"] .filters-form select option {
    background: #ffffff;
    color: #0f172a;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
    direction: rtl;
}

.page-link,
.page-info,
.page-dots {
    min-width: 42px;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    background: rgba(99, 102, 241, 0.08);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-info {
    min-width: 130px;
    color: var(--muted);
    background: transparent;
}

.page-dots {
    border-color: transparent;
    background: transparent;
    min-width: auto;
}

html[data-theme="dark"] .page-link,
html[data-theme="dark"] .page-info,
html[data-theme="dark"] .page-dots {
    color: #f8fafc;
}

@media (max-width: 760px) {
    .pagination {
        justify-content: stretch;
    }

    .page-link,
    .page-info {
        flex: 1;
    }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 24px;
    direction: rtl;
}

.page-link,
.page-info,
.page-dots {
    min-width: 42px;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    background: rgba(99, 102, 241, 0.08);
}

.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-info {
    min-width: 130px;
    color: var(--muted);
    background: transparent;
}

.page-dots {
    border-color: transparent;
    background: transparent;
    min-width: auto;
}

html[data-theme="dark"] .page-link,
html[data-theme="dark"] .page-info,
html[data-theme="dark"] .page-dots {
    color: #f8fafc;
}

@media (max-width: 760px) {
    .pagination {
        justify-content: stretch;
    }

    .page-link,
    .page-info {
        flex: 1;
    }
}

.address-cell {
    max-width: 340px;
    min-width: 220px;
    color: var(--muted);
    line-height: 1.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

html[data-theme="dark"] .address-cell {
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .address-cell {
        min-width: 260px;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-card {
    width: min(760px, 100%);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--card);
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    padding: 22px;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-close {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--text);
    font-size: 28px;
    cursor: pointer;
}

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

.lead-info-grid div,
.lead-address-full {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.05);
}

.lead-info-grid span,
.lead-address-full span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.lead-info-grid strong {
    display: block;
    line-height: 1.8;
}

.lead-address-full {
    margin-top: 12px;
}

.lead-address-full p {
    margin: 0;
    line-height: 2;
}

.info-button {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(14, 165, 233, 0.35);
}

@media (max-width: 760px) {
    .lead-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-card {
        padding: 16px;
    }
}

.modal-backdrop[hidden] {
    display: none !important;
}

.modal-backdrop {
    overflow-y: auto;
}

.modal-card {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.7) rgba(15, 23, 42, 0.4);
}

.modal-card::-webkit-scrollbar {
    width: 8px;
}

.modal-card::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 999px;
}

.modal-card::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.7);
    border-radius: 999px;
}

.modal-card::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.9);
}

.note-button {
    background: rgba(245, 158, 11, 0.16);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.note-modal-card {
    width: min(680px, 100%);
}

.note-lead-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.note-lead-summary div {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.05);
}

.note-lead-summary span,
.note-form label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.note-lead-summary strong {
    display: block;
    line-height: 1.8;
}

.note-form textarea {
    width: 100%;
    resize: vertical;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 2;
    background: rgba(99, 102, 241, 0.05);
    color: var(--text);
}

html[data-theme="dark"] .note-form textarea {
    background: #0b1220;
    color: #f8fafc;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

@media (max-width: 760px) {
    .note-lead-summary {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

.note-form .clear-button,
.modal-actions .clear-button {
    background: rgba(100, 116, 139, 0.18);
    color: var(--text);
    border: 1px solid rgba(100, 116, 139, 0.35);
    border-radius: 14px;
    padding: 12px 18px;
    font-family: inherit;
    font-weight: 900;
    cursor: pointer;
}

html[data-theme="dark"] .note-form .clear-button,
html[data-theme="dark"] .modal-actions .clear-button {
    background: rgba(148, 163, 184, 0.12);
    color: #f8fafc;
}

html[data-theme="light"] .note-form .clear-button,
html[data-theme="light"] .modal-actions .clear-button {
    background: #e2e8f0;
    color: #0f172a;
}

.note-button.has-note {
    background: rgba(34, 197, 94, 0.20);
    color: #86efac;
    border-color: rgba(34, 197, 94, 0.50);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12) inset;
}

html[data-theme="light"] .note-button.has-note {
    background: rgba(34, 197, 94, 0.16);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.35);
}

.location-button {
    background: rgba(236, 72, 153, 0.16);
    color: #f9a8d4;
    border: 1px solid rgba(236, 72, 153, 0.35);
    min-width: 48px;
    font-size: 17px;
}

html[data-theme="light"] .location-button {
    background: rgba(236, 72, 153, 0.12);
    color: #be185d;
    border-color: rgba(236, 72, 153, 0.30);
}

.location-modal-card {
    width: min(700px, 100%);
}

.location-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.location-summary div,
.location-link-box {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: rgba(99, 102, 241, 0.05);
}

.location-summary span,
.location-link-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 7px;
}

.location-summary strong {
    display: block;
    line-height: 1.8;
}

.location-link-box {
    margin-top: 12px;
}

.location-link-box input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
    font-family: inherit;
    direction: ltr;
    text-align: left;
    background: rgba(99, 102, 241, 0.05);
    color: var(--text);
}

html[data-theme="dark"] .location-link-box input {
    background: #0b1220;
    color: #f8fafc;
}

.disabled-link {
    opacity: 0.45;
    pointer-events: none;
}

@media (max-width: 760px) {
    .location-summary {
        grid-template-columns: 1fr;
    }
}

/* Uniform action buttons inside leads table */
td .mini-button,
td .mini-link {
    width: 92px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    box-sizing: border-box;
}

td .location-button {
    min-width: 92px;
    font-size: 14px;
}

td .note-button.has-note {
    min-height: 38px;
}

@media (max-width: 900px) {
    td .mini-button,
    td .mini-link {
        width: 84px;
        font-size: 13px;
        padding: 7px 8px;
    }
}

/* Final action buttons alignment */
td .mini-button,
td .mini-link {
    width: 96px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 10px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

td .note-button.has-note {
    height: 38px !important;
    min-height: 38px !important;
}

td .location-button {
    height: 38px !important;
    min-height: 38px !important;
}

td .mini-button + .mini-button,
td .mini-button + .mini-link,
td .mini-link + .mini-button {
    margin-top: 6px;
}

/* Put row action buttons side-by-side on desktop */
td:first-child {
    min-width: 310px;
}

td:first-child .mini-button,
td:first-child .mini-link {
    margin-top: 0 !important;
    margin-inline: 3px;
}

td:first-child {
    white-space: nowrap;
}

@media (max-width: 900px) {
    td:first-child {
        min-width: 110px;
        white-space: normal;
    }

    td:first-child .mini-button,
    td:first-child .mini-link {
        display: flex;
        margin-top: 6px !important;
        margin-inline: 0;
    }
}

/* Compact vertical action buttons - override horizontal attempt */
td:first-child {
    min-width: 112px !important;
    width: 112px !important;
    white-space: normal !important;
}

td:first-child .mini-button,
td:first-child .mini-link {
    width: 92px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 8px !important;
    margin: 0 auto 5px auto !important;
    font-size: 13px !important;
    border-radius: 11px !important;
    display: flex !important;
}

td:first-child .mini-button:last-child,
td:first-child .mini-link:last-child {
    margin-bottom: 0 !important;
}

/* Slightly reduce row height after action buttons become compact */
.leads-table td,
table td {
    padding-top: 14px;
    padding-bottom: 14px;
}

/* Icon action buttons - compact CRM table */
td:first-child {
    min-width: 62px !important;
    width: 62px !important;
    text-align: center;
}

td:first-child .action-icon {
    width: 40px !important;
    height: 34px !important;
    min-height: 34px !important;
    padding: 0 !important;
    margin: 0 auto 5px auto !important;
    border-radius: 12px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

td:first-child .note-button.has-note {
    width: 48px !important;
    font-size: 15px !important;
}

/* reduce row height now that actions are compact */
table td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

.quick-status-select {
    min-height: 34px;
}

/* Compact inline action icons */
td:first-child {
    min-width: 132px !important;
    width: 132px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

td:first-child .action-icon {
    width: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 2px !important;
    border-radius: 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

td:first-child .note-button.has-note {
    width: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
}

td:first-child .info-button {
    font-size: 18px !important;
}

td:first-child .location-button {
    font-size: 15px !important;
}

table td {
    padding-top: 10px !important;
    padding-bottom: 10px !important;
}

/* Force lead row action buttons into one compact line */
td:has(.action-icon) {
    width: 128px !important;
    min-width: 128px !important;
    max-width: 128px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

td:has(.action-icon) .mini-button.action-icon {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 2px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

td:has(.action-icon) .note-button.has-note {
    width: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
}

td:has(.action-icon) .info-button {
    font-size: 17px !important;
}

td:has(.action-icon) .location-button {
    font-size: 15px !important;
}

/* make rows shorter after compact actions */
table td {
    padding-top: 9px !important;
    padding-bottom: 9px !important;
}

/* Collapsible right sidebar */
.sidebar-toggle {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.12);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    margin-bottom: 12px;
    font-family: inherit;
    font-weight: 900;
}

.app-sidebar {
    transition: width 0.2s ease, padding 0.2s ease;
}

body.has-sidebar {
    transition: padding-right 0.2s ease;
}

html[data-sidebar="collapsed"] body.has-sidebar {
    padding-right: 104px !important;
}

html[data-sidebar="collapsed"] .app-sidebar {
    width: 82px !important;
    padding: 18px 10px !important;
}

html[data-sidebar="collapsed"] .sidebar-profile strong,
html[data-sidebar="collapsed"] .sidebar-profile span,
html[data-sidebar="collapsed"] .side-nav a,
html[data-sidebar="collapsed"] .sidebar-bottom a,
html[data-sidebar="collapsed"] .sidebar-bottom button {
    font-size: 0 !important;
}

html[data-sidebar="collapsed"] .sidebar-profile {
    justify-content: center;
}

html[data-sidebar="collapsed"] .profile-avatar {
    margin: 0 auto;
}

html[data-sidebar="collapsed"] .side-nav a {
    width: 48px;
    height: 48px;
    padding: 0 !important;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[data-sidebar="collapsed"] .side-nav a::before {
    content: attr(data-icon);
    font-size: 20px;
    line-height: 1;
}

html[data-sidebar="collapsed"] .sidebar-bottom,
html[data-sidebar="collapsed"] .sidebar-actions {
    display: grid;
    gap: 10px;
}

html[data-sidebar="collapsed"] .sidebar-bottom a,
html[data-sidebar="collapsed"] .sidebar-bottom button,
html[data-sidebar="collapsed"] .theme-toggle {
    width: 48px !important;
    min-width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin-inline: auto;
    overflow: hidden;
}

html[data-sidebar="collapsed"] .sidebar-toggle {
    margin-inline: auto;
}

@media (max-width: 760px) {
    html[data-sidebar="collapsed"] body.has-sidebar {
        padding-right: 0 !important;
    }

    html[data-sidebar="collapsed"] .app-sidebar {
        width: 100% !important;
    }
}

/* Cleaner collapsed sidebar: icons only */
html[data-sidebar="collapsed"] .app-sidebar {
    width: 76px !important;
    padding: 16px 8px !important;
}

html[data-sidebar="collapsed"] body.has-sidebar {
    padding-right: 92px !important;
}

html[data-sidebar="collapsed"] .sidebar-profile strong,
html[data-sidebar="collapsed"] .sidebar-profile span {
    display: none !important;
}

html[data-sidebar="collapsed"] .side-nav a {
    font-size: 0 !important;
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    margin: 0 auto 8px auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html[data-sidebar="collapsed"] .side-nav a::before {
    content: attr(data-icon);
    font-size: 20px !important;
    line-height: 1 !important;
}

html[data-sidebar="collapsed"] .sidebar-bottom a,
html[data-sidebar="collapsed"] .sidebar-bottom button,
html[data-sidebar="collapsed"] .theme-toggle {
    font-size: 0 !important;
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    padding: 0 !important;
    margin: 0 auto 8px auto !important;
    border-radius: 14px !important;
}

html[data-sidebar="collapsed"] .theme-toggle::before {
    content: "◐";
    font-size: 20px !important;
}

html[data-sidebar="collapsed"] .sidebar-bottom a::before {
    content: "⎋";
    font-size: 20px !important;
}

html[data-sidebar="collapsed"] .sidebar-toggle {
    width: 46px !important;
    height: 46px !important;
    margin: 0 auto 12px auto !important;
}

/* Sticky actions column in leads table */
.table-wrap {
    position: relative;
}

.table-wrap table th:first-child,
.table-wrap table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--card);
    box-shadow: 12px 0 18px rgba(2, 6, 23, 0.18);
}

.table-wrap table th:first-child {
    z-index: 5;
}

html[data-theme="dark"] .table-wrap table th:first-child,
html[data-theme="dark"] .table-wrap table td:first-child {
    background: #0f172a;
}

html[data-theme="light"] .table-wrap table th:first-child,
html[data-theme="light"] .table-wrap table td:first-child {
    background: #ffffff;
}

/* Let main content use freed space when sidebar is collapsed */
html[data-sidebar="collapsed"] body.has-sidebar {
    padding-right: 92px !important;
}

html[data-sidebar="collapsed"] .page {
    max-width: none !important;
    width: calc(100vw - 122px) !important;
    margin-right: 0 !important;
    margin-left: 24px !important;
}

html[data-sidebar="collapsed"] .hero,
html[data-sidebar="collapsed"] .panel,
html[data-sidebar="collapsed"] .cards-grid,
html[data-sidebar="collapsed"] .dashboard-grid {
    max-width: none !important;
}

html[data-sidebar="collapsed"] .table-wrap {
    width: 100% !important;
}

/* In open sidebar mode, keep current layout stable */
html:not([data-sidebar="collapsed"]) .page {
    transition: width 0.2s ease, max-width 0.2s ease, margin 0.2s ease;
}

/* Force hide sidebar labels when collapsed */
html[data-sidebar="collapsed"] .side-nav a {
    color: transparent !important;
    overflow: hidden !important;
}

html[data-sidebar="collapsed"] .side-nav a::before {
    color: var(--text) !important;
}

html[data-sidebar="collapsed"] .sidebar-bottom a,
html[data-sidebar="collapsed"] .sidebar-bottom button {
    color: transparent !important;
    overflow: hidden !important;
}

html[data-sidebar="collapsed"] .sidebar-bottom a::before,
html[data-sidebar="collapsed"] .sidebar-bottom button::before {
    color: var(--text) !important;
}

html[data-sidebar="collapsed"] .side-nav a[data-icon="↗"]::before {
    content: "↗";
}

/* Fix sticky action cell to show all 3 icons */
.table-wrap table th:first-child,
.table-wrap table td:first-child,
td:has(.action-icon) {
    width: 128px !important;
    min-width: 128px !important;
    max-width: 128px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

td:has(.action-icon) .mini-button.action-icon {
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 30px !important;
    min-height: 30px !important;
    margin: 0 2px !important;
    padding: 0 !important;
    display: inline-flex !important;
    vertical-align: middle !important;
}

/* Small breathing gap between collapsed sidebar and main content */
html[data-sidebar="collapsed"] body.has-sidebar {
    padding-right: 108px !important;
}

html[data-sidebar="collapsed"] .page {
    width: calc(100vw - 146px) !important;
    margin-right: 12px !important;
    margin-left: 24px !important;
}

/* Clean collapsed sidebar: icon-only */
html[data-sidebar="collapsed"] .app-sidebar {
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    padding: 16px 8px !important;
    overflow: hidden !important;
}

html[data-sidebar="collapsed"] body.has-sidebar {
    padding-right: 104px !important;
}

html[data-sidebar="collapsed"] .page {
    width: calc(100vw - 136px) !important;
    max-width: none !important;
    margin-right: 12px !important;
    margin-left: 20px !important;
}

html[data-sidebar="collapsed"] .sidebar-profile strong,
html[data-sidebar="collapsed"] .sidebar-profile span {
    display: none !important;
}

html[data-sidebar="collapsed"] .side-nav a {
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    margin: 0 auto 8px auto !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
    font-size: 0 !important;
    color: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html[data-sidebar="collapsed"] .side-nav a::before {
    content: attr(data-icon) !important;
    text-indent: 0 !important;
    font-size: 21px !important;
    color: #cbd5e1 !important;
}

html[data-sidebar="collapsed"] .sidebar-toggle,
html[data-sidebar="collapsed"] .theme-toggle,
html[data-sidebar="collapsed"] .sidebar-bottom a,
html[data-sidebar="collapsed"] .sidebar-bottom button {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    padding: 0 !important;
    margin: 0 auto 10px auto !important;
    overflow: hidden !important;
    font-size: 0 !important;
    text-indent: -9999px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

html[data-sidebar="collapsed"] .sidebar-toggle {
    font-size: 20px !important;
    text-indent: 0 !important;
}

html[data-sidebar="collapsed"] .theme-toggle::before {
    content: "◐" !important;
    text-indent: 0 !important;
    font-size: 21px !important;
    color: #cbd5e1 !important;
}

html[data-sidebar="collapsed"] .sidebar-bottom a::before,
html[data-sidebar="collapsed"] .sidebar-bottom button::before {
    content: "⎋" !important;
    text-indent: 0 !important;
    font-size: 21px !important;
    color: #ffffff !important;
}
