:root {
    --bg: #f3f6fb;
    --bg-accent: #e8eefc;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-strong: #ffffff;
    --surface-dark: #132238;
    --text: #172033;
    --muted: #6b7890;
    --border: rgba(24, 39, 75, 0.10);
    --border-strong: rgba(24, 39, 75, 0.16);
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --secondary: #0f766e;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --info: #0891b2;
    --shadow-lg: 0 30px 70px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.09);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(15, 118, 110, 0.12), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef4fb 52%, #f3f6fb 100%);
}

a {
    text-decoration: none;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1045;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.52rem 0.9rem;
    background: rgba(248, 251, 255, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.app-topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.app-topbar-brand .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #2563eb, #0f766e);
    color: #fff;
    font-size: 0.88rem;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.18);
}

.app-topbar-brand h1 {
    font-size: 0.82rem;
    font-weight: 800;
    margin: 0;
    color: var(--text);
    line-height: 1;
}

.app-topbar-brand p {
    margin: 0.12rem 0 0;
    font-size: 0.62rem;
    line-height: 1.25;
    color: var(--muted);
}

.menu-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
    color: var(--text);
    flex-shrink: 0;
}

.menu-toggle i {
    font-size: 1rem;
}

.admin-wrapper {
    display: flex;
    min-height: calc(100vh - 62px);
}

.app-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 13, 26, 0.54);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 1040;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    background:
        linear-gradient(180deg, rgba(14, 27, 49, 0.98), rgba(18, 34, 58, 0.92)),
        radial-gradient(circle at top, rgba(37, 99, 235, 0.16), transparent 30%);
    color: rgba(255, 255, 255, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1.4rem 1rem;
    overflow-y: auto;
    position: sticky;
    top: 78px;
    height: calc(100vh - 78px);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(37, 99, 235, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.sidebar-header i {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.25rem;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}


.sidebar-nav {
    display: grid;
    gap: 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    color: rgba(255, 255, 255, 0.76);
    border-radius: 16px;
    transition: 0.2s ease;
    font-weight: 600;
    border: 1px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(79, 70, 229, 0.88));
    color: #fff;
    box-shadow: 0 14px 30px rgba(37, 99, 235, 0.32);
}

.nav-link-logout {
    margin-top: 0.45rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    color: rgba(255, 255, 255, 0.92);
}

.nav-link-logout:hover {
    background: rgba(220, 38, 38, 0.16);
    border-color: rgba(255, 255, 255, 0.08);
}

.nav-link i {
    font-size: 1.15rem;
}

.main-content {
    flex: 1;
    padding: 1.35rem;
}

.main-content.statement-editor-page {
    padding-top: 0.55rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.content-header-workspace {
    margin-top: 0.3rem;
}

.dashboard-simple-header {
    align-items: center;
    margin-bottom: 1rem;
}

.content-header h1 {
    margin: 0;
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.content-header .text-muted,
.text-muted {
    color: var(--muted) !important;
}

.page-lead {
    font-size: 0.95rem;
    max-width: 720px;
}

.hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 1.7rem;
    margin-bottom: 1.4rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.16), transparent 26%),
        linear-gradient(135deg, #0f172a, #1d4ed8 54%, #0f766e);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

.hero-card h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
}

.hero-card p {
    margin: 0.55rem 0 0;
    color: rgba(255, 255, 255, 0.84);
}

.hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.95fr);
    gap: 1.2rem;
    align-items: end;
}

.hero-copy {
    max-width: 720px;
}

.eyebrow-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.2rem;
}

.hero-panel {
    padding: 1rem;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
}

.hero-panel-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 0.85rem;
}

.hero-panel-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.hero-panel-item {
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-panel-item span {
    display: block;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.7);
}

.hero-panel-item strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1rem;
    line-height: 1.25;
    word-break: break-word;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.metrics-grid-primary {
    grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(180px, 1fr));
}

.metrics-grid-simple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.metrics-grid-simple .metric-card {
    padding: 0.9rem 1rem;
    border-radius: 18px;
}

.metrics-grid-simple .metric-label {
    font-size: 0.74rem;
}

