* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #1f2933;
    background: #f5f7f8;
}

.topbar {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #16212a;
    color: #fff;
}

.brand {
    font-weight: 700;
    letter-spacing: .02em;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

.page-spacer {
    height: 14px;
}

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

.admin-tools {
    align-items: stretch;
}

.panel {
    background: #fff;
    border: 1px solid #dfe5ea;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(18, 35, 48, .06);
}

.login-panel {
    max-width: 420px;
    margin: 80px auto;
}

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

.stack,
.form-grid {
    display: grid;
    gap: 14px;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    align-items: end;
}

.license-form {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) minmax(120px, .8fr) minmax(220px, 1.4fr);
    gap: 18px 16px;
    align-items: end;
}

.license-form label:nth-of-type(4) {
    grid-column: 1 / span 2;
}

.license-form .form-actions {
    grid-column: 3;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(160px, .9fr) minmax(140px, .8fr);
    gap: 18px 16px;
    align-items: end;
}

.form-actions {
    display: flex;
    align-items: end;
}

.form-actions button {
    width: 100%;
}

label {
    display: grid;
    gap: 9px;
    font-size: 13px;
    color: #52616b;
    min-width: 0;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cfd8df;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
}

button {
    border: 0;
    border-radius: 8px;
    min-height: 42px;
    padding: 10px 14px;
    color: #fff;
    background: #1f9d55;
    cursor: pointer;
    font-weight: 650;
}

button:hover {
    background: #18864a;
}

.link-button {
    background: transparent;
    color: #dce8ef;
    padding: 6px 0;
}

.alert,
.notice {
    padding: 11px 13px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.alert {
    background: #fff0f0;
    color: #b42318;
}

.notice {
    background: #e9f8ef;
    color: #146c3a;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 8px;
}

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

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

th {
    color: #64727d;
    font-weight: 700;
    background: #f8fafb;
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.badge {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.status-unused {
    background: #edf2f7;
    color: #52616b;
}

.status-active {
    background: #e3f7e8;
    color: #137333;
}

.status-disabled,
.status-expired {
    background: #fde8e8;
    color: #b42318;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions button {
    padding: 7px 10px;
    font-size: 12px;
    background: #405261;
}

.activation-row {
    background: #fbfcfd;
    color: #64727d;
}

.empty {
    text-align: center;
    color: #8a99a5;
    padding: 32px;
}

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

    .license-form label:nth-of-type(4),
    .license-form .form-actions,
    .search-form .form-actions {
        grid-column: auto;
    }
}
