:root {
    --cn-navy-950: #061426;
    --cn-navy-900: #081a33;
    --cn-navy-850: #0b2342;
    --cn-navy-800: #0d2c52;
    --cn-blue-700: #075dcc;
    --cn-blue-600: #0875ea;
    --cn-blue-500: #1687ff;
    --cn-blue-100: #eaf4ff;
    --cn-cyan-100: #e9fbff;
    --cn-surface: #ffffff;
    --cn-background: #f3f6fb;
    --cn-border: #dfe6ef;
    --cn-border-soft: #edf1f6;
    --cn-text: #172438;
    --cn-text-soft: #607086;
    --cn-text-muted: #8491a3;
    --cn-green: #18875f;
    --cn-green-soft: #e7f8f1;
    --cn-orange: #d86b1d;
    --cn-orange-soft: #fff1e7;
    --cn-purple: #7357c7;
    --cn-purple-soft: #f1edff;
    --cn-red: #cc3d4a;
    --cn-red-soft: #ffebed;
    --sidebar-width: 264px;
    --topbar-height: 76px;
    --shadow-sm: 0 2px 10px rgba(24, 39, 75, 0.06);
    --shadow-md: 0 12px 35px rgba(20, 42, 74, 0.10);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--cn-background);
    color: var(--cn-text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* Application shell */

.crm-shell {
    display: flex;
    min-height: 100vh;
}

.crm-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    min-height: 100vh;
    overflow-y: auto;
    background:
        radial-gradient(
            circle at top right,
            rgba(26, 126, 246, 0.18),
            transparent 35%
        ),
        linear-gradient(180deg, var(--cn-navy-900), var(--cn-navy-950));
    color: #fff;
    box-shadow: 9px 0 30px rgba(4, 18, 36, 0.12);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 98px;
    padding: 17px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-logo {
    display: block;
    width: 178px;
    max-height: 66px;
    object-fit: contain;
    filter:
        drop-shadow(0 3px 9px rgba(0, 0, 0, 0.14))
        brightness(1.12);
}

.sidebar-close {
    display: none;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 1.25rem;
}

.sidebar-section-label {
    padding: 24px 25px 9px;
    color: rgba(211, 226, 247, 0.58);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.sidebar-navigation {
    padding: 0 12px;
}

.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 47px;
    gap: 13px;
    margin: 3px 0;
    padding: 10px 13px;
    border-radius: 9px;
    color: rgba(229, 239, 252, 0.76);
    font-size: 0.91rem;
    font-weight: 520;
    transition:
        background 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.sidebar-link i {
    width: 23px;
    font-size: 1.05rem;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-link.active {
    background:
        linear-gradient(
            90deg,
            rgba(23, 128, 255, 0.95),
            rgba(12, 100, 212, 0.88)
        );
    color: #fff;
    box-shadow: 0 7px 17px rgba(0, 102, 224, 0.25);
}

.sidebar-link.active::before {
    position: absolute;
    left: -12px;
    width: 4px;
    height: 26px;
    border-radius: 0 5px 5px 0;
    background: #77bdff;
    content: "";
}

.sidebar-service-label {
    margin-top: 6px;
}

.sidebar-status-card {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0 15px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
}

.status-indicator {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #42d795;
    box-shadow: 0 0 0 5px rgba(66, 215, 149, 0.12);
}

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

.sidebar-status-card strong {
    color: #f2f7ff;
    font-size: 0.76rem;
}

.sidebar-status-card span {
    margin-top: 2px;
    color: rgba(214, 227, 246, 0.56);
    font-size: 0.67rem;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 18px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-user {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    gap: 10px;
}

.user-avatar,
.profile-avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background:
        linear-gradient(145deg, var(--cn-blue-500), var(--cn-blue-700));
    color: #fff;
    font-weight: 750;
}

.user-avatar {
    width: 37px;
    height: 37px;
}

.user-details {
    min-width: 0;
}

.user-details strong,
.user-details span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-details strong {
    color: #f7faff;
    font-size: 0.78rem;
}

.user-details span {
    margin-top: 1px;
    color: rgba(218, 231, 249, 0.53);
    font-size: 0.67rem;
}

.sidebar-logout {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
    color: rgba(228, 238, 251, 0.67);
    transition: background 150ms ease, color 150ms ease;
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
}

.sidebar-overlay {
    display: none;
}

.crm-main {
    display: flex;
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    flex-direction: column;
    margin-left: var(--sidebar-width);
}

.crm-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    min-height: var(--topbar-height);
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 28px;
    border-bottom: 1px solid var(--cn-border);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 10px rgba(25, 42, 70, 0.035);
    backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions,
.topbar-profile {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 12px;
}

.topbar-title {
    color: var(--cn-text);
    font-size: 1.03rem;
    font-weight: 730;
}

.topbar-subtitle {
    margin-top: 2px;
    color: var(--cn-text-muted);
    font-size: 0.72rem;
}

.topbar-actions {
    gap: 9px;
}

.topbar-action {
    position: relative;
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 1px solid var(--cn-border);
    border-radius: 9px;
    background: #fff;
    color: #4b5d74;
    transition:
        border-color 150ms ease,
        color 150ms ease,
        box-shadow 150ms ease;
}

.topbar-action:hover {
    border-color: #b5cce7;
    color: var(--cn-blue-700);
    box-shadow: var(--shadow-sm);
}

.notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 6px;
    height: 6px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #ff525f;
}

.topbar-profile {
    gap: 9px;
    margin-left: 3px;
    padding-left: 12px;
    border-left: 1px solid var(--cn-border);
}

.profile-avatar {
    width: 38px;
    height: 38px;
}

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

.profile-copy strong {
    color: #24364c;
    font-size: 0.78rem;
}

.profile-copy span {
    color: var(--cn-text-muted);
    font-size: 0.67rem;
}

.mobile-menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--cn-border);
    border-radius: 9px;
    background: #fff;
    color: var(--cn-navy-850);
    font-size: 1.3rem;
}

