@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: hsl(165, 68%, 45%);      /* Vibrant Green/Teal */
    --primary-hover: hsl(165, 68%, 35%);
    --secondary: hsl(352, 100%, 65%);    /* Red/Pink highlight */
    --bg-main: hsl(210, 20%, 96%);       /* Light grayish blue */
    --surface: hsl(0, 0%, 100%);
    --text-main: hsl(220, 15%, 20%);
    --text-muted: hsl(220, 10%, 45%);
    --border: hsl(220, 15%, 90%);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.08);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.12);
    --sidebar-width: 280px;
    
    /* Gradients */
    --grad-primary: linear-gradient(135deg, hsl(165, 68%, 45%), hsl(195, 80%, 45%));
    --grad-dark: linear-gradient(135deg, hsl(230, 20%, 20%), hsl(230, 25%, 12%));
    
    /* Rounded corners */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
}

[data-theme="dark"] {
    --bg-main: hsl(220, 20%, 10%);
    --surface: hsl(220, 20%, 15%);
    --text-main: hsl(220, 15%, 88%);
    --text-muted: hsl(220, 10%, 60%);
    --border: hsl(220, 15%, 22%);
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.25);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.35);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.45);
    --grad-dark: linear-gradient(135deg, hsl(0, 0%, 100%), hsl(220, 15%, 80%));
}

[data-theme="dark"] iframe {
    filter: grayscale(1) invert(0.9) hue-rotate(180deg);
    opacity: 0.85;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Global Form Elements text color inherit */
input, select, textarea {
    color: var(--text-main);
}

select option {
    background-color: var(--surface);
    color: var(--text-main);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    outline: none;
    transition: all 0.3s ease;
}

/* ==================== LAYOUT: SIDEBAR & MAIN ==================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.sidebar__logo {
    height: 70px;
    padding: 0 24px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar__logo i {
    font-size: 28px;
}
.sidebar__close {
    display: none !important;
    font-size: 20px !important;
    cursor: pointer;
    color: var(--text-muted);
    margin-left: auto;
    transition: color 0.2s;
}
.sidebar__close:hover {
    color: var(--secondary);
}

.sidebar__nav {
    padding: 20px 15px;
    flex: 1;
    overflow-y: auto;
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.nav__item:hover, .nav__item.active {
    background: var(--bg-main);
    color: var(--primary);
}

.nav__item i {
    font-size: 18px;
}

.sidebar__footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    /*
     * Tanpa ini seluruh area admin & client meluber horizontal di layar sempit.
     * Flex item bawaannya `min-width: auto`, yang berarti ia MENOLAK menyusut di
     * bawah lebar intrinsik isinya - satu tabel lebar mendorong seluruh halaman
     * melebar, dan pembungkus `overflow-x: auto` di dalamnya tidak pernah
     * kebagian kesempatan menggulung isinya sendiri.
     *
     * Terukur pada viewport 420px: /admin/crm/leads 1025 -> 420,
     * /admin/invoices 824 -> 420, /admin/sales-orders 784 -> 420,
     * /admin/clients 584 -> 420. Pada 1440px tidak ada yang berubah.
     */
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 70px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hamburger {
    display: none !important;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

.topbar__right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-primary {
    background: var(--grad-primary);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 10px 24px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 14px;
}
.btn-secondary:hover {
    background: var(--bg-main);
}

/* ==================== HERO / INTRO ==================== */

.hero {
    padding: 60px 40px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin: 40px 40px 0;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; right: -20%;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(26, 188, 156, 0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.hero__title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 20px;
    background: var(--grad-dark);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero__title .highlight {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero__desc {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 30px;
}

/* ==================== PRODUCTS GRID ==================== */
.section {
    padding: 60px 40px;
}

.section__title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 30px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 30px;
}

.product-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.product__image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.product__badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.product__badge.free {
    background: var(--primary);
}

.product__body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product__category {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.product__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.product__desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    height: 3em;
}

.product__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.product__price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
}

.product__actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    color: var(--text-muted);
    transition: all 0.2s;
}
.btn-icon:hover {
    background: var(--primary);
    color: white;
}


/* ==================== LOGIN / AUTH UI ==================== */
.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
}

.auth-card {
    background: var(--surface);
    width: 100%;
    max-width: 450px;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.auth-card h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
}

.auth-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.form-group {
    text-align: left;
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 15px;
    background: var(--bg-main);
    color: var(--text-main);
    transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(26, 188, 156, 0.1);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    margin-top: 10px;
}

.auth-switch {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-switch a {
    color: var(--primary);
    font-weight: 600;
}

/* ==================== DASHBOARD UI ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-full);
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-info h4 {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.stat-info .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-main);
}


/* ==================== TABLES ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.data-table th, .data-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-main);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.data-table td {
    font-size: 14px;
    vertical-align: middle;
}

/* ==================== TICKET CHAT ==================== */
.chat-container {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 600px;
    overflow: hidden;
}

.chat-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-msg {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}
.chat-msg.me {
    align-self: flex-end;
}
.chat-msg.them {
    align-self: flex-start;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.chat-msg.me .msg-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.them .msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom-left-radius: 4px;
}

.msg-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}
.chat-msg.me .msg-info {
    text-align: right;
}

.chat-input {
    padding: 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}
.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-family: inherit;
    background: var(--bg-main);
    color: var(--text-main);
}
.chat-input button {
    background: var(--primary);
    color: white;
    width: 45px; height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s;
    padding: 20px;
}

