/* ============================================================
   NChat Design System v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

:root {
    --nc-primary:       #128C7E;
    --nc-primary-dark:  #075E54;
    --nc-primary-light: #e6f4f1;
    --nc-secondary:     #25D366;
    --nc-bg:            #f0f2f5;
    --nc-surface:       #ffffff;
    --nc-sidebar-w:     240px;
    --nc-topbar-h:      0px;        /* topbar removido — espaço ocupado pelo mobile header em mobile */
    --nc-mobile-header-h: 44px;
    --nc-text:          #1e293b;
    --nc-muted:         #64748b;
    --nc-border:        #e2e8f0;
    --nc-shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --nc-shadow-md:     0 4px 12px rgba(0,0,0,.1);
    --nc-radius:        8px;
    --nc-radius-sm:     6px;
    --nc-radius-lg:     12px;
    --nc-radius-xl:     16px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--nc-bg);
    color: var(--nc-text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.nc-wrapper { display: flex; min-height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.nc-sidebar {
    width: var(--nc-sidebar-w);
    background: var(--nc-surface);
    border-right: 1px solid var(--nc-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    transition: width .22s ease, transform .25s ease;
    overflow: hidden;
}

.nc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--nc-border);
    text-decoration: none;
    cursor: default;
}

.nc-brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nc-brand-icon {
    width: 36px; height: 36px;
    background: var(--nc-primary);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 17px;
    flex-shrink: 0;
}

.nc-brand-text {
    font-size: 17px;
    font-weight: 800;
    color: var(--nc-text);
    letter-spacing: -.3px;
}

.nc-brand-text em {
    color: var(--nc-primary);
    font-style: normal;
}

.nc-sidebar-nav {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.nc-nav-section {
    padding: 14px 16px 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
}

.nc-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 1px 8px;
    border-radius: var(--nc-radius-sm);
    color: var(--nc-muted);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 600;
    transition: all .15s;
    cursor: pointer;
}

.nc-nav-link:hover {
    background: var(--nc-primary-light);
    color: var(--nc-primary);
    text-decoration: none;
}

.nc-nav-link.active {
    background: var(--nc-primary-light);
    color: var(--nc-primary);
}

.nc-nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.nc-nav-badge {
    margin-left: auto;
    background: var(--nc-primary);
    color: #fff;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 700;
}

.nc-sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--nc-border);
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.nc-main {
    margin-left: var(--nc-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: calc(100vw - var(--nc-sidebar-w));
}

/* ============================================================
   MOBILE HEADER (substitui o topbar — visível só em mobile)
   ============================================================ */
.nc-mobile-header {
    display: none;
    height: var(--nc-mobile-header-h);
    background: var(--nc-surface);
    border-bottom: 1px solid var(--nc-border);
    align-items: center;
    padding: 0 12px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 900;
    flex-shrink: 0;
}
.nc-mobile-header-title {
    flex: 1;
    font-size: 15px;
    font-weight: 800;
    color: var(--nc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   SIDEBAR USER INFO
   ============================================================ */
.nc-sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--nc-radius-sm);
    margin-bottom: 6px;
    cursor: default;
    overflow: hidden;
}
.nc-sidebar-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--nc-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -.5px;
}
.nc-sidebar-user-name {
    font-size: 13px; font-weight: 700; color: var(--nc-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nc-sidebar-user-role {
    font-size: 11px; color: var(--nc-muted);
}

/* Legacy topbar — mantido para não quebrar JS que referencia .nc-topbar */
.nc-topbar { display: none; }

.nc-icon-btn {
    width: 34px; height: 34px;
    border-radius: var(--nc-radius-sm);
    border: none;
    background: transparent;
    color: var(--nc-muted);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
    text-decoration: none;
}

.nc-icon-btn:hover {
    background: var(--nc-bg);
    color: var(--nc-text);
    text-decoration: none;
}

.nc-user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--nc-primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: -.5px;
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.nc-content {
    flex: 1;
    padding: 24px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.nc-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
}

.nc-page-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--nc-text);
    line-height: 1.2;
}

.nc-page-subtitle {
    font-size: 13px;
    color: var(--nc-muted);
    margin-top: 3px;
    font-weight: 500;
}

/* ============================================================
   CARDS
   ============================================================ */
.nc-card {
    background: var(--nc-surface);
    border-radius: var(--nc-radius);
    border: 1px solid var(--nc-border);
    box-shadow: var(--nc-shadow);
    overflow: hidden;
}

.nc-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nc-border);
}

.nc-card-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--nc-text);
}

.nc-card-body { padding: 20px; }

/* Stat cards */
.nc-stat {
    background: var(--nc-surface);
    border-radius: var(--nc-radius);
    border: 1px solid var(--nc-border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--nc-shadow);
    transition: box-shadow .15s;
}

.nc-stat:hover { box-shadow: var(--nc-shadow-md); }

