.coin-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === Page header === */
.coin-page-header {
    margin-bottom: 1.5rem;
}

.coin-page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.coin-page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.25rem 0;
}

.coin-subtitle {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin: 0;
}

/* === Stats === */
.coin-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.15rem;
}

/* === Coin grid (index page) === */
.coin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.coin-card-link {
    text-decoration: none;
    color: inherit;
}

.coin-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    border: 1px solid #f0f0f0;
}

.coin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: #e0e0e0;
}

.coin-card-header {
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
}

.coin-card-name {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.coin-symbol-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.coin-symbol-badge-lg {
    width: 48px;
    height: 48px;
    font-size: 0.9rem;
    border-radius: 12px;
}

.coin-symbol-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.coin-name-secondary {
    font-size: 0.78rem;
    color: #7f8c8d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.coin-name {
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
}

/* === Search & Filters === */
.coin-filters {
    margin-bottom: 1.5rem;
}

.coin-filter-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.coin-search-group {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.coin-filter-group {
    min-width: 160px;
}

.coin-filter-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 0.3rem;
}

.coin-filter-select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
    color: #2c3e50;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
}

.coin-filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.coin-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #dc2626;
    text-decoration: none;
    background: #fee2e2;
    transition: all 0.2s;
    white-space: nowrap;
    height: fit-content;
}

.coin-filter-reset:hover {
    background: #fecaca;
    color: #b91c1c;
}

.coin-search-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    background: white;
    color: #2c3e50;
    outline: none;
    transition: border-color 0.2s;
}

.coin-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.coin-search-input::placeholder {
    color: #adb5bd;
}

/* === Pagination === */
.coin-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.coin-pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: #475569;
    background: white;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
    position: static;
}

.coin-pagination .page-link:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
}

.coin-pagination .page-current {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: transparent;
    pointer-events: none;
}

.coin-pagination .page-dots {
    color: #adb5bd;
    padding: 0 0.25rem;
}

.chain-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    justify-content: flex-end;
}

.chain-badge-more {
    background-color: #e5e7eb;
    color: #4b5563;
}

.chain-badge {
    display: inline-block;
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 500;
}

.coin-card-body {
    padding: 0.75rem 1.25rem 1rem;
}