/*
 * A closed modal must not be laid out at all.
 *
 * `opacity: 0` alone makes it invisible and unclickable but keeps its box, and
 * its contents still push the page wider: every admin page overflowed
 * horizontally on a narrow screen because of modals nobody had opened. On
 * /admin/about-settings at 420px the document grew to 673px purely from the
 * payment-verification modal's fixed 270px columns.
 *
 * The cost is the fade-in, which cannot run from `display: none` without
 * `transition-behavior: allow-discrete`. A modal that appears instantly is a
 * fair trade for pages that fit their screen.
 */
.modal-overlay:not(.active) {
    display: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface);
    width: 100%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    transform: translateY(20px);
    transition: all 0.3s;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}
.modal-close {
    background: none;
    font-size: 20px;
    color: var(--text-muted);
}
.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .hamburger {
        display: block !important;
    }
    .sidebar__close {
        display: block !important;
    }
}

/* ==================== PRODUCT DETAIL VIEW ==================== */
.detail-section {
    padding-top: 20px;
}

.detail-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.detail-main {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.detail-image-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    background: var(--surface);
    height: 400px;
}

.detail-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.detail-image-wrapper:hover img {
    transform: scale(1.03);
}

.detail-content-card {
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.detail-title-text {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 25px;
    color: var(--text-main);
    line-height: 1.2;
}

.detail-section-subtitle {
    font-size: 18px;
    font-weight: 700;
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border);
    color: var(--text-main);
}

.detail-desc-text {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
}

.detail-features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.detail-features-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.detail-features-list li i {
    font-size: 16px;
}

.detail-sidebar {
    flex: 1;
    position: sticky;
    top: 90px;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.pricing-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
}

.pricing-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 5px;
}

.pricing-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
}

.pricing-benefits {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-muted);
}

.benefit-item i {
    color: var(--primary);
}

