/* Backoffice custom styles */

/* Fix Bulma 1.x default outlined buttons: without a color modifier (e.g. .is-primary),
   the text and border color resolve to white (scheme-main-l = 100%), making them invisible.
   Override with direct properties. Colored variants (.is-primary etc.) have higher
   specificity from Bulma and still override these. */
.button.is-outlined {
    color: var(--bulma-text);
    border-color: var(--bulma-border);
}
.button.is-outlined:hover {
    color: var(--bulma-text-strong);
    border-color: var(--bulma-text-strong);
    background-color: var(--bulma-background);
}

/* Sidebar */
.sidebar {
    width: 260px;
    min-height: 100vh;
    background: #1a1d29;
}

.sidebar .menu-list a {
    color: #8b8fa3;
    padding: 0.75rem 1.25rem;
    border-radius: 0.375rem;
    margin: 0.125rem 0;
}

.sidebar .menu-list a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar .menu-list a.is-active {
    color: #fff;
    background: #2563eb;
}

.sidebar .menu-list a i {
    width: 1.5rem;
}

.sidebar-brand {
    /* Stack the W-Y mark on top of the wordmark, both horizontally
       centred. Slightly tighter padding than the rest of the sidebar
       so the mark visually anchors the column. */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1rem;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-mark {
    /* Stretch close to the sidebar width; the SVG keeps its aspect ratio. */
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
}

.sidebar-brand-name {
    line-height: 1.2;
    letter-spacing: 0.02em;
}

/* Main content area */
.main-content {
    flex: 1;
    background: #f5f7fa;
    min-height: 100vh;
}

.topbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1.5rem;
}

.content-area {
    padding: 1.5rem;
}

/* Stat cards */
.stat-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1d29;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
}

/* Table header styling */
.table th {
    font-weight: 600;
    color: #4b5563;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Badge state sizing */
.badge-state {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Login page */
.login-page {
    background: #1a1d29;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.login-bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

.login-bg-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 29, 41, 0.65), rgba(26, 29, 41, 0.45));
    z-index: 1;
    pointer-events: none;
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 0.75rem;
    padding: 2.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand-mark {
    /* Bigger than the sidebar mark -- the login card is the place where
       the brand should read first. */
    width: 216px;
    height: 216px;
    display: block;
    margin: 0 auto 0.75rem;
}

.login-brand h2 {
    color: #1a1d29;
    font-weight: 700;
}

.login-brand p {
    color: #6b7280;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
}

.chart-container-tall {
    position: relative;
    height: 350px;
}

/* Custom helpers */
.is-inline-block {
    display: inline-block !important;
}

.is-unstyled {
    list-style: none !important;
    margin-left: 0 !important;
}

/* Support message styling */
.message-internal {
    margin-left: 2rem;
}

.message-external {
    margin-right: 2rem;
}

.message-body-internal {
    padding: 0.75rem;
    border-radius: 0.25rem;
    background: rgba(255, 221, 87, 0.1);
    border-left: 3px solid #ffdd57;
}

.message-body-external {
    padding: 0.75rem;
    border-radius: 0.25rem;
    background: #f5f5f5;
    border-left: 3px solid #dbdbdb;
}

/* Card body no-padding for flush tables */
.card-content.is-flush {
    padding: 0;
}

/* Remove margin-bottom on tables inside cards */
.card-content .table {
    margin-bottom: 0;
}

/* Sidebar bottom info text */
.sidebar-info {
    color: #8b8fa3;
    font-size: 0.875rem;
}

/* System configuration table (integrations page) */
.system-config-table th.col-key { width: 28%; }
.system-config-table th.col-value { width: 24%; }
.system-config-table th.col-actions { width: 1%; }
.system-config-table input.system-config-integer { max-width: 10rem; }

/* Ledger tables (account detail and transaction detail).
   `.ledger-group-0` and `.ledger-group-1` are alternated per workunit
   group so officers can visually segment a transaction's entries or
   consecutive entries from the same account. */
.ledger-table td.has-text-right,
.ledger-table th.has-text-right {
    font-variant-numeric: tabular-nums;
}
.ledger-table tr.ledger-group-0 > td {
    background: #ffffff;
}
.ledger-table tr.ledger-group-1 > td {
    background: #f6f8fb;
}
.ledger-table tr.ledger-group-0:hover > td,
.ledger-table tr.ledger-group-1:hover > td {
    background: #eef2f7;
}

/* Event-log expanded detail row */
.event-detail-cell { background: #fafafa; }
.event-detail-pre {
    padding: 0.75rem;
    background: #f5f5f5;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Compact upload row below each sanctions-list card's table. */
.sanction-upload {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
}

/* Tab panels.
   Driven by class toggling (not inline `style=`) so the server-rendered
   HTML stays CSP-compliant under `style-src 'self'`. Without these
   rules, inline `style="display:none"` on hidden panels is stripped by
   the CSP and every panel flashes visible before the JS activates one. */
.tab-panel {
    display: none;
}
.tab-panel.is-active {
    display: block;
}
.sanction-upload input[type="file"] { font-size: 0.8rem; }
