/* Vlearned global UI sizing policy — every button, breadcrumb and card is small,
   uniform and aligned, and every table shares one compact cell style.
   Loaded AFTER app.css. Selectors carry [class] qualifiers because app.css also
   ships Bootstrap's !important spacing utilities (.py-4 = 1.5rem), which would
   otherwise outrank plain element selectors. */

:root {
    /* Buttons */
    --vl-btn-fs: 0.8125rem;    /* 13px label */
    --vl-btn-lh: 1.25rem;     /* 20px line box */
    --vl-btn-py: 0.25rem;     /* 4px vertical padding */
    --vl-btn-px: 0.625rem;    /* 10px horizontal padding */
    --vl-btn-min-h: 1.75rem;  /* 28px minimum height so rows align */
    --vl-btn-radius: 0.375rem;
    --vl-btn-gap: 0.375rem;

    /* Cards */
    --vl-card-radius: 8px;
    --vl-card-pad: 0.75rem;      /* 12px body padding */
    --vl-card-pad-x: 0.875rem;   /* 14px horizontal padding */
    --vl-card-gap: 0.75rem;      /* 12px uniform stacking gap */

    /* Breadcrumbs */
    --vl-crumb-fs: 0.75rem;      /* 12px */
    --vl-crumb-lh: 1.125rem;     /* 18px */
    --vl-crumb-gap: 0.375rem;

    /* Tables */
    --vl-table-head-bg: #f8fafc;
    --vl-table-head-fg: #64748b;
    --vl-table-line: #e9edf3;
    --vl-table-hover: #f8fafc;
    --vl-table-text: #334155;
    --vl-cell-pad-y: 0.5rem;      /* 8px vertical cell padding */
    --vl-cell-pad-x: 0.75rem;     /* 12px horizontal cell padding */
    --vl-cell-fs: 0.8125rem;      /* 13px body text */
    --vl-cell-head-fs: 0.6875rem; /* 11px header text */
}

.dark {
    --vl-table-head-bg: rgba(148, 163, 184, 0.08);
    --vl-table-head-fg: #94a3b8;
    --vl-table-line: rgba(148, 163, 184, 0.18);
    --vl-table-hover: rgba(148, 163, 184, 0.08);
    --vl-table-text: #e2e8f0;
}

/* ── Buttons ───────────────────────────────────────────────────────────
   Real buttons, Bootstrap .btn (incl. .btn-lg / .btn-sm), pagination links
   and role=button triggers all collapse to one small aligned size. */


button:not(.btn-close),
button[class]:not(.btn-close),
[type="button"]:not(.btn-close),
[type="button"][class]:not(.btn-close),
[type="submit"]:not(.btn-close),
[type="submit"][class]:not(.btn-close),
[type="reset"]:not(.btn-close),
[type="reset"][class]:not(.btn-close),
.btn:not(.btn-close),
.btn[class]:not(.btn-close),
a.btn,
a.btn[class],
label.btn,
label.btn[class],
a.page-link,
a.page-link[class],
[role="button"],
[role="button"][class],
a[role="button"],
a[role="button"][class] {
    font-size: var(--vl-btn-fs) !important;
    line-height: var(--vl-btn-lh) !important;
    padding: var(--vl-btn-py) var(--vl-btn-px) !important;
    height: auto !important;
    min-height: var(--vl-btn-min-h) !important;
    border-radius: var(--vl-btn-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--vl-btn-gap);
    white-space: nowrap;
    vertical-align: middle;
    transform: none !important;
}

/* Anchor buttons styled with Tailwind padding / typography utilities */
a[class*="px-"][class*="py-"],
a[class*="px-"][class*="rounded"],
a[class*="py-"][class*="rounded"],
a[class*="text-base"][class*="rounded"],
a[class*="text-lg"][class*="rounded"],
a[class*="bg-"][class*="px-"],
a[class*="bg-"][class*="py-"] {
    font-size: var(--vl-btn-fs) !important;
    line-height: var(--vl-btn-lh) !important;
    padding: var(--vl-btn-py) var(--vl-btn-px) !important;
    height: auto !important;
    min-height: var(--vl-btn-min-h) !important;
    border-radius: var(--vl-btn-radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--vl-btn-gap);
    white-space: nowrap;
    vertical-align: middle;
}

