* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f5f6f8;
    color: #17191c;
}

a {
    color: inherit;
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    min-width: 240px;
    background: #111315;
    color: #fff;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.brand-icon,
.login-logo {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #fff;
    color: #111315;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.brand strong {
    display: block;
}

.brand span {
    display: block;
    color: #94999f;
    font-size: 12px;
    margin-top: 2px;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

nav a,
nav .disabled {
    padding: 11px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14px;
}

nav a:hover {
    background: #22262a;
}

nav .disabled {
    color: #656b72;
    cursor: not-allowed;
}

.sidebar-bottom {
    margin-top: auto;
    font-size: 13px;
    color: #a8adb2;
}

.sidebar-bottom a {
    display: block;
    margin-top: 9px;
    color: #fff;
}

.content {
    flex: 1;
    min-width: 0;
    padding: 34px;
    overflow: auto;
}

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

.page-header h1 {
    margin: 0;
    font-size: 29px;
}

.page-header p {
    margin: 6px 0 0;
    color: #73777c;
}

.stats {
    display: grid;
    grid-template-columns:
        repeat(
            auto-fit,
            minmax(180px, 1fr)
        );
    gap: 15px;
    margin-bottom: 24px;
}

.stat-card,
.panel {
    background: #fff;
    border: 1px solid #e4e6e9;
    border-radius: 13px;
}

.stat-card {
    padding: 20px;
}

.stat-card span {
    display: block;
    color: #72777d;
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin-top: 9px;
    font-size: 26px;
}

.panel {
    overflow: hidden;
}

.panel-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #eceef0;
}

.panel-header h2,
.detail-card h2 {
    margin: 0;
    font-size: 17px;
}

.panel-header a {
    color: #4058c7;
    text-decoration: none;
    font-size: 14px;
}

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: left;
    background: #fafafa;
    color: #696e74;
    font-weight: 600;
}

th,
td {
    padding: 13px 15px;
    border-bottom: 1px solid #eceef0;
    white-space: nowrap;
}

tbody tr:hover {
    background: #fafbfc;
}

.order-link {
    color: #4058c7;
    text-decoration: none;
}

.order-link:hover {
    text-decoration: underline;
}

.status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #eef0f2;
    font-size: 12px;
}

.status-finished {
    background: #e8f7ee;
    color: #177441;
}

.status-failed,
.status-refunded,
.status-expired {
    background: #fdecec;
    color: #a92c2c;
}

.status-partially_paid {
    background: #fff5df;
    color: #8c6111;
}

.status-waiting,
.status-confirming,
.status-confirmed,
.status-sending {
    background: #edf1ff;
    color: #4257a8;
}

.status-abandoned {
    background: #f0f0f0;
    color: #666;
}

.empty {
    padding: 25px;
    color: #878b90;
    text-align: center;
}

.search-form {
    display: flex;
    gap: 9px;
    margin-bottom: 18px;
}

.search-form input {
    width: min(620px, 100%);
}

input {
    border: 1px solid #d5d8dc;
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
}

input:focus {
    border-color: #747d8a;
    box-shadow: 0 0 0 3px rgba(70, 88, 190, .08);
}

button {
    border: 0;
    background: #16191c;
    color: #fff;
    border-radius: 8px;
    padding: 11px 18px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #292d31;
}

.detail-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 2fr)
        minmax(280px, 1fr);
    gap: 18px;
}

.detail-card {
    padding: 22px;
}

dl {
    display: grid;
    grid-template-columns:
        150px
        minmax(0, 1fr);
    gap: 13px;
    margin: 22px 0 0;
}

dt {
    color: #777c82;
}

dd {
    margin: 0;
    word-break: break-word;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #f3f4f6;
}

.login-card {
    width: min(
        390px,
        calc(100% - 32px)
    );
    padding: 34px;
    background: #fff;
    border: 1px solid #e1e3e6;
    border-radius: 16px;
    box-shadow:
        0 18px 50px rgba(0, 0, 0, .07);
}

.login-card h1 {
    margin: 18px 0 4px;
}