.metrics-grid-simple .metric-value {
    font-size: 1.45rem;
    margin-top: 0.35rem;
}

.metrics-grid-simple .metric-value-compact {
    font-size: 1rem;
}

.metrics-grid-simple .metric-note {
    margin-top: 0.25rem;
    font-size: 0.8rem;
}

.metric-card,
.card {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.metric-card {
    padding: 1.15rem 1.2rem;
}

.metric-card-primary {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(235, 243, 255, 0.92));
    border-color: rgba(37, 99, 235, 0.16);
}

.metric-card .metric-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 700;
}

.metric-card .metric-value {
    font-size: 1.9rem;
    line-height: 1.1;
    margin-top: 0.55rem;
    font-weight: 800;
    color: var(--text);
}

.metric-card .metric-value-compact {
    font-size: 1.2rem;
    line-height: 1.25;
    word-break: break-word;
}

.metric-card .metric-note {
    margin-top: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.card {
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.55);
}

.card-subtitle {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.card-header > div {
    min-width: 0;
}

.card-header h5 {
    margin: 0;
    font-weight: 800;
    color: var(--text);
}

.card-body {
    padding: 1.2rem;
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    justify-content: flex-end;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.page-actions .btn {
    min-height: 42px;
}

.app-topbar .toolbar-row .btn {
    padding: 0.52rem 0.82rem;
    border-radius: 15px;
    min-height: 34px;
    box-shadow: none;
}

.app-topbar .toolbar-row .text-muted {
    font-size: 0.82rem;
    font-weight: 700;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.btn {
    font-weight: 700;
    border-radius: 14px;
    padding: 0.78rem 1.05rem;
    transition: 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-success,
.btn-info,
.btn-danger {
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 18px 32px rgba(37, 99, 235, 0.24);
}

.btn-success {
    background: linear-gradient(135deg, #16a34a, #15803d);
}

.btn-info {
    background: linear-gradient(135deg, #0891b2, #0e7490);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.btn-light {
    background: #fff;
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-info {
    background: rgba(255, 255, 255, 0.7);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(37, 99, 235, 0.22);
}

.btn-outline-secondary {
    color: var(--text);
    border-color: var(--border-strong);
}

.btn-outline-danger {
    color: var(--danger);
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-outline-info {
    color: var(--info);
    border-color: rgba(8, 145, 178, 0.22);
}

.dropdown-menu {
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 0.55rem;
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    border-radius: 12px;
    padding: 0.7rem 0.85rem;
    font-weight: 600;
}

.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.form-label {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select,
textarea.form-control {
    border-radius: 14px;
    border: 1px solid var(--border-strong);
    padding: 0.85rem 0.95rem;
    background: rgba(255, 255, 255, 0.88);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.alert {
    border: 1px solid transparent;
    border-radius: 18px;
    padding: 1rem 1.15rem;
    box-shadow: var(--shadow-md);
}

.alert-success {
    background: #ebf9ef;
    border-color: #bfe8c9;
    color: #166534;
}

.alert-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #9f1239;
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.alert-info {
    background: #ecfeff;
    border-color: #bae6fd;
    color: #155e75;
}

.table-responsive {
    border-radius: 20px;
    overflow: auto;
}

.table {
    margin: 0;
    --bs-table-bg: transparent;
}

.table thead th {
    white-space: nowrap;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(24, 39, 75, 0.06);
}

.table-hover tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

.admin-table-wrap {
    border-radius: 20px;
}

.admin-table thead th {
    background: rgba(244, 248, 255, 0.92);
}

.admin-table tbody td {
    line-height: 1.45;
}

.statement-actions {
    flex-wrap: wrap;
}

.statement-actions .btn {
    min-width: 36px;
}

.chip-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip-links .btn {
    padding: 0.7rem 0.95rem;
}

.workbench-card .card-body {
    display: grid;
    gap: 1rem;
}

.statement-editor-form {
    display: grid;
    gap: 0.95rem;
}

.statement-editor-form .card {
    overflow: hidden;
}

.statement-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
    padding-top: 0.4rem;
}

.statement-editor-form .card-header.bg-primary,
.statement-editor-form .card-header.bg-success,
.statement-editor-form .card-header.bg-dark,
.transaction-workspace .card-header.bg-info,
.transaction-workspace .card-header.bg-primary,
.transaction-workspace .card-header.bg-success,
.transaction-workspace .card-header.bg-dark {
    border-bottom: 0;
}

.statement-editor-form .card-header.bg-primary,
.transaction-workspace .card-header.bg-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
}

.statement-editor-form .card-header.bg-success,
.transaction-workspace .card-header.bg-success {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
}

.statement-editor-form .card-header.bg-dark,
.transaction-workspace .card-header.bg-dark {
    background: linear-gradient(135deg, #172033, #253752) !important;
}

.transaction-workspace .card-header.bg-info {
    background: linear-gradient(135deg, #0891b2, #0e7490) !important;
}

.statement-editor-form .card-header.bg-white {
    background: rgba(255, 255, 255, 0.82) !important;
}

.statement-editor-form .card-header h5,
.statement-editor-form .card-header h4,
.transaction-workspace .card-header h5 {
    margin: 0;
    font-weight: 800;
}

.statement-editor-form .card-body,
.transaction-workspace .card-body {
    padding: 1.15rem 1.2rem;
}

.statement-editor-form .row.g-3 {
    --bs-gutter-x: 0.8rem;
    --bs-gutter-y: 0.8rem;
}

.statement-editor-form .form-label {
    margin-bottom: 0.35rem;
    font-size: 0.88rem;
}

.statement-editor-form .form-control,
.statement-editor-form .form-select,
.statement-editor-form textarea.form-control {
    padding: 0.72rem 0.85rem;
}

.statement-editor-form .card-header {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.statement-editor-form .alert.mb-4,
.statement-editor-form .card.mb-4 {
    margin-bottom: 0.9rem !important;
}

.statement-editor-form .card-header h5,
.statement-editor-form .card-header h4 {
    font-size: 1rem;
}

.transaction-workspace .alert {
    margin-bottom: 1rem;
}

.workbench-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
}

.workbench-search,
.workbench-filters > div {
    min-width: 0;
}

.workbench-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
}

.workbench-actions {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.quick-launch-row {
    display: grid;
    gap: 0.7rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.quick-launch-label,
.workspace-count {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 800;
}

.workspace-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.section-stack {
    display: grid;
    gap: 1.2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
    gap: 1.2rem;
    margin-bottom: 1.25rem;
}

.dashboard-grid-compact {
    align-items: start;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.9rem;
}

.status-card {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(15, 118, 110, 0.04));
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
}

.status-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.status-value {
    margin-top: 0.45rem;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
}

.status-note {
    margin-top: 0.35rem;
    font-size: 0.88rem;
    color: var(--muted);
}

.activity-list,
.watch-list,
.leaderboard {
    display: grid;
    gap: 0.8rem;
}

.activity-item,
.watch-item,
.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary);
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-content strong,
.watch-item strong {
    display: block;
}

.activity-content p,
.watch-item p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.watch-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--danger);
}

.leaderboard-item span {
    color: var(--text);
    font-weight: 600;
}

.leaderboard-item strong {
    color: var(--primary);
    font-size: 1.05rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.compact-empty-state {
    padding: 1.8rem 1rem;
}

.empty-state i {
    font-size: 3.5rem;
    color: #9db2cf;
}

.empty-state h4 {
    margin-top: 1rem;
    font-weight: 800;
}

.pattern-row {
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    padding: 1rem 1.1rem;
    margin: 0.85rem 0;
    background: rgba(255, 255, 255, 0.76);
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.pattern-template {
    font-family: 'Courier New', monospace;
    background: rgba(248, 250, 252, 0.9);
    padding: 0.9rem 1rem;
    border-radius: 14px;
    font-size: 0.9em;
    border: 1px solid rgba(24, 39, 75, 0.08);
}

.freq-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.84rem;
}

.insight-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0 0 1rem;
}

.insight-chip {
    min-width: 160px;
    padding: 0.85rem 1rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(15, 118, 110, 0.04));
    border: 1px solid var(--border);
}

.insight-chip span {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 800;
}

.insight-chip strong {
    display: block;
    margin-top: 0.35rem;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.no-top-padding {
    padding-top: 1rem;
}

.statement-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    justify-content: center;
}

.statement-record-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    width: 100%;
    border: 1px solid rgba(37, 99, 235, 0.24);
    border-radius: 22px;
    padding: 0.9rem;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 30%),
        radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.08), transparent 26%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.96) 55%, rgba(239, 246, 255, 0.94));
    box-shadow:
        0 22px 44px rgba(15, 23, 42, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    display: grid;
    gap: 0.72rem;
}

.statement-record-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 22px 0 0 22px;
    background: linear-gradient(180deg, #2563eb, #0f766e);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.28);
}

.statement-record-card::after {
    content: "";
    position: absolute;
    top: -34px;
    right: -28px;
    width: 118px;
    height: 118px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.92) 0%, rgba(219, 234, 254, 0.68) 38%, rgba(219, 234, 254, 0) 72%);
    opacity: 0.9;
    pointer-events: none;
    z-index: -1;
}