.crm-content {
    width: 100%;
    max-width: 1720px;
    flex: 1;
    margin: 0 auto;
    padding: 27px 28px 40px;
}

.crm-alert {
    border: 0;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.crm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 18px 28px;
    border-top: 1px solid var(--cn-border);
    background: #fff;
    color: var(--cn-text-muted);
    font-size: 0.7rem;
}

/* Page headings */

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 23px;
}

.page-heading h1 {
    margin: 3px 0 5px;
    color: #12243c;
    font-size: clamp(1.45rem, 2.3vw, 2rem);
    font-weight: 760;
    letter-spacing: -0.026em;
}

.page-heading p {
    margin: 0;
    color: var(--cn-text-soft);
    font-size: 0.88rem;
}

.page-eyebrow {
    color: var(--cn-blue-700);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.page-actions {
    display: flex;
    gap: 9px;
}

.btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 650;
}

.btn-primary {
    border-color: var(--cn-blue-700);
    background:
        linear-gradient(135deg, var(--cn-blue-600), var(--cn-blue-700));
    box-shadow: 0 6px 14px rgba(8, 111, 224, 0.16);
}

.btn-primary:hover {
    border-color: #0554b9;
    background: #055fcf;
}

.btn-outline-primary {
    border-color: #b7cce5;
    color: #185d9f;
    background: #fff;
}

.btn-outline-primary:hover {
    border-color: #2f7cc4;
    background: #edf6ff;
    color: #124e87;
}

/* Dashboard metrics */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.metric-card {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--cn-border-soft);
    border-radius: 12px;
    background: var(--cn-surface);
    box-shadow: var(--shadow-sm);
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.metric-card:hover {
    border-color: #c9d8e9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-icon {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border-radius: 10px;
    font-size: 1rem;
}

.metric-icon-blue {
    background: var(--cn-blue-100);
    color: var(--cn-blue-700);
}

.metric-icon-purple {
    background: var(--cn-purple-soft);
    color: var(--cn-purple);
}

.metric-icon-orange {
    background: var(--cn-orange-soft);
    color: var(--cn-orange);
}

.metric-icon-green,
.metric-icon-teal {
    background: var(--cn-green-soft);
    color: var(--cn-green);
}

.metric-trend {
    padding: 4px 7px;
    border-radius: 20px;
    background: #f1f4f8;
    color: #77869a;
    font-size: 0.61rem;
    font-weight: 680;
}

