/* =========================================================================
   SRL Manager — Falcon-inspired admin dashboard theme
   ========================================================================= */

:root {
    /* Brand & accents */
    --primary: #2c7be5;
    --primary-dark: #1f5fbf;
    --primary-soft: #e3edfb;

    /* Neutrals */
    --body-bg: #edf2f9;
    --surface: #ffffff;
    --border: #e3e6ed;
    --border-strong: #d8e2ef;

    /* Text */
    --text: #344050;
    --text-muted: #5e6e82;
    --text-soft: #748194;
    --heading: #232e3c;

    /* State */
    --success: #00d27a;
    --warning: #f5803e;
    --danger: #e63757;
    --info: #27bcfd;

    /* Layout */
    --sidebar-width: 250px;
    --header-height: 62px;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow-sm: 0 7px 14px 0 rgba(65, 69, 88, 0.1), 0 3px 6px 0 rgba(0, 0, 0, 0.07);
    --shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);

    --font-sans: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--body-bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    font-weight: 600;
    margin-top: 0;
}

/* =========================================================================
   App shell layout
   ========================================================================= */

.layout {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---- */

.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1030;
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: var(--header-height);
    padding: 0.75rem 1.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--heading);
}

.sidebar__brand-text {
    /* Wrap long company names onto multiple lines and keep them fully visible. */
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.sidebar__brand-logo {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--info), var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    overflow: hidden;
}

.sidebar__brand-logo--image {
    background: #fff;
    padding: 3px;
}

.sidebar__brand-logo--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.sidebar__nav {
    padding: 0.75rem 0.75rem 2rem;
    list-style: none;
    margin: 0;
}

.sidebar__label {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
    font-weight: 600;
    padding: 1rem 0.75rem 0.4rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 0.1rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar__link:hover {
    background: var(--body-bg);
    color: var(--heading);
}

.sidebar__link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.sidebar__link.is-disabled {
    color: var(--text-muted);
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.sidebar__link.is-disabled .sidebar__icon,
.sidebar__link.is-disabled > span:not(.sidebar__badge) {
    opacity: 0.3;
}

.sidebar__badge {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    white-space: nowrap;
}

.sidebar__icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---- Main column ---- */

.main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- Top navbar ---- */

.navbar {
    height: var(--header-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.navbar__left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.navbar__toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
}

.navbar__toggle svg,
.navbar__search-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.navbar__search-icon svg {
    display: block;
}

.dropdown__item svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.navbar__search {
    position: relative;
    max-width: 340px;
    width: 100%;
}

.navbar__search input {
    width: 100%;
    padding: 0.5rem 0.9rem 0.5rem 2.2rem;
    border: 1px solid var(--border-strong);
    border-radius: 2rem;
    background: var(--body-bg);
    font-size: 0.85rem;
    color: var(--text);
}

.navbar__search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.navbar__search .navbar__search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 0.85rem;
}

.navbar__right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ---- User dropdown ---- */

.dropdown {
    position: relative;
}

.dropdown__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 2rem;
    color: var(--text);
}

.dropdown__toggle:hover {
    background: var(--body-bg);
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--info));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.dropdown__menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    min-width: 210px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem;
    display: none;
    z-index: 1050;
}

.dropdown__menu.is-open {
    display: block;
}

.dropdown__header {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
}

.dropdown__name {
    font-weight: 600;
    color: var(--heading);
}

.dropdown__role {
    font-size: 0.72rem;
    color: var(--text-soft);
    text-transform: capitalize;
}

.dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.dropdown__item:hover {
    background: var(--body-bg);
    color: var(--heading);
}

.dropdown__item--danger {
    color: var(--danger);
}

.dropdown__item--danger:hover {
    background: rgba(230, 55, 87, 0.08);
    color: var(--danger);
}

.dropdown__divider {
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0;
    border: none;
}

.dropdown__form {
    margin: 0;
}

/* =========================================================================
   Content area
   ========================================================================= */

.content {
    padding: 1.75rem 1.5rem;
    flex: 1;
}

