/* ─── Custom additions on top of Tailwind ───────────────────────────────── */

/* ─── Base typography ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Poppins', ui-sans-serif, system-ui, -apple-system, sans-serif;
    color: #000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Tabular numbers for financial figures — keeps columns aligned */
.tabular-nums,
[class*="font-black"],
[class*="font-bold"] {
    font-variant-numeric: tabular-nums;
}

/* Better input focus ring */
input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    border-color: #dc2626 !important;
}

/* Card lift on hover */
.card-hover {
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.card-hover:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* Smooth page transitions */
#app > * {
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Spinner animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}
.spin { animation: spin 0.75s linear infinite; }

/* Tree connector lines */
.tree-children {
    position: relative;
    padding-left: 1.5rem;
}
.tree-children::before {
    content: '';
    position: absolute;
    left: 0.65rem;
    top: 0;
    bottom: 1.25rem;
    width: 2px;
    background: #e5e7eb;
}
.tree-node {
    position: relative;
}
.tree-node + .tree-node::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 1.1rem;
    width: 1.5rem;
    height: 2px;
    background: #e5e7eb;
}

/* Modal backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: fadeIn 0.18s ease;
}

/* Dropdown */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    min-width: 220px;
    z-index: 30;
    overflow: hidden;
    animation: fadeIn 0.12s ease;
}

/* Skeleton shimmer */
@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 800px 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 0.5rem;
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
