:root {
    --app-bg: #f7f8fb;
}

body {
    background: var(--app-bg);
}

.auth-page {
    min-height: 100vh;
}

/* Auth pages (tenant/admin): image fit + larger UI without browser zoom */
.auth {
    min-height: 100vh;
}

.auth-left {
    overflow: hidden;
}

.auth-left > .d-flex {
    min-height: 100vh;
    width: 100%;
}

.auth-left > .d-flex > img {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    object-position: center;
    display: block;
}

.auth-right .max-w-464-px {
    max-width: 560px !important;
}

.auth-right h4 {
    font-size: clamp(2rem, 1.6rem + 1vw, 2.75rem);
}

.auth-right p.text-lg {
    font-size: 1.12rem;
}

.auth-right .form-control.h-56-px {
    height: 60px !important;
    font-size: 1.05rem;
}

.auth-right .btn.py-16 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    font-size: 1.05rem;
}

@media (min-width: 992px) {
    .auth-left {
        width: 52%;
    }

    .auth-right {
        width: 48%;
    }
}

#items-result .item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0.2rem;
    border-bottom: 1px solid #ececec;
}

.print-card {
    background: #fff;
}

.crm-column {
    min-width: 300px;
}

.crm-column-body {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.crm-card {
    cursor: grab;
}

.crm-card-avatar {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #1f2937;
    background: #ffffff;
    border: 1px solid #d1d5db;
    flex-shrink: 0;
}

.crm-card-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

.crm-card-pastel {
    background: var(--crm-client-color, #f4e8ff) !important;
    background: color-mix(in srgb, var(--crm-client-color, #f4e8ff) 70%, #ffffff) !important;
    border: 1px solid color-mix(in srgb, var(--crm-client-color, #f4e8ff) 85%, #cbd5e1);
}

.crm-setup-toggle {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.crm-setup-toggle i {
    display: block;
    line-height: 1;
}

.crm-setup-panel {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #d8dee7;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.crm-setup-panel .text-xs {
    font-size: 12px;
}

.crm-empty {
    border: 1px dashed #cfd8e3;
    border-radius: 8px;
    background: #fff;
    padding: 12px;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.crm-card-dragging {
    opacity: 0.55;
    cursor: grabbing;
}

.pos-shell {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 14px;
}

.pos-products,
.pos-cart {
    background: #ffffff;
    border: 1px solid #dbe2ec;
    border-radius: 14px;
    padding: 14px;
}

.pos-header {
    margin-bottom: 10px;
}

.pos-search {
    margin-bottom: 12px;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
    max-height: 68vh;
    overflow: auto;
    padding-right: 4px;
}

.pos-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    transition: transform .08s ease, box-shadow .12s ease;
}

.pos-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

.pos-card img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.pos-card h6 {
    font-size: 14px;
    margin: 0 0 2px;
    min-height: 36px;
}

.pos-card small {
    color: #64748b;
    display: block;
}

.pos-card strong {
    color: #0f172a;
}

.pos-lines {
    min-height: 130px;
    max-height: 36vh;
    overflow: auto;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 8px;
    margin-bottom: 10px;
}

.pos-line {
    border-bottom: 1px solid #eef2f7;
    padding: 6px 0;
}

.pos-line:last-child {
    border-bottom: 0;
}

.pos-line-main {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.chat-center-wrapper {
    min-height: 76vh;
}

.chat-center-wrapper .chat-sidebar,
.chat-center-wrapper .chat-main,
.chat-center-wrapper .profile-setting {
    min-height: 70vh;
}

.chat-center-wrapper .chat-empty-state {
    display: flex;
    min-height: 62vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

.chat-center-wrapper .chat-empty-state img {
    width: 220px;
    max-width: 80%;
    opacity: 0.9;
}

.chat-center-wrapper .chat-all-list .chat-sidebar-single {
    text-decoration: none;
}

.chat-center-wrapper .chat-message-list {
    padding: 16px 18px;
}

.chat-center-wrapper .chat-single-message .chat-message-content {
    max-width: min(82%, 720px);
}

.chat-center-wrapper .chat-single-message.right .chat-message-content {
    margin-left: auto;
}

.chat-center-wrapper .chat-message-box input[name="body"] {
    width: 100%;
}

.chat-center-wrapper .chat-attachment-policy,
.chat-center-wrapper .chat-upload-box {
    margin-left: 18px;
    margin-right: 18px;
}

.avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #d9dee7;
    color: #1f2937;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex: 0 0 40px;
}

.avatar-initial.avatar-lg {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
}

.chat-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    z-index: 1050;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.35);
}

.chat-contact-results {
    max-height: 220px;
    overflow: auto;
    border-radius: 8px;
}

.chat-contact-item {
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #fff;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-contact-item:hover {
    background: #f8fafc;
}

.chat-contact-avatar {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: #d1fae5;
    color: #065f46;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.wa-title-badge {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #22c55e;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.28);
}

.chat-all-list .chat-sidebar-single .info p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    line-height: 1.25;
    max-height: 2.5em;
}

@media (max-width: 1399px) {
    .chat-center-wrapper {
        display: grid;
        grid-template-columns: 320px 1fr;
        gap: 16px;
    }

    .chat-center-wrapper .profile-setting {
        grid-column: 1 / -1;
        min-height: auto;
    }
}

@media (max-width: 991px) {
    .chat-center-wrapper {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .chat-center-wrapper .chat-sidebar,
    .chat-center-wrapper .chat-main,
    .chat-center-wrapper .profile-setting {
        min-height: auto;
    }
}

.pos-line-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pos-line-actions button {
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 8px;
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #334155;
}

.pos-line-actions button:hover {
    background: #f8fafc;
}

.pos-line-actions .pos-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.pos-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
}

.pos-send {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 992px) {
    .pos-shell {
        grid-template-columns: 1fr;
    }
    .pos-grid {
        max-height: 42vh;
    }
}

.crm-column-over {
    border-color: #3d7eff;
    box-shadow: inset 0 0 0 2px rgba(61, 126, 255, 0.12);
}

@media print {
    nav,
    .btn,
    #quote-message {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

.menu-sortable-item {
    cursor: grab;
}

.menu-sortable-item.is-dragging {
    opacity: 0.6;
}

.menu-sort-handle {
    color: #94a3b8;
    margin-left: auto;
    font-size: 14px;
}

.pm-project-list {
    max-height: 72vh;
    overflow-y: auto;
}

.pm-project-link {
    display: block;
    padding: 14px 16px;
    border-bottom: 1px solid #eef2f7;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
}

.pm-project-link:hover {
    background: #f8fafc;
}

.pm-project-link.is-active {
    background: #ecf3ff;
}

.pm-project-link h6 {
    font-size: 14px;
}

.pm-project-link p {
    font-size: 12px;
    line-height: 1.35;
}

.pm-board {
    display: grid;
    grid-template-columns: repeat(6, minmax(220px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pm-column {
    min-height: 420px;
    background: #f8fafc;
    border: 1px solid #e5eaf3;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

.pm-column-header {
    padding: 12px;
    border-bottom: 1px solid #e5eaf3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.pm-task-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 320px;
}

.pm-task-list.is-drop-target {
    outline: 2px dashed #94a3b8;
    outline-offset: -4px;
}

.pm-task-card {
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 10px;
    padding: 10px;
    cursor: move;
}

.pm-task-card.is-dragging {
    opacity: 0.7;
}