.text-success {
    color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.pricing-actions {
    display: flex;
    flex-direction: column;
}

/* Responsive detail page */
@media (max-width: 992px) {
    .detail-layout {
        flex-direction: column;
    }
    .detail-sidebar {
        width: 100%;
        position: static;
    }
    .detail-image-wrapper {
        height: 300px;
    }
}

/* ==================== CUSTOM TOAST NOTIFICATIONS ==================== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 
                0 1px 3px rgba(0, 0, 0, 0.02),
                inset 0 1px 0 rgba(255, 255, 255, 0.5);
    pointer-events: auto;
    overflow: hidden;
    position: relative;
    animation: toast-slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

[data-theme="dark"] .toast {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 
                0 1px 3px rgba(0, 0, 0, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}


.toast--hiding {
    animation: toast-slide-out 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 18px;
}

.toast__content {
    flex: 1;
}

.toast__message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.4;
}

.toast__close {
    background: transparent;
    color: var(--text-muted);
    border: none;
    font-size: 16px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
}

.toast__close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Toast variants styling */
.toast--success {
    border-left: 4px solid var(--primary);
}
.toast--success .toast__icon {
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
}

.toast--error {
    border-left: 4px solid var(--secondary);
}
.toast--error .toast__icon {
    background: rgba(255, 74, 96, 0.1);
    color: var(--secondary);
}

.toast--warning {
    border-left: 4px solid hsl(45, 100%, 50%);
}
.toast--warning .toast__icon {
    background: rgba(255, 193, 7, 0.1);
    color: hsl(45, 100%, 45%);
}

.toast--info {
    border-left: 4px solid hsl(210, 100%, 55%);
}
.toast--info .toast__icon {
    background: rgba(13, 110, 253, 0.1);
    color: hsl(210, 100%, 50%);
}

/* Keyframe animations */
@keyframes toast-slide-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toast-slide-out {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* Mobile responsive styles */
@media (max-width: 576px) {
    /*
     * On a 360px phone the topbar's own 40px side padding plus the status pill
     * and the user dropdown did not fit, and the topbar pushed every admin and
     * client page to 398px wide. Trimming the padding and hiding the realtime
     * status pill - decoration, not a control - makes the row fit.
     */
    .topbar {
        padding: 0 16px;
    }
    .sse-status {
        display: none !important;
    }
    .section {
        padding: 32px 16px;
    }
    /*
     * Long unbreakable strings (paths, tokens, URLs shown in Settings) cannot
     * wrap on their own and drag the page wider than the screen.
     */
    code, pre {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    #toast-container {
        top: auto;
        bottom: 24px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: calc(100% - 24px);
    }
    @keyframes toast-slide-in {
        from {
            transform: translateY(120%);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    @keyframes toast-slide-out {
        from {
            transform: translateY(0);
            opacity: 1;
        }
        to {
            transform: translateY(120%);
            opacity: 0;
        }
    }
}

/* ==================== STATS SECTION ==================== */
.stats-section {
    padding: 20px 40px 40px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}
.stats-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.stats-card__icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.stats-card__info {
    display: flex;
    flex-direction: column;
}
.stats-card__value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.stats-card__label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ==================== FEATURES SECTION ==================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}
.feature-card {
    padding: 24px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}
.feature-card:hover {
    background: var(--bg-main);
    border-color: var(--border);
    transform: translateY(-5px);
}
.feature-card__icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: var(--grad-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(26, 188, 156, 0.2);
}
.feature-card__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}
.feature-card__desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== TESTIMONIALS SECTION ==================== */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}
.testimonial-card {
    background: var(--bg-main);
    padding: 30px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}
.testimonial-card:hover {
    background: var(--surface);
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}
.testimonial-card__quote {
    position: relative;
    margin-bottom: 24px;
}
.testimonial-card__quote i {
    font-size: 24px;
    color: rgba(26, 188, 156, 0.2);
    margin-bottom: 12px;
    display: block;
}
.testimonial-card__quote p {
    font-size: 14px;
    color: var(--text-main);
    font-style: italic;
    line-height: 1.6;
}
.testimonial-card__user {
    display: flex;
    align-items: center;
    gap: 12px;
}
.testimonial-card__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.testimonial-card__meta h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}
.testimonial-card__meta span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== FAQ SECTION ==================== */
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary {
    outline: none;
    user-select: none;
}
.faq-item[open] {
    border-color: var(--primary) !important;
    box-shadow: 0 4px 20px rgba(26, 188, 156, 0.05);
}
.faq-item[open] summary i {
    transform: rotate(180deg);
    color: var(--primary);
}
.faq-item summary i {
    transition: transform 0.3s ease, color 0.3s ease;
}

