* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    color: #252525;
    background: #f3f4f3;
}

a {
    color: #4b4b4b;
    text-decoration: none;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 74px;
    padding: 12px 28px;
    background: #ffffff;
    border-bottom: 1px solid #d8d8d8;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    font-weight: 700;
    color: #1f1f1f;
}

.brand img {
    display: block;
    width: 148px;
    max-height: 46px;
    object-fit: contain;
}

.brand span {
    padding-left: 16px;
    border-left: 1px solid #d0d0d0;
    font-size: 21px;
    letter-spacing: 0;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
}

.topbar nav a {
    border-radius: 999px;
    padding: 8px 11px;
}

.topbar nav a:hover {
    background: #eeeeee;
}

.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 28px 28px 48px;
}

.panel {
    background: #ffffff;
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.05);
}

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

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

input,
select,
textarea,
button {
    width: 100%;
    min-height: 42px;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    padding: 9px 11px;
    font: inherit;
    background: #ffffff;
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
}

textarea {
    min-height: 90px;
}

button {
    cursor: pointer;
    border-color: #3f3d3d;
    background: #3f3d3d;
    color: #ffffff;
    font-weight: 700;
}

button:hover {
    background: #242424;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border-radius: 6px;
    padding: 9px 14px;
    background: #3f3d3d;
    color: #ffffff;
    font-weight: 700;
}

.button-link:hover {
    background: #242424;
}

.form-row {
    margin-bottom: 14px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
}

.table th,
.table td {
    padding: 11px 12px;
    border-bottom: 1px solid #e2e2e2;
    text-align: left;
    vertical-align: top;
}

.table th {
    background: #efefef;
    font-size: 13px;
    color: #555555;
}

.table tbody tr:hover {
    background: #f7f7f7;
}

.table-wrap {
    max-height: 470px;
    overflow: auto;
}

.compact-table {
    max-height: 365px;
}

.notice {
    margin: 12px 0;
    padding: 12px;
    border-radius: 6px;
    background: #f0f7f2;
    border: 1px solid #b7d6bf;
}

.error {
    background: #fff5f5;
    border-color: #feb2b2;
}

.scan-form {
    max-width: 560px;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

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

.dashboard-head h1 {
    margin: 0;
    font-size: 34px;
}

.eyebrow {
    margin: 0 0 4px;
    color: #707070;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-pill {
    border: 1px solid #d2d2d2;
    border-radius: 999px;
    padding: 9px 14px;
    background: #ffffff;
    font-weight: 700;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.85fr);
    gap: 18px;
    margin-bottom: 18px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    gap: 18px;
    align-items: start;
}

.public-dashboard {
    display: grid;
    grid-template-columns: minmax(300px, 0.6fr) minmax(0, 1.4fr);
    gap: 18px;
    align-items: start;
}

.public-dashboard .list-panel:last-child {
    grid-column: 1 / -1;
}

.public-login {
    position: sticky;
    top: 18px;
}

.panel-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title h2 {
    margin: 0;
    font-size: 20px;
}

.panel-title span {
    color: #707070;
    font-size: 13px;
}

.form-message:empty,
#scan-message:empty {
    display: none;
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.55fr) minmax(0, 1.45fr);
    gap: 18px;
    align-items: start;
}

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

.user-admin-list {
    display: grid;
    gap: 14px;
}

.user-admin-item {
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 14px;
    background: #fafafa;
}

.user-admin-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.user-admin-head span {
    color: #707070;
    font-size: 13px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    min-height: 70px;
}

.checkbox-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.password-reset-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #dddddd;
}

.clickable-row {
    cursor: pointer;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.42);
}

.modal-dialog {
    position: relative;
    z-index: 41;
    width: min(860px, calc(100% - 32px));
    max-height: calc(100vh - 70px);
    overflow: auto;
    margin: 36px auto;
    padding: 22px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

.close-button {
    position: absolute;
    top: 14px;
    right: 14px;
}

.icon-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

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

    .page {
        padding: 20px 14px 36px;
    }

    .brand img {
        width: 118px;
    }

    .brand span {
        font-size: 18px;
    }

    .dashboard-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-grid,
    .quick-actions,
    .public-dashboard,
    .admin-layout,
    .grid.two {
        grid-template-columns: 1fr;
    }

    .public-dashboard .list-panel:last-child {
        grid-column: auto;
    }
}

@media (max-width: 1180px) {
    .dashboard-grid,
    .quick-actions,
    .public-dashboard,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .public-dashboard .list-panel:last-child {
        grid-column: auto;
    }
}