.page-title {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.card__title {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1.25rem;
}

.grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat__label {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.stat__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--heading);
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge--success {
    background: rgba(0, 210, 122, 0.12);
    color: #0f9b6c;
}

.badge--muted {
    background: rgba(94, 110, 130, 0.12);
    color: var(--text-muted);
}

.badge--soft {
    background: var(--primary-soft);
    color: var(--primary);
    text-transform: capitalize;
}

/* ---- Page head ---- */

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.page-head .page-title {
    margin-bottom: 0;
}

/* ---- Tables ---- */

.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th,
.table td {
    text-align: left;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table th {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-soft);
    font-weight: 600;
}

.table tbody tr:hover {
    background: var(--body-bg);
}

.table__empty {
    text-align: center;
    color: var(--text-soft);
    padding: 2rem;
}

.table__actions {
    text-align: right;
    white-space: nowrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

/* =========================================================================
   Buttons & forms (shared)
   ========================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

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

.btn--block {
    width: 100%;
}

.btn--sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

.btn--light {
    background: var(--body-bg);
    color: var(--text);
    border-color: var(--border-strong);
}

.btn--light:hover {
    background: var(--border);
    color: var(--heading);
}

.btn--danger-outline {
    background: transparent;
    color: var(--danger);
    border-color: rgba(230, 55, 87, 0.4);
}

.btn--danger-outline:hover {
    background: rgba(230, 55, 87, 0.08);
}

.btn--success-outline {
    background: transparent;
    color: #0f9b6c;
    border-color: rgba(0, 210, 122, 0.4);
}

.btn--success-outline:hover {
    background: rgba(0, 210, 122, 0.08);
}

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--heading);
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.15);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-error {
    color: var(--danger);
    font-size: 0.78rem;
    margin-top: 0.35rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 560px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-help {
    font-size: 0.82rem;
    color: var(--text-muted);
    background: var(--body-bg);
    border-radius: var(--radius);
    padding: 0.75rem 0.9rem;
    margin-bottom: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.card--form {
    max-width: 640px;
}

/* ---- Inline formset rows (e.g. vendor contacts / bank accounts) ---- */

.formset-row {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--body-bg);
}

/* ---- Contracts (collapsible tree on the vendor page) ---- */

.contract-tree {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.contract-node {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: var(--radius);
    background: var(--surface, #fff);
    overflow: hidden;
}

.contract-node summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.contract-node summary::-webkit-details-marker {
    display: none;
}

.contract-node summary::before {
    content: '▸';
    font-size: 0.8rem;
    color: var(--primary, #2c7be5);
    transition: transform 0.15s ease;
}

.contract-node[open] summary::before {
    transform: rotate(90deg);
}

.contract-node[open] summary {
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: var(--primary-soft, #e3edfb);
}

.contract-node summary:hover {
    background: var(--primary-soft, #e3edfb);
}

.contract-node__name {
    font-weight: 600;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-node__meta {
    font-size: 0.8rem;
    color: var(--text-muted, #888);
    white-space: nowrap;
}

.contract-node__actions {
    display: flex;
    gap: 0.4rem;
}

.contract-files {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
}

.contract-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1rem 0.5rem 2.1rem;
}

.contract-file + .contract-file {
    border-top: 1px solid var(--border, #eee);
}

.contract-file__name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contract-file__orig {
    font-size: 0.78rem;
    color: var(--text-muted, #888);
}

.contract-file--empty {
    padding: 0.6rem 1rem 0.6rem 2.1rem;
    color: var(--text-muted, #888);
    font-size: 0.85rem;
}

.contract-file-current {
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

/* ---- Alerts ---- */

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert--danger {
    background: rgba(230, 55, 87, 0.08);
    border-color: rgba(230, 55, 87, 0.2);
    color: var(--danger);
}

.alert--success {
    background: rgba(0, 210, 122, 0.08);
    border-color: rgba(0, 210, 122, 0.2);
    color: #0f9b6c;
}

/* =========================================================================
   Auth / login page
   ========================================================================= */

.auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background-color: var(--body-bg);
    background-image:
        radial-gradient(circle at 82% 22%, rgba(44, 123, 229, 0.10) 0, transparent 26%),
        radial-gradient(circle at 24% 82%, rgba(44, 123, 229, 0.10) 0, transparent 22%);
    position: relative;
    overflow: hidden;
}

.auth__circle {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.auth__circle--1 { width: 220px; height: 220px; top: 12%; right: 16%; border-color: rgba(44,123,229,.35); }
.auth__circle--2 { width: 120px; height: 120px; top: 6%; right: 10%; }
.auth__circle--3 { width: 90px; height: 90px; bottom: 18%; left: 22%; border-color: rgba(44,123,229,.5); }
.auth__circle--4 { width: 150px; height: 150px; bottom: 8%; left: 14%; }

.auth__card {
    display: flex;
    width: 100%;
    max-width: 760px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.auth__aside {
    width: 42%;
    padding: 2.5rem 2rem;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth__aside::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    bottom: -120px;
    left: -40px;
}

.auth__brand {
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    z-index: 1;
}

.auth__brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.auth__tagline {
    font-size: 0.9rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.85);
    position: relative;
    z-index: 1;
    margin-top: 1.25rem;
}

.auth__aside-footer {
    position: relative;
    z-index: 1;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
}

.auth__body {
    width: 58%;
    padding: 2.75rem 2.5rem;
}

.auth__title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

.auth__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .auth__aside {
        display: none;
    }
    .auth__body {
        width: 100%;
    }
}

/* =========================================================================
   Responsive sidebar
   ========================================================================= */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 1025;
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.is-open {
        transform: translateX(0);
    }
    .main {
        margin-left: 0;
    }
    .navbar__toggle {
        display: inline-flex;
    }
    .sidebar-backdrop.is-open {
        display: block;
    }
}

/* =========================================================================
   Reporting tables
   ========================================================================= */

.report-table {
    font-variant-numeric: tabular-nums;
}

/* Disable the default full-row hover; we highlight individual cells instead. */
.report-table tbody tr:hover {
    background: transparent;
}

.report-table th.report-num,
.report-table td.report-num {
    text-align: right;
    white-space: nowrap;
}

.report-table td.report-num {
    transition: background-color 0.1s ease;
}

/* Per-cell hover. */
.report-table td.report-num:hover {
    background: var(--primary-soft);
}

.report-table .report-cat {
    min-width: 200px;
    font-weight: 500;
    color: var(--heading);
}

/* The trailing Total column gets a divider and slight emphasis. */
.report-table td.report-total-col,
.report-table th.report-total-col {
    border-left: 1px solid var(--border-strong);
    font-weight: 600;
}

/* Distinct title styling for the header row. */
.report-table thead th {
    background: var(--body-bg);
    color: var(--heading);
    font-weight: 700;
    border-bottom: 2px solid var(--border-strong);
}

/* Section total rows (in <tfoot>). */
.report-table .report-total-row td {
    border-top: 2px solid var(--border-strong);
    background: var(--body-bg);
    font-weight: 700;
    color: var(--heading);
}

/* Balance row. */
.report-table .report-balance-row td {
    font-weight: 700;
    color: var(--heading);
}

/* ---- Stacked amounts inside a cell ---- */

.report-amt {
    display: block;
    line-height: 1.35;
}

.report-amt__cur {
    font-size: 0.68em;
    color: var(--text-soft);
    margin-left: 0.25em;
    font-weight: 500;
}

/* Zeroed amounts are heavily de-emphasised. */
.report-table .report-amt.is-zero,
.report-table .report-amt.is-zero .report-amt__num,
.report-table .report-amt.is-zero .report-amt__cur {
    color: #cdd4de !important;
    font-weight: 400;
}

/* Amount colouring (non-zero only, applied via value_class). */
.report-amt.is-expense .report-amt__num {
    color: var(--danger);
}

.report-amt.is-income .report-amt__num {
    color: #0f9b6c;
}

.report-amt.is-positive .report-amt__num {
    color: #0f9b6c;
}

.report-amt.is-negative .report-amt__num {
    color: var(--danger);
}

/* ---- Clickable report cells & drill-down modal ---- */

.report-cell {
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.report-cell:hover {
    background-color: var(--primary-soft);
}

.report-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 10rem 1rem 3rem;
    overflow-y: auto;
}

.report-modal.is-open {
    display: flex;
}

.report-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(35, 46, 60, 0.5);
}

.report-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 960px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.report-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.report-modal__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--heading);
    margin: 0;
}

.report-modal__head-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.report-modal__close {
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 0.25rem;
}

.report-modal__close:hover {
    color: var(--heading);
}

.report-modal__body {
    padding: 1rem 1.25rem 1.25rem;
}

.report-entries-table {
    width: 100%;
    font-size: 0.85rem;
}

.report-entries-table th {
    white-space: nowrap;
}

.report-entries-empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 0;
}

.report-entries-link {
    color: var(--primary);
    font-weight: 500;
}

/* Actions cell (Open + Delete) in the report entries modal */
.report-entries-actions {
    white-space: nowrap;
}

.report-entries-actions .btn + .btn {
    margin-left: 0.4rem;
}

.report-entries-actions .btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Color-coded, button-based status selector (expense & income forms) */
.status-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-bg, #fff);
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

/* Hide the native radio; the label itself is the visible control. */
.status-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.status-option:hover {
    border-color: var(--primary);
}

/* Selected states — color coded per status value. */
.status-option--projected:has(input:checked) {
    background: rgba(148, 163, 184, 0.16);
    border-color: #94a3b8;
    color: #475569;
}

.status-option--confirmed:has(input:checked) {
    background: rgba(59, 130, 246, 0.14);
    border-color: #3b82f6;
    color: #1d4ed8;
}

.status-option--paid:has(input:checked) {
    background: rgba(0, 210, 122, 0.14);
    border-color: #00d27a;
    color: #058a55;
}

/* Keyboard focus visibility. */
.status-option:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
}

/* Inline editable status (reporting entries modal) */
.status-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-inline.is-saving {
    opacity: 0.6;
    pointer-events: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
    transition: filter 0.12s ease;
}

.status-badge:hover {
    filter: brightness(0.96);
}

.status-badge--projected {
    background: rgba(148, 163, 184, 0.16);
    color: #475569;
}

.status-badge--confirmed {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
}

.status-badge--paid {
    background: rgba(0, 210, 122, 0.16);
    color: #058a55;
}

.status-badge--error {
    background: rgba(230, 55, 87, 0.16);
    color: #be123c;
}

.status-inline__editor {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--card-bg, #fff);
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.status-chip:hover {
    border-color: var(--primary);
}

.status-chip--projected.is-current {
    background: rgba(148, 163, 184, 0.16);
    border-color: #94a3b8;
    color: #475569;
}

.status-chip--confirmed.is-current {
    background: rgba(59, 130, 246, 0.14);
    border-color: #3b82f6;
    color: #1d4ed8;
}

.status-chip--paid.is-current {
    background: rgba(0, 210, 122, 0.14);
    border-color: #00d27a;
    color: #058a55;
}

.status-chip--cancel {
    color: #be123c;
    border-color: transparent;
}

.status-chip--cancel:hover {
    border-color: #e63757;
    background: rgba(230, 55, 87, 0.08);
}

/* Download-documents month list */
.docs-month-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.docs-month-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.5rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.12s ease;
}

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

.docs-month-item:hover {
    background: var(--body-bg);
}

.docs-month-item.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

.docs-month-item.is-active {
    background: var(--body-bg);
}

.docs-month-label {
    font-weight: 500;
    color: var(--heading);
}

.docs-month-count {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.docs-month-status {
    font-size: 0.8rem;
    color: var(--primary);
    min-width: 6rem;
    text-align: right;
}

/* =========================================================================
   Bulk document upload
   ========================================================================= */

.card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.card__head .card__title {
    margin-bottom: 0;
}

/* ---- Drop zone ---- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 1.75rem 1rem;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    background: var(--body-bg);
    text-align: center;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.dropzone.is-hover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dropzone__icon svg {
    width: 34px;
    height: 34px;
    stroke: var(--primary);
    stroke-width: 1.6;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dropzone__title {
    margin: 0;
    font-weight: 600;
    color: var(--heading);
}

.dropzone__browse {
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--primary);
    text-decoration: underline;
    cursor: pointer;
}

.dropzone__hint {
    margin: 0;
    max-width: 46rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dropzone__status {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--primary);
    min-height: 1.2em;
}

/* ---- Review list: one card per document ---- */

.bulk-list-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.5rem 0 0.75rem;
}

/* ---- Month filter (one chip per month + document count) ---- */

.month-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1rem;
}

.month-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.month-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.month-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.month-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 600;
}

.month-chip.is-active .month-chip__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.bulk-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.bulk-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0;
}

.bulk-card--compact {
    gap: 0.5rem;
}

.bulk-card--done {
    border-left: 3px solid var(--success);
}

/* ---- Card header ---- */

.bulk-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.bulk-card--compact .bulk-card__head {
    padding-bottom: 0;
    border-bottom: none;
}

.bulk-card__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.bulk-card__file {
    font-weight: 600;
    color: var(--heading);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 32rem;
}

a.bulk-card__file {
    color: var(--primary);
}

.bulk-card__actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.bulk-card__message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.bulk-card__message--error {
    color: var(--danger);
}

.bulk-created {
    font-weight: 600;
}

/* ---- Editable field grid ---- */

.bulk-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem 1.25rem;
}