.metric-trend.positive {
    background: var(--cn-green-soft);
    color: var(--cn-green);
}

.metric-value {
    margin-top: 14px;
    color: #122238;
    font-size: 1.65rem;
    font-weight: 770;
    line-height: 1;
    letter-spacing: -0.035em;
}

.metric-value.metric-currency {
    font-size: 1.38rem;
}

.metric-label {
    margin-top: 8px;
    color: #33455b;
    font-size: 0.78rem;
    font-weight: 700;
}

.metric-description {
    margin-top: 2px;
    color: var(--cn-text-muted);
    font-size: 0.65rem;
}

/* Cards and tables */

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.75fr);
    gap: 18px;
    margin-bottom: 18px;
}

.content-card,
.card {
    overflow: hidden;
    border: 1px solid var(--cn-border-soft);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.content-card-header,
.card-header {
    display: flex;
    min-height: 66px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--cn-border-soft);
    background: #fff;
}

.content-card-header h2 {
    margin: 0;
    color: #24364c;
    font-size: 0.91rem;
    font-weight: 740;
}

.content-card-header p {
    margin: 3px 0 0;
    color: var(--cn-text-muted);
    font-size: 0.68rem;
}

.card-header-link {
    color: var(--cn-blue-700);
    font-size: 0.72rem;
    font-weight: 680;
}

.professional-table,
.table {
    margin: 0;
    vertical-align: middle;
}

.professional-table thead th,
.table thead th {
    padding: 11px 16px;
    border-bottom: 1px solid var(--cn-border);
    background: #f8fafc;
    color: #708095;
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.055em;
    text-transform: uppercase;
    white-space: nowrap;
}

.professional-table tbody td,
.table tbody td {
    padding: 13px 16px;
    border-color: var(--cn-border-soft);
    color: #3d4e63;
    font-size: 0.76rem;
}

.professional-table tbody tr:hover,
.table tbody tr:hover {
    background: #fafcff;
}

.table-primary-text {
    color: #23364d;
    font-weight: 700;
}

.table-secondary-text {
    margin-top: 2px;
    color: var(--cn-text-muted);
    font-size: 0.66rem;
}

.table-value {
    color: #22364e;
    font-weight: 700;
}

.stage-badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 20px;
    background: #eef3f8;
    color: #586a7f;
    font-size: 0.62rem;
    font-weight: 700;
}

.stage-badge.stage-won {
    background: var(--cn-green-soft);
    color: var(--cn-green);
}

.stage-badge.stage-lost {
    background: var(--cn-red-soft);
    color: var(--cn-red);
}

.stage-badge.stage-proposal,
.stage-badge.stage-negotiation {
    background: var(--cn-orange-soft);
    color: var(--cn-orange);
}

.stage-badge.stage-qualified {
    background: var(--cn-blue-100);
    color: var(--cn-blue-700);
}

.task-list {
    padding: 3px 17px 13px;
}

.dashboard-task {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 0;
    border-bottom: 1px solid var(--cn-border-soft);
}

.dashboard-task:last-child {
    border-bottom: 0;
}

.task-status-marker {
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--cn-blue-500);
    box-shadow: 0 0 0 5px var(--cn-blue-100);
}

.dashboard-task-content {
    min-width: 0;
    flex: 1;
}

.dashboard-task-content strong,
.dashboard-task-content span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-task-content strong {
    color: #33465d;
    font-size: 0.74rem;
}

.dashboard-task-content span {
    margin-top: 2px;
    color: var(--cn-text-muted);
    font-size: 0.64rem;
}

.dashboard-task-date {
    color: #75859a;
    font-size: 0.64rem;
    white-space: nowrap;
}

.empty-state {
    padding: 34px 20px;
    text-align: center;
}

.empty-state.compact {
    padding: 28px 15px;
}

.empty-state i {
    color: #9cb6d2;
    font-size: 1.7rem;
}

.empty-state h3 {
    margin: 8px 0 4px;
    color: #394c63;
    font-size: 0.86rem;
}

.empty-state p {
    margin: 0;
    color: var(--cn-text-muted);
    font-size: 0.7rem;
}

