/* =========================
   SAMRIDDHI CRM – CLEAN SAAS THEME
   ========================= */

/* ---- Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

:root {
    --brand-dark: #020617;
    --brand-dark-soft: #0f172a;
    --brand-green: #16a34a;
    --brand-blue: #2563eb;
    --bg-body: #f4f5f7;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-subtle: #e5e7eb;
    --radius-lg: 18px;
}

html {
    font-size: 14px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
}

/* Wrapper used on landing page */
.main-bg {
    background: radial-gradient(circle at 0% 0%, #eefdf3 0, transparent 60%),
                radial-gradient(circle at 100% 100%, #e0f2fe 0, transparent 60%),
                var(--bg-body);
    padding-bottom: 40px;
}

/* Generic layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0f172a;
}

p {
    margin: 0 0 0.4rem;
    color: var(--text-muted);
}

small {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* =========================
   HEADER (website / landing)
   ========================= */

.site-header {
    background: var(--brand-dark);
    color: #f9fafb;
    padding: 0.8rem 0;
    border-bottom: 1px solid #020617;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    border-radius: 999px;
    background: #f9fafb;
    padding: 0.2rem;
}

.site-header h1 {
    font-size: 1.35rem;
    margin: 0;
}

.site-header p {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-link {
    color: #e5e7eb;
    font-size: 0.78rem;
    text-decoration: none;
}

.header-link:hover {
    text-decoration: underline;
}

/* =========================
   BUTTONS / LINKS
   ========================= */

button,
.btn {
    display: inline-block;
    background: var(--brand-blue);
    color: #fff;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid rgba(229, 231, 235, 0.8);
    color: #f9fafb;
    box-shadow: none;
}

.btn-outline:hover {
    background: #020617;
}

/* =========================
   LANDING HERO (lead form)
   ========================= */

.hero {
    margin-top: 2.2rem;
    margin-bottom: 2.6rem;
    padding: 1.9rem 1.9rem;
    background: #ffffff;
    border-radius: 26px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-wrap: wrap;
    gap: 1.9rem;
    align-items: flex-start;
}

.hero-text {
    flex: 1 1 320px;
    max-width: 420px;
    padding-right: 1.2rem;
    border-right: 1px solid #e5e7eb;
}

.hero-text h2 {
    font-size: 1.6rem;
    margin: 0 0 0.4rem;
}

.hero-text p {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.hero-text ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.hero-text ul li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: #374151;
}

.hero-text ul li::before {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, #16a34a, #22c55e);
}

.hero-form {
    flex: 1 1 360px;
    max-width: 420px;
}

/* =========================
   CARDS / FORMS
   ========================= */

.card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.3rem;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.card h3 {
    margin-top: 0;
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
}

label {
    display: block;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    color: #374151;
}

input[type=text],
input[type=email],
input[type=password],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    margin-top: 0.25rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: #f9fafb;
}

input[type=text]:focus,
input[type=email]:focus,
input[type=password]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
    background: #ffffff;
}

textarea {
    resize: vertical;
}

.small-note {
    font-size: 0.75rem;
    opacity: 0.75;
    margin-top: 0.4rem;
}

/* messages */
.error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.success {
    color: #15803d;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

/* =========================
   BADGE STRIP + FEATURES
   ========================= */

.badge-strip {
    background: #0b1120;
    color: #e5e7eb;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
}

.badge-strip-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.4rem;
    padding: 0.7rem 0;
    font-size: 0.8rem;
}

.section-title {
    text-align: center;
    margin: 2.4rem 0 1.3rem;
    font-size: 1.3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.1rem;
    margin-bottom: 2.6rem;
}

.feature-card {
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.feature-card p {
    font-size: 0.9rem;
}

/* =========================
   FOOTER
   ========================= */

.site-footer {
    text-align: center;
    padding: 1rem 0 1.2rem;
    background: var(--brand-dark-soft);
    color: #e5e7eb;
    margin-top: 2rem;
    font-size: 0.8rem;
}

/* =========================
   TABLES (leads list)
   ========================= */

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.table th,
.table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.table th {
    background: #f3f4f6;
    text-align: left;
    color: #4b5563;
}

/* =========================
   GENERIC GRIDS
   ========================= */

.grid,
.grid-2 {
    display: grid;
    gap: 1rem;
}

.grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* =========================
   AUTH PAGES
   ========================= */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--brand-dark-soft);
}

.auth-card {
    max-width: 340px;
    width: 100%;
    padding: 1.6rem;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.5);
}

/* =========================
   TOP NAV (CRM)
   ========================= */

.top-nav {
    background: var(--brand-dark-soft);
    color: #f9fafb;
    padding: 0.6rem 0;
    margin-bottom: 1.3rem;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.nav-left .logo {
    font-weight: 700;
    color: #f9fafb;
    text-decoration: none;
}

.nav-right a {
    color: #e5e7eb;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.nav-right a:hover {
    text-decoration: underline;
}

.nav-user {
    font-size: 0.78rem;
    opacity: 0.85;
    margin-left: 1rem;
}

.page {
    padding-bottom: 2.4rem;
}

/* =========================
   LEAD DETAIL – 3 COLUMN LAYOUT
   ========================= */

.lead-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1.6fr) 270px;
    gap: 1.1rem;
}

