/* ─────────────────────────────────────────────────────────────────────────────
   ACCOUNTS
   Chart of accounts grid, the timeline, and the A4 document preview.

   Part 4 of 11, cut from the 5,142-line app.css. THE ORDER OF THESE
   FILES IS LOAD-BEARING — they are one cascade, split for navigation only, and
   index.php links them in this sequence. Moving one changes which rule wins.
   ───────────────────────────────────────────────────────────────────────────── */
/* =========================================
   CHART OF ACCOUNTS - GRID LAYOUT
   ========================================= */
#accounts-tree {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-6);
    align-items: start;
}

.acc-group {
    background: var(--bg-main);
    border: none;                 /* frameless — recessed bg-main fill groups it */
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.acc-group-title {
    padding: 12px 16px;
    background: var(--active-theme-bg);
    border-bottom: 1px solid var(--divider);
    font-weight: var(--font-bold);
    font-size: 13px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    display: flex;
    align-items: center;
    gap: 8px;
}

.acc-items {
    display: flex;
    flex-direction: column;
}

.acc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid var(--divider);
    transition: background 0.2s ease;
}

.acc-item:last-child {
    border-bottom: none;
}

.acc-item:hover {
    background: var(--bg-hover);
}

.acc-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.acc-code {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--divider-strong);
    font-weight: 600;
}

.acc-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

/* Ensure action buttons don't overpower the row until hovered */
.acc-item .table-actions {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.acc-item:hover .table-actions {
    opacity: 1;
}

/* =========================================
   TIMELINE
   ========================================= */
.timeline-container {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 16px;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    text-align: center;
    position: relative;
    cursor: pointer;
}

.timeline-label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.dot-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    margin-bottom: 16px;
}

.timeline-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--divider-strong);
    box-shadow: 0 0 0 4px var(--bg-card);
    z-index: 2;
    transition: all 0.2s;
}

.timeline-dot.quote { background-color: var(--text-main); }
.timeline-dot.invoice { background-color: var(--warning-yellow); }
.timeline-dot.receipt { background-color: var(--success-green); }

.timeline-node:hover .timeline-dot {
    transform: scale(1.2);
}

.timeline-date {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
    margin-bottom: 4px;
}

.timeline-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    font-variant-numeric: tabular-nums;
}

.timeline-line {
    flex: 1;
    min-width: 80px;
    height: 2px;
    background-color: var(--divider);
    position: relative;
    margin-top: 38px;
}

.timeline-line.active {
    background-color: transparent;
    border-top: 2px dashed var(--divider-strong);
}

.timeline-duration {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg-card);
    padding: 0 8px;
    white-space: nowrap;
}

.duration-active {
    color: var(--text-main);
}

/* =========================================
   DOCUMENT PREVIEW (Studio MARY A4 sheet)
   Shadow lives here (preview only) so it never
   rasterises into the generated PDF.
   ========================================= */
#preview-inject .a4-preview-doc {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}
