:root {
    --mct-cyan: #8ad7f8;
    --mct-cyan-strong: #38b6e8;
    --mct-warm-gray: #a09390;
    --mct-charcoal: #3f3d3f;
    --mct-ink: #27343d;
    --mct-muted: #7a8790;
    --mct-line: #e8edf0;
    --mct-bg: #f5f8fa;
    --mct-white: #ffffff;
    --mct-sidebar: #ffffff;
    --mct-shadow: 0 12px 32px rgba(38, 58, 72, .06);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--mct-bg); }
body { margin: 0; color: var(--mct-ink); font-family: Inter, "Segoe UI", Tahoma, Arial, sans-serif; font-size: 14px; line-height: 1.5; background: var(--mct-bg); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 252px; flex: 0 0 252px; min-height: 100vh; padding: 22px 18px 18px; background: var(--mct-sidebar); border-inline-end: 1px solid var(--mct-line); display: flex; flex-direction: column; position: relative; z-index: 5; }
.sidebar-brand { min-height: 135px; display: flex; align-items: center; justify-content: center; padding: 4px 0 18px; border-bottom: 1px solid var(--mct-line); }
.sidebar-logo { display: block; width: 100%; max-width: 205px; height: auto; object-fit: contain; }
.sidebar-brand-stack { width: 100%; display: flex; flex-direction: column; align-items: center; }
.brand-product-name { display: block; margin-top: -13px; color: #62727b; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-align: center; text-transform: uppercase; }
.sidebar-section-label { margin: 28px 12px 12px; color: #9aa5ac; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 7px; }
.nav-link { min-height: 46px; display: flex; align-items: center; gap: 13px; padding: 0 13px; border-radius: 11px; color: #697781; font-weight: 600; transition: background .18s ease, color .18s ease; }
.nav-link svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.nav-link:hover { background: #f1f9fc; color: var(--mct-charcoal); }
.nav-link.is-active { color: #2b5364; background: #eaf8fe; box-shadow: inset 3px 0 0 var(--mct-cyan-strong); }
.is-rtl .nav-link.is-active { box-shadow: inset -3px 0 0 var(--mct-cyan-strong); }
.sidebar-footer { margin-top: auto; padding: 16px 10px 2px; border-top: 1px solid var(--mct-line); display: flex; align-items: center; gap: 9px; color: #8a969d; font-size: 11px; }
.brand-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mct-cyan-strong); box-shadow: 0 0 0 4px rgba(138, 215, 248, .18); flex: 0 0 auto; }
.main-column { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.topbar { min-height: 76px; padding: 0 34px; background: rgba(255,255,255,.9); border-bottom: 1px solid var(--mct-line); display: flex; align-items: center; gap: 18px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 15px; }
.currency-pill { display: inline-flex; align-items: center; justify-content: center; padding: 7px 11px; color: #45606d; background: #eff9fd; border: 1px solid #d9f1fb; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.currency-pill-large { padding: 9px 13px; }
.language-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid var(--mct-line); border-radius: 999px; background: #f8fafb; }
.language-switch form { margin: 0; }
.language-button { border: 0; background: transparent; color: #73818a; min-width: 38px; padding: 6px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.language-button.is-selected { color: #294b5a; background: var(--mct-cyan); }
.user-chip { display: flex; align-items: center; gap: 9px; color: var(--mct-charcoal); font-weight: 700; }
.user-avatar, .table-avatar { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #355565; background: #e4f6fd; font-size: 12px; font-weight: 800; }
.logout-form { margin: 0; }
.logout-button { border: 0; padding: 8px 11px; color: #697781; background: transparent; border-radius: 8px; font-size: 12px; font-weight: 700; }
.logout-button:hover { color: #9b4b4b; background: #fff2f1; }
.mobile-menu-button { display: none; }
.main-content { width: min(100%, 1600px); margin: 0 auto; padding: 34px 38px 42px; flex: 1; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; margin-bottom: 25px; }
.eyebrow { margin-bottom: 8px; color: #8a9aa3; font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
.page-heading h1 { margin-bottom: 6px; color: var(--mct-charcoal); font-size: clamp(24px, 3vw, 31px); line-height: 1.2; font-weight: 750; letter-spacing: -.035em; }
.page-heading p { margin-bottom: 0; color: var(--mct-muted); font-size: 13px; }
.heading-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 9px; }
.scope-pill { padding: 8px 11px; color: #687984; background: #fff; border: 1px solid var(--mct-line); border-radius: 999px; font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.stat-card { min-height: 142px; padding: 19px 20px; background: #fff; border: 1px solid var(--mct-line); border-radius: 15px; box-shadow: 0 4px 18px rgba(38, 58, 72, .025); }
.stat-card-primary { border-color: #d5f0fb; background: linear-gradient(145deg, #fff 0%, #f4fbfe 100%); }
.stat-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #77858e; font-size: 12px; font-weight: 650; }
.stat-icon { width: 31px; height: 31px; display: inline-flex; align-items: center; justify-content: center; color: #617c89; background: #f2f6f8; border-radius: 9px; font-size: 18px; font-weight: 600; }
.stat-icon-cyan { color: #2f91b9; background: #e3f7ff; }
.stat-value { margin-top: 12px; color: var(--mct-charcoal); font-size: 31px; line-height: 1; font-weight: 780; letter-spacing: -.04em; }
.stat-foot { margin-top: 9px; color: #a0aab0; font-size: 10px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; }
.info-card { min-height: 116px; padding: 19px; display: flex; align-items: flex-start; gap: 15px; background: #fff; border: 1px solid var(--mct-line); border-radius: 15px; }
.info-card-icon { width: 43px; height: 43px; flex: 0 0 43px; display: flex; align-items: center; justify-content: center; color: #39677a; background: #e9f8fe; border-radius: 12px; font-size: 11px; font-weight: 900; }
.notification-icon { color: #7b706d; background: #f4f1f0; }
.notification-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.info-card h2 { margin: 1px 0 5px; color: var(--mct-charcoal); font-size: 13px; }
.info-card p { margin: 0; color: #839099; font-size: 11px; line-height: 1.65; }
.info-card .info-card-strong { margin-bottom: 3px; color: #52616a; font-weight: 700; }
.content-card { margin-top: 18px; overflow: hidden; background: #fff; border: 1px solid var(--mct-line); border-radius: 15px; box-shadow: 0 4px 18px rgba(38, 58, 72, .025); }
.section-heading { min-height: 77px; padding: 17px 21px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--mct-line); }
.section-heading h2 { margin: 0 0 3px; color: var(--mct-charcoal); font-size: 15px; }
.section-heading p { margin: 0; color: #97a2a9; font-size: 11px; }
.section-count { min-width: 31px; height: 31px; display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; color: #3c6a7d; background: #eaf8fe; border-radius: 9px; font-size: 12px; font-weight: 800; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; text-align: start; }
.data-table th { padding: 12px 18px; color: #98a3aa; background: #fbfcfd; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-align: start; text-transform: uppercase; }
.data-table td { padding: 13px 18px; color: #64737c; border-top: 1px solid #f0f3f5; font-size: 12px; }
.data-table tbody tr:hover { background: #fbfdfe; }
.data-table td:first-child { color: var(--mct-charcoal); font-weight: 650; }
.data-table .table-avatar { width: 27px; height: 27px; margin-inline-end: 9px; vertical-align: middle; }
.phone-cell { color: #526d7a !important; font-variant-numeric: tabular-nums; }
.date-cell { color: #8a969d !important; }
.status-badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 750; }
.status-new { color: #287da0; background: #e8f7fd; }
.status-contacted { color: #586c9b; background: #eef1fb; }
.status-follow-up { color: #9b6d22; background: #fff6e5; }
.status-qualified { color: #397b64; background: #eaf7f1; }
.status-won { color: #287a4c; background: #e9f8ee; }
.status-lost { color: #a35d5d; background: #fff0ef; }
.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #9aa5ac; font-size: 12px; }
.empty-state strong { color: #71808a; font-weight: 600; }
.empty-state-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; color: #7dbbd4; background: #eef9fd; border-radius: 14px; font-size: 22px; }
.page-footer { padding: 16px 38px 20px; color: #a1abb1; font-size: 10px; text-align: center; }
.page-footer span { margin: 0 5px; color: var(--mct-cyan-strong); }
.messages-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.message { padding: 11px 14px; border-radius: 9px; background: #eff8fc; color: #42697b; font-size: 12px; }
.forbidden-card { max-width: 620px; margin: 80px auto; padding: 42px; text-align: center; background: #fff; border: 1px solid var(--mct-line); border-radius: 18px; }
.forbidden-code { color: var(--mct-cyan-strong); font-size: 54px; font-weight: 850; }
.forbidden-card h1 { color: var(--mct-charcoal); font-size: 19px; }

/* Login page */
.login-body { min-height: 100vh; padding: 30px; background: #f4f7f9; }
.login-language-switch { position: absolute; top: 25px; inset-inline-end: 28px; z-index: 2; }
.login-layout { width: min(1080px, 100%); min-height: min(690px, calc(100vh - 60px)); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; background: #fff; border: 1px solid #e7edf0; border-radius: 22px; box-shadow: 0 22px 70px rgba(40, 59, 73, .09); }
.login-brand-panel { min-height: 650px; padding: 50px 38px 27px; display: flex; flex-direction: column; justify-content: center; align-items: center; background: #fff; border-inline-end: 1px solid #edf1f3; }
.login-brand-inner { width: 100%; text-align: center; }
.login-logo { display: block; width: min(100%, 460px); height: auto; margin: 0 auto; object-fit: contain; }
.login-brand-caption { margin-top: 12px; color: #7e898f; font-size: 12px; }
.login-brand-bottom { margin-top: auto; display: flex; align-items: center; gap: 9px; color: #98a3a9; font-size: 11px; }
.login-form-panel { padding: 72px clamp(28px, 5vw, 66px) 45px; display: flex; align-items: center; justify-content: center; background: #fcfdfe; }
.login-card { width: 100%; max-width: 370px; }
.login-card h1 { margin: 0 0 9px; color: var(--mct-charcoal); font-size: 27px; letter-spacing: -.04em; }
.login-subtitle { margin: 0 0 29px; color: #87939a; font-size: 12px; line-height: 1.7; }
.login-form { display: grid; gap: 10px; }
.login-form label { margin-top: 7px; color: #5c6971; font-size: 11px; font-weight: 750; }
.login-form input { width: 100%; height: 47px; padding: 0 14px; color: var(--mct-charcoal); background: #fff; border: 1px solid #e1e8ec; border-radius: 9px; outline: none; transition: border .15s, box-shadow .15s; }
.login-form input:focus { border-color: #85d1f0; box-shadow: 0 0 0 3px rgba(138, 215, 248, .2); }
.login-form input::placeholder { color: #b0bac0; }
.primary-button { min-height: 47px; margin-top: 13px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; color: #294653; background: var(--mct-cyan); border: 0; border-radius: 9px; font-size: 12px; font-weight: 800; transition: transform .15s, background .15s; }
.primary-button:hover { background: #78ccef; transform: translateY(-1px); }
.primary-button-link { margin-top: 12px; }
.form-error { margin-bottom: 17px; padding: 11px 13px; color: #a14f4f; background: #fff1f0; border: 1px solid #f7ddda; border-radius: 8px; font-size: 11px; }
.login-security-note { margin-top: 25px; display: flex; align-items: center; gap: 8px; color: #a0abb1; font-size: 10px; }
.login-security-note svg { width: 16px; height: 16px; fill: none; stroke: #8dbbcd; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.login-mobile-logo-wrap { display: none; }

.is-rtl { font-family: Tahoma, "Segoe UI", Arial, sans-serif; }
.is-rtl .page-heading h1, .is-rtl .login-card h1 { letter-spacing: 0; }
.is-rtl .data-table { text-align: right; }
.is-rtl .data-table th, .is-rtl .data-table td { text-align: right; }
.is-rtl .stat-value { letter-spacing: 0; }

@media (max-width: 1100px) {
    .sidebar { width: 220px; flex-basis: 220px; }
    .main-content { padding-inline: 25px; }
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: 250px; transform: translateX(-105%); transition: transform .2s ease; box-shadow: 10px 0 35px rgba(28, 45, 58, .12); }
    .is-rtl .sidebar { transform: translateX(105%); }
    .sidebar.is-open { transform: translateX(0); }
    .is-rtl .sidebar.is-open { transform: translateX(0); }
    .topbar { min-height: 66px; padding: 0 15px; }
    .mobile-menu-button { width: 34px; height: 34px; display: grid; align-content: center; gap: 4px; padding: 7px; background: #fff; border: 1px solid var(--mct-line); border-radius: 8px; }
    .mobile-menu-button span { display: block; height: 2px; background: #64747d; border-radius: 2px; }
    .topbar-actions { gap: 7px; }
    .user-name { display: none; }
    .currency-pill { padding: 6px 8px; }
    .language-button { min-width: 32px; padding: 6px 8px; }
    .logout-button { padding: 7px 6px; font-size: 10px; }
    .main-content { padding: 24px 15px 32px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .heading-meta { justify-content: flex-start; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { min-height: 126px; padding: 15px; }
    .stat-value { font-size: 27px; }
    .info-grid { grid-template-columns: 1fr; gap: 10px; }
    .section-heading { padding: 15px; }
    .data-table th, .data-table td { padding: 11px 12px; }
    .page-footer { padding-inline: 15px; }
    .login-body { padding: 62px 14px 18px; }
    .login-language-switch { top: 15px; inset-inline-end: 15px; }
    .login-layout { min-height: auto; grid-template-columns: 1fr; border-radius: 17px; }
    .login-brand-panel { display: none; }
    .login-form-panel { padding: 34px 25px 30px; }
    .login-mobile-logo-wrap { display: block; margin: 0 auto 25px; text-align: center; }
    .login-mobile-logo { width: min(100%, 270px); height: auto; }
    .login-card h1 { font-size: 23px; }
}
@media (max-width: 420px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .currency-pill { font-size: 9px; }
    .user-avatar { width: 28px; height: 28px; }
    .logout-button { max-width: 65px; }
}