.nc-stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.si-green   { background: #dcfce7; color: #16a34a; }
.si-blue    { background: #dbeafe; color: #2563eb; }
.si-yellow  { background: #fef9c3; color: #b45309; }
.si-red     { background: #fee2e2; color: #dc2626; }
.si-purple  { background: #ede9fe; color: #7c3aed; }
.si-teal    { background: #ccfbf1; color: #0d9488; }
.si-orange  { background: #ffedd5; color: #ea580c; }

.nc-stat-val {
    font-size: 30px;
    font-weight: 900;
    color: var(--nc-text);
    line-height: 1;
    margin-bottom: 4px;
}

.nc-stat-lbl {
    font-size: 12px;
    color: var(--nc-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-nc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--nc-radius-sm);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    text-decoration: none;
    line-height: 1;
}

.btn-nc:hover { text-decoration: none; }

.btn-nc-primary { background: var(--nc-primary); color: #fff; border-color: var(--nc-primary); }
.btn-nc-primary:hover { background: var(--nc-primary-dark); color: #fff; border-color: var(--nc-primary-dark); }

.btn-nc-outline { background: transparent; color: var(--nc-primary); border-color: var(--nc-primary); }
.btn-nc-outline:hover { background: var(--nc-primary); color: #fff; }

.btn-nc-ghost { background: var(--nc-bg); color: var(--nc-text); border-color: var(--nc-border); }
.btn-nc-ghost:hover { background: var(--nc-border); color: var(--nc-text); }

.btn-nc-danger { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.btn-nc-danger:hover { background: #dc2626; color: #fff; border-color: #dc2626; }

.btn-nc-edit { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.btn-nc-edit:hover { background: #2563eb; color: #fff; border-color: #2563eb; }

.btn-nc-warning { background: #fef3c7; color: #d97706; border-color: #fcd34d; }
.btn-nc-warning:hover { background: #d97706; color: #fff; border-color: #d97706; }

.btn-nc-sm { padding: 6px 12px; font-size: 12px; }
.btn-nc-lg { padding: 12px 24px; font-size: 15px; }
.btn-nc-block { width: 100%; justify-content: center; }

/* ============================================================
   BADGES
   ============================================================ */
.nc-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2px;
}

.badge-success  { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef9c3; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #dc2626; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-muted    { background: #f1f5f9; color: #475569; }
.badge-primary  { background: var(--nc-primary-light); color: var(--nc-primary); }
.badge-purple   { background: #ede9fe; color: #7c3aed; }

/* ============================================================
   TABLES
   ============================================================ */
.nc-table-wrap {
    overflow-x: auto;
}

.nc-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.nc-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--nc-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--nc-border);
    white-space: nowrap;
}

.nc-table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nc-border);
    font-size: 13px;
    color: var(--nc-text);
    vertical-align: middle;
}

.nc-table tbody tr:last-child td { border-bottom: none; }
.nc-table tbody tr:hover { background: #f8fafc; }

/* ============================================================
   FORMS
   ============================================================ */
.nc-form-group { margin-bottom: 18px; }
.nc-form-row { display: flex; gap: 16px; }
.nc-form-row .nc-form-group { flex: 1; }

.nc-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--nc-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.nc-input, .nc-select, .nc-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-sm);
    font-size: 13px;
    font-family: inherit;
    color: var(--nc-text);
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}

.nc-input:focus, .nc-select:focus, .nc-textarea:focus {
    border-color: var(--nc-primary);
    box-shadow: 0 0 0 3px rgba(18, 140, 126, .12);
}

.nc-textarea { resize: vertical; min-height: 90px; }
.nc-select { cursor: pointer; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border: none;
    border-radius: var(--nc-radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.15);
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--nc-border);
    align-items: center;
}

.modal-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--nc-text);
}

.modal-body { padding: 22px; }

/* Botão fechar modal */
.nc-modal-close {
    width: 30px; height: 30px;
    border-radius: var(--nc-radius-sm);
    border: none;
    background: transparent;
    color: var(--nc-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    transition: all .15s;
    flex-shrink: 0;
    margin-left: auto;
    padding: 0;
}

.nc-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
}

.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--nc-border);
    gap: 8px;
}

/* ============================================================
   TICKET INTERFACE
   ============================================================ */
.nc-tickets-wrap {
    display: flex;
    height: calc(100vh - var(--nc-topbar-h));
    overflow: hidden;
}

.nc-tkt-list {
    width: 330px;
    flex-shrink: 0;
    background: var(--nc-surface);
    border-right: 1px solid var(--nc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nc-tkt-detail {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #efeae2;
    overflow: hidden;
}

/* Ticket list header */
.nc-tkt-list-header {
    padding: 14px 14px 0;
    background: var(--nc-surface);
}

.nc-tkt-search-wrap {
    position: relative;
    margin-bottom: 10px;
}

.nc-tkt-search-wrap input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--nc-border);
    border-radius: 20px;
    font-size: 13px;
    background: var(--nc-bg);
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
}

.nc-tkt-search-wrap input:focus { border-color: var(--nc-primary); background: #fff; }
.nc-tkt-search-wrap .search-icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--nc-muted); font-size: 12px; pointer-events: none;
}

.nc-tkt-tabs {
    display: flex;
    border-bottom: 1px solid var(--nc-border);
    margin: 0 -14px;
    padding: 0 4px;
}

.nc-tkt-tab {
    flex: 1;
    padding: 9px 6px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--nc-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
    text-align: center;
}

.nc-tkt-tab:hover { color: var(--nc-text); }
.nc-tkt-tab.active { color: var(--nc-primary); border-bottom-color: var(--nc-primary); }

/* Ticket items */
.nc-tkt-items { flex: 1; overflow-y: auto; }

.nc-tkt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--nc-border);
    cursor: pointer;
    transition: background .1s;
}

.nc-tkt-item:hover { background: #f8fafc; }
.nc-tkt-item.active { background: var(--nc-primary-light); }

.nc-tkt-avatar-wrap { position: relative; flex-shrink: 0; }

.nc-tkt-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.nc-tkt-channel-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #128C7E; /* default; overridden inline with cnl_cor */
    border: 2px solid #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 7px;
    color: #fff;
}

.nc-tkt-info { flex: 1; min-width: 0; }

.nc-tkt-name {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-tkt-preview {
    font-size: 12px;
    color: var(--nc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.nc-tkt-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.nc-tkt-time { font-size: 11px; color: var(--nc-muted); }

.nc-tkt-unread {
    width: 18px; height: 18px;
    background: var(--nc-secondary);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

/* Ellipsis button on each ticket list item */
.nc-tkt-item-opts {
    background: none;
    border: none;
    color: var(--nc-muted);
    font-size: 12px;
    width: 22px; height: 22px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s, background .1s;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.nc-tkt-item:hover .nc-tkt-item-opts { opacity: 1; }
.nc-tkt-item-opts:hover,
.nc-tkt-item-opts:focus { opacity: 1; background: rgba(0,0,0,.07); color: var(--nc-text); outline: none; }

/* Context menu buttons */
.tkt-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13px;
    color: var(--nc-text);
    cursor: pointer;
    text-align: left;
    transition: background .1s;
    white-space: nowrap;
}
.tkt-menu-btn:hover { background: var(--nc-bg); }

/* Filter selects inside ticket list */
.nc-tkt-flt {
    width: 100%;
    padding: 5px 7px;
    font-size: 11px;
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-sm);
    font-family: inherit;
    outline: none;
    background: var(--nc-bg);
    color: var(--nc-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%2394a3b8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
    padding-right: 20px;
}
.nc-tkt-flt:focus { border-color: var(--nc-primary); }

/* Etiqueta dot in ticket list */
.nc-tkt-etq-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Ticket detail */
.nc-tkt-detail-header {
    background: #f0f0f0;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #d1d7db;
}

.nc-tkt-detail-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Messages */
.nc-msg-wrap { display: flex; gap: 8px; max-width: 65%; }
.nc-msg-wrap.in { align-self: flex-start; }
.nc-msg-wrap.out { align-self: flex-end; flex-direction: row-reverse; }

.nc-msg-bubble {
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 1px 1px rgba(0,0,0,.08);
    position: relative;
}

.nc-msg-wrap.in  .nc-msg-bubble { background: #fff; border-bottom-left-radius: 3px; }
.nc-msg-wrap.out .nc-msg-bubble { background: #d9fdd3; border-bottom-right-radius: 3px; }

/* Mensagem removida */
.nc-msg-removed {
    color: #aaa;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 5px;
}
.nc-msg-removed del { text-decoration: line-through; }

/* Falha ao enviar */
.nc-msg-bubble.nc-msg-failed {
    border: 1.5px solid #dc2626 !important;
    background: #fff5f5 !important;
}

.nc-msg-time {
    font-size: 10px;
    color: #8696a0;
    text-align: right;
    margin-top: 3px;
}

.nc-msg-day {
    align-self: center;
    background: #e9edef;
    color: #54656f;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 10px;
    margin: 8px 0;
}

/* Message input */
.nc-tkt-input-area {
    background: #f0f0f0;
    padding: 10px 12px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    border-top: 1px solid #d1d7db;
}

.nc-tkt-input-area textarea {
    flex: 1;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    background: #fff;
    line-height: 1.4;
}

.nc-tkt-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #f0f2f5;
}

.nc-tkt-empty i { font-size: 48px; color: #cdd3d8; }
.nc-tkt-empty p { color: var(--nc-muted); font-size: 14px; font-weight: 500; }

/* ============================================================
   CHANNELS
   ============================================================ */
.nc-channel-card {
    background: var(--nc-surface);
    border-radius: var(--nc-radius);
    border: 1px solid var(--nc-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: var(--nc-shadow);
    transition: box-shadow .15s;
}

.nc-channel-card:hover { box-shadow: var(--nc-shadow-md); }

.nc-channel-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nc-channel-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.nc-channel-info { flex: 1; min-width: 0; }

.nc-channel-name {
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-channel-number { font-size: 13px; color: var(--nc-muted); margin-top: 2px; }

.nc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-top: 6px;
}

.nc-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}

.nc-status.connected    { color: #16a34a; }
.nc-status.connected .nc-status-dot    { background: #16a34a; }
.nc-status.disconnected { color: #dc2626; }
.nc-status.disconnected .nc-status-dot { background: #dc2626; }
.nc-status.connecting   { color: #d97706; }
.nc-status.connecting .nc-status-dot   { background: #d97706; animation: blink 1.2s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.nc-channel-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--nc-border);
}

/* ============================================================
   MODAL SELEÇÃO DE CANAL
   ============================================================ */
.modal-canal-selecao { max-width: 460px; }

.nc-modal-subtitle {
    font-size: 13px;
    color: var(--nc-muted);
    margin: 2px 0 0;
}

.nc-canal-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nc-canal-select-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--nc-surface);
    border: 1.5px solid var(--nc-border);
    border-radius: var(--nc-radius);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.nc-canal-select-card:hover {
    border-color: var(--nc-primary);
    box-shadow: 0 0 0 3px rgba(var(--nc-primary-rgb, 79,70,229), .08);
    background: var(--nc-hover);
}

.nc-csc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.nc-csc-body { flex: 1; min-width: 0; }

.nc-csc-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nc-csc-phone {
    font-size: 12px;
    color: var(--nc-muted);
    margin-top: 2px;
}

.nc-csc-arrow {
    color: var(--nc-muted);
    font-size: 13px;
    flex-shrink: 0;
    transition: color .15s;
}

.nc-canal-select-card:hover .nc-csc-arrow { color: var(--nc-primary); }

/* ============================================================
   LABELS
   ============================================================ */
.nc-label-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.nc-label-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .15s;
}

.nc-label-chip:hover { opacity: .85; transform: translateY(-1px); }
.nc-label-chip .chip-edit { opacity: 0; transition: opacity .15s; font-size: 12px; }
.nc-label-chip:hover .chip-edit { opacity: 1; }

/* ============================================================
   TABS (settings)
   ============================================================ */
.nc-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--nc-border); margin-bottom: 24px; }

.nc-tab {
    padding: 11px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--nc-muted);
    border: none;
    background: transparent;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s;
    font-family: inherit;
}

.nc-tab:hover { color: var(--nc-text); }
.nc-tab.active { color: var(--nc-primary); border-bottom-color: var(--nc-primary); }

.nc-tab-panel { display: none; }
.nc-tab-panel.active { display: block; }

/* ============================================================
   QR CODE
   ============================================================ */
.nc-qr-box {
    width: 200px; height: 200px;
    border: 2px dashed var(--nc-border);
    border-radius: var(--nc-radius);
    display: flex; align-items: center; justify-content: center;
    background: var(--nc-bg);
    margin: 0 auto 16px;
}

.nc-qr-box img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }

/* ============================================================
   SEARCH FILTER
   ============================================================ */
.nc-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nc-search-input-wrap { position: relative; }
.nc-search-input-wrap input {
    padding: 9px 14px 9px 36px;
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-sm);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    background: #fff;
    width: 240px;
}
.nc-search-input-wrap input:focus { border-color: var(--nc-primary); }
.nc-search-input-wrap i {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--nc-muted); font-size: 13px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.nc-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--nc-radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

.nc-alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.nc-alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fde047; }
.nc-alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.nc-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.nc-login-body {
    min-height: 100vh;
    background: linear-gradient(145deg, #075E54 0%, #128C7E 55%, #25D366 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nc-login-card {
    background: #fff;
    border-radius: var(--nc-radius-xl);
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25);
}

.nc-login-logo {
    text-align: center;
    margin-bottom: 36px;
}

.nc-login-logo-icon {
    width: 64px; height: 64px;
    background: var(--nc-primary);
    border-radius: 18px;
    display: inline-flex;
    align-items: center; justify-content: center;
    font-size: 30px;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(18,140,126,.4);
}

.nc-login-logo h1 {
    font-size: 24px;
    font-weight: 900;
    color: var(--nc-text);
    letter-spacing: -.3px;
}

.nc-login-logo p { font-size: 13px; color: var(--nc-muted); margin-top: 4px; }

.nc-login-form .nc-form-group { margin-bottom: 16px; }

/* ============================================================
   UTILS
   ============================================================ */
.text-muted    { color: var(--nc-muted) !important; }
.text-primary  { color: var(--nc-primary) !important; }
.text-success  { color: #16a34a !important; }
.text-danger   { color: #dc2626 !important; }
.fw-600        { font-weight: 600; }
.fw-700        { font-weight: 700; }
.fw-800        { font-weight: 800; }

/* ============================================================
   SIDEBAR COLLAPSIBLE
   ============================================================ */

/* Toggle button inside brand */
.nc-sidebar-toggle {
    margin-left: auto;
    width: 28px; height: 28px;
    border: 1px solid var(--nc-border);
    border-radius: 6px;
    background: transparent;
    color: var(--nc-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
    transition: all .15s;
}

.nc-sidebar-toggle:hover { background: var(--nc-bg); color: var(--nc-text); }

/* Collapsed state */
.nc-sidebar.collapsed {
    width: 68px;
}

.nc-sidebar.collapsed .nc-brand-text,
.nc-sidebar.collapsed .nc-nav-label,
.nc-sidebar.collapsed .nc-nav-section {
    display: none;
}

.nc-sidebar.collapsed .nc-brand {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 12px 0;
    gap: 8px;
}

.nc-sidebar.collapsed .nc-sidebar-toggle {
    margin-left: 0;
    width: 26px;
    height: 26px;
    font-size: 10px;
}

.nc-sidebar.collapsed .nc-nav-link {
    justify-content: center;
    padding: 10px 0;
    margin: 1px 8px;
    position: relative;
}

.nc-sidebar.collapsed .nc-sidebar-footer {
    padding: 12px 8px;
}
.nc-sidebar.collapsed .nc-sidebar-user-name,
.nc-sidebar.collapsed .nc-sidebar-user-role {
    display: none;
}

/* Tooltip on collapsed */
.nc-sidebar.collapsed .nc-nav-link[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.nc-sidebar.collapsed .nc-nav-link[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #1e293b;
    z-index: 2001;
    pointer-events: none;
}

/* Main area adjustment */
.nc-main {
    transition: margin-left .22s ease, max-width .22s ease;
}

.nc-sidebar.collapsed ~ .nc-main {
    margin-left: 68px;
    max-width: calc(100vw - 68px);
}

/* Chevron rotation when collapsed */
.nc-sidebar.collapsed + * .nc-sidebar-toggle i,
#sidebarCollapse.rotated i {
    transform: rotate(180deg);
}

/* ============================================================
   MEDIA MESSAGES (chat)
   ============================================================ */

/* Image bubble */
.nc-msg-img {
    max-width: 240px;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

/* Video bubble */
.nc-msg-video-wrap {
    position: relative;
    max-width: 240px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.nc-msg-video-wrap video {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.nc-msg-video-overlay {
    position: absolute;
    inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35);
}

.nc-msg-video-overlay i { color: #fff; font-size: 28px; }

/* Audio player */
.nc-msg-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f1f5f9;
    border-radius: 24px;
    min-width: 200px;
    max-width: 300px;
}

.nc-msg-audio-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--nc-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
}

.nc-msg-audio-btn:hover { background: var(--nc-primary-dark); }

.nc-msg-audio-bar {
    flex: 1;
    height: 3px;
    background: var(--nc-border);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.nc-msg-audio-progress {
    height: 100%;
    background: var(--nc-primary);
    border-radius: 2px;
    width: 0%;
    transition: width .1s;
}

.nc-msg-audio-dur {
    font-size: 11px;
    color: var(--nc-muted);
    flex-shrink: 0;
}

.nc-msg-audio-speed {
    background: none;
    border: 1px solid var(--nc-border);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    color: var(--nc-muted);
    cursor: pointer;
    padding: 1px 5px;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
    line-height: 1.6;
    transition: color .15s, border-color .15s;
}
.nc-msg-audio-speed:hover {
    color: var(--nc-primary);
    border-color: var(--nc-primary);
}

/* Sticker */
.nc-msg-sticker {
    max-width: 140px;
    max-height: 140px;
    border-radius: 8px;
    display: block;
    background: transparent;
}
.nc-msg-sticker-erro {
    display: inline-block;
    font-size: 13px;
    color: var(--nc-muted);
    padding: 4px 8px;
    background: var(--nc-bg-alt, #f4f6f8);
    border-radius: 8px;
}

/* Document/file attachment */
.nc-msg-doc {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border: 1px solid var(--nc-border);
    border-radius: 8px;
    min-width: 200px;
    cursor: pointer;
    text-decoration: none;
}

.nc-msg-doc:hover { background: var(--nc-primary-light); }

.nc-msg-doc-icon {
    font-size: 24px;
    color: var(--nc-primary);
    flex-shrink: 0;
}

.nc-msg-doc-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--nc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

/* Attach menu button */
.nc-attach-menu .dropdown-item i {
    width: 18px;
    text-align: center;
    margin-right: 6px;
}

/* Audio record state */
.nc-recording {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    background: #fee2e2;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #dc2626;
    font-weight: 700;
}

.nc-rec-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #dc2626;
    animation: blink 1s infinite;
}

/* ============================================================
   TICKETS PAGE — TOOLBAR + VIEW TOGGLE
   ============================================================ */
.nc-tkt-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nc-topbar-h));
    overflow: hidden;
}

.nc-tkt-toolbar {
    height: 48px;
    background: var(--nc-surface);
    border-bottom: 2px solid var(--nc-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    flex-shrink: 0;
    z-index: 10;
}

.nc-view-toggle {
    display: flex;
    background: var(--nc-bg);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-sm);
    padding: 3px;
    gap: 2px;
}

.nc-view-btn {
    width: 30px; height: 26px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: var(--nc-muted);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.nc-view-btn:hover  { color: var(--nc-primary); }
.nc-view-btn.active { background: var(--nc-primary); color: #fff; }

/* Override tickets-wrap height — parent nc-tkt-page now controls it */
.nc-tkt-page > .nc-tickets-wrap {
    height: auto;
    flex: 1;
    min-height: 0;
}

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.nc-kanban-wrap {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--nc-bg);
    min-height: 0;
}

.nc-kanban-board {
    display: flex;
    gap: 12px;
    padding: 14px 16px 16px;
    height: 100%;
    min-width: max-content;
    align-items: flex-start;
    box-sizing: border-box;
}

/* Kanban column */
.nc-kanban-col {
    width: 272px;
    flex-shrink: 0;
    background: var(--nc-surface);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-lg);
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 2px);
    overflow: hidden;
    transition: box-shadow .15s;
}

.nc-kanban-col-header {
    padding: 10px 14px 9px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    border-bottom: 2px solid var(--nc-border);
}

/* .nc-kanban-col-dot kept for backwards compat */
.nc-kanban-col-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nc-kanban-col-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    flex: 1;
    color: var(--nc-text);
}

.nc-kanban-col-count {
    background: var(--nc-bg);
    border: 1px solid var(--nc-border);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--nc-muted);
    min-width: 24px;
    text-align: center;
}

.nc-kanban-col-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 60px;
    transition: background .15s;
}

.nc-kanban-col-body.drag-over {
    background: var(--nc-primary-light);
    outline: 2px dashed var(--nc-primary);
    outline-offset: -4px;
    border-radius: var(--nc-radius);
}

/* Kanban card */
.nc-kanban-card {
    background: #fff;
    border-radius: var(--nc-radius);
    padding: 11px 12px 9px;
    box-shadow: 0 1px 2px rgba(0,0,0,.07);
    cursor: grab;
    border: 1px solid var(--nc-border);
    transition: box-shadow .15s, transform .12s, opacity .15s;
    user-select: none;
    position: relative;
}

.nc-kanban-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

.nc-kanban-card.dragging {
    opacity: 0;
    pointer-events: none;
}

/* While any card is being dragged, block pointer events on ALL other cards
   so dragover/drop events always reach the .nc-kanban-col-body */
.nc-kanban-board.kb-dragging .nc-kanban-card:not(.dragging) {
    pointer-events: none;
}

.nc-kanban-card-ghost {
    opacity: 0.3;
    background: var(--nc-primary-light);
    border: 2px dashed var(--nc-primary);
}

.nc-kanban-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 4px;
}

/* Three-dots menu button on kanban card */
.nc-kb-menu-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    padding: 0 2px;
    font-size: 14px;
    color: var(--nc-muted);
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s, background .1s;
}
.nc-kanban-card:hover .nc-kb-menu-btn { opacity: 1; }
.nc-kb-menu-btn:hover { background: var(--nc-bg); color: var(--nc-text); }

.nc-kanban-card-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--nc-text);
    flex: 1;
    line-height: 1.3;
}

.nc-kanban-card-meta {
    font-size: 11px;
    color: var(--nc-muted);
    margin-bottom: 7px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.nc-kanban-card-preview {
    font-size: 12px;
    color: var(--nc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 9px;
}

.nc-kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.nc-kb-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 2px 7px;
    border-radius: 10px;
    display: inline-block;
}

.nc-kb-badge.aguardando  { background: #fef9c3; color: #92400e; }
.nc-kb-badge.atendimento { background: #dcfce7; color: #166534; }
.nc-kb-badge.resolvido   { background: #f1f5f9; color: var(--nc-muted); }

/* Etiqueta tag on kanban card */
.nc-kb-etq-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    border: 1px solid;
    border-radius: 20px;
    padding: 2px 8px;
    line-height: 1.6;
}
.nc-kb-etq-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Column icon */
.nc-kb-col-icon { font-size: 12px; flex-shrink: 0; }

/* Empty column state */
.nc-kb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 24px 0;
    color: var(--nc-muted);
    font-size: 12px;
    pointer-events: none;
}
.nc-kb-empty i { font-size: 22px; opacity: .3; }

/* ── Touch status picker (mobile long-press) ─────────────── */
#kb-status-picker {
    position: fixed;
    inset: 0;
    z-index: 2000;
}
#kb-sp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.4);
}
#kb-sp-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 0 0 env(safe-area-inset-bottom, 12px);
    transform: translateY(100%);
    transition: transform .25s cubic-bezier(.32,1,.32,1);
    box-shadow: 0 -4px 24px rgba(0,0,0,.14);
}
#kb-sp-sheet.show { transform: translateY(0); }
.kb-sp-handle-bar {
    width: 40px; height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin: 12px auto 4px;
}
.kb-sp-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--nc-muted);
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 6px 20px 10px;
}
.kb-sp-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: none;
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    color: var(--nc-text);
    cursor: pointer;
    text-align: left;
    border-radius: 0;
    transition: background .12s;
}
.kb-sp-btn:hover,
.kb-sp-btn:focus { background: var(--nc-bg); outline: none; }
.kb-sp-btn.active { background: var(--nc-primary-light); }
.kb-sp-btn i:first-child { font-size: 17px; width: 22px; flex-shrink: 0; }
.kb-sp-btn span { flex: 1; }
.kb-sp-check { font-size: 13px !important; margin-left: auto; }