.coin-card-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.meta-item {
    font-size: 0.82rem;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.coin-card-contract {
    margin-top: 0.5rem;
}

.coin-card-contract code {
    font-size: 0.75rem;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* === Detail page header === */
.coin-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.coin-detail-title {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.coin-detail-title h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
}

.coin-detail-name {
    font-weight: 400;
    font-size: 1.1rem;
    color: #7f8c8d;
}

.coin-disabled-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fee2e2;
    color: #dc2626;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-back:hover {
    background: #e2e8f0;
    color: #334155;
}

/* === Admin actions === */
.coin-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.coin-toggle-form {
    margin: 0;
}

.btn-disable-coin,
.btn-enable-coin {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-disable-coin {
    background: #fee2e2;
    color: #dc2626;
}

.btn-disable-coin:hover {
    background: #fecaca;
    color: #b91c1c;
}

.btn-enable-coin {
    background: #dcfce7;
    color: #166534;
}

.btn-enable-coin:hover {
    background: #bbf7d0;
    color: #14532d;
}

/* === Info row === */
.coin-info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: white;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.info-card-label {
    font-size: 0.78rem;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.info-card-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
}

/* Правка значения карточки: текст с карандашом, поле — только после клика */
.info-card-editable {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* display: flex у author-стилей перебивает [hidden] браузера — гасим вручную */
.info-card-editable[hidden],
.info-card-edit-form[hidden] {
    display: none;
}

.btn-inline-edit,
.btn-inline-save,
.btn-inline-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.btn-inline-edit:hover {
    background: #f1f5f9;
    color: #3498db;
}

.btn-inline-save {
    color: #22c55e;
}

.btn-inline-save:hover {
    background: #f0fdf4;
}

.btn-inline-cancel:hover {
    background: #fef2f2;
    color: #ef4444;
}

.info-card-edit-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.info-card-edit-input {
    width: 100%;
    min-width: 0;
    padding: 0.2rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 700;
    transition: border-color 0.15s ease;
}

.info-card-edit-input:focus {
    outline: none;
    border-color: #3498db;
}

/* === Contract block === */
.contract-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.contract-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #7f8c8d;
}

.contract-value {
    font-size: 0.82rem;
    color: #2c3e50;
    background: #f8f9fa;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    word-break: break-all;
    font-family: 'Roboto Mono', monospace;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #475569;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* === Sections === */
.coin-section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chains-table td {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

.chains-table .chain-badge {
    font-size: 0.72rem;
}

.chains-table .chain-main {
    margin-left: 0.3rem;
    font-size: 0.65rem;
    color: #7f8c8d;
    text-transform: uppercase;
}

.chain-contract-form {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chain-contract-form input[type="text"] {
    flex: 1 1 auto;
    min-width: 300px;
    padding: 0.25rem 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    border: 1px solid #dfe4ea;
    border-radius: 5px;
    background: #fff;
    color: #2c3e50;
}

.chains-table-actions {
    width: 1%;
    white-space: nowrap;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.4rem;
    border: 1px solid #dfe4ea;
    border-radius: 5px;
    background: #fff;
    color: #2980b9;
    cursor: pointer;
    font-size: 0.8rem;
}

.btn-icon:hover {
    background: #f1f6fb;
}

.btn-icon-danger {
    color: #c0392b;
}

.btn-icon-danger:hover {
    background: #fdf0ee;
}

.add-exchange-form .chain-contract-field input[type="text"] {
    min-width: 340px;
}

.chains-empty {
    margin: 0;
    font-size: 0.8rem;
    color: #7f8c8d;
}

.scan-exchanges-form {
    margin: 0 0 0 auto;
}

.btn-scan-exchanges {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #2980b9;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-scan-exchanges:hover {
    background: #eaf3fa;
    border-color: #2980b9;
}

.btn-scan-exchanges:disabled {
    opacity: 0.6;
    cursor: progress;
}

.section-count {
    background-color: #e9ecef;
    color: #495057;
    padding: 0.1rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* === Table === */
.table-responsive {
    overflow-x: auto;
    border-radius: 10px;
}

.coin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    font-size: 0.85rem;
}

.coin-table thead {
    background-color: #f8f9fa;
}

.coin-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #8a8a9a;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.coin-table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.coin-table tbody tr:last-child td {
    border-bottom: none;
}

.coin-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Ссылки-иконки в первой колонке таблицы спредов: график спреда и анализ
   прибыльности связки. Идут в ряд, цвет наследуют от обычных ссылок таблицы,
   чтобы читаться как пара. */
.row-links {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.row-links a {
    display: inline-flex;
    line-height: 1;
}

/* === Exchange cell === */
.exchange-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exchange-logo-sm {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.exchange-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
}

.exchange-link:hover {
    text-decoration: underline;
    color: #3498db;
}

.tier-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 600;
    color: white;
}

.tier-badge.tier-1 { background-color: #27ae60; }
.tier-badge.tier-2 { background-color: #f39c12; }
.tier-badge.tier-3 { background-color: #e74c3c; }
.tier-badge.tier-4 { background-color: #7f8c8d; }

/* === Trade types === */
.trade-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.trade-type-item {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.trade-type-delete-form {
    display: inline;
    margin: 0;
}

.btn-trade-type-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #b91c1c;
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-trade-type-delete:hover {
    opacity: 1;
    background: #fee2e2;
}

.trade-type-add-form {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
}

.trade-type-add-select {
    padding: 0.1rem 0.35rem;
    border: 1px dashed #cbd5e1;
    border-radius: 50px;
    background: transparent;
    color: #475569;
    font-size: 0.72rem;
    cursor: pointer;
}

.btn-trade-type-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #166534;
    font-size: 0.6rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.btn-trade-type-add:hover {
    opacity: 1;
    background: #dcfce7;
}

.trade-type-link {
    text-decoration: none;
    transition: opacity 0.2s;
}

.trade-type-link:hover {
    opacity: 0.8;
}

.trade-type-badge {
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 500;
}

.trade-type-badge.trade-type-spot {
    background-color: #dcfce7;
    color: #166534;
}

.trade-type-badge.trade-type-futures,
.trade-type-badge.trade-type-фьючерсы {
    background-color: #fef3c7;
    color: #92400e;
}

.trade-type-delisted {
    text-decoration: line-through;
    opacity: 0.5;
}

/* === API icon inside trade type badge === */
.api-icon {
    margin-left: 0.25rem;
    font-size: 0.7rem;
}

.api-icon-ok {
    color: #166534;
}

.api-icon-partial {
    color: #92400e;
}

/* === Deposit / withdraw flags (per exchange, from the spot market) === */
.th-hint-icon {
    font-size: 0.7rem;
    opacity: 0.6;
    cursor: help;
}

.wallet-cell {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    white-space: nowrap;
}

.wallet-flag {
    font-size: 0.78rem;
    line-height: 1.4;
}

.wallet-flag i {
    font-size: 0.72rem;
}

.wallet-flag-ok {
    color: #166534;
}

.wallet-flag-off {
    color: #dc2626;
}

.wallet-flag-unknown {
    color: #9ca3af;
}

/* === Price cells === */
.askbid-cell {
    white-space: nowrap;
}

.askbid-cell .ask,
.askbid-cell .bid {
    display: block;
    font-size: 0.78rem;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.4;
}

.askbid-cell .ask { color: #16a34a; }
.askbid-cell .bid { color: #dc2626; }

/* Цена по типам торговли: спот и фьючерс стоят по-разному, поэтому каждый
   рынок занимает свою строку — «Spot: ask / bid». */
.price-tt,
.updated-tt {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    white-space: nowrap;
    line-height: 1.4;
}

.price-tt + .price-tt,
.updated-tt + .updated-tt {
    margin-top: 0.25rem;
}

.price-tt .trade-type-label,
.updated-tt .trade-type-label {
    color: #7f8c8d;
    font-weight: 500;
    font-size: 0.72rem;
}

.askbid-inline {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
}

.askbid-inline .ask { color: #16a34a; }
.askbid-inline .bid { color: #dc2626; }
.askbid-inline .askbid-sep { color: #b0b7bd; }

/* === Идентичность монеты на бирже === */
.identity-icon {
    margin-left: 0.25rem;
    font-size: 0.72rem;
}

/* Доказанное расхождение: биржа торгует другим контрактом в сети монеты. */
.identity-icon-conflict { color: #dc2626; }

/* Расхождение без общей сети — требует проверки человеком. */
.identity-icon-suspect { color: #d97706; }

.identity-icon-verified { color: #16a34a; }

/* === Volume === */
.volume-cell {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.volume-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
}

/* === Funding === */
.funding-rate {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.82rem;
    font-weight: 600;
}

.funding-rate.positive { color: #16a34a; }
.funding-rate.negative { color: #dc2626; }

/* Ставка и период — одной строкой («+0.0100% / 8 ч»), отсчёт до списания — под ними. */
.funding-tt {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0.3rem;
    line-height: 1.4;
    white-space: nowrap;
}

.funding-interval,
.funding-countdown {
    font-size: 0.72rem;
    color: #7f8c8d;
}

.funding-countdown {
    flex-basis: 100%;
}

/* === Max position === */
.max-pos-usd {
    display: block;
    font-size: 0.72rem;
    color: #7f8c8d;
}

/* === Spread cells === */
.spread-pct {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
}

.spread-pct-reverse {
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0.8;
}

.spread-pct.positive,
.spread-pct-reverse.positive { color: #16a34a; }
.spread-pct.negative,
.spread-pct-reverse.negative { color: #dc2626; }

.spread-ext-col {
    display: flex;
    flex-direction: column;
}

.spread-pct-minmax {
    font-size: 0.78rem;
    white-space: nowrap;
    opacity: 0.75;
}

.spread-pct-minmax.positive { color: #16a34a; }
.spread-pct-minmax.negative { color: #dc2626; }

/* === Exchange badges === */
.exchange-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-1 {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-2 {
    background-color: #fef3c7;
    color: #92400e;
}

/* === Time info === */
.time-info {
    font-size: 0.82rem;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    white-space: nowrap;
}

.date-info {
    font-size: 0.72rem;
    color: #7f8c8d;
}

/* === Listing dates === */
.listing-dates {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.listing-date-item {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    line-height: 1.3;
}

.listing-date-item .date-main {
    font-size: 0.82rem;
    font-weight: 500;
    color: #2c3e50;
}

.listing-date-item .date-time {
    font-size: 0.72rem;
    color: #7f8c8d;
}

/* Плановый делистинг — предупреждение под датой листинга */
.listing-date-item-delist .date-main {
    color: #c0392b;
}

/* === Text muted === */
.text-muted {
    color: #adb5bd;
}

/* === Empty state === */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0;
    font-size: 1rem;
}

/* === Fetch price button === */
.fetch-price-form {
    display: inline-block;
    margin-top: 0.25rem;
}

.btn-fetch-price {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #2980b9;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-fetch-price:hover {
    background: #eaf4fb;
    border-color: #2980b9;
}

.btn-fetch-price i {
    font-size: 0.9rem;
}

/* === Max position refresh (matching listing page) === */
.bingx-refresh-form {
    display: inline-block;
}

.btn-bingx-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #2980b9;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-bingx-refresh:hover {
    background: #eaf4fb;
    border-color: #2980b9;
}

.btn-bingx-refresh i {
    font-size: 0.9rem;
}

.max-position-tt {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.25rem;
    font-size: 0.78rem;
}

.max-position-tt .trade-type-label {
    color: #7f8c8d;
    font-weight: 500;
}

.max-position-tt .max-pos-usd {
    white-space: nowrap;
}

.max-pos-coin {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.78rem;
}

/* === Responsive === */
@media (max-width: 768px) {
    .coin-container {
        padding: 1rem;
    }

    .coin-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .coin-info-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .coin-grid {
        grid-template-columns: 1fr;
    }

    .contract-block {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* === Add exchange form (admin) === */
.add-exchange-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.add-exchange-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.add-exchange-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.add-exchange-field select,
.add-exchange-field input[type="text"] {
    padding: 0.45rem 0.6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #fff;
    color: #1e293b;
}

.add-exchange-field select:focus,
.add-exchange-field input[type="text"]:focus {
    outline: none;
    border-color: #2980b9;
}

.add-exchange-checkbox {
    justify-content: flex-end;
}

.add-exchange-checkbox label {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: #334155;
    display: flex;
}

.btn-add-exchange {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border: none;
    border-radius: 6px;
    background: #2980b9;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-add-exchange:hover {
    background: #216394;
}

.add-exchange-empty {
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* Пояснение под формой: занимает всю ширину flex-строки */
.add-exchange-hint {
    flex-basis: 100%;
    margin: 0;
    font-size: 0.8rem;
}

.add-exchange-trade-types {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.85rem;
    padding: 0.35rem 0;
}

.trade-type-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #334155;
    cursor: pointer;
}

/* === Spread delete button (admin) === */
.spread-delete-form {
    display: inline;
    margin: 0;
}

.btn-spread-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-spread-delete:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* === Spread parser controls (admin) === */
.parser-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.parser-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: #dbeafe;
    color: #1e40af;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.spread-parser-add-form,
.spread-parser-server-form {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.parser-icon {
    color: #1e40af;
    font-size: 0.8rem;
}

.parser-server-select {
    padding: 0.2rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-size: 0.75rem;
}

.btn-parser-on,
.btn-parser-off {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-parser-on {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.btn-parser-on:hover {
    background: #bbf7d0;
}

.btn-parser-off {
    background: transparent;
    color: #b91c1c;
    opacity: 0.6;
}

.btn-parser-off:hover {
    opacity: 1;
    background: #fee2e2;
}

.btn-parser-errors {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: #d97706;
    background: transparent;
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.7;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-parser-errors:hover {
    opacity: 1;
    background: #fef3c7;
}

/* === CoinExchange parse toggle (admin) === */
.parse-toggle-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.parse-switch {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
}

.parse-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.parse-slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #cbd5e1;
    border-radius: 50px;
    transition: background 0.15s ease;
}

.parse-slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 2px;
    top: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.parse-switch input:checked + .parse-slider {
    background: #22c55e;
}

.parse-switch input:checked + .parse-slider::before {
    transform: translateX(16px);
}

.parse-comment-form {
    margin: 0.3rem 0 0;
}

.parse-comment-input {
    width: 110px;
    max-width: 100%;
    padding: 0.15rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-size: 0.72rem;
    transition: border-color 0.15s ease;
}

.parse-comment-input::placeholder {
    color: #94a3b8;
}

.parse-comment-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Символ монеты на бирже — редактируется прямо в строке таблицы */
.exchange-symbol-form {
    margin: 0.3rem 0 0;
}

.exchange-symbol-input {
    width: 110px;
    max-width: 100%;
    padding: 0.15rem 0.4rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1e293b;
    font-size: 0.72rem;
    transition: border-color 0.15s ease;
}

.exchange-symbol-input::placeholder {
    color: #94a3b8;
}

.exchange-symbol-input:focus {
    outline: none;
    border-color: #3498db;
}

.exchange-symbol-text {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
}

/* Удаление биржи у монеты — иконка появляется при наведении на строку */
.exchange-delete-form {
    margin: 0 0 0 auto;
}

.btn-exchange-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font-size: 0.75rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.coin-table tbody tr:hover .btn-exchange-delete,
.btn-exchange-delete:focus {
    opacity: 1;
}

.btn-exchange-delete:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* === Spread server errors page === */
.spread-errors-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.spread-errors-coin {
    font-weight: 700;
    font-size: 1rem;
    margin-right: 0.25rem;
}

.spread-errors-arrow {
    color: #94a3b8;
    margin: 0 0.15rem;
}

.spread-errors-message {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #b91c1c;
    max-width: 640px;
}