.operations-banner {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 20px;
    border: 1px solid #cfe1f2;
    border-radius: 12px;
    background:
        linear-gradient(100deg, #f2f8ff, #f8fbff);
}

.operations-banner-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: var(--cn-blue-100);
    color: var(--cn-blue-700);
    font-size: 1.2rem;
}

.operations-banner div:nth-child(2) {
    flex: 1;
}

.operations-banner strong,
.operations-banner span {
    display: block;
}

.operations-banner strong {
    color: #263c55;
    font-size: 0.78rem;
}

.operations-banner span {
    margin-top: 2px;
    color: var(--cn-text-muted);
    font-size: 0.67rem;
}

.operations-banner a {
    color: var(--cn-blue-700);
    font-size: 0.72rem;
    font-weight: 700;
}

/* Existing form enhancement */

.form-control,
.form-select {
    min-height: 42px;
    border-color: #d7e0ea;
    border-radius: 8px;
    color: #32445a;
    font-size: 0.78rem;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: #73afea;
    box-shadow: 0 0 0 3px rgba(22, 135, 255, 0.11);
}

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

.form-label {
    margin-bottom: 6px;
    color: #41546b;
    font-size: 0.72rem;
    font-weight: 690;
}

/* Login */

.login-page {
    position: relative;
    display: grid;
    min-height: 100vh;
    overflow: hidden;
    grid-template-columns: minmax(420px, 1.08fr) minmax(420px, 0.92fr);
    background: #f6f9fd;
}

.login-brand-panel {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    padding: clamp(38px, 7vw, 100px);
    overflow: hidden;
    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(47, 145, 255, 0.25),
            transparent 35%
        ),
        radial-gradient(
            circle at 10% 90%,
            rgba(0, 75, 175, 0.22),
            transparent 30%
        ),
        linear-gradient(145deg, #06172d, #0a2d58 55%, #064f9f);
}

.login-brand-panel::before {
    position: absolute;
    inset: 0;
    opacity: 0.25;
    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.045) 1px,
            transparent 1px
        );
    background-size: 38px 38px;
    content: "";
}

.login-brand-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.login-side-logo {
    width: 270px;
    max-height: 150px;
    object-fit: contain;
    object-position: left center;
    filter:
        brightness(0) invert(1)
        drop-shadow(0 7px 20px rgba(0, 0, 0, 0.12));
}

.login-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 35px;
    padding: 7px 11px;
    border: 1px solid rgba(147, 200, 255, 0.22);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    color: #cfe7ff;
    font-size: 0.71rem;
    font-weight: 650;
}

.login-brand-content h1 {
    max-width: 590px;
    margin: 22px 0 16px;
    color: #fff;
    font-size: clamp(2.1rem, 4vw, 3.65rem);
    font-weight: 760;
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.login-brand-content > p {
    max-width: 560px;
    margin: 0;
    color: rgba(221, 237, 255, 0.75);
    font-size: clamp(0.9rem, 1.3vw, 1.05rem);
    line-height: 1.65;
}

.login-feature-list {
    display: grid;
    gap: 12px;
    margin-top: 29px;
}

.login-feature-list div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(237, 246, 255, 0.88);
    font-size: 0.8rem;
}

.login-feature-list i {
    color: #5de0ab;
}

.login-form-panel {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    padding: 45px;
    background:
        radial-gradient(
            circle at 85% 15%,
            rgba(25, 134, 255, 0.08),
            transparent 30%
        ),
        #f7f9fc;
}

.login-form-wrapper {
    width: min(430px, 100%);
    padding: 43px;
    border: 1px solid #e1e7ef;
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow:
        0 24px 70px rgba(20, 43, 78, 0.12),
        0 2px 6px rgba(20, 43, 78, 0.04);
}

.login-mobile-logo {
    display: none;
}

.login-form-header {
    margin-bottom: 27px;
}

.login-eyebrow {
    color: var(--cn-blue-700);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-form-header h2 {
    margin: 7px 0 7px;
    color: #142741;
    font-size: 1.72rem;
    font-weight: 760;
    letter-spacing: -0.025em;
}

.login-form-header p {
    margin: 0;
    color: var(--cn-text-soft);
    font-size: 0.78rem;
}

.professional-login-form {
    display: grid;
    gap: 19px;
}

.form-group {
    min-width: 0;
}

.password-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.secure-label {
    color: #789;
    font-size: 0.61rem;
}

.secure-label i {
    color: var(--cn-green);
}

.input-with-icon {
    position: relative;
}

.input-with-icon > i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: #8998aa;
    transform: translateY(-50%);
}

