:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --text: #1c2430;
    --muted: #667085;
    --line: #d9e2ec;
    --primary: #246bfe;
    --primary-dark: #1555d5;
    --paid: #149447;
    --refunded: #d92d20;
    --unpaid: #667085;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell,
.install-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.app-shell {
    padding: 38px 0;
}

.topbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.topbar p,
.install-head p {
    margin: 0 0 5px;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: 0;
}

.version-tag {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    vertical-align: middle;
}

h2 {
    margin: 22px 0 14px;
    font-size: 18px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-actions a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.top-actions button {
    padding: 10px 14px;
}

.query-panel,
.table-wrap,
.install-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(21, 39, 71, 0.08);
}

.query-panel {
    padding: 18px;
    margin-bottom: 18px;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.query-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 12px;
    margin-top: 8px;
}

.batch-form {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.batch-form button {
    justify-self: start;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 13px;
    background: #fff;
    color: var(--text);
    outline: none;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 107, 254, 0.14);
}

button {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    padding: 12px 16px;
}

button:hover {
    background: var(--primary-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.66;
}

.message,
.notice,
.alert {
    margin-top: 14px;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
}

.message.success,
.notice {
    background: #ecfdf3;
    color: #027a48;
}

.message.error,
.alert {
    background: #fef3f2;
    color: #b42318;
}

.table-wrap {
    overflow: hidden;
}

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

th,
td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f8fafc;
    color: #475467;
    font-size: 13px;
}

tr:last-child td {
    border-bottom: 0;
}

.status {
    font-weight: 800;
}

.status.paid {
    color: var(--paid);
}

.status.refunded {
    color: var(--refunded);
}

.status.unpaid {
    color: var(--unpaid);
}

.copy-order {
    max-width: 240px;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--primary);
    padding: 0;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-order:hover {
    background: transparent;
    color: var(--primary-dark);
    text-decoration: underline;
}

.delete-btn {
    background: #fff;
    border: 1px solid #fecdca;
    color: var(--refunded);
    padding: 8px 12px;
}

.delete-btn:hover {
    background: #fef3f2;
}

.empty {
    padding: 34px 16px;
    color: var(--muted);
    text-align: center;
}

.install-page {
    background: #eef3f8;
}

.install-shell {
    padding: 34px 0;
}

.install-panel {
    padding: 24px;
}

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

.grid {
    display: grid;
    gap: 14px;
}

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

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

.install-form button {
    margin-top: 8px;
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .query-row,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .batch-form button {
        justify-self: stretch;
    }

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

    table {
        min-width: 760px;
    }
}
