body {
    background: #f3f5f9;
    color: #1f2937;
    font-family: Inter, Arial, sans-serif;
    margin: 0;
}

.app-shell {
    min-height: 100vh;
    padding: 20px 0 40px;
}

.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 18px;
}

.page-header {
    margin-bottom: 18px;
}

.brand-block h1 {
    margin: 0 0 8px;
    font-size: 32px;
    color: #101828;
}

.processing-line {
    color: #667085;
    font-size: 14px;
    margin-bottom: 4px;
}

.processing-btc {
    font-size: 24px;
    font-weight: 800;
    color: #101828;
    line-height: 1.1;
}

.card {
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 22px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    padding: 22px;
    margin-bottom: 18px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-title-row h2 {
    margin: 0;
    font-size: 24px;
    color: #101828;
}

.payout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.coin-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 24px;
    font-weight: 700;
}

.coin-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f7931a;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.label {
    color: #98a2b3;
    font-size: 14px;
    text-transform: uppercase;
    margin: 20px 0 8px;
}

.value-text {
    color: #101828;
    font-size: 20px;
    font-weight: 700;
    word-break: break-all;
}

.payments-head {
    align-items: flex-end;
}

.payments-head .left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tab-strip {
    display: inline-flex;
    gap: 8px;
    border: 1px solid #d0d5dd;
    background: #f8fafc;
    padding: 6px;
    border-radius: 14px;
}

.mini-tab {
    border: 0;
    background: transparent;
    color: #667085;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 16px;
    cursor: pointer;
}

.mini-tab.active {
    background: #4f67f6;
    color: #fff;
}

.earn-box {
    text-align: right;
}

.small-label {
    color: #98a2b3;
    font-size: 14px;
    margin-bottom: 6px;
}

.earn-big {
    font-size: 24px;
    font-weight: 800;
}

.payments-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.rows-control {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #344054;
}

.rows-control select {
    height: 40px;
    border-radius: 8px;
    border: 1px solid #d0d5dd;
    background: #fff;
    padding: 0 8px;
    font-size: 16px;
}

.payments-info {
    color: #344054;
    font-weight: 600;
}

.payments-pagination {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #101828;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.page-btn:hover:not(:disabled) {
    background: #eef2ff;
}

.page-btn.active {
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 6px;
    color: #667085;
}

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

.payments-table,
.workers-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th,
.payments-table td,
.workers-table th,
.workers-table td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid #eaecf0;
    vertical-align: top;
}

.payments-table th,
.workers-table th {
    font-size: 13px;
    color: #667085;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.muted-row {
    text-align: center;
    color: #98a2b3;
    padding: 24px !important;
}

.workers-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.segmented-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #f9fafb;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid #eaecf0;
}

.tab-btn {
    border: 0;
    background: transparent;
    color: #667085;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.tab-btn.active {
    background: #4f67f6;
    color: #fff;
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 14px;
    font-weight: 700;
}

.tab-btn.active .tab-count {
    background: rgba(255,255,255,0.18);
    color: #fff;
}