.input-with-icon .form-control {
    height: 49px;
    padding-left: 42px;
    border-color: #d7e0ea;
    background: #fbfcfe;
    font-size: 0.78rem;
}

.login-submit-button {
    display: flex;
    width: 100%;
    height: 50px;
    align-items: center;
    justify-content: space-between;
    margin-top: 3px;
    padding: 0 18px;
    border: 0;
    border-radius: 9px;
    background:
        linear-gradient(135deg, #1687ff, #0563d4);
    color: #fff;
    box-shadow: 0 10px 25px rgba(4, 106, 222, 0.21);
    font-size: 0.78rem;
    font-weight: 710;
}

.login-submit-button:hover {
    background:
        linear-gradient(135deg, #0878eb, #034fae);
    color: #fff;
}

.login-security-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--cn-border-soft);
    color: #7c8b9e;
    font-size: 0.64rem;
    line-height: 1.45;
}

.login-security-note i {
    color: var(--cn-green);
}

.login-background-decoration {
    position: absolute;
    z-index: 1;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}

.login-decoration-one {
    top: -170px;
    right: 22%;
    width: 380px;
    height: 380px;
    background: rgba(70, 160, 255, 0.09);
}

.login-decoration-two {
    right: -110px;
    bottom: -150px;
    width: 380px;
    height: 380px;
    background: rgba(19, 119, 227, 0.08);
}

/* Responsive */

@media (max-width: 1280px) {
    .metric-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

@media (max-width: 991px) {
    .crm-sidebar {
        width: min(285px, 88vw);
        transform: translateX(-105%);
        transition: transform 210ms ease;
    }

    .crm-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 1030;
        display: block;
        visibility: hidden;
        background: rgba(4, 15, 30, 0.55);
        opacity: 0;
        transition:
            opacity 200ms ease,
            visibility 200ms ease;
    }

    .sidebar-overlay.active {
        visibility: visible;
        opacity: 1;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .crm-main {
        width: 100%;
        margin-left: 0;
    }

    .mobile-menu-button {
        display: grid;
        place-items: center;
    }

    .login-page {
        display: block;
        background:
            radial-gradient(
                circle at top right,
                rgba(16, 126, 242, 0.13),
                transparent 34%
            ),
            #f5f8fc;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 25px;
    }

    .login-mobile-logo {
        position: absolute;
        top: 30px;
        left: 50%;
        display: block;
        transform: translateX(-50%);
    }

    .login-mobile-logo img {
        width: 190px;
        max-height: 100px;
        object-fit: contain;
    }

    .login-form-wrapper {
        margin-top: 70px;
    }
}

@media (max-width: 720px) {
    .crm-topbar {
        min-height: 67px;
        padding: 10px 15px;
    }

    .topbar-subtitle,
    .profile-copy,
    .topbar-action:first-child {
        display: none;
    }

    .topbar-profile {
        padding-left: 8px;
    }

    .crm-content {
        padding: 20px 14px 30px;
    }

    .crm-footer {
        display: block;
        padding: 16px;
        text-align: center;
    }

    .crm-footer span {
        display: block;
        margin: 3px 0;
    }

    .page-heading {
        display: block;
    }

    .page-actions {
        margin-top: 15px;
    }

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

    .operations-banner {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .operations-banner a {
        width: 100%;
        margin-left: 56px;
    }
}

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

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

    .login-form-panel {
        padding: 18px;
    }

    .login-form-wrapper {
        padding: 29px 23px;
    }
}


/* ==================================================
   CLOUDNORTH SIGN-IN WATER REFLECTION EFFECT
   ================================================== */

.login-submit-button {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 52px;
    border: 1px solid rgba(70, 170, 255, 0.48);
    background:
        linear-gradient(
            180deg,
            #2494ff 0%,
            #0874e8 48%,
            #0458be 100%
        );
    box-shadow:
        0 12px 28px rgba(4, 99, 215, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 39, 110, 0.35);
    transition:
        transform 180ms ease,
        box-shadow 180ms ease,
        filter 180ms ease;
}

.login-submit-button::before {
    position: absolute;
    z-index: -1;
    top: -140%;
    left: -35%;
    width: 36%;
    height: 380%;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.58),
            transparent
        );
    content: "";
    transform: rotate(24deg);
    animation: cloudnorthWaterSweep 4.2s ease-in-out infinite;
}