/* ==================== ABOUT US SECTION ==================== */
.about-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 40px;
    margin: 0 40px 40px;
    background: var(--surface);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.about-info h3, .about-maps h3 {
    color: var(--primary);
    margin-bottom: 18px;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.about-info p {
    line-height: 1.8;
    color: var(--text-main);
    margin-bottom: 30px;
    text-align: justify;
}

.about-info ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-info ul li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.about-info ul li:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.about-info ul li i {
    color: var(--primary);
    font-size: 20px;
    background: rgba(20, 184, 166, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.about-maps iframe {
    width: 100%;
    height: 350px;
    border: none;
    border-radius: var(--radius-sm);
    display: block;
}

@media (max-width: 992px) {
    .about-grid {
        grid-template-columns: 1fr;
        margin: 0 20px 20px;
        padding: 30px 20px;
        gap: 30px;
    }
}

/* Responsive adjustment for Mobile screens */
@media (max-width: 768px) {
    .stats-section, .faq-section, .cta-section {
        padding: 20px 20px !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }
    .features-section, .testimonials-section, .how-it-works-section, .trusted-by-section {
        padding: 40px 20px !important;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }
    .hero {
        margin: 20px 20px 0 !important;
        padding: 40px 20px !important;
    }
    .hero__title {
        font-size: 32px !important;
    }
}

/* ==================== NOTIF BADGE ==================== */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
    line-height: 1;
    animation: notif-pulse 1.8s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes notif-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(231, 76, 60, 0); }
}

/* Nav item flex so badge stays at far right */
.nav__item {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

/* ==================== LIVE CHAT ENHANCEMENTS ==================== */
.chat-msg {
    display: flex;
    flex-direction: column;
    margin-bottom: 14px;
    animation: chat-fadein 0.3s ease;
}

@keyframes chat-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-msg.me { align-items: flex-end; }
.chat-msg.them { align-items: flex-start; }

.msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.chat-msg.me .msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg.them .msg-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-bottom-left-radius: 4px;
}

.chat-msg.unread .msg-bubble {
    border-left: 3px solid var(--secondary);
}

.msg-info {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

/* SSE Connection status indicator */
.sse-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-muted);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-main);
    border: 1px solid var(--border);
}

.sse-status .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #95a5a6;
    flex-shrink: 0;
}

.sse-status.connected .dot {
    background: #2ecc71;
    animation: notif-pulse 2s ease-in-out infinite;
}

.sse-status.disconnected .dot { background: #e74c3c; }

/* ==================== STATS SECTION ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    margin: 0 40px;
}
.stats-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.stats-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}
.stats-card__icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    background: rgba(26, 188, 156, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stats-card__info {
    display: flex;
    flex-direction: column;
}
.stats-card__value {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}
.stats-card__label {
    font-size: 13px;
    color: var(--text-muted);
}

/* ==================== HOW IT WORKS SECTION ==================== */
.step-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}
.step-card {
    position: relative;
    background: var(--bg-main);
    border: 1px solid var(--border);
    padding: 35px 24px 28px;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}
.step-card:hover {
    transform: translateY(-5px);
    background: var(--surface);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}
.step-card__number {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 36px;
    font-weight: 800;
    color: rgba(26, 188, 156, 0.15);
    font-family: inherit;
    line-height: 1;
}
.step-card__icon {
    font-size: 26px;
    color: var(--primary);
    margin-bottom: 20px;
}
.step-card__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-main);
}
.step-card__desc {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== TRUSTED BY SECTION ==================== */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.logo-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    color: var(--text-muted);
}
.logo-item i {
    font-size: 20px;
    color: var(--text-muted);
    transition: color 0.3s;
}
.logo-item span {
    font-size: 14px;
    font-weight: 600;
    transition: color 0.3s;
}
.logo-item:hover {
    border-color: var(--primary);
    background: var(--bg-main);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.logo-item:hover i {
    color: var(--primary);
}

/* ==================== CTA SECTION ==================== */
.cta-banner {
    background: linear-gradient(135deg, hsl(165, 68%, 35%), hsl(195, 80%, 25%));
    border-radius: var(--radius-lg);
    padding: 55px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.cta-banner__content {
    position: relative;
    z-index: 2;
    max-width: 750px;
    margin: 0 auto;
}
.cta-banner__title {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    line-height: 1.3;
}
.cta-banner__desc {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    line-height: 1.7;
}
.cta-banner__actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== PRINT STYLES FOR INVOICE RECEIPT ==================== */
@media print {
    body * {
        visibility: hidden !important;
    }
    #modal-view-invoice, #modal-view-invoice-client, 
    #printable-invoice-container, #printable-invoice-container-client, 
    #receipt-print-wrapper, #receipt-print-wrapper * {
        visibility: visible !important;
    }
    .modal-overlay {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        padding: 0 !important;
    }
    .modal {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }
    .modal-header, .modal-footer, .modal-close {
        display: none !important;
    }
    #receipt-print-wrapper {
        border: 1px solid #000 !important;
        padding: 20px !important;
        color: #000 !important;
        background: #fff !important;
    }
}

