:root {
    --square-primary: #1d4ed8;
    --square-primary-dark: #1e3a8a;
    --square-accent: #10b981;
    --square-warning: #f59e0b;
    --square-danger: #ef4444;
    --square-ink: #111827;
    --square-muted: #64748b;
    --square-border: #dbe3ee;
    --square-surface: #ffffff;
    --square-bg: #f5f7fb;
}

body {
    color: var(--square-ink);
    background: var(--square-bg);
    font-size: 13px;
    font-family: "Aptos", "Segoe UI Variable", "Segoe UI", "Inter", Arial, sans-serif;
    font-weight: 400;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.crm-login-page {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
    align-items: stretch;
    justify-content: stretch;
    background:
        radial-gradient(circle at 16% 8%, rgba(37, 99, 235, .12), transparent 28%),
        radial-gradient(circle at 96% 12%, rgba(245, 158, 11, .14), transparent 24%),
        linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
}

a {
    color: var(--square-primary);
}

.main-sidebar {
    background: #101827;
}

.brand-link {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.square-brand-link {
    display: flex;
    align-items: center;
    min-height: 66px;
    padding: 10px 14px;
}

.brand-logo-frame {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    margin-right: 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.square-brand-image {
    float: none;
    max-height: 34px;
    width: 34px;
    margin: 0;
    object-fit: contain;
    opacity: 1;
}

.brand-link .brand-text {
    font-weight: 750;
    font-size: .98rem;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: normal;
}

.sidebar .user-panel {
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.sidebar-mini.sidebar-collapse .main-sidebar .brand-text,
.sidebar-mini.sidebar-collapse .main-sidebar .user-panel .info,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar p,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar .right,
.sidebar-mini.sidebar-collapse .main-sidebar .sidebar-caret {
    display: none !important;
}

.sidebar-mini.sidebar-collapse .main-sidebar .square-brand-link,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-link {
    justify-content: center;
}

.sidebar-mini.sidebar-collapse .main-sidebar .brand-logo-frame,
.sidebar-mini.sidebar-collapse .main-sidebar .nav-icon {
    margin-right: 0 !important;
}

.nav-sidebar > .nav-item > .nav-link {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 4px;
    min-height: 42px;
    display: flex;
    align-items: center;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
}

.nav-sidebar > .nav-item > .nav-link > .nav-icon {
    width: 1.45rem;
    margin-right: .55rem;
    font-size: 1rem;
    text-align: center;
    color: #cbd5e1;
}

.nav-sidebar > .nav-item > .nav-link p {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    padding-right: 18px;
    white-space: nowrap;
}

.nav-sidebar .right {
    display: none !important;
}

.nav-sidebar > .nav-item > .nav-link .right {
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    color: #cbd5e1;
    font-size: .78rem !important;
    line-height: 1 !important;
    transform: translateY(-50%);
}

.nav-sidebar > .nav-item.menu-open > .nav-link .right {
    transform: translateY(-50%) rotate(-90deg);
}

.sidebar-caret {
    position: absolute;
    right: 13px;
    top: 50%;
    color: #cbd5e1;
    font-size: 18px;
    line-height: 1;
    transform: translateY(-50%);
    transition: transform .16s ease;
}

.nav-sidebar > .nav-item.menu-open > .nav-link .sidebar-caret {
    transform: translateY(-50%) rotate(90deg);
}

.nav-sidebar > .nav-item > .nav-link.active,
.nav-sidebar > .nav-item > .nav-link:hover {
    background: rgba(37, 99, 235, .18);
    color: #fff;
}

.nav-sidebar > .nav-item > .nav-link.active > .nav-icon,
.nav-sidebar > .nav-item > .nav-link:hover > .nav-icon {
    color: #fff;
}

.main-header {
    border-bottom: 1px solid var(--square-border);
    min-height: 58px;
}

.top-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 750;
    color: var(--square-ink) !important;
}

.top-brand-mark {
    width: 26px;
    height: 26px;
    object-fit: contain;
    margin-right: 8px;
}

.content-wrapper {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, .7) 0, rgba(255, 255, 255, 0) 170px),
        var(--square-bg);
}

.content > .container-fluid,
.content-header > .container-fluid {
    padding-left: 22px;
    padding-right: 22px;
}

.content-header {
    padding: 16px 0 10px;
}

.content-header h1 {
    color: var(--square-ink);
    font-size: 20px;
    font-weight: 720;
    line-height: 1.2;
    letter-spacing: 0;
}

.crm-card,
.card {
    border: 1px solid var(--square-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 16px 36px rgba(15, 23, 42, .05);
}

.crm-card > .card-body {
    padding: 18px 20px;
}

.crm-list-card {
    overflow: hidden;
}

.crm-list-card .table-responsive {
    margin-top: 4px;
}

.crm-list-card .table {
    margin-bottom: 0;
}

.card-header {
    background: var(--square-surface);
    border-bottom: 1px solid var(--square-border);
}

.card-title {
    color: var(--square-ink);
    font-weight: 700;
    font-size: 16px;
}

.crm-stat-card {
    position: relative;
    min-height: 118px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 8px;
    color: #fff;
    padding: 20px 22px;
    box-shadow: 0 16px 34px rgba(15, 23, 42, .14);
}

.crm-stat-card .stat-value {
    display: block;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

.crm-stat-card .stat-label {
    display: block;
    margin-top: 10px;
    font-size: 15px;
    font-weight: 700;
}

.crm-stat-card .stat-icon {
    position: absolute;
    right: 18px;
    top: 20px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .9);
    font-size: 20px;
}

.crm-stat-card.primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.crm-stat-card.teal {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.crm-stat-card.amber {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.crm-stat-card.green {
    background: linear-gradient(135deg, #059669, #16a34a);
}

.crm-stat-card.rose {
    background: linear-gradient(135deg, #be123c, #f43f5e);
}

.crm-stat-card.slate {
    background: linear-gradient(135deg, #334155, #0f172a);
}

.table thead th {
    border-top: 0;
    border-bottom: 1px solid var(--square-border);
    color: #64748b;
    font-size: 11px;
    font-weight: 720;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
    padding: 12px 16px;
}

.table td {
    vertical-align: middle;
    color: #1f2937;
    font-size: 13px;
    padding: 13px 16px;
    border-top-color: #edf2f7;
}

.table td a {
    color: #1d4ed8;
    font-weight: 650;
}

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

.table-hover tbody tr:hover {
    background: #f8fbff;
}

.table-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #334155;
}

.table-sort-link i {
    color: #94a3b8;
    font-size: .72rem;
}

.badge-status,
.badge-rating {
    font-size: 11px;
    font-weight: 700;
    padding: .22rem .45rem;
    border-radius: 999px;
}

.timeline-entry {
    border-left: 3px solid var(--square-primary);
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.btn {
    min-height: 36px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 650;
    letter-spacing: 0;
}

.btn-primary {
    background: var(--square-primary);
    border-color: var(--square-primary);
    box-shadow: 0 8px 18px rgba(29, 78, 216, .18);
}

.btn-outline-primary {
    color: var(--square-primary);
    border-color: var(--square-primary);
    background: #fff;
}

.form-control {
    border-color: #cbd5e1;
    border-radius: 7px;
    min-height: 38px;
    color: #334155;
    font-size: 13px;
    box-shadow: none;
}

.form-control:focus {
    border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .09);
}

.form-control::placeholder {
    color: #94a3b8;
}

.password-input-group .form-control {
    border-right: 0;
}

.password-input-group .password-toggle-btn {
    min-width: 42px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--square-muted);
    box-shadow: none;
    line-height: 1;
}

.password-input-group .password-toggle-btn:hover,
.password-input-group .password-toggle-btn:focus,
.password-input-group .password-toggle-btn:active,
.password-input-group .password-toggle-btn:active:focus {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: none;
    color: var(--square-muted);
}

.password-input-group .password-toggle-btn:focus {
    outline: none;
}

.form-group label {
    color: #0f172a;
    font-size: 12px;
    font-weight: 650;
    margin-bottom: 7px;
}

.crm-filter-form {
    margin-bottom: 12px;
}

.crm-filter-form [class*="col-"] {
    padding-left: 8px;
    padding-right: 8px;
}

.crm-filter-form .btn {
    min-height: 38px;
}

.btn-group form {
    display: inline-flex;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: nowrap;
}

.table-actions form {
    margin: 0;
}

.table-actions .btn,
.table-actions button {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    border-radius: 8px;
    background: #fff;
}

.table-actions .btn i,
.table-actions button i {
    font-size: 0.82rem;
    line-height: 1;
}

.pagination {
    margin: 16px 0 0;
    align-items: center;
}

.pagination .page-link {
    min-width: 34px;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #334155;
    border-color: #dbe3ee;
    font-size: 13px;
    font-weight: 600;
    box-shadow: none;
}

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

.pagination svg {
    width: 14px !important;
    height: 14px !important;
}

.crm-login-shell {
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(560px, 44%) minmax(0, 56%);
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.crm-login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 18px clamp(48px, 6vw, 96px) 34px;
    background: #fff;
    overflow: hidden;
}

.crm-login-content {
    width: 100%;
    max-width: 486px;
    transform: translateY(-18px);
}

.brand-login-logo {
    margin-bottom: 22px;
    text-align: center;
}

.brand-login-logo img {
    width: 156px;
    height: auto;
    display: inline-block;
    mix-blend-mode: multiply;
}

.login-copy {
    margin-bottom: 22px;
    text-align: center;
}

.login-kicker {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, .08);
    color: var(--square-primary-dark);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.login-copy h1 {
    margin: 14px 0 8px;
    color: var(--square-ink);
    font-size: clamp(34px, 2.8vw, 44px);
    line-height: 1.12;
    font-weight: 900;
}

.login-copy p {
    color: var(--square-primary-dark);
    font-size: 15px;
    line-height: 1.45;
    font-weight: 800;
    letter-spacing: .04em;
    margin: 0;
}

.login-form-card {
    border: 1px solid var(--square-border);
    border-radius: 14px;
    box-shadow: 0 24px 54px rgba(15, 23, 42, .1);
}

.login-card-body {
    padding: 30px;
    border-radius: 14px;
}

.login-card-body label {
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.login-card-body .input-group-text {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--square-muted);
}

.login-submit-btn {
    height: 54px;
    margin-top: 4px;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .24);
}

.crm-login-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 48px 54px;
    background: linear-gradient(135deg, #202b46 0%, #344f96 100%);
    overflow: hidden;
}

.crm-illustration {
    position: relative;
    width: min(580px, 100%);
    height: min(720px, calc(100vh - 96px));
    min-height: 580px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 38px 38px 32px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 32% 28%, rgba(219, 234, 254, .98), transparent 31%),
        radial-gradient(circle at 68% 46%, rgba(219, 234, 254, .78), transparent 32%),
        #ffffff;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .24);
    overflow: hidden;
}

.crm-illustration::before,
.crm-illustration::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(37, 99, 235, .08);
}

.crm-illustration::before {
    width: 92px;
    height: 92px;
    left: 42px;
    top: 210px;
}

.crm-illustration::after {
    width: 110px;
    height: 110px;
    right: 52px;
    bottom: 150px;
}

.illustration-title {
    position: relative;
    z-index: 2;
    color: #1565c0;
    text-align: center;
    text-transform: uppercase;
    font-weight: 900;
    font-size: clamp(20px, 1.8vw, 26px);
    line-height: 1.1;
    letter-spacing: .02em;
    white-space: nowrap;
}

.illustration-stage {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 360px;
}

.lens {
    position: absolute;
    left: 50%;
    top: 54%;
    width: 300px;
    height: 136px;
    transform: translate(-50%, -50%);
}

.lens-base {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 8px;
    height: 74px;
    border: 13px solid #78909c;
    border-top-width: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .7);
    box-shadow: inset 0 0 0 6px rgba(15, 23, 42, .04);
}

.bars {
    position: absolute;
    left: 52px;
    right: 48px;
    bottom: 68px;
    height: 168px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    z-index: 3;
}

.bar {
    position: relative;
    width: 38px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 10px 18px rgba(15, 23, 42, .16);
}

.bar b {
    position: absolute;
    left: 50%;
    bottom: -28px;
    transform: translateX(-50%);
    color: #64748b;
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.bar.red {
    height: 76px;
    background: #d53f4f;
}

.bar.gold {
    height: 114px;
    background: #f5b62b;
}

.bar.green {
    height: 150px;
    background: #059669;
}

.bar.blue {
    height: 194px;
    background: #0875ad;
}

.growth-arrow {
    position: absolute;
    left: 124px;
    top: -42px;
    color: #16a34a;
    font-size: 74px;
    transform: rotate(18deg);
    z-index: 4;
}

.bubble {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(219, 234, 254, .96);
    color: #1565c0;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(37, 99, 235, .1);
}

.bubble-growth {
    left: 6px;
    top: 150px;
    width: 92px;
    height: 92px;
    font-size: 18px;
}

.bubble-analysis {
    left: 205px;
    top: 16px;
    padding: 8px 18px;
    font-size: 18px;
}

.bubble-review {
    right: 10px;
    bottom: 72px;
    width: 96px;
    height: 96px;
    flex-direction: column;
    font-size: 18px;
}

.gear {
    position: absolute;
    z-index: 3;
    color: #0f6fa9;
    opacity: .92;
}

.gear-one {
    left: 132px;
    top: 56px;
    font-size: 40px;
}

.gear-two {
    right: 82px;
    top: 92px;
    color: #bfdbfe;
    font-size: 54px;
}

.checkmark {
    position: absolute;
    right: 70px;
    top: 24px;
    z-index: 3;
    color: #0875ad;
    font-size: 32px;
}

.mini-card {
    position: absolute;
    z-index: 3;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .1);
}

.chart-card {
    right: 38px;
    top: 138px;
    width: 134px;
    height: 92px;
    padding: 16px;
    color: #0875ad;
}

.chart-card i {
    color: #f59e0b;
    font-size: 34px;
}

.chart-card span {
    display: block;
    height: 7px;
    margin-top: 9px;
    border-radius: 999px;
    background: #dbe4ef;
}

.chart-card span:last-child {
    width: 70%;
}

.rating-card {
    right: 28px;
    bottom: 20px;
    width: 128px;
    padding: 10px 12px;
    color: #1565c0;
}

.stars {
    color: #f5b62b;
    font-size: 13px;
}

.workflow-line {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 5;
    width: 300px;
    height: 64px;
    transform: translateX(-50%);
    border-bottom: 4px solid #2563eb;
    border-radius: 0 0 50% 50%;
}

.workflow-line span {
    position: absolute;
    bottom: -18px;
    width: 50px;
    height: 50px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 12px 22px rgba(37, 99, 235, .24);
}

.workflow-line span:nth-child(1) { left: 0; }
.workflow-line span:nth-child(2) { left: 95px; }
.workflow-line span:nth-child(3) { right: 95px; }
.workflow-line span:nth-child(4) {
    right: 0;
    background: linear-gradient(135deg, #f5b62b, #d97706);
}

.illustration-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #1565c0;
    line-height: 1;
    font-size: clamp(22px, 1.9vw, 30px);
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
}

@media (max-width: 991.98px) {
    .crm-login-shell {
        grid-template-columns: 1fr;
        width: 100vw;
        min-height: 100vh;
    }

    .crm-login-panel {
        padding: 28px 24px;
    }

    .crm-login-visual {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .crm-login-shell {
        width: 100%;
        min-height: 100vh;
        border-radius: 0;
        border: 0;
    }

    .login-copy h1 {
        font-size: 28px;
    }

    .brand-login-logo img {
        width: 170px;
    }

    .login-card-body {
        padding: 22px;
    }
}

@media (max-width: 767.98px) {
    .content-header h1 {
        font-size: 22px;
    }

    .crm-stat-card {
        min-height: 104px;
    }
}
