/* =========================================================
   crm.css — Vyapaar Capital Internal CRM
   ========================================================= */

/* --- Reset & Variables --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand */
    --navy: #0A0E1A;
    --navy-2: #111628;
    --navy-3: #161C30;
    --navy-4: #1E2542;
    --navy-5: #252D50;
    --gold: #C9A84C;
    --gold-dim: #9E7D32;
    --gold-light: #E8C96A;

    /* UI */
    --sidebar-w: 240px;
    --header-h: 64px;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    /* Text */
    --text-1: #F0F2F8;
    --text-2: #A0AAC8;
    --text-3: #6B7599;
    --text-inv: #0A0E1A;

    /* Border */
    --border: rgba(255, 255, 255, 0.07);
    --border-2: rgba(255, 255, 255, 0.12);

    /* Semantic colors */
    --blue: #3B82F6;
    --purple: #8B5CF6;
    --cyan: #06B6D4;
    --orange: #F97316;
    --green: #22C55E;
    --red: #EF4444;
    --gray: #6B7280;

    /* Shadow */
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);

    /* Font */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

html,
body {
    height: 100%;
    font-family: var(--font-sans);
    background: var(--navy);
    color: var(--text-1);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

button {
    cursor: pointer;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

img {
    display: block;
    max-width: 100%;
}

/* =========================================================
   LAYOUT — App Shell
   ========================================================= */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--navy-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar__logo {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar__logo-mark {
    width: 36px;
    height: 36px;
    background: var(--gold);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--navy);
    flex-shrink: 0;
}

.sidebar__logo-text {
    line-height: 1.2;
}

.sidebar__logo-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-1);
    letter-spacing: 0.01em;
}

.sidebar__logo-sub {
    font-size: 0.62rem;
    color: var(--text-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar__section-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
    padding: 0.75rem 1.25rem 0.4rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: var(--text-2);
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}

.sidebar__link:hover {
    background: var(--navy-3);
    color: var(--text-1);
}

.sidebar__link.active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--gold);
    border-right: 2px solid var(--gold);
}

.sidebar__link .icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar__badge {
    margin-left: auto;
    background: var(--gold);
    color: var(--navy);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}

.sidebar__footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.sidebar__user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar__user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__user-role {
    font-size: 0.65rem;
    color: var(--text-3);
    text-transform: capitalize;
}

.sidebar__logout {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #EF4444;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 0.15s;
}

.sidebar__logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* --- Main Content --- */
.main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Top Header --- */
.topbar {
    height: var(--header-h);
    background: var(--navy-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.75rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
    flex: 1;
}

.topbar__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--navy-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    width: 240px;
}

.topbar__search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 0.82rem;
    width: 100%;
}

.topbar__search input::placeholder {
    color: var(--text-3);
}

.topbar__search-icon {
    color: var(--text-3);
    font-size: 0.8rem;
}

.topbar__actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Page Content Area --- */
.page-content {
    padding: 1.75rem;
    flex: 1;
}

.page-header {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header__left h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 0.25rem;
}

.page-header__left p {
    font-size: 0.82rem;
    color: var(--text-3);
}

.page-header__actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* =========================================================
   COMPONENTS
   ========================================================= */

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn--primary {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
}

.btn--primary:hover {
    background: var(--gold-light);
}

.btn--outline {
    background: transparent;
    color: var(--text-1);
    border-color: var(--border-2);
}

.btn--outline:hover {
    background: var(--navy-3);
    border-color: var(--gold-dim);
}

.btn--ghost {
    background: transparent;
    color: var(--text-2);
    border-color: transparent;
}

.btn--ghost:hover {
    background: var(--navy-3);
    color: var(--text-1);
}

.btn--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.25);
}

.btn--danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.75rem;
}

.btn--icon {
    padding: 0.45rem;
    border-radius: var(--radius-sm);
}

