/* ==================================================
   BASE LAYOUT
================================================== */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f5f7fb;
    color: #0b1220;
}

.crm-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f5f7fb;
}

/* main content container */
.crm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-top: 38px;    /* 🔹 header–content gap */
}

/* ==================================================
   GENERIC BUTTONS / BADGES / TABLES
   (kept from your old design, polished)
================================================== */

.btn {
    padding: 9px 18px;
    border-radius: 999px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background: linear-gradient(135deg, #377cff, #5da3ff);
    color: #fff;
}

.btn.secondary {
    background: rgba(226, 232, 255, 0.95);
    color: #1d4ed8;
}

.btn.export { background: #2563eb; color: #fff; }
.btn.import { background: #178c0d; color: #fff; }
.btn.danger { background: #fee2e2; color: #991b1b; }

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
}

.status-badge {
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 999px;
    display: inline-block;
}

.status-badge.completed {
    background: rgba(34, 197, 94, 0.09);
    color: #16a34a;
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.09);
    color: #ef4444;
}

/* ==================================================
   TABLE
================================================== */
/* table scroll container fills main */
.crm-table-wrapper {
    flex: 1;
    max-height: none;          /* remove previous max-height calc */
    overflow-y: auto;
    overflow-x: hidden;
}

/* table base */
table {
    width: 95%;
    margin: 12px auto;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

/* sticky header row */
thead th {
    position: sticky;
    top: 0;  /* table container top */
    z-index: 10;
    background: linear-gradient(180deg, #010405, #3b82f6);
}

th {
    color: #f9fafb;
    font-weight: 700;
    padding: 10px;
    text-align: left;
}

td {
    padding: 8px;
    border-bottom: 1px solid #e5eaf0;
    color: #0f172a;
}

tr:nth-child(even) { background: #f9fafb; }
tr:nth-child(odd)  { background: #ffffff; }

tr:hover { background: #e0f2fe; }


/* ==================================================
   FORMS
================================================== */

input, select, textarea {
    padding: 10px;
    border: 1px solid #1f2937;
    border-radius: 8px;
    width: 100%;
}

input::placeholder {
    color: #6b7280;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.6);
}
.reg-page-wrapper {
    max-width: 900px;
    margin: 0 auto;
}
.reg-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 4px;
}

.reg-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* card */

.reg-form-card {
    background: #ffffff;
    border-radius: 14px;
    padding: 18px 20px 22px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

/* 2-column grid */

.reg-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.form-group {
    margin-bottom: 0;
}

.reg-remark {
    grid-column: 1 / -1;   /* full width last row */
}

.reg-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

/* inputs light theme */

.reg-form-card .reg-input {
    background: #ffffff;
    color: #111827;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 9px 10px;
}

.reg-form-card .reg-input::placeholder {
    color: #9ca3af;
}

.reg-form-card .reg-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.reg-form-container {
    background: #ffffff;
    padding: 18px 20px 24px;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.form-card {
    margin-top: 10px;
}

.form-group {
    margin-bottom: 12px;
}

/* labels */

/* registration / normal forms */
.reg-form-card .form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #111827;
}

/* login page override only inside login-card */
.login-card .form-group label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
    color: #e5e7eb;
}


.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #2563eb;
    text-decoration: none;
    background: #e0edff;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    font-weight: 600;
}

.back-btn:hover {
    background: #d0e2ff;
    color: #1d4ed8;
}


.submit-btn {
    margin-top: 6px;
    border-radius: 999px;
    padding-inline: 22px;
}

.followup-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ==================================================
   HEADER + TOP NAV
================================================== */

.crm-header {
    background: #08173d;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(16px);
    position: sticky;      /* NEW */
    top: 0;                /* stick to top */
    z-index: 50;           /* above table */
}

.crm-topbar {
    display: grid;
    grid-template-columns: 1.4fr 1.2fr 1.1fr; /* left, center logo, right */
    align-items: center;
    gap: 16px;
    padding: 10px 18px;
}

/* center logo */
.crm-top-center-logo {
    display: flex;
    justify-content: center;
}

.crm-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.crm-logo-wrap {
    height: 42px;
    width: 42px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.crm-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.crm-brand-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.crm-brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #e4e6eb;
}

.crm-brand-sub {
    font-size: 0.75rem;
    color: #6b7280;
}
.crm-page-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #020d29;
}
.crm-page-sub {
    font-size: 0.75rem;
    color: #6b7280;
}

/* left: search + menu */

.crm-top-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-top-left-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.crm-user-label {
    font-size: 0.8rem;
    color: #cbd5f5;
    padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.5);
}

.crm-link-light {
    color: #60a5fa;
    text-decoration: none;
}

/* center: search */

.crm-top-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.crm-search-box {
    display: flex;
    width: 100%;
    max-width: 480px;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    border-radius: 999px;
    padding: 2px 4px;
    box-shadow: inset 0 0 0 1px rgba(51, 65, 85, 0.9);
}

.crm-search-input {
    background: transparent;
    border-radius: 999px;
    border: none;
    padding-left: 14px;
    color: #e5e7eb;
    font-size: 14px;
}

.crm-search-input::placeholder {
    color: #6b7280;
}

.crm-search-input:focus {
    outline: none;
    box-shadow: none;
}

.crm-search-btn {
    border-radius: 999px;
    padding-inline: 18px;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
}
.crm-top-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 220px;
}

/* admin chip */

.crm-user-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(148, 163, 184, 0.6);
    font-size: 0.8rem;
    color: #111827;
}

.crm-user-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.25);
}