.login-card p {
    margin: 0 0 26px;
    color: #787d83;
}

.login-card label {
    display: block;
    margin: 15px 0 7px;
    font-size: 13px;
}

.login-card input,
.login-card button {
    width: 100%;
}

.login-card button {
    margin-top: 20px;
}

.alert-error {
    background: #fdeeee;
    color: #a52c2c;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}

@media (max-width: 800px) {

    .sidebar {
        display: none;
    }

    .content {
        padding: 20px 14px;
    }

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

    .stats {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    dl {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    dd {
        margin-bottom: 10px;
    }
}


/* ==========================================================
   B10-C Operations Console
   ========================================================== */

.nav-section {
    margin: 20px 14px 7px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    opacity: .45;
}

.sidebar nav a.active {
    background: rgba(255,255,255,.11);
    font-weight: 600;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 22px;
}

.page-head h1 {
    margin-bottom: 5px;
}

.page-head p {
    margin: 0;
    opacity: .62;
}

.filterbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.filterbar input,
.filterbar select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background: #fff;
}

.filterbar input {
    min-width: 260px;
}

.filterbar button {
    min-height: 40px;
    padding: 9px 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-wrap table {
    width: 100%;
    min-width: 900px;
}

.table-wrap th {
    white-space: nowrap;
}

.table-wrap td {
    vertical-align: top;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-failed {
    background: #f4e9e9;
}

.muted {
    opacity: .55;
    font-size: 12px;
}

.mono {
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        monospace;
}

.error-text {
    margin-top: 5px;
    font-size: 12px;
    opacity: .7;
}

.empty-state {
    padding: 42px 20px;
    text-align: center;
    opacity: .5;
}

.package-grid {
    display: grid;
    grid-template-columns:
        repeat(
            3,
            minmax(0, 1fr)
        );
    gap: 18px;
}

.package-card {
    padding: 22px;
    border: 1px solid #e3e6ec;
    border-radius: 14px;
    background: #fff;
}

.package-top {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.package-top h2 {
    margin: 3px 0 0;
}

.package-price {
    font-size: 28px;
    font-weight: 700;
}

.package-price span {
    display: block;
    font-size: 10px;
    text-align: right;
    opacity: .5;
}

.package-card dl {
    margin-top: 20px;
}

.package-card dt {
    font-size: 12px;
    opacity: .55;
}

.package-card dd {
    margin: 2px 0 13px;
    font-weight: 600;
}

@media (max-width: 1100px) {

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


/* ==========================================================
   B10-C2 Deep Operations
   ========================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 13px;
    opacity: .62;
}

.secondary-button {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
}

.operations-section {
    margin-top: 20px;
}

.operations-section h2 {
    display: flex;
    align-items: center;
    gap: 9px;
}

.count-badge {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 11px;
}

.timeline {
    max-width: 1050px;
}

.timeline-row {
    display: grid;
    grid-template-columns:
        190px
        24px
        minmax(0, 1fr);
    gap: 10px;
    min-height: 82px;
}

.timeline-time {
    padding-top: 10px;
    text-align: right;
    font-size: 12px;
    opacity: .56;
}

.timeline-dot {
    position: relative;
}

.timeline-dot::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.timeline-dot::after {
    content: "";
    position: absolute;
    top: 23px;
    bottom: -14px;
    left: 11px;
    width: 1px;
    background: #dfe3ea;
}

.timeline-row:last-child
.timeline-dot::after {
    display: none;
}

.timeline-card {
    margin-bottom: 14px;
    padding: 12px 15px;
    border: 1px solid #e3e6ec;
    border-radius: 10px;
    background: #fff;
}

.timeline-category {
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .45;
}

.timeline-detail {
    margin-top: 5px;
    font-size: 13px;
    opacity: .68;
}

@media (max-width: 760px) {

    .timeline-row {
        grid-template-columns:
            1fr;
        gap: 3px;
    }

    .timeline-time {
        text-align: left;
    }

    .timeline-dot {
        display: none;
    }
}
