:root {
    --bg-body: #0f1015;
    --bg-sidebar: #16171d;
    --bg-card: #1e1f26;
    --text-primary: #e0e6ed;
    --text-muted: #d1d5db;
    --border-color: #2b2d36;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --accent-hover: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    --success-gradient: linear-gradient(135deg, #22c55e 0%, #15803d 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: 'Source Sans Pro', sans-serif;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-body); 
}
::-webkit-scrollbar-thumb {
    background: #4b5563; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #6b7280; 
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1f2937 0%, #0f1015 100%);
}

.login-box {
    width: 400px;
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

.login-box h3 {
    margin-bottom: 30px;
    font-weight: 300;
    letter-spacing: 1px;
}

.form-control {
    background-color: #2a2b35;
    border: 1px solid #3f4250;
    color: var(--text-primary);
}

.form-control:focus {
    background-color: #2a2b35;
    border-color: #6366f1;
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.25);
}

.input-group-text {
    background-color: #323541;
    border: 1px solid #3f4250;
    color: var(--text-muted);
}

/* Layout */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 240px;
    max-width: 240px;
    background: var(--bg-sidebar);
    color: var(--text-primary);
    transition: all 0.3s;
    min-height: 100vh;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

#sidebar .sidebar-header {
    padding: 18px 16px 14px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#sidebar .sidebar-header h3 {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 2px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2px;
}

#sidebar .sidebar-header .text-muted {
    color: #ffffff !important;
}

#sidebar .sidebar-header p {
    font-size: 0.72rem;
    opacity: 0.4;
    margin: 0;
}

#sidebar ul.components {
    padding: 6px 0 10px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Thin inner scrollbar */
#sidebar ul.components::-webkit-scrollbar { width: 3px; }
#sidebar ul.components::-webkit-scrollbar-track { background: transparent; }
#sidebar ul.components::-webkit-scrollbar-thumb { background: #2b2d36; border-radius: 3px; }

/* Collapsible sidebar groups */
#sidebar .sidebar-group {
    margin: 0;
}

#sidebar .sidebar-group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

#sidebar .sidebar-group-toggle span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #555a6e;
    transition: color 0.15s;
}

#sidebar .sidebar-group-toggle:hover span {
    color: #8b90a5;
}

#sidebar .sidebar-group-chevron {
    font-size: 0.5rem;
    color: #3e4255;
    transition: transform 0.25s ease, color 0.15s;
}

#sidebar .sidebar-group-toggle:hover .sidebar-group-chevron {
    color: #6b7090;
}

#sidebar .sidebar-group.collapsed .sidebar-group-chevron {
    transform: rotate(-90deg);
}

#sidebar .sidebar-group-items {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden;
    max-height: 500px;
    transition: max-height 0.3s ease;
}

#sidebar .sidebar-group.collapsed .sidebar-group-items {
    max-height: 0;
}

#sidebar ul li.nav-item a {
    padding: 7px 16px;
    font-size: 0.82rem;
    line-height: 1.3;
    display: flex;
    align-items: center;
    color: #7c8091;
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    border-left: 2px solid transparent;
    margin: 0;
}

#sidebar ul li.nav-item a span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar ul li.nav-item a:hover {
    color: #b8bdd0;
    background: rgba(255,255,255,0.025);
}

#sidebar ul li.active > a {
    color: #e0e4f0;
    background: rgba(99, 102, 241, 0.08);
    border-left-color: #6366f1;
}

#sidebar ul li.nav-item a i {
    width: 18px;
    min-width: 18px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.78rem;
    opacity: 0.45;
    flex-shrink: 0;
}

#sidebar ul li.nav-item a:hover i {
    opacity: 0.7;
}

#sidebar ul li.active > a i {
    opacity: 0.9;
}

/* Sidebar footer */
#sidebar .sidebar-footer {
    padding: 10px 14px !important;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

#sidebar .sidebar-footer .btn {
    font-size: 0.78rem;
    padding: 5px 0;
    border-radius: 6px;
}

