* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #f4f6f8;
    color: #20242b;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #dde3ea;
    display: flex;
    justify-content: space-between;
    padding: 14px 28px;
}

.brand {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

nav {
    display: flex;
    gap: 14px;
}

nav a {
    color: #3f556b;
    border-bottom: 2px solid transparent;
    padding-bottom: 4px;
    text-decoration: none;
}

nav a.active {
    border-color: #2563eb;
    color: #111827;
    font-weight: 700;
}

.wrap {
    margin: 0 auto;
    max-width: 1120px;
    padding: 28px;
}

.panel {
    background: #ffffff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    margin-bottom: 20px;
    padding: 24px;
}

h1,
h2 {
    margin: 0 0 18px;
}

h1 span {
    color: #65758b;
    font-size: 18px;
    font-weight: 400;
}

h2 span {
    color: #65758b;
    font-size: 14px;
    font-weight: 400;
}

.muted {
    color: #65758b;
    margin: -8px 0 18px;
}

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

.grid-form.compact {
    align-items: end;
    grid-template-columns: 1.5fr 1fr 1fr auto;
}

label {
    color: #455468;
    display: grid;
    gap: 6px;
    font-weight: 600;
}

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

input,
select {
    border: 1px solid #c8d1dc;
    border-radius: 6px;
    color: #111827;
    font: inherit;
    padding: 10px 12px;
    width: 100%;
}

.actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

button,
.button {
    background: #2563eb;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 700;
    padding: 10px 14px;
    text-decoration: none;
}

.button.secondary {
    background: #e8eef5;
    color: #233143;
}

.button.small {
    padding: 7px 10px;
}

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

.stats div {
    background: #f7f9fb;
    border: 1px solid #e1e7ee;
    border-radius: 8px;
    padding: 14px;
}

.stats span {
    color: #65758b;
    display: block;
    font-size: 12px;
    margin-bottom: 6px;
}

.stats strong {
    font-size: 20px;
}

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

th,
td {
    border-bottom: 1px solid #e1e7ee;
    padding: 10px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #455468;
    font-size: 12px;
    text-transform: uppercase;
}

td small {
    color: #65758b;
    display: block;
    margin-top: 3px;
}

.num {
    text-align: right;
}

.alert {
    background: #fff4e5;
    border: 1px solid #f6c16b;
    border-radius: 8px;
    color: #7a4100;
    margin-bottom: 18px;
    padding: 12px 14px;
}

@media (max-width: 760px) {
    .grid-form,
    .stats {
        grid-template-columns: 1fr;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .wrap {
        padding: 16px;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }
}
