/* =======================
   GLOBAL
======================= */

body {
    background: #f4f6f9;
    font-family: 'Inter', sans-serif;
}


/* =======================
   BANNER
======================= */

.dashboard-banner-wrap {
    overflow: hidden;
    border-radius: 16px;
    background: #e9ecef;
}

.dashboard-banner {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    aspect-ratio: 960 / 672;
    object-fit: cover;
}


/* =======================
   KPI BOX
======================= */

.kpi-box {
    position: relative;
    padding: 18px 8px;
    border-radius: 14px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.kpi-box span {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ffffff;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 50px;
}


/* =======================
   ACTION CARDS
======================= */

.action-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px 14px;
    text-align: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    transition: all 0.25s ease;
    display: block;
    height: 100%;
    text-decoration: none;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.15);
}


/* ICON */

.action-card img {
    width: 100px;
    margin-bottom: 10px;
    transition: transform 0.25s ease;
}

.action-card:hover img {
    transform: scale(1.15);
}


/* TEXT */

.action-card span {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}


/* =======================
   QUOTATION CARD
======================= */

.quote-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-header h6 {
    font-weight: 700;
    margin-bottom: 4px;
}

.quote-amount {
    font-weight: 700;
    color: #198754;
}

.quote-card small {
    color: #666;
}

.quote-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}


/* =======================
   COLOR HELPERS
======================= */

.bg-primary {
    background: #0d6efd;
}

.bg-warning {
    background: #ffc107;
    color: #000;
}

.bg-success {
    background: #198754;
}


/* =======================
   MOBILE OPTIMIZATION
======================= */

@media (max-width: 576px) {
    .action-card img {
        width: 76px;
    }
    .kpi-box {
        font-size: 13px;
    }
}

.lead-card {
    border-radius: 14px;
}

.lead-card h6 {
    font-size: 15px;
}

.lead-meta {
    font-size: 13px;
    color: #6c757d;
}

.status-badge {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 20px;
}

.card-quote {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-quote:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-weight: 600;
    font-size: 1.25rem;
}

.service-row {
    margin-bottom: 5px;
}

.badge-service {
    background-color: #0d6efd;
    color: white;
    margin-right: 5px;
}

.badge-product {
    background-color: #198754;
    color: white;
    margin-right: 5px;
}

.badge-item {
    background-color: #fd7e14;
    color: white;
    margin-right: 5px;
    margin-bottom: 3px;
    display: inline-block;
}

.view-btn {
    margin-top: auto;
}

.card-quote {
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
}

.card-title {
    font-weight: 600;
    font-size: 1.5rem;
}

.badge-service {
    background-color: #0d6efd;
    color: white;
    margin-right: 5px;
}

.badge-product {
    background-color: #198754;
    color: white;
    margin-right: 5px;
}

.badge-item {
    background-color: #fd7e14;
    color: white;
    margin-right: 5px;
    margin-bottom: 3px;
    display: inline-block;
}

table th,
table td {
    vertical-align: middle !important;
}

.table thead {
    background-color: #e9ecef;
}

.chat-container-custom {
    display: flex;
    flex-direction: column;
    height: 100vh;
    /* Full viewport height */
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* Chat Header */

.chat-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: #f5f6f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h5 {
    margin: 0;
    font-weight: 500;
}

.chat-header small {
    color: #555;
}


/* Chat messages */

.chat-messages {
    flex: 1;
    padding: 15px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f0f2f5;
}


/* Chat bubbles */

.message {
    display: flex;
}

.message.customer {
    justify-content: flex-start;
}

.message.tech {
    justify-content: flex-end;
}

.bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.message.customer .bubble {
    background: #fff;
    border-top-left-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.tech .bubble {
    background: #0084ff;
    color: #fff;
    border-top-right-radius: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.bubble small {
    display: block;
    font-size: 11px;
    margin-top: 5px;
    color: #555;
}

.message.tech .bubble small {
    color: #e0e0e0;
}


/* Images inside chat */

.bubble img {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    margin-top: 5px;
}


/* Scrollbar customization */

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}


/* Chat input at bottom */

.chat-input {
    display: flex;
    gap: 10px;
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    background: #f5f6f7;
}

.chat-input input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border-radius: 25px;
    border: 1px solid #ccc;
    outline: none;
}

.chat-input button {
    padding: 10px 15px;
    border: none;
    border-radius: 25px;
    background: #0084ff;
    color: #fff;
    cursor: pointer;
}

.chat-input .file-upload {
    position: relative;
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 50%;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-input .file-upload input[type="file"] {
    display: none;
}


/* Responsive */

@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
        border-radius: 0;
    }
}


/* ================================
   MOBILE / APK SAFE AREA LAYOUT
   (notch, camera cutout, home bar)
   ================================ */