/* Sidebar exchange-rate widget */
#sidebar .sidebar-rates {
    flex-shrink: 0;
    margin-top: auto;
}

#sidebar .sidebar-rates .rate-card {
    position: relative;
    background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(168,85,247,0.12) 100%);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 10px;
    padding: 8px 12px;
    transition: all 0.2s ease;
    overflow: hidden;
}

#sidebar .sidebar-rates .rate-card[role="button"] { cursor: pointer; }
#sidebar .sidebar-rates .rate-card[role="button"]:hover {
    border-color: rgba(168,85,247,0.55);
    box-shadow: 0 0 0 3px rgba(168,85,247,0.10);
    transform: translateY(-1px);
}

#sidebar .sidebar-rates .rate-label {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0b4;
    margin-bottom: 2px;
}

#sidebar .sidebar-rates .rate-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

#sidebar .sidebar-rates .rate-edit-ico {
    font-size: 0.7rem;
    color: #a855f7;
    opacity: 0.6;
    transition: opacity 0.2s;
}
#sidebar .sidebar-rates .rate-card:hover .rate-edit-ico { opacity: 1; }

/* API docs modal */
.api-docs-modal .api-docs-label {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9aa0b4;
    margin-bottom: 4px;
}
.api-docs-modal code.form-control {
    background: #0f1015;
    color: #e6e7ee;
    border-color: #2b2d36;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.82rem;
}


#content {
    width: 100%;
    padding: 2.5rem;
    min-height: 100vh;
    transition: all 0.3s;
    background: #0f1015;
}

/* Top Navbar */
.navbar {
    padding: 0;
    background: transparent !important;
    border-bottom: none;
    margin-bottom: 2rem !important;
}

#sidebarCollapse {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 8px;
    margin-bottom: 25px;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
}

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

.card-body {
    color: var(--text-muted);
    padding: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: var(--accent-gradient);
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.4);
}

.btn-danger {
    background: var(--danger-gradient);
    border: none;
}
.btn-success {
    background: var(--success-gradient);
    border: none;
}
.btn-warning {
    background: var(--warning-gradient);
    border: none;
    color: #fff;
}

.badge.bg-warning {
    background: #b45309 !important;
    color: #fff !important;
}

.badge.bg-info {
    background: #0e7490 !important;
    color: #fff !important;
}

/* Tables */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table>:not(caption)>*>* {
    background-color: transparent;
    border-bottom-color: var(--border-color);
    padding: 1rem 0.5rem;
}

.table-striped>tbody>tr:nth-of-type(odd)>* {
    color: var(--text-primary);
    background-color: rgba(255,255,255,0.02);
}

/* Fix for Even rows visibility */
.table-striped>tbody>tr:nth-of-type(even)>* {
    color: var(--text-primary) !important;
    background-color: transparent;
}

table.dataTable tbody tr.even {
    background-color: transparent !important;
}

table.dataTable tbody tr {
    color: var(--text-primary) !important;
}

.table-hover>tbody>tr:hover>* {
    color: #fff;
    background-color: rgba(255,255,255,0.05);
}

thead th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: #ffffff !important;
    background-color: #1f2029;
    padding: 12px !important;
    border-bottom: 2px solid var(--border-color) !important;
}

/* DataTables Overrides */
.dataTables_wrapper .dataTables_length, 
.dataTables_wrapper .dataTables_filter, 
.dataTables_wrapper .dataTables_info, 
.dataTables_wrapper .dataTables_processing, 
.dataTables_wrapper .dataTables_paginate {
    color: var(--text-muted) !important;
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    background-color: #2a2b35;
    border: 1px solid #3f4250;
    color: var(--text-primary);
    border-radius: 4px;
    padding: 4px 8px;
}

.page-item.disabled .page-link {
    background-color: #2a2b35;
    border-color: #3f4250;
    color: #6c757d;
}

.page-item.active .page-link {
    background: var(--accent-gradient);
    border-color: transparent;
}

.page-link {
    background-color: #2a2b35;
    border-color: #3f4250;
    color: var(--text-primary);
}