.login-submit-button::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 48%;
    border-radius: 0 0 8px 8px;
    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.12),
            rgba(157, 220, 255, 0.04) 45%,
            rgba(0, 38, 100, 0.16)
        );
    content: "";
    pointer-events: none;
}

.water-reflection-text {
    position: relative;
    z-index: 2;
    display: inline-block;
    color: #ffffff;
    font-weight: 750;
    letter-spacing: 0.025em;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.2),
        0 2px 5px rgba(0, 31, 82, 0.35),
        0 7px 8px rgba(155, 218, 255, 0.18);
}

.login-submit-button:hover {
    color: #ffffff;
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow:
        0 15px 32px rgba(4, 99, 215, 0.31),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.login-submit-button:active {
    transform: translateY(1px);
    box-shadow:
        0 7px 16px rgba(4, 99, 215, 0.2),
        inset 0 2px 5px rgba(0, 38, 105, 0.2);
}

.login-submit-button:focus-visible {
    outline: 3px solid rgba(67, 160, 255, 0.3);
    outline-offset: 3px;
}

@keyframes cloudnorthWaterSweep {
    0% {
        left: -45%;
        opacity: 0;
    }

    15% {
        opacity: 0.75;
    }

    45% {
        left: 115%;
        opacity: 0;
    }

    100% {
        left: 115%;
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-submit-button::before {
        animation: none;
    }

    .login-submit-button {
        transition: none;
    }
}

/* ======================================================
   CloudNorth Premium Logo Styling
   ====================================================== */

.sidebar-brand{
    display:flex;
    justify-content:center;
    align-items:center;
    padding:30px 18px 24px;
}

.sidebar-brand img{
    width:165px;
    height:auto;

    padding:16px;

    background:rgba(255,255,255,.08);

    backdrop-filter:blur(12px);

    border-radius:18px;

    border:1px solid rgba(255,255,255,.15);

    box-shadow:
        0 8px 30px rgba(0,0,0,.35),
        0 0 20px rgba(42,144,255,.20);

    transition:.3s;
}

.sidebar-brand img:hover{

    transform:scale(1.04);

    box-shadow:
        0 12px 35px rgba(0,0,0,.40),
        0 0 35px rgba(56,167,255,.45);

}

/* slightly lighter sidebar */

.sidebar{

    background:
        linear-gradient(
            180deg,
            #123e79 0%,
            #0f3363 45%,
            #0a2343 100%
        );

}


/* ==================================================
   CLOUDNORTH SIDEBAR BRANDING — FINAL OVERRIDE
   ================================================== */

.sidebar-brand {
    min-height: 116px !important;
    padding: 17px 15px !important;
    justify-content: center !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-brand > a {
    display: flex !important;
    width: 100% !important;
    min-height: 80px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 14px !important;

    border: 1px solid rgba(198, 220, 246, 0.5);
    border-radius: 14px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 1),
            rgba(242, 247, 253, 0.98)
        );

    box-shadow:
        0 8px 22px rgba(0, 7, 25, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 1);

    overflow: hidden;
}

.sidebar-logo,
.sidebar-brand img {
    display: block !important;
    width: 205px !important;
    max-width: 100% !important;
    height: 64px !important;
    max-height: 64px !important;
    padding: 0 !important;
    margin: 0 auto !important;

    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;

    object-fit: contain !important;
    object-position: center !important;

    opacity: 1 !important;
    filter: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.sidebar-brand img:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
}

/* Keep page titles consistent throughout the CRM. */

.topbar-title {
    color: #172a43 !important;
    font-size: 1.03rem !important;
    font-weight: 760 !important;
    letter-spacing: -0.01em;
}

@media (max-width: 991px) {
    .sidebar-brand {
        min-height: 105px !important;
    }

    .sidebar-logo,
    .sidebar-brand img {
        width: 190px !important;
        height: 58px !important;
    }
}