.statement-record-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    padding-bottom: 0.18rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.statement-record-titles h3 {
    margin: 0.42rem 0 0.18rem;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
}

.statement-record-id {
    margin: 0;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 700;
    word-break: break-word;
}

.statement-record-meta {
    margin: 0.28rem 0 0;
    color: #72829d;
    font-size: 0.77rem;
    font-weight: 700;
}

.statement-bank-chip,
.statement-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid transparent;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

.statement-bank-chip {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(79, 70, 229, 0.08));
    border-color: rgba(37, 99, 235, 0.18);
    color: #2563eb;
}

.statement-status-pill {
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.16), rgba(22, 163, 74, 0.08));
    border-color: rgba(15, 118, 110, 0.18);
    color: #0f766e;
    white-space: nowrap;
}

.statement-record-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.62rem;
}

.statement-info-line {
    position: relative;
    padding: 0.78rem 0.82rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 17px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 255, 0.9));
    box-shadow:
        0 10px 22px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.88);
    min-height: 64px;
}

.statement-meta-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7b8aa4;
    font-weight: 800;
}

.statement-info-line strong {
    display: block;
    margin-top: 0.28rem;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}

.statement-info-account strong {
    letter-spacing: -0.02em;
}

.statement-info-period strong {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.statement-record-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.2rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(248, 251, 255, 0.86), rgba(242, 247, 255, 0.74));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.statement-record-actions .btn,
.statement-record-actions form {
    width: 100%;
}

