:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f6f7f9;
    color: #1f2933;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

button, input, select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
}

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

.brand {
    font-size: 20px;
    font-weight: 750;
}

.muted {
    color: #667085;
}

.layout {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    min-height: 0;
}

.sidebar {
    padding: 22px;
    border-right: 1px solid #d9e1e8;
    background: #fbfcfd;
    overflow: auto;
}

.content {
    padding: 28px;
    overflow: auto;
}

.panel {
    background: #ffffff;
    border: 1px solid #d9e1e8;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}

.panel h2, .panel h3 {
    margin: 0 0 14px;
    font-size: 17px;
}

.list-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.list-header h2 {
    margin-bottom: 8px;
}

.list-header p {
    margin: 0;
}

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

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 16px 0;
    padding: 4px;
    border: 1px solid #cdd6df;
    border-radius: 8px;
    background: #eef2f6;
}

.segmented.compact {
    margin: 0;
}

.segmented button {
    min-height: 38px;
    border-radius: 6px;
    background: transparent;
    color: #475467;
    font-weight: 750;
}

.segmented button.active {
    background: #ffffff;
    color: #0b5f68;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

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

.row > * {
    min-width: 0;
}

.field {
    width: 100%;
    min-height: 40px;
    border: 1px solid #cdd6df;
    border-radius: 7px;
    padding: 9px 10px;
    background: #ffffff;
}

.btn {
    min-height: 40px;
    border-radius: 7px;
    padding: 0 18px;
    background: #177e89;
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
    overflow: visible;
    flex: 0 0 auto;
    min-width: max-content;
}

.btn.secondary {
    background: #e8eef2;
    color: #26323d;
}

.btn.danger {
    background: #b42318;
}

.icon-button {
    width: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.list-button {
    width: 100%;
    text-align: left;
    padding: 12px;
    border-radius: 7px;
    background: transparent;
    color: #26323d;
}

.list-button.active {
    background: #dff3f0;
    color: #0b5f68;
    font-weight: 750;
}

.items {
    display: grid;
    gap: 8px;
}

.item {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    border: 1px solid #d9e1e8;
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
}

.item.in-cart {
    background: #effaf4;
    border-color: #b7dfc5;
}

.item.missing {
    background: #fff8eb;
    border-color: #f5d18b;
}

.item strong {
    font-size: 14px;
    line-height: 1.25;
}

.icon-action {
    min-height: 32px;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 750;
    white-space: nowrap;
}

.danger-action {
    background: #fee4e2;
    color: #b42318;
}

.missing-action {
    background: #fff0c2;
    color: #92400e;
}

.item-trash-button {
    width: 36px;
    min-width: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.item-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.check {
    width: 24px;
    height: 24px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 0 9px;
    background: #eef2f6;
    color: #475467;
    font-size: 12px;
    font-weight: 700;
}

.badge.ok {
    background: #d9f2e2;
    color: #17663a;
}

.badge.warn {
    background: #fff0c2;
    color: #92400e;
}

.status-column {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.item-meta {
    color: #667085;
    font-size: 12px;
    line-height: 1.25;
}

.login {
    max-width: 460px;
    margin: 10vh auto;
}

.form-section {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.list-item-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.7fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
}

.share-form {
    display: grid;
    grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.notice {
    border-left: 4px solid #177e89;
    padding: 10px 12px;
    background: #eef9f7;
    border-radius: 6px;
    line-height: 1.45;
}

.error {
    color: #b42318;
    font-weight: 700;
}

@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid #d9e1e8;
    }

    .content {
        padding: 18px;
    }

    .form-row,
    .list-item-form,
    .share-form {
        grid-template-columns: 1fr;
    }

    .list-header {
        display: grid;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}