.page-link:hover {
    background-color: #3f4250;
    border-color: #3f4250;
    color: #fff;
}

/* SweetAlert2 Dark */
.swal2-popup {
    background: var(--bg-card) !important;
    color: var(--text-primary) !important;
}
.swal2-title {
    color: var(--text-primary) !important;
}
.swal2-content, .swal2-html-container {
    color: var(--text-muted) !important;
}
.swal2-input, .swal2-select, .swal2-textarea {
    background-color: #2a2b35 !important;
    border: 1px solid #3f4250 !important;
    color: #fff !important;
}
.swal2-select {
    padding: 0.625rem 0.75rem !important;
    border-radius: 0.3125em !important;
    font-size: 1.125em !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
    padding-right: 32px !important;
}
.swal2-select option {
    background: #2a2b35;
    color: #fff;
}
.swal2-input:focus, .swal2-select:focus, .swal2-textarea:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}
.swal2-textarea {
    min-height: 80px !important;
    resize: vertical !important;
}
.swal2-input::placeholder, .swal2-textarea::placeholder {
    color: #6b7280 !important;
}
.swal2-validation-message {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #fca5a5 !important;
    border: none !important;
    font-size: 0.85rem !important;
}
.swal-field-group {
    text-align: left;
    margin: 0.75rem auto;
    width: calc(100% - 2rem);
}
.swal-field-group > label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    padding-left: 2px;
}
.swal-field-group > input,
.swal-field-group > select,
.swal-field-group > textarea {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
.swal-field-group .field-hint {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 0.2rem;
    padding-left: 2px;
}

/* ====== Tom Select (used for ALL <select> inside Swal modals) ======
   Standardized look: every <select> gets enhanced, hidden, and replaced
   by .ts-wrapper which mimics .swal2-input/.swal2-select exactly. */

/* Hide the original <select>. Swal's .swal2-select rules use !important,
   so we use position+visibility+size collapse on top of display:none for
   maximum reliability — Tom Select's own class .ts-hidden-accessible is
   added to the original element. */
.swal-field-group select.tomselected,
.swal-field-group select.ts-hidden-accessible,
select.tomselected,
select.ts-hidden-accessible {
    display: none !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
}

/* Wrapper takes full width like .swal2-select. */
.swal-field-group .ts-wrapper {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* The visible "field" — single source of border, bg, caret. */
.swal-field-group .ts-wrapper .ts-control {
    background-color: #2a2b35 !important;
    border: 1px solid #3f4250 !important;
    color: #fff !important;
    border-radius: 0.3125em !important;
    font-size: 1.125em !important;
    line-height: 1.4 !important;
    padding: 0.625rem 2.25rem 0.625rem 0.75rem !important;
    min-height: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
    /* Caret — single, same as .swal2-select */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 12px !important;
}

/* Strip any caret/border the TS theme might add to inner elements. */
.swal-field-group .ts-wrapper .ts-control::before,
.swal-field-group .ts-wrapper .ts-control::after,
.swal-field-group .ts-wrapper::before,
.swal-field-group .ts-wrapper::after {
    display: none !important;
    content: none !important;
}

/* Inner item / search input — no extra borders, transparent. */
.swal-field-group .ts-wrapper .ts-control > input,
.swal-field-group .ts-wrapper .ts-control > .item {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: inherit !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
}
.swal-field-group .ts-wrapper .ts-control > input::placeholder {
    color: #6b7280 !important;
}

/* Focus ring on the control. */
.swal-field-group .ts-wrapper.focus .ts-control,
.swal-field-group .ts-wrapper.dropdown-active .ts-control {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
    outline: none !important;
}
.swal-field-group .ts-wrapper.disabled .ts-control {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dropdown menu — floats on body via dropdownParent:'body' */
body > .ts-dropdown {
    z-index: 2000;
    background: #1e1f26 !important;
    border: 1px solid #3f4250 !important;
    border-radius: 0.3125em !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    color: var(--text-primary) !important;
    margin-top: 4px !important;
    padding: 4px 0 !important;
}
body > .ts-dropdown .option {
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
}
body > .ts-dropdown .option.active,
body > .ts-dropdown .option:hover {
    background: rgba(99, 102, 241, 0.18) !important;
    color: #fff !important;
}
body > .ts-dropdown .option.selected {
    background: rgba(99, 102, 241, 0.10) !important;
}
body > .ts-dropdown .no-results,
body > .ts-dropdown .optgroup-header {
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
body > .ts-dropdown .ts-dropdown-content {
    max-height: 240px;
}
/* Hide the redundant "— Выберите —" placeholder option from the menu */
body > .ts-dropdown .option[data-value=""] {
    display: none;
}

/* ====== Loaders & Transitions ====== */

/* Top progress bar */
.top-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 9999;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
    pointer-events: none;
}
.top-loader.loading {
    animation: topLoaderProgress 1.8s ease-in-out forwards;
}
.top-loader.done {
    width: 100% !important;
    opacity: 0;
    transition: width 0.15s ease, opacity 0.4s ease 0.15s;
}
@keyframes topLoaderProgress {
    0%   { width: 0; }
    20%  { width: 35%; }
    50%  { width: 60%; }
    80%  { width: 82%; }
    100% { width: 90%; }
}

/* Page content fade-in */
#page-content {
    opacity: 1;
    transition: opacity 0.18s ease;
}
#page-content.fade-out {
    opacity: 0;
}

/* DataTable processing overlay - modern */
.dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
    margin: 0 !important;
    padding: 1rem 2rem !important;
    background: rgba(15, 16, 21, 0.92) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 10px !important;
    color: var(--text-muted) !important;
    font-size: 0.85rem !important;
    backdrop-filter: blur(4px) !important;
    z-index: 50 !important;
    align-items: center !important;
    gap: 10px !important;
}
.dataTables_processing[style*="display: block"] {
    display: flex !important;
}
.dataTables_processing::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid #3f4250;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: dtSpin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes dtSpin {
    to { transform: rotate(360deg); }
}