.statement-record-actions form {
    display: contents;
}

.statement-record-actions form .btn {
    width: 100%;
}

.statement-record-actions .btn {
    min-height: 40px;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.84rem;
    padding: 0.55rem 0.75rem;
    border-width: 1px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow:
        0 8px 18px rgba(15, 23, 42, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
    white-space: nowrap;
}

.statement-record-actions .btn i {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
}

.statement-action-statement {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(255, 255, 255, 0.95));
    border-color: rgba(37, 99, 235, 0.2);
}

.statement-action-statement i {
    background: rgba(37, 99, 235, 0.12);
}

.statement-action-solvency {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(255, 255, 255, 0.95));
    border-color: rgba(22, 163, 74, 0.2);
}

.statement-action-solvency i {
    background: rgba(22, 163, 74, 0.12);
}

.statement-action-edit {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.14), rgba(255, 255, 255, 0.94));
}

.statement-action-edit i {
    background: rgba(100, 116, 139, 0.12);
}

.statement-action-transactions {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.12), rgba(255, 255, 255, 0.94));
    border-color: rgba(8, 145, 178, 0.2);
}

.statement-action-transactions i {
    background: rgba(8, 145, 178, 0.12);
}

.statement-action-delete .btn {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.08), rgba(255, 255, 255, 0.94));
    border-color: rgba(220, 38, 38, 0.18);
}

.statement-action-delete .btn i {
    background: rgba(220, 38, 38, 0.1);
}

.statement-action-delete {
    width: 100%;
}

.statement-action-delete form {
    width: 100%;
}

.app-footer-space {
    height: 1rem;
}