.nc-kb-unread {
    font-size: 10px;
    font-weight: 800;
    background: var(--nc-primary);
    color: #fff;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    display: inline-block;
}

/* Kanban add-col button */
.nc-kanban-add-col {
    width: 48px;
    flex-shrink: 0;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nc-kanban-add-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px dashed var(--nc-border);
    background: none;
    color: var(--nc-muted);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
}

.nc-kanban-add-btn:hover {
    border-color: var(--nc-primary);
    color: var(--nc-primary);
    background: var(--nc-primary-light);
}

/* ============================================================
   FLOW MANAGEMENT LIST
   ============================================================ */
.nc-flow-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nc-flow-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--nc-bg);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-sm);
    cursor: grab;
    transition: box-shadow .15s, border-color .15s;
}

.nc-flow-item:hover     { box-shadow: var(--nc-shadow); }
.nc-flow-item.dragging  { opacity: 0.35; }
.nc-flow-item.drag-over { border-color: var(--nc-primary); border-top: 3px solid var(--nc-primary); }

.nc-flow-handle { color: var(--nc-muted); font-size: 13px; cursor: grab; }
.nc-flow-dot    { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.nc-flow-name   { flex: 1; font-size: 13px; font-weight: 700; }

.nc-flow-switch {
    position: relative;
    width: 36px; height: 20px;
    flex-shrink: 0;
}

.nc-flow-switch input { opacity: 0; width: 0; height: 0; position: absolute; }

.nc-flow-switch-track {
    position: absolute;
    inset: 0;
    background: var(--nc-border);
    border-radius: 10px;
    cursor: pointer;
    transition: background .2s;
}

.nc-flow-switch-track::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    top: 3px; left: 3px;
    transition: left .2s;
    box-shadow: 0 1px 2px rgba(0,0,0,.2);
}