/* Card body table area - relative for processing */
.card-body { position: relative; }

/* Skeleton shimmer */
.skeleton {
    background: linear-gradient(90deg, #1e1f26 25%, #2a2b35 50%, #1e1f26 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 6px;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Table skeleton rows */
.table-skeleton {
    padding: 0;
}
.table-skeleton .skel-row {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}
.table-skeleton .skel-row:last-child { border-bottom: none; }
.table-skeleton .skel-cell {
    height: 16px;
    border-radius: 4px;
    flex: 1;
}
.table-skeleton .skel-cell.sm { max-width: 50px; }
.table-skeleton .skel-cell.md { max-width: 120px; }
.table-skeleton .skel-cell.lg { max-width: 200px; }

/* Button loading state */
.btn.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: dtSpin 0.6s linear infinite;
}

/* Content area loading overlay (for full-card loads) */
.card-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 16, 21, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
    backdrop-filter: blur(2px);
}
.card-loading-overlay .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2b2d36;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: dtSpin 0.7s linear infinite;
}

/* Column filter banner */
.column-filter-banner {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    color: #e0e6ed;
    font-size: 0.9rem;
}
.column-filter-banner .fa-filter {
    color: #a855f7;
}
.column-filter-banner .reset-filter-btn {
    border-color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    padding: 2px 12px;
    transition: all 0.2s;
}
.column-filter-banner .reset-filter-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #ef4444;
    color: #fca5a5;
}

/* Click-to-copy chips (used in partners table for keys & wallets) */
.copy-chip-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.copy-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.05);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: fit-content;
    white-space: nowrap;
}
.copy-chip:hover {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.6);
}
.copy-chip:active {
    transform: scale(0.97);
}
.copy-chip .copy-chip-label {
    font-weight: 600;
    color: #a855f7;
}
.copy-chip code {
    color: #e0e6ed;
    background: transparent;
    padding: 0;
    font-size: 0.72rem;
}
/* Trailing copy icon hidden by default — the whole chip is clickable
   and the hover state already conveys the intent. Saves ~14px / chip. */