.hard-reload-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: linear-gradient(135deg, #dc2626, #ea580c);
    color: #fff;
    box-shadow: 0 18px 35px rgba(220, 38, 38, 0.28);
    font-weight: 800;
    letter-spacing: 0.01em;
}

.hard-reload-button i {
    font-size: 1rem;
}

.hard-reload-button:hover {
    transform: translateY(-2px);
    color: #fff;
}

@media (max-width: 991.98px) {
    .hero-layout,
    .metrics-grid-primary,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(274px, 78vw);
        height: 100vh;
        padding-top: 5.1rem;
        transform: translateX(-100%);
        z-index: 1046;
        box-shadow: 0 24px 60px rgba(2, 8, 23, 0.42);
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    .sidebar-header {
        padding: 0.65rem;
        margin-bottom: 0.85rem;
        border-radius: 18px;
    }

    .sidebar-header i {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: 1.1rem;
    }

    .sidebar-header h3 {
        font-size: 0.98rem;
    }

    .nav-link {
        gap: 0.75rem;
        padding: 0.82rem 0.88rem;
        border-radius: 14px;
    }

    .nav-link i {
        font-size: 1.02rem;
    }

    body.app-nav-open .sidebar {
        transform: translateX(0);
    }

    body.app-nav-open .app-backdrop {
        opacity: 1;
        visibility: visible;
        z-index: 1045;
    }

    body.app-nav-open {
        overflow: hidden;
    }

    .main-content {
        width: 100%;
        padding: 1rem;
    }

    .main-content.statement-editor-page {
        padding-top: 0.35rem;
    }

    .content-header {
        flex-direction: column;
        align-items: stretch;
    }

    .workbench-toolbar {
        grid-template-columns: 1fr;
    }

    .workbench-actions {
        flex-wrap: wrap;
    }

    .statement-editor-actions,
    .page-actions {
        justify-content: stretch;
    }

    .hero-card,
    .metric-card,
    .card-body,
    .card-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 360px) {
    .statement-editor-form .row.g-3 > [class*="col-md-"] {
        flex: 0 0 auto;
        width: 50%;
    }

    .statement-editor-form textarea.form-control {
        min-height: calc(1.5em + 1.44rem + 2px);
    }
}

@media (max-width: 420px) {
    .statement-editor-form .row.g-3 > .col-md-6:first-child:nth-last-child(2),
    .statement-editor-form .row.g-3 > .col-md-6:first-child:nth-last-child(2) ~ .col-md-6 {
        width: 100%;
    }
}