.nc-flow-switch input:checked ~ .nc-flow-switch-track { background: var(--nc-primary); }
.nc-flow-switch input:checked ~ .nc-flow-switch-track::after { left: 19px; }

/* ============================================================
   EMOJI PICKER
   ============================================================ */
.nc-emoji-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    width: 318px;
    background: var(--nc-surface);
    border: 1px solid var(--nc-border);
    border-radius: var(--nc-radius-lg);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
    z-index: 1050;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: epFadeIn .15s ease;
}

@keyframes epFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.nc-emoji-search-wrap {
    padding: 10px 10px 8px;
    border-bottom: 1px solid var(--nc-border);
}

.nc-emoji-search {
    width: 100%;
    border: 1px solid var(--nc-border);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    background: var(--nc-bg);
    color: var(--nc-text);
    transition: border-color .15s;
}

.nc-emoji-search:focus { border-color: var(--nc-primary); }

.nc-emoji-cats {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--nc-border);
    overflow-x: auto;
    scrollbar-width: none;
}

.nc-emoji-cats::-webkit-scrollbar { display: none; }

.nc-emoji-cat-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    border-radius: var(--nc-radius-sm);
    padding: 5px 7px;
    font-size: 17px;
    cursor: pointer;
    transition: background .15s;
    line-height: 1;
}