/* --- Stat Cards --- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--navy-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
}

.stat-card--blue::before {
    background: var(--blue);
}

.stat-card--gold::before {
    background: var(--gold);
}

.stat-card--green::before {
    background: var(--green);
}

.stat-card--orange::before {
    background: var(--orange);
}

.stat-card--purple::before {
    background: var(--purple);
}

.stat-card--red::before {
    background: var(--red);
}

.stat-card__icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.stat-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-1);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-card__label {
    font-size: 0.72rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.stat-card__delta {
    font-size: 0.7rem;
    color: var(--green);
    margin-top: 0.4rem;
}

/* --- Card panel --- */
.card {
    background: var(--navy-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.card__title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-1);
}

.card__body {
    padding: 1.25rem;
}

/* --- Table --- */
.table-wrap {
    overflow-x: auto;
}

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

thead th {
    padding: 0.65rem 1rem;
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-3);
    background: var(--navy-3);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.82rem;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tbody tr {
    transition: background 0.1s;
}

tbody tr:hover {
    background: var(--navy-3);
}

tbody tr:last-child td {
    border-bottom: none;
}

.td-name {
    font-weight: 600;
    color: var(--text-1);
}

.td-link {
    color: var(--gold);
    cursor: pointer;
}

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

.td-dim {
    color: var(--text-3);
    font-size: 0.75rem;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.badge--blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60A5FA;
}

.badge--purple {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
}

.badge--cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #22D3EE;
}

.badge--gold {
    background: rgba(201, 168, 76, 0.15);
    color: #E8C96A;
}

.badge--orange {
    background: rgba(249, 115, 22, 0.15);
    color: #FB923C;
}

.badge--green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
}

.badge--red {
    background: rgba(239, 68, 68, 0.15);
    color: #F87171;
}

.badge--gray {
    background: rgba(107, 114, 128, 0.15);
    color: #9CA3AF;
}

/* --- Avatar --- */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 0.4rem;
    letter-spacing: 0.03em;
}

.form-control {
    width: 100%;
    background: var(--navy-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    color: var(--text-1);
    font-size: 0.85rem;
    transition: border 0.15s;
    outline: none;
}

.form-control:focus {
    border-color: var(--gold-dim);
}

.form-control::placeholder {
    color: var(--text-3);
}

select.form-control option {
    background: var(--navy-3);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: 0.3rem;
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1.1rem;
    background: var(--navy-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.filter-bar__label {
    font-size: 0.72rem;
    color: var(--text-3);
    font-weight: 600;
    white-space: nowrap;
}

.filter-select {
    background: var(--navy-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    color: var(--text-1);
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--navy-3);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.7rem;
    flex: 1;
    min-width: 160px;
    max-width: 280px;
}

.filter-search input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 0.8rem;
    width: 100%;
}

.filter-search input::placeholder {
    color: var(--text-3);
}

.filter-bar__spacer {
    flex: 1;
}

/* --- Pipeline Steps --- */
.pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.pipeline__step {
    flex: 1;
    min-width: 100px;
    padding: 0.7rem 0.5rem 0.7rem 1.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--navy-3);
    color: var(--text-3);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    border: none;
    white-space: nowrap;
}

.pipeline__step:first-child {
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%);
    padding-left: 0.75rem;
}

.pipeline__step.active {
    background: var(--gold);
    color: var(--navy);
}

.pipeline__step.completed {
    background: rgba(201, 168, 76, 0.15);
    color: var(--gold);
}

.pipeline__step.lost {
    background: rgba(239, 68, 68, 0.1);
    color: #F87171;
}

.pipeline__step.won {
    background: rgba(34, 197, 94, 0.15);
    color: #4ADE80;
}

/* --- Modals --- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal--open {
    opacity: 1;
    pointer-events: all;
}

.modal__box {
    background: var(--navy-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: modalIn 0.25s ease;
}

.modal__box--lg {
    max-width: 720px;
}

@keyframes modalIn {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.modal__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}

.modal__close {
    background: var(--navy-3);
    border: 1px solid var(--border);
    color: var(--text-2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.modal__close:hover {
    color: var(--text-1);
}

.modal__body {
    padding: 1.5rem;
}

.modal__footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* --- Toasts --- */
#toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: var(--navy-4);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.82rem;
    color: var(--text-1);
    box-shadow: var(--shadow);
    min-width: 260px;
    max-width: 380px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast--show {
    transform: translateX(0);
}

.toast--success .toast__icon {
    color: var(--green);
}

.toast--error .toast__icon {
    color: var(--red);
}

