:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #687385;
    --line: #dfe4ea;
    --accent: #136f63;
    --accent-dark: #0e584f;
    --danger: #b42318;
    --danger-bg: #fff0ee;
    --shadow: 0 12px 32px rgba(23, 32, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 32px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 28px;
}

h2 {
    margin-bottom: 8px;
    font-size: 20px;
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.muted,
.subtext {
    color: var(--muted);
}

.subtext {
    display: block;
    margin-top: 4px;
    font-size: 13px;
}

.page {
    width: min(1240px, calc(100% - 32px));
    margin: 28px auto;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(440px, 100%);
}

.login-panel,
.search-bar,
.contact-panel,
.purchase-panel,
.empty-state {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-panel {
    padding: 30px;
}

.search-bar {
    padding: 22px;
}

label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    color: #303b4b;
    font-weight: 700;
}

input,
select {
    width: 100%;
    border: 1px solid #cbd3dd;
    border-radius: 6px;
    padding: 12px 13px;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(19, 111, 99, 0.15);
}

.search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) minmax(190px, 230px) auto;
    gap: 12px;
    align-items: end;
}

.sort-field {
    margin-bottom: 0;
    font-size: 13px;
}

.button,
.primary-button,
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 16px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.small-button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 12px;
}

.primary-button {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

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

.full-width {
    width: 100%;
}

.alert,
.notice {
    margin: 18px 0;
    border-radius: 8px;
    padding: 12px 14px;
}

.alert {
    border: 1px solid #f4b2ab;
    background: var(--danger-bg);
    color: var(--danger);
}

.notice {
    border: 1px solid #9fd8b4;
    background: #eefbf3;
    color: #17663a;
}

.setup-link {
    margin: 16px 0 0;
    text-align: center;
}

.empty-state {
    margin-top: 24px;
    padding: 28px;
}

.results-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 12px;
}

.results-head p {
    margin-bottom: 0;
}

.table-wrap {
    overflow-x: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef3f2;
    color: #303b4b;
    font-size: 13px;
}

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

.strong-link {
    color: var(--accent-dark);
    font-weight: 700;
    text-decoration: none;
}

.strong-link:hover {
    text-decoration: underline;
}

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

.pagination {
    justify-content: flex-end;
    margin-top: 16px;
}

.inline-form {
    margin-top: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 3px 8px;
    background: #eefbf3;
    color: #17663a;
    font-size: 12px;
    font-weight: 700;
}

.contact-action-form {
    margin-top: 10px;
}

.customer-layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) 1fr;
    gap: 22px;
    align-items: start;
}

.contact-panel,
.purchase-panel {
    padding: 22px;
}

dl {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 10px 14px;
    margin: 0 0 20px;
}

dt {
    color: var(--muted);
    font-weight: 700;
}

dd {
    margin: 0;
}

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

    .search-row,
    .customer-layout {
        grid-template-columns: 1fr;
    }

    .topbar {
        padding: 18px;
    }

    .page {
        width: min(100% - 20px, 1240px);
        margin-top: 18px;
    }

    h1 {
        font-size: 24px;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}