.tab-count.good { background: #ecfdf3; color: #12b76a; }
.tab-count.warn { background: #fff7ed; color: #f79009; }
.tab-count.bad { background: #fef3f2; color: #f04438; }
.tab-count.dark { background: #1d2939; color: #fff; }

.workers-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    width: 370px;
    max-width: 100%;
}

.search-box input {
    width: 100%;
    height: 54px;
    border-radius: 18px;
    border: 1px solid #d0d5dd;
    background: #fff;
    padding: 0 18px 0 52px;
    font-size: 17px;
    outline: none;
    box-sizing: border-box;
}

.search-box input:focus {
    border-color: #5b6ef5;
    box-shadow: 0 0 0 4px rgba(91, 110, 245, 0.08);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    fill: #98a2b3;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.status-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 16px;
    padding: 14px 18px;
    white-space: nowrap;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #98a2b3;
}

.status-dot.ok { background: #12b76a; }
.status-dot.error { background: #f04438; }
.status-dot.loading { background: #f79009; }

.col-name {
    min-width: 300px;
}

.worker-name {
    font-size: 16px;
    font-weight: 700;
    color: #101828;
}

.expand-btn {
    width: 18px;
    height: 18px;
    border: 0;
    background: transparent;
    margin-right: 8px;
    cursor: pointer;
    position: relative;
    top: 2px;
}

.expand-btn::before {
    content: "›";
    display: block;
    font-size: 22px;
    line-height: 1;
    color: #475467;
    transform: rotate(90deg);
    transition: transform .2s ease;
}

.expand-btn.open::before {
    transform: rotate(270deg);
}

.worker-expand-row.hidden {
    display: none;
}

.worker-expand-row td {
    background: #fafbff;
    padding: 18px !important;
}

.expanded-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
}

.expanded-box,
.asic-card {
    border: 1px solid #dbe1ea;
    background: #f8fafc;
    border-radius: 16px;
    padding: 18px;
}

.metric-pills {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.metric-pill {
    min-width: 150px;
    background: #fff;
    border: 1px solid #dfe3eb;
    border-radius: 14px;
    padding: 14px 16px;
}

.metric-pill.active {
    background: #eef2ff;
    border-color: #c7d2fe;
}

.metric-pill-title {
    color: #344054;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric-pill-value {
    color: #667085;
    font-size: 28px;
    font-weight: 800;
}

.chart-placeholder {
    width: 100%;
    height: 340px;
    border-radius: 16px;
    background:
        linear-gradient(to right, rgba(71,84,103,0.08) 1px, transparent 1px) 0 0 / 76px 100%,
        linear-gradient(to top, rgba(71,84,103,0.06) 1px, transparent 1px) 0 0 / 100% 50px,
        #fff;
    border: 1px solid #e4e7ec;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-empty {
    color: #667085;
    font-weight: 600;
    text-align: center;
    padding: 20px;
}

.chart-box {
    position: relative;
    width: 100%;
    height: 100%;
}

.chart-tooltip {
    position: absolute;
    z-index: 5;
    min-width: 170px;
    max-width: 240px;
    background: rgba(255,255,255,0.96);
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.16);
    padding: 10px 12px;
    font-size: 14px;
    color: #344054;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease;
    left: 0;
    top: 0;
}

.chart-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.big-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-area {
    fill: rgba(79, 103, 246, 0.18);
}

.chart-line {
    fill: none;
    stroke: #4f67f6;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point-dot {
    fill: #4f67f6;
    opacity: 0;
    transition: opacity .15s ease;
}

.chart-point-hit {
    fill: transparent;
    cursor: pointer;
}

.chart-point-group:hover .chart-point-dot {
    opacity: 1;
}

.sparkline-cell {
    color: #101828;
    width: 100px;
}

.sparkline {
    width: 72px;
    height: 20px;
    display: block;
}

.sparkline-empty {
    color: #98a2b3;
}

.asic-card h4 {
    margin: 0 0 18px;
    font-size: 22px;
}

.asic-label {
    color: #98a2b3;
    font-size: 14px;
    margin: 14px 0 6px;
}

.asic-value {
    color: #4f67f6;
    font-weight: 700;
    font-size: 18px;
    word-break: break-all;
}

.asic-note {
    margin-top: 16px;
    color: #4f67f6;
    font-size: 15px;
}

@media (max-width: 1100px) {
    .expanded-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .workers-top {
        align-items: stretch;
    }

    .workers-controls,
    .payments-controls {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        width: 100%;
    }

    .workers-table {
        min-width: 900px;
    }

    .payments-table {
        min-width: 600px;
    }

    .processing-btc {
        font-size: 20px;
    }

    .section-title-row h2 {
        font-size: 22px;
    }
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f5f9;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid #e4e7ec;
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(16,24,40,.08);
    padding: 28px;
}

.login-box h1 {
    margin: 0 0 10px;
    font-size: 32px;
    color: #101828;
}

.login-box p {
    margin: 0 0 18px;
    color: #667085;
}

.login-box input {
    width: 100%;
    height: 52px;
    border: 1px solid #d0d5dd;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 16px;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.login-box button {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 14px;
    background: #4f67f6;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.login-box button:hover {
    background: #4258de;
}

.login-error {
    margin-bottom: 14px;
    color: #f04438;
    font-weight: 600;
}

.header-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    border: 1px solid #d0d5dd;
    background: #fff;
    color: #344054;
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
}

.logout-btn:hover {
    background: #f8fafc;
}

.main-tabs {
    display: flex;
    gap: 34px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e4e7ec;
    padding-bottom: 8px;
}

.main-tab {
    border: 0;
    background: transparent;
    color: #8b8b8b;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 0 0 8px;
    position: relative;
}

.main-tab.active {
    color: #101828;
}

.main-tab.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 2px;
    background: #101828;
    border-radius: 2px;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
}

.dashboard-card {
    padding-top: 22px;
}

.dashboard-pills {
    margin-bottom: 18px;
}

.dashboard-chart {
    height: 420px;
}