* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f5f7fb;
    color: #172033;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.sidebar {
    width: 245px;
    background: #111827;
    color: white;
    padding: 24px 18px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 28px;
}

.brand-logo,
.login-logo {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg,#6366f1,#8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 20px;
}

.brand strong {
    display: block;
    font-size: 20px;
}

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

nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    color: #d1d5db;
    margin-bottom: 4px;
}

nav a:hover {
    background: #1f2937;
    color: white;
}

.nav-title {
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    padding: 23px 14px 7px;
}

.sidebar-user {
    margin-top: auto;
    border-top: 1px solid #263244;
    padding: 18px 8px 0;
}

.sidebar-user strong {
    display: block;
}

.sidebar-user span {
    color: #94a3b8;
    font-size: 12px;
}

.logout {
    margin-top: 10px;
    background: none;
    border: 0;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
}

.main {
    margin-left: 245px;
    width: calc(100% - 245px);
}

.topbar {
    height: 68px;
    background: white;
    border-bottom: 1px solid #e7eaf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
}

.content {
    padding: 30px;
    max-width: 1500px;
    margin: auto;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 20px;
}

.page-head h1 {
    margin: 0;
    font-size: 28px;
}

.page-head p {
    color: #7b8495;
    margin: 6px 0 0;
}

.btn {
    border: 1px solid #d8dde7;
    background: white;
    color: #253046;
    border-radius: 9px;
    min-height: 42px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    border-color: #4f46e5;
    background: #4f46e5;
    color: white;
}

.btn-danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

.btn-full {
    width: 100%;
}

.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.stat-card,
.panel {
    background: white;
    border: 1px solid #e7eaf0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15,23,42,.035);
}

.stat-card {
    padding: 23px;
}

.stat-label {
    color: #7c8799;
    font-size: 14px;
}

.stat-number {
    font-size: 32px;
    font-weight: 750;
    margin-top: 9px;
}

.panel {
    padding: 22px;
}

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

.panel-title h2 {
    margin: 0;
    font-size: 18px;
}

.panel-title a {
    color: #4f46e5;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    font-size: 12px;
    color: #7a8495;
    background: #fafbfc;
    padding: 13px 14px;
    white-space: nowrap;
}

td {
    border-top: 1px solid #edf0f4;
    padding: 14px;
    font-size: 14px;
    white-space: nowrap;
}

.status {
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-following {
    background: #eef2ff;
    color: #4338ca;
}

.status-closed {
    background: #ecfdf3;
    color: #067647;
}

.status-paused {
    background: #fff7ed;
    color: #c2410c;
}

.status-invalid {
    background: #f1f5f9;
    color: #64748b;
}

.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.filters input {
    flex: 1;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #d9dee8;
    border-radius: 9px;
    padding: 11px 12px;
    font-size: 14px;
    outline: none;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

.form-panel {
    max-width: 1000px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 7px;
}

.field-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.field-error,
.form-error {
    color: #be123c;
    font-size: 12px;
    margin-top: 6px;
}

.message {
    background: #ecfdf3;
    color: #067647;
    border: 1px solid #a7f3d0;
    padding: 12px 15px;
    border-radius: 9px;
    margin-bottom: 18px;
}

.empty {
    color: #8a94a5;
    text-align: center;
    padding: 35px;
}

.product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.product-item {
    background: #f4f5f8;
    border-radius: 9px;
    padding: 9px 13px;
}

.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top left,#ede9fe,transparent 35%),
        radial-gradient(circle at bottom right,#dbeafe,transparent 35%),
        #f8fafc;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 410px;
    background: white;
    padding: 38px;
    border-radius: 22px;
    box-shadow: 0 25px 70px rgba(15,23,42,.12);
}

.login-logo {
    margin-bottom: 22px;
}

.login-card h1 {
    font-size: 25px;
    margin: 0;
}

.login-card p {
    color: #7b8495;
    margin: 8px 0 26px;
}

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

.login-card .btn {
    margin-top: 22px;
}

.mobile-title {
    font-weight: 700;
}

@media (max-width: 800px) {

    .sidebar {
        width: 78px;
        padding: 20px 10px;
    }

    .brand div:last-child,
    .sidebar nav a,
    .nav-title,
    .sidebar-user > div {
        font-size: 0;
    }

    .brand {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    nav a {
        text-align: center;
        font-size: 11px;
        padding: 10px 4px;
    }

    nav a:nth-child(1)::after {
        content: "首页";
    }

    nav a:nth-child(2)::after {
        content: "客户";
    }

    nav a:nth-child(3)::after {
        content: "新增";
    }

    .main {
        margin-left: 78px;
        width: calc(100% - 78px);
    }

    .content {
        padding: 18px;
    }

    .topbar {
        padding: 0 18px;
    }

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

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

    .field-wide {
        grid-column: auto;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }
}

.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(340px, .7fr);
    gap: 22px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.info-grid div {
    background: #f8fafc;
    padding: 14px;
    border-radius: 10px;
}

.info-grid span {
    display: block;
    color: #7b8495;
    font-size: 12px;
    margin-bottom: 5px;
}

.timeline-item {
    padding: 17px 0;
    border-bottom: 1px solid #edf0f4;
}

.timeline-item:first-child {
    padding-top: 0;
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.timeline-head span {
    color: #8a94a5;
    font-size: 12px;
}

.timeline-content {
    margin-top: 10px;
    line-height: 1.7;
}

.timeline-meta {
    margin-top: 9px;
    color: #8a94a5;
    font-size: 12px;
}

@media (max-width: 1000px) {

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

}

@media (max-width: 600px) {

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

}