.crm-user-name {
    font-weight: 600;
}

/* logout dropdown - absolutely positioned under chip */
.crm-logout-pill {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, 6px);
    padding: 4px 12px;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-size: 0.78rem;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(248, 113, 113, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

.crm-user-chip:hover .crm-logout-pill {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}
.crm-logout-link {
    color: #ef4444;
    text-decoration: none;
    font-weight: 600;
    padding-left: 6px;
    border-left: 1px solid #e5e7eb;
}

.crm-logout-link:hover {
    color: #b91c1c;
}

@keyframes user-chip-pop {
    from { transform: translateY(-4px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.btn.logout {
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 12px;
}

.btn.logout:hover {
    background: #fecaca;
    color: #7f1d1d;
}

.btn-status-pill {
    border-radius: 999px !important;
    border: none;
    background: #f9fafb;
    color: #111827;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 0 0 1px #e5e7eb;
    padding-inline: 10px;
}

.btn-status-pill.primary {
    box-shadow: 0 0 0 1px #60a5fa;
}

/* completed / rejected row - separate from admin chip */
.crm-status-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    margin-top: 14px;          /* pushes pills a bit lower than admin chip */
}

.status-pill {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    min-width: 120px;
}

.completed-pill {
    background: #ecfdf3;
    color: #16a34a;
}

.rejected-pill {
    background: #fef2f2;
    color: #ef4444;
}

.crm-status-stack.active .completed-pill {
    box-shadow: 0 0 0 1px #4ade80;
    border-radius: 999px;
}

/* right: actions */

.crm-top-right .btn-sm {
    font-size: 0.78rem;
    padding: 6px 11px;
}

.crm-nav-btn {
    border-radius: 999px !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
    background: transparent;
    color: #e5e7eb;
}

.crm-nav-btn:hover {
    background: rgba(30, 64, 175, 0.9);
    color: #f9fafb;
}

.enquiry-new-btn {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.enquiry-new-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* ==================================================
   FOOTER
================================================== */

.crm-footer {
    text-align: center;
    padding: 10px;
    background: #020617;
    color: #9ca3af;
    font-size: 0.8rem;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
}
.footer-link {
    color: #9ecbff;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.25s ease;
}

.footer-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.footer-link:hover .footer-icon {
    transform: translateX(3px);
}


/* ==================================================
   LOGIN PAGE (kept, minor color match)
================================================== */

.login-wrapper {
    min-height: 100vh;
    background: radial-gradient(circle at top, #1d4ed8 0, #020617 50%, #000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: #020617;
    padding: 35px 30px;
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.8);
    text-align: center;
    border: 1px solid rgba(55, 65, 81, 0.9);
}

.login-logo {
    max-width: 250px;
    height: auto;
    width: 100%;
    max-height: 100px;
    display: block;
    margin: 0 auto 2rem;
}

/* ==================================================
   Enuquiry List Page
================================================== */
.enq-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;   /* title left/center, button right */
    margin-bottom: 8px;
}

.enq-page-title {
    flex: 1;
    text-align: center;
}

/* REMOVE this if added earlier:
.enq-page-header .enquiry-new-btn { position:absolute; right:0; }
*/

.enquiry-new-btn {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}
.enquiry-new-btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

/* ==================================================
   Analytics Page
================================================== */
.analytics-container {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    padding: 18px 22px 22px;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.stat-cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-bottom: 22px;
    gap: 18px;
}

.stat-card {
    flex: 1 1 40%;
    background: linear-gradient(120deg, #f2f6fc 70%, #e5eefc 100%);
    padding: 18px 14px 12px 18px;
    border-radius: 9px;
    border-left: 4px solid #5a9cff;
    color: #3866a8;
    box-shadow: 0 2px 7px #606e8f12;
    min-width: 160px;
}

.stat-label {
    font-size: 0.9rem;
    color: #3872ad;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #2254b7;
}

.status-card-row {
    display: flex;
    gap: 18px;
    margin: 10px 0 14px;
    flex-wrap: wrap;
}

.status-card {
    min-width: 140px;
    padding: 1.4em 1.1em 1.1em;
    border-radius: 14px;
    text-align: center;
    background: linear-gradient(111deg, #eef2fb 74%, #cde7f8 100%);
    box-shadow: 0 2px 10px #2770e012;
}

.status-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2462ff;
    margin-bottom: 4px;
}

.status-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0c4278;
}

.analytics-chart-title {
    color: #2462ff;
    text-align: center;
    font-weight: 500;
    margin-bottom: 8px;
}

.chart-section canvas {
    background: #fefefe;
    border-radius: 8px;
    box-shadow: 0 1px 10px #99b8fa22;
    display: block;
    margin: 0 auto 10px;
    max-width: 95%;
}

@media (max-width: 700px) {
    .analytics-container {
        padding: 14px 4vw 18px;
    }
    .stat-cards {
        flex-direction: column;
        gap: 14px;
    }
}


/* ==================================================
   🔥 Completed tab row colors
================================================== */
.row-completed {
    background: #ecfdf5 !important;
    border-left: 4px solid #22c55e;
}

.row-completed:hover {
    background: #d1fae5 !important;
}

.row-rejected {
    background: #fef2f2 !important;
    border-left: 4px solid #ef4444;
}

.row-rejected:hover {
    background: #fecaca !important;
}

/* Normal dashboard rows (no change) */
tr:nth-child(even) { background: #f9fafb; }
tr:nth-child(odd)  { background: #ffffff; }
tr:hover { background: #e0f2fe; }

/* ==================================================
   🔥 Custoer Edit Page
================================================== */
/* Customer Edit Page Styles */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.page-title {
    color: #178c0d;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
}

.admin-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.form-row.full-width {
    flex-direction: column;
}

.form-label {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 250px;
    gap: 0.5rem;
}

.form-label input,
.form-label select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-label input:focus,
.form-label select:focus {
    outline: none;
    border-color: #178c0d;
    box-shadow: 0 0 0 3px rgba(23, 140, 13, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

/* ===== MOBILE FIX FINAL ===== */

@media (max-width: 768px) {

    /* Header */
    .crm-header {
        padding: 6px 8px;
    }

    .crm-topbar {
        grid-template-columns: 1fr auto;
    }

    .crm-top-left {
        display: none;
    }

    .crm-menu-toggle {
        background: transparent;
        border: 2px solid rgba(255,255,255,0.6);
        color: #ffffff;
        font-weight: 600;
        font-size: 14px;
        padding: 6px 14px;
        border-radius: 20px;
        letter-spacing: 0.5px;
        cursor: pointer;
        transition: all 0.25s ease;
   }
 
    .crm-menu-toggle:hover {
        background: rgba(255,255,255,0.15);
        border-color: #ffffff;
   }

    /* Mobile menu */
    .crm-mobile-menu {
        display: none;
        padding: 12px;
        background: rgba(15, 23, 42, 0.98);
    }

    .crm-mobile-menu.show {
        display: block;
    }

    /* Table scroll fix */
    .crm-table-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .crm-table-wrapper table {
        min-width: 900px;
    }

    /* Buttons */
    .btn {
        font-size: 13px;
        padding: 8px 12px;
    }
    .crm-status-row {
        display: none !important;
    }
}

