* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #f3f8ff;
    color: #0f172a;
    font-family: Arial, "Microsoft YaHei", sans-serif;
}

a {
    color: #2563eb;
    text-decoration: none;
}

a:hover {
    color: #1d4ed8;
}

/* ===== Top Navigation: clean light blue theme ===== */
.site-topbar {
    width: 100%;
    min-height: 64px;
    background: linear-gradient(90deg, #2563eb, #38bdf8);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.20);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.site-title {
    font-size: 19px;
    font-weight: 800;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    white-space: nowrap;
}

.site-nav a {
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.site-nav a:hover {
    color: #e0f2fe;
}

.site-user {
    color: #eff6ff;
    font-size: 14px;
    font-weight: 700;
    padding-left: 22px;
    border-left: 1px solid rgba(255,255,255,.45);
    white-space: nowrap;
}

/* ===== Layout ===== */
.wrap {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 24px;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.stat .num {
    font-size: 30px;
    font-weight: 800;
    margin-top: 8px;
}

/* ===== Tables ===== */
.scroll,
.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
}

th, td {
    padding: 11px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #eff6ff;
    color: #0f172a;
    font-weight: 800;
    white-space: nowrap;
}

td {
    color: #111827;
}

.order-table {
    min-width: 1450px;
    table-layout: auto;
}

.order-table th,
.order-table td {
    white-space: nowrap;
}

.order-table .small {
    white-space: normal;
    line-height: 1.45;
}

/* ===== Forms ===== */
input, select, textarea {
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
}

textarea {
    padding: 10px 11px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
}

button,
.btn {
    min-height: 38px;
    padding: 0 15px;
    border: 0;
    border-radius: 9px;
    background: #2563eb;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    white-space: nowrap;
}

button:hover,
.btn:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.btn.gray,
button.gray {
    background: #64748b;
}

.btn.gray:hover,
button.gray:hover {
    background: #475569;
}

.action-form {
    display: inline-block;
    margin: 0;
}

.action-btn {
    min-width: 96px;
    height: 40px;
    white-space: nowrap;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.ok {
    background: #dcfce7;
    color: #166534;
}

.no {
    background: #fee2e2;
    color: #991b1b;
}

.warn {
    background: #fef3c7;
    color: #92400e;
}

.small {
    font-size: 12px;
    color: #64748b;
}

.formrow {
    margin-bottom: 14px;
}

.formrow label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

.formrow input {
    width: 100%;
}

.login,
.login-card {
    max-width: 480px;
    margin: 80px auto;
}

/* ===== Mobile ===== */
@media (max-width: 900px) {
    .site-topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 18px;
        gap: 12px;
    }

    .site-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 14px 18px;
        white-space: normal;
    }

    .site-user {
        padding-left: 0;
        border-left: 0;
    }

    .wrap {
        padding: 16px;
    }
}