/* ── Breadcrumbs ───────────────────────────────────────────────────────
   Every breadcrumb (Bootstrap .breadcrumb, .vl-breadcrumbs, vl-styled nav)
   becomes a small inline trail with tight gaps and no large margins. */


nav[aria-label="Breadcrumb"],
nav[aria-label="Breadcrumb"][class],
nav[aria-label="breadcrumb"],
nav[aria-label="breadcrumb"][class],
.breadcrumb,
.breadcrumb[class],
ol.breadcrumb,
ol.breadcrumb[class],
ul.breadcrumb,
ul.breadcrumb[class],
.vl-breadcrumbs,
.vl-breadcrumbs[class] {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.125rem var(--vl-crumb-gap) !important;
    margin: 0 0 0.5rem !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    font-size: var(--vl-crumb-fs) !important;
    line-height: var(--vl-crumb-lh) !important;
    list-style: none !important;
}

nav[aria-label="Breadcrumb"] ol,
nav[aria-label="breadcrumb"] ol,
.breadcrumb-item,
.vl-breadcrumbs li {
    display: inline-flex !important;
    align-items: center;
    gap: 0.25rem;
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

nav[aria-label="Breadcrumb"] a,
nav[aria-label="breadcrumb"] a,
nav[aria-label="Breadcrumb"] a[class],
nav[aria-label="breadcrumb"] a[class],
nav[aria-label="Breadcrumb"] span,
nav[aria-label="breadcrumb"] span,
nav[aria-label="Breadcrumb"] span[class],
nav[aria-label="breadcrumb"] span[class],
.breadcrumb-item a,
.breadcrumb-item a[class],
.breadcrumb-item span,
.breadcrumb-item span[class],
.vl-breadcrumbs a,
.vl-breadcrumbs a[class],
.vl-breadcrumbs span,
.vl-breadcrumbs span[class],
nav[aria-label="Breadcrumb"] svg,
nav[aria-label="breadcrumb"] svg,
nav[aria-label="Breadcrumb"] svg[class],
nav[aria-label="breadcrumb"] svg[class],
.vl-breadcrumbs svg,
.vl-breadcrumbs svg[class] {
    padding: 0 !important;
    margin: 0 !important;
    font-size: var(--vl-crumb-fs) !important;
    line-height: var(--vl-crumb-lh) !important;
    white-space: nowrap;
}

.breadcrumb-item + .breadcrumb-item::before,
.vl-breadcrumbs li + li::before {
    float: none !important;
    padding: 0 0.25rem !important;
    margin: 0 !important;
    font-size: var(--vl-crumb-fs) !important;
    line-height: var(--vl-crumb-lh) !important;
    color: #94a3b8 !important;
}

/* ── Cards ─────────────────────────────────────────────────────────────
   One compact card size everywhere: 8px radius, ~13px padding, uniform
   12px stacking gap so every panel lines up across the system. */

.card,
.stat-card,
.vl-stat-card,
.vl-page-card,
.vl-widget-card,
.vl-stats-banner,
.vl-pipeline-tile,
.brand-card,
.brand-card-soft {
    margin-bottom: var(--vl-card-gap) !important;
    padding: var(--vl-card-pad) var(--vl-card-pad-x) !important;
    border-radius: var(--vl-card-radius) !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* Radius-only helper: .rounded-card also dresses dropdowns and toasts */
.rounded-card {
    border-radius: var(--vl-card-radius) !important;
}

.vl-stat-card__value,
.stat-value {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    margin: 0.125rem 0 0 !important;
}

.vl-stat-card__icon,
.stat-icon {
    width: 1.875rem !important;
    height: 1.875rem !important;
    font-size: 0.875rem !important;
    border-radius: var(--vl-card-radius) !important;
}

.vl-widget-card__header,
.card-header,
.card > header[class],
.vl-page-card__header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 !important;
    padding: 0.5rem var(--vl-card-pad-x) !important;
    border-bottom: 1px solid #f1f5f9;
    font-size: var(--vl-btn-fs) !important;
    font-weight: 600 !important;
}

.card-body,
.vl-card__body,
.vl-widget-card__body,
.vl-page-card__body {
    padding: var(--vl-card-pad) var(--vl-card-pad-x) !important;
}

.card-footer {
    padding: 0.5rem var(--vl-card-pad-x) !important;
    background: transparent !important;
    border-top: 1px solid #f1f5f9;
}

.card-title {
    margin: 0 0 0.25rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
}

.card-subtitle {
    margin: 0 0 0.5rem !important;
    font-size: 0.75rem !important;
}

.card-text {
    margin: 0 0 0.5rem !important;
    font-size: var(--vl-btn-fs) !important;
}

.card-img-top {
    border-radius: var(--vl-card-radius) var(--vl-card-radius) 0 0 !important;
}

/* Tailwind-built panels (bg-* + rounded + shadow + padding utilities) */
[class*="rounded"][class*="shadow"][class*="bg-"][class*="p-"],
[class*="rounded"][class*="shadow"][class*="bg-"][class*="px-"],
[class*="rounded"][class*="shadow"][class*="bg-"][class*="py-"] {
    padding: var(--vl-card-pad) var(--vl-card-pad-x) !important;
    border-radius: var(--vl-card-radius) !important;
    margin-bottom: var(--vl-card-gap) !important;
}

/* ── Tables ─────────────────────────────────────────────────────────────
   One table style everywhere: shared cell padding, one font scale, hairline
   row separators, aligned header row and a subtle hover. Covers Bootstrap
   .table and every Tailwind-built table (px-6 py-4 / divide-y patterns).
   PDF and export views use standalone stylesheets and never load this file. */

table,
.table {
    width: 100%;
    border-collapse: collapse !important;
    margin-bottom: var(--vl-card-gap);
}

.card-body > table[class]:last-child,
.vl-card__body > table[class]:last-child,
.vl-widget-card__body > table[class]:last-child,
.vl-page-card__body > table[class]:last-child {
    margin-bottom: 0 !important;
}

/* One hairline governs every table: neutralise utility row borders first */
table thead tr,
table tbody tr,
table tfoot tr,
.table thead tr,
.table tbody tr,
.table tfoot tr,
table thead tr[class],
table tbody tr[class],
table tfoot tr[class],
.table thead tr[class],
.table tbody tr[class],
.table tfoot tr[class] {
    border-width: 0 !important;
}

table th,
table td,
.table th,
.table td,
table th[class],
table td[class],
.table th[class],
.table td[class] {
    padding: var(--vl-cell-pad-y) var(--vl-cell-pad-x) !important;
    font-size: var(--vl-cell-fs) !important;
    line-height: 1.45 !important;
    vertical-align: middle !important;
    text-align: left;
    color: var(--vl-table-text);
    background-color: transparent;
    border: 0 !important;
    border-bottom: 1px solid var(--vl-table-line) !important;
}

table thead th,
.table thead th,
table th[scope="col"],
table thead th[class],
.table thead th[class],
table th[scope="col"][class] {
    background-color: var(--vl-table-head-bg);
    color: var(--vl-table-head-fg);
    font-size: var(--vl-cell-head-fs) !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--vl-table-line) !important;
}

table tbody tr:hover,
table tbody tr:hover th,
table tbody tr:hover td,
.table tbody tr:hover,
table tbody tr:hover th[class],
table tbody tr:hover td[class] {
    background-color: var(--vl-table-hover) !important;
}

table tbody tr:last-child td,
table tbody tr:last-child th,
.table tbody tr:last-child td,
table tbody tr:last-child td[class],
table tbody tr:last-child th[class],
.table tbody tr:last-child td[class] {
    border-bottom: 0 !important;
}

table caption,
.table caption,
table caption[class],
.table caption[class] {
    caption-side: top;
    text-align: left;
    padding: 0 0 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--vl-table-head-fg);
}