@media (min-width: 992px) {
    .menu-toggle {
        display: none;
    }

    .app-topbar {
        padding: 0.72rem 1.2rem;
    }

    .main-content {
        padding: 1.5rem;
    }

    .main-content.statement-editor-page {
        padding-top: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .app-topbar {
        gap: 0.45rem;
        padding: 0.45rem 0.65rem;
    }

    .app-topbar-brand h1 {
        font-size: 0.76rem;
    }

    .app-topbar-brand p {
        font-size: 0.56rem;
        max-width: 140px;
    }

    .hero-actions,
    .toolbar-row,
    .chip-links {
        flex-direction: row;
        align-items: center;
    }

    .btn,
    .btn-group {
        width: 100%;
    }

    .app-topbar .toolbar-row .btn,
    .app-topbar .toolbar-row .btn-group {
        width: auto;
    }

    .statement-editor-actions .btn,
    .page-actions .btn {
        width: 100%;
    }

    .statement-card-grid {
        grid-template-columns: minmax(0, 430px);
        justify-content: center;
    }

    .statement-record-card {
        width: min(100%, 430px);
        margin-inline: auto;
    }

    .workbench-filters {
        grid-template-columns: 1fr;
    }

    .workspace-meta {
        align-items: stretch;
    }

    .statement-record-body,
    .statement-record-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .statement-record-card {
        padding: 0.7rem 0.65rem 0.68rem;
        gap: 0.48rem;
        border-radius: 17px;
        border-color: rgba(37, 99, 235, 0.34);
        box-shadow:
            0 16px 30px rgba(15, 23, 42, 0.09),
            inset 0 1px 0 rgba(255, 255, 255, 0.94);
    }

    .statement-record-head {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 0.45rem;
        padding-bottom: 0.08rem;
    }

    .statement-record-titles {
        min-width: 0;
        flex: 1;
    }

    .statement-record-titles h3 {
        font-size: 0.86rem;
        margin: 0.24rem 0 0.08rem;
        line-height: 1.18;
    }

    .statement-record-id,
    .statement-record-meta {
        display: inline-block;
        vertical-align: middle;
        margin-top: 0;
        font-size: 0.69rem;
        line-height: 1.2;
        white-space: nowrap;
    }

    .statement-record-meta {
        margin-left: 0.35rem;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .statement-record-body {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr);
        gap: 0.38rem;
    }

    .statement-info-line {
        min-height: auto;
        padding: 0.5rem 0.52rem;
        border-radius: 13px;
        box-shadow:
            0 8px 18px rgba(15, 23, 42, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .statement-meta-label {
        font-size: 0.63rem;
        letter-spacing: 0.08em;
    }

    .statement-info-line strong {
        text-align: left;
        font-size: 0.78rem;
        margin-top: 0.18rem;
        line-height: 1.18;
    }

    .statement-info-account strong {
        font-size: 0.76rem;
        overflow-wrap: anywhere;
    }

    .statement-info-period strong {
        font-size: 0.75rem;
        line-height: 1.2;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: none;
    }

    .statement-info-balance {
        grid-column: 1 / -1;
    }

    .statement-record-actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas:
            "statement statement solvency solvency"
            "edit transactions transactions delete";
        gap: 0.32rem;
        padding: 0.14rem;
        border-radius: 15px;
    }

    .statement-action-statement {
        grid-area: statement;
    }

    .statement-action-solvency {
        grid-area: solvency;
    }

    .statement-action-edit {
        grid-area: edit;
    }

    .statement-action-transactions {
        grid-area: transactions;
    }

    .statement-action-delete {
        grid-area: delete;
    }

    .statement-record-actions .btn {
        min-height: 32px;
        padding: 0.38rem 0.35rem;
        font-size: 0.68rem;
        border-radius: 11px;
        gap: 0.24rem;
        box-shadow:
            0 7px 14px rgba(15, 23, 42, 0.05),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
        letter-spacing: -0.01em;
    }

    .statement-record-actions .btn i {
        width: 0.95rem;
        height: 0.95rem;
        font-size: 0.68rem;
    }

    .statement-action-transactions {
        min-width: 0;
    }

    .statement-action-transactions {
        font-size: 0.66rem;
    }

    .statement-bank-chip,
    .statement-status-pill {
        min-height: 26px;
        padding: 0.24rem 0.52rem;
        font-size: 0.64rem;
    }

    .hero-panel-grid {
        grid-template-columns: 1fr;
    }

    .insight-strip {
        flex-direction: column;
    }

    .table thead th,
    .table tbody td {
        padding: 0.8rem;
    }

    .statement-table thead {
        display: none;
    }

    .statement-table,
    .statement-table tbody,
    .statement-table tr,
    .statement-table td {
        display: block;
        width: 100%;
    }

    .statement-table tbody {
        display: grid;
        gap: 0.9rem;
    }

    .statement-table tr {
        border: 1px solid var(--border);
        border-radius: 18px;
        padding: 0.3rem 0;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
    }

    .statement-table td {
        border-bottom: 1px dashed rgba(24, 39, 75, 0.08);
        padding: 0.8rem 0.9rem;
        text-align: left;
    }

    .statement-table td:last-child {
        border-bottom: 0;
    }

    .statement-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 0.28rem;
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--muted);
        font-weight: 800;
    }

    .statement-table td:nth-child(5)::before {
        content: "Balance";
    }

    .statement-table td:nth-child(6)::before {
        content: "Actions";
    }

    .statement-actions {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
    }

    .statement-actions .btn,
    .statement-actions form {
        width: 100%;
    }

    .hard-reload-button {
        right: 14px;
        bottom: 14px;
        padding: 0.85rem 0.95rem;
    }

    .hard-reload-button span {
        display: none;
    }
}