:root {
    --app-safe-top: 36px;
    --app-safe-bottom: 16px;
    --app-safe-left: 12px;
    --app-safe-right: 12px;
    --app-content-gutter: 16px;
}

.mobile-safe-layout {
    padding-left: 0;
    padding-right: 0;
}

.mobile-safe-layout .salon-main-header {
    padding-block: unset !important;
    padding-top: max(44px, calc(12px + env(safe-area-inset-top, var(--app-safe-top)))) !important;
    padding-bottom: 12px !important;
    padding-left: var(--app-content-gutter) !important;
    padding-right: var(--app-content-gutter) !important;
    top: 0;
    z-index: 5;
}

.mobile-safe-layout .custom-container {
    padding-left: var(--app-content-gutter) !important;
    padding-right: var(--app-content-gutter) !important;
}

.mobile-safe-layout .salon-main-header .custom-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.mobile-safe-layout .salon-main-header .header-content {
    gap: 12px;
    min-height: 44px;
}

.mobile-safe-layout .salon-main-header .header-content img {
    flex-shrink: 0;
}

.mobile-safe-layout .bottom-navbar {
    left: var(--app-content-gutter) !important;
    right: var(--app-content-gutter) !important;
    bottom: max(12px, env(safe-area-inset-bottom, var(--app-safe-bottom))) !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14) !important;
    z-index: 5 !important;
    padding-top: 8px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, var(--app-safe-bottom)));
    padding-left: max(10px, env(safe-area-inset-left, var(--app-safe-left)));
    padding-right: max(10px, env(safe-area-inset-right, var(--app-safe-right)));
}

.mobile-safe-layout .mobile-bottom-spacer {
    height: calc(96px + env(safe-area-inset-bottom, var(--app-safe-bottom)));
    width: 100%;
    pointer-events: none;
}

.mobile-safe-layout .salon-auth-header {
    padding-top: calc(20px + env(safe-area-inset-top, var(--app-safe-top)));
    padding-left: 0;
    padding-right: 0;
}

.mobile-safe-layout.auth-page .bottom-navbar,
.mobile-safe-layout.auth-page .mobile-bottom-spacer,
.mobile-safe-layout.auth-page .panel-space-sm {
    display: none !important;
}

.mobile-safe-layout .app-page-content,
.mobile-safe-layout .custom-container2,
.mobile-safe-layout .container {
    padding-left: var(--app-content-gutter);
    padding-right: var(--app-content-gutter);
}

body.mobile-safe-layout.is-mobile-app .salon-main-header {
    padding-top: max(48px, calc(12px + env(safe-area-inset-top, 40px))) !important;
}

body.mobile-safe-layout.android-webview-app .salon-main-header,
body.mobile-safe-layout.android-webview-app.is-mobile-app .salon-main-header {
    padding-top: 12px !important;
}

body.mobile-safe-layout.android-webview-app .salon-main-header {
    background-color: #fff;
}

body.mobile-safe-layout.android-webview-app .salon-auth-header {
    padding-top: 12px !important;
}

body.mobile-safe-layout.is-mobile-app .bottom-navbar {
    left: var(--app-content-gutter) !important;
    right: var(--app-content-gutter) !important;
    bottom: max(14px, env(safe-area-inset-bottom, 14px)) !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    border-radius: 16px !important;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14) !important;
}

body.mobile-safe-layout.is-mobile-app .mobile-bottom-spacer {
    height: calc(100px + env(safe-area-inset-bottom, 18px)) !important;
}

.mobile-dashboard-grid .row {
    --bs-gutter-x: 10px;
}

.mobile-dashboard-grid .kpi-box,
.mobile-dashboard-grid .status-box {
    overflow: visible;
    word-break: break-word;
}

@media (max-width: 768px), (hover: none) and (pointer: coarse) {
    body.mobile-safe-layout .bottom-navbar {
        left: var(--app-content-gutter) !important;
        right: var(--app-content-gutter) !important;
        bottom: max(12px, env(safe-area-inset-bottom, 12px)) !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 16px !important;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14) !important;
    }

    .mobile-safe-layout .app-page-content,
    .mobile-safe-layout .custom-container2,
    .mobile-safe-layout .container {
        padding-left: var(--app-content-gutter) !important;
        padding-right: var(--app-content-gutter) !important;
        max-width: 100% !important;
    }

    .mobile-safe-layout .container {
        --bs-gutter-x: 12px;
    }

    .mobile-safe-layout .salon-main-header .main-content h4 {
        font-size: 15px;
        line-height: 1.25;
    }

    .mobile-safe-layout .salon-main-header .main-content h5 {
        font-size: 12px;
        margin-top: 2px;
    }

    .mobile-safe-layout .bottom-navbar ul li .icon h5 {
        font-size: 11px;
        line-height: 1.1;
    }

    .mobile-safe-layout .bottom-navbar ul li .icon .menu-icon {
        padding: 6px 12px;
    }
}