/* ==================== TOMSELECT SEARCHABLE SELECT STYLING ==================== */
.ts-control {
    padding: 10px 14px !important;
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border) !important;
    background: var(--surface) !important;
    color: var(--text-main) !important;
    font-size: 13px !important;
    font-family: inherit !important;
    box-shadow: none !important;
    min-height: 42px !important;
    display: flex !important;
    align-items: center !important;
}
.ts-control input {
    color: var(--text-main) !important;
    font-size: 13px !important;
}
.ts-wrapper.focus .ts-control {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15) !important;
}
.ts-dropdown {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow-sm) !important;
    z-index: 100000 !important;
    font-size: 13px !important;
}
.ts-dropdown .option {
    padding: 10px 14px !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
}
.ts-dropdown .option.active, .ts-dropdown .option:hover {
    background: rgba(46, 204, 113, 0.12) !important;
    color: var(--primary) !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   TOPBAR USER DROPDOWN COMPONENT & RESPONSIVE STYLES
   ========================================================================== */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 5px 12px 5px 6px;
    border-radius: var(--radius-full);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.user-dropdown__toggle:hover {
    border-color: var(--primary);
    background: var(--bg-main);
}

.user-dropdown__avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-dropdown__info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.25;
}

.user-dropdown__name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown__role {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: capitalize;
}

.user-dropdown__arrow {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    margin-left: 2px;
}

.user-dropdown.open .user-dropdown__arrow {
    transform: rotate(180deg);
}

.user-dropdown__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px 0;
    z-index: 1050;
    display: none;
    animation: fadeIn 0.15s ease-out;
}

.user-dropdown.open .user-dropdown__menu {
    display: block;
}

.user-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
}

.user-dropdown__item:hover {
    background: var(--bg-main);
    color: var(--primary);
}

.user-dropdown__item.danger {
    color: #e74c3c;
}

.user-dropdown__item.danger:hover {
    background: rgba(231, 76, 60, 0.08);
    color: #c0392b;
}

/* Responsive adjustment for Mobile Header */
@media (max-width: 576px) {
    .user-dropdown__info {
        display: none;
    }
    .user-dropdown__toggle {
        padding: 4px 8px 4px 4px;
        border-radius: 50px;
    }
    .user-dropdown__menu {
        right: -5px;
        width: 210px;
    }
}