/* left sidebar */
.lead-sidebar {
    background: #020617;
    color: #e5e7eb;
    border-radius: 16px;
    padding: 0.7rem 0.6rem;
    display: flex;
    flex-direction: column;
    min-height: 18rem;
}

.lead-sidebar-header {
    padding: 0 0.4rem 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.4);
    margin-bottom: 0.3rem;
}

.lead-sidebar-header h3 {
    margin: 0 0 0.3rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.lead-search {
    width: 100%;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #1f2937;
    background: #020617;
    color: #e5e7eb;
    font-size: 0.78rem;
}

.lead-search::placeholder {
    color: #6b7280;
}

.lead-list {
    margin-top: 0.4rem;
    padding-right: 0.25rem;
    overflow-y: auto;
    max-height: calc(100vh - 13rem);
}

.lead-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.45rem;
    border-radius: 9px;
    text-decoration: none;
    color: #e5e7eb;
    font-size: 0.84rem;
    margin-bottom: 0.2rem;
    transition: background 0.12s ease, transform 0.05s ease;
}

.lead-item:hover {
    background: rgba(249, 250, 251, 0.08);
    transform: translateY(-1px);
}

.lead-item.active {
    background: rgba(249, 250, 251, 0.16);
}

.lead-avatar {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.lead-meta {
    overflow: hidden;
}

.lead-name {
    font-weight: 500;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.lead-company {
    font-size: 0.7rem;
    color: #9ca3af;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.lead-stage-pill {
    margin-top: 0.1rem;
    font-size: 0.65rem;
    display: inline-flex;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.6);
}

/* center */
.lead-main-card {
    padding: 1.1rem 1.2rem 1rem;
    border-radius: 18px;
}

.lead-main-header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
}

.lead-main-header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.lead-subline {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.lead-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.chip {
    font-size: 0.7rem;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.chip-stage {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.45);
    color: #15803d;
}

/* actions */
.lead-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 0.9rem;
}

.lead-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
    font-size: 0.8rem;
    border: 1px solid #e5e7eb;
    transition: background 0.12s ease, transform 0.05s ease, box-shadow 0.12s ease;
}

.lead-action-icon {
    font-size: 0.9rem;
}

.lead-action:hover {
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.15);
    transform: translateY(-1px);
}

/* activity */
.lead-main-body {
    margin-top: 0.4rem;
}

.lead-activity-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    padding: 0.8rem 0.8rem 0.6rem;
    background: #f9fafb;
}

.lead-activity-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.lead-activity-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

.lead-activity-count {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.note-form textarea {
    font-size: 0.82rem;
}

.note-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.note-form-footer button {
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
}

.note-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.note-list {
    margin-top: 0.6rem;
}

.note-timeline {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 0.45rem 0.6rem;
    margin-bottom: 0.4rem;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.note-user {
    font-weight: 600;
}

.note-time {
    font-style: italic;
}

.note-empty {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* right column */
.lead-info {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lead-info-card,
.lead-stage-card,
.lead-notes-card {
    border-radius: 16px;
}

.lead-info-card h3,
.lead-stage-card h3,
.lead-notes-card h3 {
    margin: 0 0 0.4rem;
    font-size: 0.95rem;
}

.info-list {
    margin: 0;
}

.info-list dt {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.info-list dd {
    margin: 0;
    font-size: 0.84rem;
}

.stage-save-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
}

/* =========================
   DASHBOARD – METRIC CARDS & CHARTS
   ========================= */

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.1rem;
}

.dashboard-title h2 {
    margin: 0 0 0.2rem;
    font-size: 1.4rem;
}

.dashboard-title p {
    margin: 0;
    font-size: 0.86rem;
}

.dash-pill {
    font-size: 0.74rem;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    background: #111827;
    color: #e5e7eb;
}

/* cards row */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.metric-card {
    border-radius: 16px;
    padding: 0.9rem 1rem;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.metric-primary {
    border-top: 3px solid var(--brand-green);
}

.metric-soft {
    border-top: 3px solid #1f2937;
}

.metric-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-muted);
}

.metric-value {
    margin-top: 0.2rem;
    font-size: 1.45rem;
    font-weight: 600;
    color: #111827;
}

.metric-sub {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* charts row */
.dash-charts {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: 1rem;
    margin-top: 0.6rem;
}

.dash-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1rem 1.1rem 0.9rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
    border: 1px solid #e5e7eb;
}

.dash-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.dash-card-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.dash-card-caption {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dash-card canvas {
    max-width: 100%;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 960px) {
    .lead-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .lead-sidebar {
        order: 3;
        min-height: auto;
    }

    .lead-info {
        order: 2;
    }

    .lead-main {
        order: 1;
    }

    .dash-charts {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .hero {
        padding: 1.2rem 1rem;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
    }

    .hero-text {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 0.9rem;
        margin-bottom: 0.7rem;
        max-width: none;
    }

    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}