.bulk-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.bulk-field--wide {
    grid-column: span 2;
}

@media (max-width: 700px) {
    .bulk-field--wide {
        grid-column: span 1;
    }
}

.bulk-field__label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.bulk-field .form-control {
    width: 100%;
    margin-bottom: 0;
}

/* ---- Warnings & notes ---- */

.bulk-card__warnings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bulk-card__warnings:empty {
    display: none;
}

.bulk-warning {
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius);
    background: rgba(245, 128, 62, 0.12);
    color: #8a4a12;
    font-weight: 500;
}

.bulk-error {
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius);
    background: rgba(230, 55, 87, 0.08);
    color: var(--danger);
    font-weight: 500;
}

.bulk-note {
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius);
    background: var(--body-bg);
    color: var(--text-muted);
}

/* ---- Extracted parties footer ---- */

.bulk-card__parties {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.4rem 1.5rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
}

.bulk-party {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.bulk-party__label {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.bulk-party__value {
    color: var(--text);
    min-width: 0;
}

.bulk-party--reason .bulk-party__value {
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Unknown-vendor suggestion ---- */

.bulk-vendor-suggestion {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--body-bg);
    font-size: 0.82rem;
}

.bulk-vendor-suggestion__text {
    color: var(--text-muted);
    min-width: 0;
}

.bulk-vendor-suggestion__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* The queue summary / inline hints are plain text here, not boxed. */
.bulk-list-head .form-help,
.bulk-vendor-suggestion__actions .form-help {
    background: none;
    padding: 0;
    margin: 0;
}

/* ---- Misc ---- */

.bulk-empty .table__empty {
    margin: 0;
}

.bulk-spinner {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border: 2px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: bulk-spin 0.8s linear infinite;
}

@keyframes bulk-spin {
    to { transform: rotate(360deg); }
}

.badge--danger {
    background: rgba(230, 55, 87, 0.12);
    color: var(--danger);
}

/* =========================================================================
   Vendor detail page
   ========================================================================= */

.vendor-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.month-table__month-col {
    width: 140px;
}

.month-table__month {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: top;
}

.month-table td {
    vertical-align: top;
}

.month-entry {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.15rem 0;
}

.month-entry__date {
    color: var(--text-muted, #6b7280);
    white-space: nowrap;
    font-size: 0.85rem;
}

.month-entry__desc {
    flex: 1 1 auto;
    min-width: 0;
}

.month-entry__amount {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.month-entry--empty {
    color: var(--text-muted, #6b7280);
}

@media (max-width: 900px) {
    .vendor-top {
        grid-template-columns: 1fr;
    }
}