/* Single-line Benefit Items with Ellipsis Truncation */
.pricing-benefits {
    overflow: hidden;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.benefit-item i {
    flex-shrink: 0;
}

.benefit-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

/* Quill Rich Text Editor Custom Styling */
.ql-toolbar.ql-snow {
    border-color: var(--border) !important;
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
    background: var(--bg-main);
}

.ql-container.ql-snow {
    border-color: var(--border) !important;
    border-bottom-left-radius: var(--radius-sm);
    border-bottom-right-radius: var(--radius-sm);
    color: var(--text-main) !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px;
}

[data-theme="dark"] .ql-stroke {
    stroke: var(--text-main) !important;
}

[data-theme="dark"] .ql-fill {
    fill: var(--text-main) !important;
}

[data-theme="dark"] .ql-picker {
    color: var(--text-main) !important;
}

/* Detail Product Description Rich HTML Content Styling */
.detail-desc-text {
    line-height: 1.7;
    color: var(--text-main);
}

.detail-desc-text p {
    margin-bottom: 12px;
}

.detail-desc-text h1,
.detail-desc-text h2,
.detail-desc-text h3,
.detail-desc-text h4 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.detail-desc-text ul,
.detail-desc-text ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.detail-desc-text li {
    margin-bottom: 6px;
}

.detail-desc-text b,
.detail-desc-text strong {
    font-weight: 700;
    color: var(--text-main);
}

/* Product Share Social Buttons Styling & Hover Animations */
.btn-share {
    transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease !important;
}

.btn-share:hover {
    transform: translateY(-2px);
    opacity: 0.92;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-share:active {
    transform: translateY(0);
}


/* ==================== BADGE ==================== */
.badge { display: inline-flex; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 50px; font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.badge i { margin-right: 5px; font-size: 11px; }

/* ==================== CRM ==================== */

/* Ringkasan corong di atas daftar lead */
.crm-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.crm-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-sm); }
.crm-stat__label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; }
.crm-stat__value { font-size: 22px; font-weight: 800; color: var(--text-main); margin-top: 4px; line-height: 1.2; }
.crm-stat__hint { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.crm-stat--alert { border-color: #e67e22; }
.crm-stat--alert .crm-stat__value { color: #e67e22; }

/* Penyaring cepat; .is-active ditandai dari app.js */
.crm-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s ease; }
.crm-chip:hover { border-color: var(--primary); color: var(--primary); }
.crm-chip.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

/*
 * Status lead: tiga warna tegas, dibaca sekilas.
 * Ini sumbu "masih ada potensi atau tidak" - sengaja dibedakan tampilannya
 * dari tahap di bawahnya, supaya keduanya tidak terbaca sebagai satu daftar.
 */
.crm-status { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: var(--radius-full); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.crm-status--open { background: rgba(52, 152, 219, .14); color: #2980b9; }
.crm-status--won { background: rgba(46, 204, 113, .16); color: #27ae60; }
.crm-status--lost { background: rgba(231, 76, 60, .14); color: #c0392b; }

/* Tahap: rangkaian langkah, bukan dropdown */
.crm-stepper { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crm-step { padding: 6px 13px; border-radius: var(--radius-full); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: all .2s ease; }
.crm-step:hover:not(.is-frozen) { border-color: var(--primary); color: var(--primary); }
.crm-step.is-current { background: var(--grad-primary); border-color: transparent; color: #fff; }
.crm-step.is-done { border-color: var(--primary); color: var(--primary); }
/* Lead tertutup: tahap tetap terlihat, tapi tidak bisa digeser */
.crm-stepper.is-frozen .crm-step { cursor: not-allowed; opacity: .55; }
.crm-stepper.is-frozen .crm-step.is-current { opacity: .85; }

/* Target deal yang sudah lewat sementara lead masih terbuka */
.crm-date-late { color: #e74c3c; font-weight: 700; }
.crm-date-late i { margin-right: 4px; }

/* Timeline aktivitas */
.crm-timeline { position: relative; padding-left: 26px; }
.crm-timeline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.crm-timeline__item { position: relative; padding: 0 0 20px 0; }
.crm-timeline__dot { position: absolute; left: -24px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--primary); display: flex; align-items: center; justify-content: center; font-size: 8px; color: var(--primary); }
.crm-timeline__dot.is-pending { border-color: #f39c12; color: #f39c12; }
.crm-timeline__dot.is-late { border-color: #e74c3c; color: #e74c3c; }
.crm-timeline__meta { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.crm-timeline__title { font-weight: 700; color: var(--text-main); font-size: 14px; }
.crm-timeline__body { font-size: 13px; color: var(--text-muted); margin-top: 4px; white-space: pre-wrap; }

/* Kelompok agenda */
.crm-agenda-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); margin-bottom: 22px; overflow: hidden; }
.crm-agenda-group__head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.crm-agenda-group__title { font-weight: 700; font-size: 15px; color: var(--text-main); display: flex; align-items: center; gap: 9px; }
.crm-agenda-group__note { font-size: 12px; color: var(--text-muted); flex-basis: 100%; }
.crm-agenda-item { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.crm-agenda-item:last-child { border-bottom: none; }
.crm-agenda-item__main { flex: 1; min-width: 220px; }
.crm-agenda-empty { padding: 18px; text-align: center; color: var(--text-muted); font-size: 13px; }

/*
 * Detail lead: dua kolom di layar lebar, satu kolom di layar sempit.
 *
 * Sebelumnya `minmax(280px, 1fr)` dipasang inline untuk kolom kanan. Itu
 * menahan dua kolom tetap berdampingan pada lebar BERAPA PUN: di 420px kolom
 * kiri tersisa ~50px dan teksnya terpecah satu huruf per baris. Batas 900px di
 * bawah ini yang membuatnya menumpuk, bukan menyempit.
 */
.crm-detail-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) {
    .crm-detail-grid { grid-template-columns: minmax(0, 1fr); }
}