.nc-emoji-cat-btn:hover  { background: var(--nc-primary-light); }
.nc-emoji-cat-btn.active {
    background: var(--nc-primary-light);
    outline: 2px solid var(--nc-primary);
    outline-offset: -1px;
}

.nc-emoji-cat-title {
    padding: 4px 10px 2px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--nc-muted);
}

.nc-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1px;
    padding: 6px 8px;
    max-height: 210px;
    overflow-y: auto;
}

.nc-emoji-btn {
    background: none;
    border: none;
    border-radius: var(--nc-radius-sm);
    font-size: 20px;
    padding: 4px 2px;
    cursor: pointer;
    transition: background .1s, transform .1s;
    line-height: 1.2;
    text-align: center;
}

.nc-emoji-btn:hover {
    background: var(--nc-primary-light);
    transform: scale(1.25);
}

/* ============================================================
   RESPONSIVE — Mobile-first (≤ 767px) + Extra-small (≤ 479px)
   ============================================================ */

/* ── Sidebar backdrop overlay ─────────────────────────────── */
.nc-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;           /* below sidebar (1000) but above content */
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}
.nc-sidebar-backdrop.show { display: block; }

/* ── Back button (list ← chat navigation on mobile) ──────── */
#btn-back-to-list {
    display: none;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--nc-primary);
    font-size: 18px;
    flex-shrink: 0;
    transition: background .15s;
}
#btn-back-to-list:hover { background: var(--nc-primary-light); }