.toast--warning .toast__icon {
    color: var(--orange);
}

.toast--info .toast__icon {
    color: var(--blue);
}

/* --- Notes / Activity Log --- */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
}

.note-item {
    background: var(--navy-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem;
}

.note-item__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.note-item__author {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-1);
}

.note-item__time {
    font-size: 0.65rem;
    color: var(--text-3);
    margin-left: auto;
}

.note-item__text {
    font-size: 0.82rem;
    color: var(--text-2);
    line-height: 1.6;
}

.note-item__del {
    background: none;
    border: none;
    color: var(--text-3);
    font-size: 0.75rem;
    padding: 0 2px;
    transition: color 0.15s;
}

.note-item__del:hover {
    color: var(--red);
}

/* --- Document list --- */
.doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.doc-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--navy-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
}

.doc-item__icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.doc-item__info {
    flex: 1;
    min-width: 0;
}

.doc-item__name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-item__meta {
    font-size: 0.65rem;
    color: var(--text-3);
}

.doc-item__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* --- Upload Zone --- */
.upload-zone {
    border: 2px dashed var(--border-2);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--gold-dim);
    background: rgba(201, 168, 76, 0.05);
}

.upload-zone__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--text-3);
}

.upload-zone__text {
    font-size: 0.82rem;
    color: var(--text-2);
}

.upload-zone__sub {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 0.25rem;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-3);
}

.empty-state__icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.empty-state__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 0.4rem;
}

.empty-state__text {
    font-size: 0.82rem;
}

/* --- Lead Detail Grid --- */
.lead-detail-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.lead-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
}

.lead-info-item__label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.2rem;
}

.lead-info-item__value {
    font-size: 0.88rem;
    color: var(--text-1);
    font-weight: 500;
}

/* --- Team grid --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.team-card {
    background: var(--navy-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
}

.team-card__top {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.team-card__info {
    flex: 1;
}

.team-card__name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-1);
}

.team-card__email {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-top: 0.1rem;
}

.team-card__stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-3);
}

.team-card__stat strong {
    color: var(--text-1);
    font-weight: 700;
}

.team-card__actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.25rem;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(201, 168, 76, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 60%);
    padding: 1rem;
}

.login-box {
    background: var(--navy-2);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    text-align: center;
}

.login-logo__mark {
    width: 52px;
    height: 52px;
    background: var(--gold);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 0.75rem;
}

.login-logo__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-1);
}

.login-logo__label {
    font-size: 0.65rem;
    color: var(--gold-dim);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.25rem;
    font-weight: 600;
}

.login-box h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 0.25rem;
}

.login-box .subtitle {
    font-size: 0.8rem;
    color: var(--text-3);
    margin-bottom: 1.5rem;
}

.login-btn {
    width: 100%;
    background: var(--gold);
    color: var(--navy);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.25rem;
}

.login-btn:hover {
    background: var(--gold-light);
}

.login-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: var(--radius-sm);
    color: #F87171;
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    display: none;
}

/* --- Tabs --- */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.tab-btn {
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-3);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: -1px;
}

.tab-btn.active {
    color: var(--gold);
    border-bottom-color: var(--gold);
}

.tab-btn:hover:not(.active) {
    color: var(--text-1);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* --- Charts (pure CSS bars) --- */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.bar-row__label {
    width: 90px;
    color: var(--text-2);
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-row__track {
    flex: 1;
    background: var(--navy-3);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.bar-row__fill {
    height: 100%;
    background: var(--gold);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.bar-row__val {
    width: 32px;
    color: var(--text-3);
    text-align: right;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--navy-4);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--navy-5);
}

/* --- Utility --- */
.text-gold {
    color: var(--gold);
}

.text-muted {
    color: var(--text-3);
}

.text-sm {
    font-size: 0.75rem;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 0.75rem;
}

.ml-auto {
    margin-left: auto;
}

.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.25rem 0;
}

.role-admin {
    color: var(--gold);
}

.role-member {
    color: var(--cyan);
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main {
        margin-left: 0;
    }

    .lead-detail-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .page-content {
        padding: 1rem;
    }

    .login-box {
        padding: 1.75rem 1.25rem;
    }
}