/* Shared styles for QuickBooks Usr_QuickBooks_* sync panes.
   Used by the /quickbooks/sync page tabs and by the Company View QuickBooks tab,
   so they must be globally available — do not inline in a single page's <style>. */

.qb-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.qb-pane-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 4px 2px 12px;
    flex-wrap: wrap;
}

.qb-pane-title {
    font-size: 1.08rem;
    font-weight: 700;
    color: #1e3a5f;
}

.qb-pane-subtitle {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: #64748b;
    margin-top: 3px;
}

.qb-dot { color: #cbd5e1; }

.qb-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.6;
}

.qb-chip-lg { padding: 5px 12px; font-size: 0.88rem; }
.qb-chip-success { background: #dcfce7; color: #166534; }
.qb-chip-warn    { background: #fef3c7; color: #92400e; }
.qb-chip-info    { background: #dbeafe; color: #1d4ed8; }
.qb-chip-neutral { background: #f1f5f9; color: #334155; }

.qb-pane-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qb-btn {
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    padding: 7px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all .12s ease;
}

.qb-btn:hover:not(:disabled) {
    border-color: #94a3b8;
    color: #1e3a5f;
}

.qb-btn-primary {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.qb-btn-primary:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.qb-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.qb-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

.qb-grid.e-grid {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.qb-grid .e-gridheader { background: #f8fafc; }

.qb-grid .e-headercelldiv {
    font-weight: 700;
    color: #334155;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.qb-grid .e-rowcell {
    font-size: 0.95rem;
    color: #1f2937;
    padding-top: 8px;
    padding-bottom: 8px;
    vertical-align: middle;
}

.qb-grid .e-row:hover .e-rowcell {
    background: #f1f5f9 !important;
}

.qb-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #0f172a;
}

.qb-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.qb-avatar-blue  { background: #dbeafe; color: #1d4ed8; }
.qb-avatar-amber { background: #fef3c7; color: #92400e; }
.qb-avatar-green { background: #dcfce7; color: #166534; }
.qb-avatar-purple{ background: #ede9fe; color: #6d28d9; }

.qb-name-text { min-width: 0; }

.qb-name-main {
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qb-name-sub {
    font-size: 0.82rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qb-muted { color: #94a3b8; font-style: italic; }

.qb-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.7;
}

.qb-pill-linked  { background: #dcfce7; color: #166534; }
.qb-pill-pending { background: #fef3c7; color: #92400e; }
.qb-pill-new     { background: #dbeafe; color: #1d4ed8; }
.qb-pill-neutral { background: #f1f5f9; color: #334155; }

.qb-rate-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.qb-rate-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px 3px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.qb-rate-name { color: #475569; }

.qb-rate-pct {
    background: #1e3a5f;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    font-size: 0.78rem;
}

/* ---- Custom hierarchical account tree (matches the .qb-grid look) ---- */
.qb-tree {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    overflow: hidden;
}

.qb-tree-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    background: #fafbfd;
    border-bottom: 1px solid #eef1f6;
}

.qb-tree-search {
    position: relative;
    flex: 1;
    max-width: 320px;
}
.qb-tree-search i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.95rem;
}
.qb-tree-search input {
    width: 100%;
    padding: 7px 10px 7px 30px;
    border: 1px solid #d7deea;
    border-radius: 6px;
    background: #fff;
    font-size: 0.92rem;
    color: #0f172a;
    outline: none;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.qb-tree-search input:focus {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, .12);
}

.qb-btn-sm {
    padding: 6px 10px !important;
    font-size: 0.88rem !important;
}

.qb-tree-head,
.qb-tree-row {
    display: grid;
    grid-template-columns: 110px minmax(260px, 1fr) 140px 200px;
    align-items: center;
}

.qb-tree-head {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #eef1f6;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #475569;
    position: sticky;
    top: 0;
    z-index: 1;
}

.qb-tree-body {
    flex: 1;
    overflow: auto;
}

.qb-tree-row {
    padding: 8px 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color .12s ease;
}
.qb-tree-row:hover { background: #f8fafc; }
.qb-tree-row.is-root { background: #fcfdff; }
.qb-tree-row.is-root:hover { background: #f1f5fb; }

.qb-tree-col {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-size: 0.92rem;
    color: #0f172a;
}
.qb-col-name { gap: 4px; }

.qb-tree-toggle {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #64748b;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.qb-tree-toggle:hover:not(.is-leaf) { background: #eef2ff; color: #1d4ed8; }
.qb-tree-toggle.is-leaf { cursor: default; visibility: hidden; }
.qb-tree-toggle i { font-size: 0.88rem; }

.qb-tree-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 0.96rem;
}
.qb-tree-empty i { font-size: 1.95rem; color: #cbd5e1; }

.qb-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    gap: 16px;
    flex-wrap: wrap;
}

.qb-pager-info {
    font-size: 0.92rem;
    color: #475569;
    font-weight: 500;
}
.qb-pager-info strong { color: #0f172a; font-weight: 700; font-variant-numeric: tabular-nums; }

.qb-pager-controls {
    display: inline-flex;
    align-items: center;
    gap: 16px;
}

.qb-pager-size {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #64748b;
}
.qb-pager-size select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    color: #0f172a;
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    min-width: 72px;
    transition: border-color .14s ease, box-shadow .14s ease;
}
.qb-pager-size select:hover { border-color: #cbd5e1; }
.qb-pager-size select:focus {
    outline: none;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.qb-pager-nav {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: #f1f5f9;
    border-radius: 8px;
}

.qb-pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 28px;
    padding: 0 10px;
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 5px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .14s ease, color .14s ease, box-shadow .14s ease;
    font-variant-numeric: tabular-nums;
}
.qb-pager-btn:hover:not(:disabled):not(.is-current) { background: #ffffff; color: #0f172a; }
.qb-pager-btn:disabled { color: #cbd5e1; cursor: not-allowed; }
.qb-pager-btn.is-arrow { color: #64748b; min-width: 28px; padding: 0 8px; }
.qb-pager-btn.is-arrow i { font-size: 0.88rem; }
.qb-pager-btn.is-current {
    background: #ffffff;
    color: #0f172a;
    cursor: default;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(29, 78, 216, 0.08);
}

.qb-pager-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 28px;
    color: #94a3b8;
    font-size: 0.92rem;
    font-weight: 600;
    user-select: none;
}