/* ── Message actions: mobile touch targets ─────────────────── */

@media (max-width: 767px) {

    /* ---------- LAYOUT ---------- */
    :root {
        /* Mobile header repõe o espaço que o topbar ocupava */
        --nc-topbar-h: var(--nc-mobile-header-h);
    }

    /* Mobile header: visível em mobile */
    .nc-mobile-header { display: flex; }

    /* Sidebar: slide-in overlay */
    .nc-sidebar {
        transform: translateX(-100%);
        width: var(--nc-sidebar-w) !important;
        transition: transform .25s ease;
        z-index: 1000;
    }
    .nc-sidebar.open {
        transform: translateX(0);
        box-shadow: var(--nc-shadow-md);
    }
    /* Main: no left margin */
    .nc-main {
        margin-left: 0 !important;
        max-width: 100vw !important;
    }

    /* Content: smaller padding */
    .nc-content {
        padding: 14px 12px !important;
    }

    /* ---------- FORMS ---------- */
    .nc-form-row { flex-direction: column; gap: 0; }
    .nc-form-group { margin-bottom: 14px; }

    /* ---------- TABLES ---------- */
    .nc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* ---------- CARDS / STAT GRID ---------- */
    .nc-stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* ---------- TICKETS INTERFACE ---------- */
    .nc-tkt-page { overflow: hidden; }

    /* List panel: full width */
    .nc-tkt-list { width: 100%; border-right: none; }

    /* Chat detail: hidden until opened, then fixed fullscreen */
    .nc-tkt-detail {
        display: none;
    }
    .nc-tkt-detail.open {
        display: flex;
        position: fixed;
        inset: 0;
        z-index: 950;   /* above topbar (900) */
        background: var(--nc-surface);
    }

    /* Back button: show on mobile */
    #btn-back-to-list { display: flex; }

    /* Message bubbles: wider on small screen */
    .nc-msg-wrap { max-width: 85%; }

    /* Toolbar buttons: reduce gap */
    .nc-tkt-toolbar {
        padding: 8px 10px;
        gap: 6px;
        flex-wrap: wrap;
    }
    #kanban-toolbar { flex-wrap: wrap; gap: 5px; }
    #kanban-toolbar select { font-size: 11px; padding: 0 6px; height: 28px; }

    /* Ticket tabs: smaller text */
    .nc-tkt-tab { font-size: 11px; padding: 5px 8px; }

    /* Emoji picker: fixed bottom sheet */
    .nc-emoji-picker {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        border-bottom: none !important;
        z-index: 1100 !important;
        max-height: 65vh;
        overflow-y: auto;
    }

    /* Message actions: dropdown items maiores no mobile */
    .nc-msg-dd-item { min-height: 48px; font-size: 14px; }

    /* Input area: account for iPhone home indicator */
    .nc-tkt-input-area { padding-bottom: env(safe-area-inset-bottom, 0); }

    /* Fixed detail panel: account for top notch / status bar */
    .nc-tkt-detail.open { padding-top: env(safe-area-inset-top, 0); }

    /* Kanban: horizontal scroll on mobile, columns slightly narrower */
    .nc-kanban-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .nc-kanban-col  { width: 240px; min-width: 240px; }

    /* Modals: full-width bottom sheet style on small screens */
    .modal-dialog { margin: 0; }
    .modal-content { border-radius: 16px 16px 0 0; }
    .modal .modal-dialog.modal-dialog-centered {
        align-items: flex-end;
        min-height: 100%;
    }
    .modal-sm .modal-content,
    .modal-dialog.modal-sm { border-radius: 12px; margin: auto 16px; }

    /* DataTables: hide less important columns or allow scroll */
    .nc-table-wrap .dataTables_wrapper { font-size: 12px; }

    /* Dropdown menus: full-width on mobile */
    .dropdown-menu { min-width: unset; width: calc(100vw - 24px); right: 0 !important; left: auto !important; }

    /* Buttons: ensure minimum touch target */
    .btn-nc { min-height: 38px; }
    .btn-nc-sm { min-height: 32px; }

    /* nc-icon-btn touch target */
    .nc-icon-btn { width: 38px; height: 38px; font-size: 15px; }

    /* Hide sidebar collapse toggle on mobile (not needed) */
    .nc-sidebar-toggle { display: none; }
}

/* ── Extra-small phones (≤ 479px) ─────────────────────────── */
@media (max-width: 479px) {
    .nc-stat-grid { grid-template-columns: 1fr; gap: 8px; }

    /* Ticket tabs: even more compact */
    .nc-tkt-tab { font-size: 10px; padding: 4px 6px; }

    /* Topbar: hide page title to save space */
    .nc-topbar-title { display: none; }

    /* Toolbar: wrap new ticket button */
    .nc-tkt-toolbar { padding: 6px 8px; }

    /* Message bubbles: almost full width */
    .nc-msg-wrap { max-width: 92%; }

    /* Kanban col: narrower */
    .nc-kanban-col { width: 210px; min-width: 210px; }

    /* Filter grid: single column */
    #tkt-filter-panel > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   TOGGLE SWITCH (nc-toggle)
   ============================================================ */
.nc-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}
.nc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.nc-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--nc-border);
    border-radius: 24px;
    transition: background .2s;
}
.nc-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nc-toggle input:checked + .nc-toggle-slider {
    background: var(--nc-primary);
}
.nc-toggle input:checked + .nc-toggle-slider::before {
    transform: translateX(20px);
}

/* ============================================================
   BOT BADGE na conversa
   ============================================================ */
.nc-msg-bot-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--nc-primary);
    background: var(--nc-primary-light);
    border-radius: 10px;
    padding: 2px 7px;
    margin-bottom: 4px;
}