.copy-chip .fa-copy {
    display: none;
}
.copy-chip:hover .fa-copy {
    display: inline-block;
    color: #a855f7;
    opacity: 1;
    font-size: 0.7rem;
}
.copy-chip .badge {
    font-size: 0.6rem;
    padding: 1px 5px;
}

/* Center DataTable cell content both axes. */
.card-body table.table > tbody > tr > td,
.card-body table.table > thead > tr > th {
    vertical-align: middle !important;
    text-align: center !important;
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}
.card-body table.table > tbody > tr > td .copy-chip-stack,
.card-body table.table > tbody > tr > td .btn-group {
    justify-content: center;
}

/* ── Stores summary card ────────────────────────────────────────────── */
.stores-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 24px 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.22) 0%, rgba(102, 16, 242, 0.18) 100%);
    border: 1px solid rgba(96, 165, 250, 0.35);
    box-shadow: 0 4px 18px rgba(13, 110, 253, 0.18);
    position: relative;
    overflow: hidden;
}
.stores-summary::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px circle at 100% 0%, rgba(96, 165, 250, 0.22), transparent 45%);
    pointer-events: none;
}
.stores-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    position: relative;
    z-index: 1;
}
.stores-summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #cbd5e1;
}
.stores-summary-label i {
    color: #60a5fa;
    font-size: 1rem;
}
.stores-summary-value {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 2.1rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}
.stores-summary-currency {
    font-size: 1rem;
    font-weight: 700;
    color: #60a5fa;
    letter-spacing: 0.06em;
}
.stores-summary-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #cbd5e1;
}
.stores-summary-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.18);
}
.stores-summary-stat b {
    color: #f8fafc;
    font-weight: 700;
    margin-left: 2px;
}
.stores-summary-stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #64748b;
    display: inline-block;
}
.stores-summary-stat-dot.dot-open     { background: #60a5fa; box-shadow: 0 0 0 2px rgba(96,165,250,0.18); }
.stores-summary-stat-dot.dot-active   { background: #34d399; box-shadow: 0 0 0 2px rgba(52,211,153,0.18); }
.stores-summary-stat-dot.dot-negative { background: #f87171; box-shadow: 0 0 0 2px rgba(248,113,113,0.18); }

/* ── Negative-stores filter toggle button ────────────────────────── */
.btn-negative-filter {
    background: rgba(220, 38, 38, 0.10);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #fca5a5;
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: background 0.18s, border-color 0.18s, box-shadow 0.18s, color 0.18s;
    white-space: nowrap;
}
.btn-negative-filter:hover {
    background: rgba(220, 38, 38, 0.22);
    border-color: rgba(220, 38, 38, 0.65);
    color: #fca5a5;
}
.btn-negative-filter.active {
    background: rgba(220, 38, 38, 0.82);
    border-color: #dc2626;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.28), 0 2px 8px rgba(220, 38, 38, 0.35);
}
.btn-negative-filter.active:hover {
    background: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35), 0 2px 12px rgba(220, 38, 38, 0.45);
}

/* ── Negative-balance row highlight ──────────────────────────────────
   The custom `.table > :not(caption) > * > *` rule above resets the cell
   background to transparent, which silently overrides Bootstrap's
   `.table-danger` cell tint. Re-assert it with high specificity so rows
   flagged in createdRow() actually show red. */
table.dataTable tbody tr.table-danger,
table.dataTable tbody tr.table-danger > *,
.table-striped > tbody > tr.table-danger:nth-of-type(odd) > *,
.table-striped > tbody > tr.table-danger:nth-of-type(even) > * {
    background-color: rgba(220, 53, 69, 0.18) !important;
    color: #fecaca !important;
}
table.dataTable tbody tr.table-danger:hover,
table.dataTable tbody tr.table-danger:hover > * {
    background-color: rgba(220, 53, 69, 0.28) !important;
}