/* ============================================================
   DARK MODE  —  html[data-theme="dark"]
   Ativado via botão sol/lua no sidebar; persiste em localStorage
   ============================================================ */

html[data-theme="dark"] {
    --nc-bg:            #0d1117;
    --nc-surface:       #161b22;
    --nc-text:          #cdd9e5;
    --nc-muted:         #768390;
    --nc-border:        #30363d;
    --nc-primary-light: #0d2926;
    --nc-shadow:        0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.35);
    --nc-shadow-md:     0 4px 16px rgba(0,0,0,.55);
}

html[data-theme="dark"] body { background: var(--nc-bg); color: var(--nc-text); }

/* Scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #30363d; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #484f58; }

/* ── Formulários ── */
html[data-theme="dark"] .nc-input,
html[data-theme="dark"] .nc-select,
html[data-theme="dark"] .nc-textarea {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
}
html[data-theme="dark"] .nc-input::placeholder,
html[data-theme="dark"] .nc-textarea::placeholder { color: #484f58; }

/* ── Tabelas ── */
html[data-theme="dark"] .nc-table thead th { background: #1c2128; }
html[data-theme="dark"] .nc-table tbody tr:hover { background: #1c2128; }

/* ── Ticket list ── */
html[data-theme="dark"] .nc-tkt-search-wrap input {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
}
html[data-theme="dark"] .nc-tkt-search-wrap input::placeholder { color: #484f58; }
html[data-theme="dark"] .nc-tkt-search-wrap input:focus { background: #21262d; }
html[data-theme="dark"] .nc-tkt-item:hover  { background: #1c2128; }
html[data-theme="dark"] .nc-tkt-channel-dot { border-color: var(--nc-surface); }
html[data-theme="dark"] .nc-tkt-flt {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23768390'/%3E%3C/svg%3E");
}

/* ── Chat (WhatsApp escuro) ── */
html[data-theme="dark"] .nc-tkt-detail      { background: #0b141a; }
html[data-theme="dark"] .nc-tkt-detail-header {
    background: #202c33;
    border-color: #2a3942;
}
html[data-theme="dark"] .nc-tkt-empty       { background: #0b141a; }
html[data-theme="dark"] .nc-tkt-empty i     { color: #1c2e38; }
html[data-theme="dark"] .nc-tkt-input-area  { background: #202c33; border-color: #2a3942; }
html[data-theme="dark"] .nc-tkt-input-area textarea,
html[data-theme="dark"] #tkt-msg-input {
    background: #2a3942 !important;
    color: var(--nc-text);
}
html[data-theme="dark"] .nc-tkt-input-area textarea::placeholder,
html[data-theme="dark"] #tkt-msg-input::placeholder { color: #526471; }

/* Light mode base */
#tkt-msg-input { background: #fff; color: #111; }

/* Balões */
html[data-theme="dark"] .nc-msg-wrap.in  .nc-msg-bubble { background: #202c33; color: var(--nc-text); }
html[data-theme="dark"] .nc-msg-wrap.out .nc-msg-bubble { background: #005c4b; color: #e9edef; }
html[data-theme="dark"] .nc-msg-bubble.nc-msg-failed { background: #2d1515 !important; border-color: #dc2626 !important; }
html[data-theme="dark"] .nc-msg-day  { background: #182229; color: #8696a0; }
html[data-theme="dark"] .nc-msg-audio { background: #21262d; }
html[data-theme="dark"] .nc-msg-doc  { background: #21262d; border-color: var(--nc-border); color: var(--nc-text); }
html[data-theme="dark"] .nc-msg-doc:hover { background: var(--nc-primary-light); }
html[data-theme="dark"] .nc-msg-doc-name { color: var(--nc-text); }
html[data-theme="dark"] .nc-msg-menu-btn { color: rgba(255,255,255,.45); }
html[data-theme="dark"] .nc-msg-menu-btn:hover,
html[data-theme="dark"] .nc-msg-menu-btn.active { background: rgba(255,255,255,.1); color: #e2e8f0; }
html[data-theme="dark"] .nc-msg-dropdown { background: #1c2128; box-shadow: 0 4px 20px rgba(0,0,0,.45); }
html[data-theme="dark"] .nc-msg-dd-item { color: #e2e8f0; }
html[data-theme="dark"] .nc-msg-dd-item:hover,
html[data-theme="dark"] .nc-msg-dd-item:focus-visible { background: #2d333b; }
html[data-theme="dark"] .nc-msg-dd-item i { color: #94a3b8; }
html[data-theme="dark"] .nc-msg-dd-item.nc-action-delete { border-top-color: #2d333b; }

/* ── Kanban ── */
html[data-theme="dark"] .nc-kanban-card { background: #1c2128; }
html[data-theme="dark"] .nc-kb-badge.aguardando  { background: #2a1e00; color: #fbbf24; }
html[data-theme="dark"] .nc-kb-badge.atendimento { background: #0a2218; color: #4ade80; }
html[data-theme="dark"] .nc-kb-badge.resolvido   { background: #1c2128; color: var(--nc-muted); }

/* Touch status picker */
html[data-theme="dark"] #kb-sp-sheet       { background: #1c2128; }
html[data-theme="dark"] .kb-sp-handle-bar  { background: #30363d; }

/* ── Stat cards ── */
html[data-theme="dark"] .si-green  { background: #0a2218; color: #4ade80; }
html[data-theme="dark"] .si-blue   { background: #0a1828; color: #60a5fa; }
html[data-theme="dark"] .si-yellow { background: #221800; color: #fbbf24; }
html[data-theme="dark"] .si-red    { background: #220a0a; color: #f87171; }
html[data-theme="dark"] .si-purple { background: #180a28; color: #a78bfa; }
html[data-theme="dark"] .si-teal   { background: #0a1e1a; color: #34d399; }
html[data-theme="dark"] .si-orange { background: #221208; color: #fb923c; }

/* ── Badges ── */
html[data-theme="dark"] .badge-success { background: #0a2218; color: #4ade80; }
html[data-theme="dark"] .badge-warning { background: #221800; color: #fbbf24; }
html[data-theme="dark"] .badge-danger  { background: #220a0a; color: #f87171; }
html[data-theme="dark"] .badge-info    { background: #0a1228; color: #60a5fa; }
html[data-theme="dark"] .badge-muted   { background: #1c2128; color: var(--nc-muted); }
html[data-theme="dark"] .badge-primary { background: var(--nc-primary-light); color: var(--nc-primary); }
html[data-theme="dark"] .badge-purple  { background: #180a28; color: #a78bfa; }

/* ── Alertas ── */
html[data-theme="dark"] .nc-alert-success { background: #0a2218; color: #4ade80; border-color: #166534; }
html[data-theme="dark"] .nc-alert-warning { background: #221800; color: #fbbf24; border-color: #92400e; }
html[data-theme="dark"] .nc-alert-danger  { background: #220a0a; color: #f87171; border-color: #991b1b; }
html[data-theme="dark"] .nc-alert-info    { background: #0a1228; color: #60a5fa; border-color: #1e3a8a; }

/* ── Modais Bootstrap ── */
html[data-theme="dark"] .modal-content {
    background: var(--nc-surface);
    border-color: var(--nc-border);
    color: var(--nc-text);
}
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer { border-color: var(--nc-border); }
html[data-theme="dark"] .modal-title  { color: var(--nc-text); }

/* ── Dropdown Bootstrap ── */
html[data-theme="dark"] .dropdown-menu {
    background: #1c2128;
    border-color: var(--nc-border);
}
html[data-theme="dark"] .dropdown-item       { color: var(--nc-text); }
html[data-theme="dark"] .dropdown-item:hover { background: #21262d; color: var(--nc-text); }
html[data-theme="dark"] .dropdown-divider    { border-color: var(--nc-border); }

/* ── Context menu ── */
html[data-theme="dark"] #tkt-item-menu {
    background: #1c2128 !important;
    border-color: var(--nc-border) !important;
}
html[data-theme="dark"] .tkt-menu-btn { color: var(--nc-text); }
html[data-theme="dark"] .tkt-menu-btn:hover { background: #21262d; }

/* ── Sidebar tooltip (collapsed) ── */
html[data-theme="dark"] .nc-sidebar.collapsed .nc-nav-link[data-tooltip]:hover::after {
    background: #e2e8f0;
    color: #1e293b;
}
html[data-theme="dark"] .nc-sidebar.collapsed .nc-nav-link[data-tooltip]:hover::before {
    border-right-color: #e2e8f0;
}

/* ── Emoji picker ── */
html[data-theme="dark"] .nc-emoji-search {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
}

/* ── SweetAlert2 ── */
html[data-theme="dark"] .swal2-popup  { background: #1c2128 !important; color: var(--nc-text) !important; }
html[data-theme="dark"] .swal2-title  { color: var(--nc-text) !important; }
html[data-theme="dark"] .swal2-html-container { color: var(--nc-muted) !important; }
html[data-theme="dark"] .swal2-input,
html[data-theme="dark"] .swal2-textarea { background: #21262d !important; color: var(--nc-text) !important; border-color: var(--nc-border) !important; }

/* ── DataTables ── */
html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
}

/* ── Search input (barra de filtro) ── */
html[data-theme="dark"] .nc-search-input-wrap input {
    background: #21262d;
    color: var(--nc-text);
    border-color: var(--nc-border);
}

/* ── Login card (tela de login) ── */
html[data-theme="dark"] .nc-login-card    { background: #1c2128; }
html[data-theme="dark"] .nc-login-card .nc-input { background: #21262d; }

/* ── Botão de dark mode no sidebar ── */
.nc-darkmode-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    margin: 1px 8px;
    border-radius: var(--nc-radius-sm);
    color: var(--nc-muted);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    width: calc(100% - 16px);
    font-family: inherit;
    text-align: left;
    transition: all .15s;
}
.nc-darkmode-btn:hover {
    background: var(--nc-primary-light);
    color: var(--nc-primary);
}
.nc-darkmode-btn i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}
/* Oculta o label quando sidebar está colapsado */
.nc-sidebar.collapsed .nc-darkmode-btn .nc-darkmode-label { display: none; }
.nc-sidebar.collapsed .nc-darkmode-btn {
    justify-content: center;
    padding: 10px 0;
    margin: 1px 8px;
    width: calc(100% - 16px);
}
/* Tooltip no collapsed */
.nc-sidebar.collapsed .nc-darkmode-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 2000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.nc-sidebar.collapsed .nc-darkmode-btn {
    position: relative;
}
html[data-theme="dark"] .nc-sidebar.collapsed .nc-darkmode-btn[data-tooltip]:hover::after {
    background: #e2e8f0;
    color: #1e293b;
}

/* ── Anotação interna — bubble ── */
.nc-msg-note {
    background: #fef9c3 !important;
    border: 1px solid #fde68a !important;
}
.nc-msg-note-hdr { color: #92400e; }

html[data-theme="dark"] .nc-msg-note {
    background: #2a1e00 !important;
    border-color: #78350f !important;
    color: #fef3c7 !important;
}
html[data-theme="dark"] .nc-msg-note-hdr { color: #fbbf24; }

/* ── Anotação interna — textarea ativa ── */
#tkt-msg-input.anot-mode {
    background: #fef9c3 !important;
    color: #1a1a1a !important;
}
html[data-theme="dark"] #tkt-msg-input.anot-mode {
    background: #2a1e00 !important;
    color: #fef3c7 !important;
}

/* ── Botão de anotação ativo (adapta ao tema automaticamente) ── */
#btn-anotacao.anot-active { color: #b45309 !important; }
html[data-theme="dark"] #btn-anotacao.anot-active { color: #fbbf24 !important; }

/* ================================================================
   LIGHTBOX — visualização ampliada de imagens
   ================================================================ */
#nc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.92);
    display: flex;
    align-items: center;
    justify-content: center;
}

#nc-lb-box {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 96vw;
}

#nc-lb-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
}

#nc-lb-img {
    max-width: 88vw;
    max-height: 82vh;
    border-radius: 6px;
    object-fit: contain;
    opacity: 0;
    transition: opacity .2s;
    display: block;
}

#nc-lb-img.nc-lb-img-loaded { opacity: 1; }

#nc-lb-close {
    position: fixed;
    top: 14px;
    right: 14px;
    background: rgba(255,255,255,.14);
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s;
}

#nc-lb-close:hover { background: rgba(255,255,255,.28); }

#nc-lb-prev,
#nc-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.14);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background .15s;
}

#nc-lb-prev { left: 14px; }
#nc-lb-next { right: 14px; }
#nc-lb-prev:hover,
#nc-lb-next:hover { background: rgba(255,255,255,.28); }

#nc-lb-footer {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 18px;
    color: rgba(255,255,255,.6);
    font-size: 13px;
}

#nc-lb-footer a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
}

#nc-lb-footer a:hover { color: #fff; }

#nc-lb-error {
    color: rgba(255,255,255,.65);
    text-align: center;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#nc-lb-error p { margin: 0 0 10px; }

#nc-lb-error a {
    color: var(--nc-secondary);
    text-decoration: underline;
}

/* Placeholder no chat quando imagem falha ao carregar */
.nc-msg-img-err {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #f1f5f9;
    border: 1px dashed var(--nc-border);
    border-radius: 8px;
    color: var(--nc-muted);
    font-size: 12px;
    max-width: 240px;
    cursor: default;
}

.nc-msg-img-err i { font-size: 18px; opacity: .5; }
